# Add a file to a deal

Scope `rows:write`. Answers the file and its upload URL.

## Endpoint

`POST /v1/ingest/rows/{rowId}/files`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| rowId | path | string | Yes |

- **rowId:** The deal's row id.

## Request body

Content type: `application/json`.

```json
{
  "name": "april.pdf",
  "contentType": "application/pdf",
  "sizeBytes": 471902,
  "documentType": "bank_statement"
}
```

## Responses

### 201

Declared.

Content type: `application/json`.

```json
{
  "data": {
    "id": "",
    "name": "string",
    "contentType": "string",
    "sizeBytes": 1,
    "documentType": "string",
    "periodStart": "string",
    "periodEnd": "string",
    "createdAt": "2026-01-01T00:00:00Z",
    "source": "string"
  },
  "uploadUrl": "string"
}
```

### 400

A file needs a name and a non-negative sizeBytes.

Content type: `application/json`.

```json
{
  "error": {
    "message": "string"
  }
}
```

### 401

No key, or an unknown or revoked one.

Content type: `application/json`.

```json
{
  "error": {
    "message": "string"
  }
}
```

### 402

A key issued from Settings → Developer, on a workspace without the Enterprise plan.

Content type: `application/json`.

```json
{
  "error": {
    "message": "string"
  }
}
```

### 403

The key was not given `rows:write`, or is a board key.

Content type: `application/json`.

```json
{
  "error": {
    "message": "string"
  }
}
```

### 404

No job or deal with that id that this key can reach.

Content type: `application/json`.

```json
{
  "error": {
    "message": "string"
  }
}
```

### 429

Over 120 requests a minute; wait `Retry-After` seconds.

Content type: `application/json`.

```json
{
  "error": {
    "message": "string"
  }
}
```

### 503

File storage is not configured.

Content type: `application/json`.

```json
{
  "error": {
    "message": "string"
  }
}
```
