> ## Documentation Index
> Fetch the complete documentation index at: https://developers.zite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File Uploads

> Upload attachments and import CSV/Excel files via multipart/form-data.

Uploads are sent as `multipart/form-data` to three dedicated endpoints. Unlike the JSON REST API, these routes live at the **root host**, not under `/api/v1`:

```
https://tables.zite.com
```

<Note>
  Every upload uses the same `Authorization: Bearer YOUR_API_KEY` header as the rest of the API, and the file must be sent as a multipart form field named **`filepond`**.
</Note>

## Example

`POST /fileupload` uploads a file for an **attachment** field; write the returned `url` to that field via [Create Record](/api/records/create-record) or [Update Record](/api/records/update-record).

```bash theme={null}
curl -X POST https://tables.zite.com/fileupload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "base-public-id: YOUR_BASE_ID" \
  -H "table-id: YOUR_TABLE_ID" \
  -H "field-id: YOUR_FIELD_ID" \
  -F "filepond=@/path/to/photo.png"
```

```json theme={null}
{
  "url": "https://.../photo.png",
  "fileName": "photo.png",
  "size": 20480,
  "mimeType": "image/png"
}
```

## Endpoints

| Endpoint           | Purpose                               | Max size | Required headers                                          | Response                            |
| ------------------ | ------------------------------------- | -------- | --------------------------------------------------------- | ----------------------------------- |
| `POST /fileupload` | Upload a file for an attachment field | 20 MB    | `Authorization`, `base-public-id`, `table-id`, `field-id` | `{ url, fileName, size, mimeType }` |
| `POST /csvupload`  | Upload a CSV to import as data        | 50 MB    | `Authorization`                                           | `{ url, fileName, s3Key }`          |
| `POST /xlsxupload` | Upload an `.xlsx` to import as data   | 50 MB    | `Authorization`                                           | `{ url, fileName, s3Key }`          |

`s3Key` is the storage key the import flow uses to reference the uploaded file.

## Validation

A request that fails any of these returns `400 Bad Request`:

| Endpoint           | Must satisfy                                                                                                        |
| ------------------ | ------------------------------------------------------------------------------------------------------------------- |
| `POST /fileupload` | All three of `base-public-id`, `table-id`, `field-id` are present, and the file is a supported attachment MIME type |
| `POST /csvupload`  | MIME type is `text/csv`, or the filename ends in `.csv`                                                             |
| `POST /xlsxupload` | The `.xlsx` MIME type, a `.xlsx` filename, and a valid Excel (ZIP) signature                                        |
