> ## 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 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`**.

## Example

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

```bash theme={"system"}
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={"system"}
{
  "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 | Your plan's attachment limit, and at most 99 MB per request | `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.

## Attachment size limits

The largest attachment you can upload depends on your plan:

| Plan | Max attachment size |
| - | - |
| Free | 20 MB |
| Pro | 50 MB |
| Business | 1 GB |
| Team | 5 GB |
| Enterprise | 10 GB (5 GB per upload) |

A file over the limit returns `413 Payload Too Large`.

## Large attachments

`POST /fileupload` carries at most 99 MB in one request. For a larger file, upload it straight to storage in
three steps. Both JSON calls take the same `base-public-id`, `table-id`, and `field-id` headers as
`/fileupload`:

1. `POST /attachment-upload-session` with `{ "filename", "sizeBytes", "mimeType" }`. It returns
   `{ presignedUrl, s3Key, contentType }`.
2. `PUT` the raw file bytes to `presignedUrl` with a `Content-Type` header set to the returned `contentType`.
3. `POST /attachment-upload-complete` with `{ "s3Key" }`. It returns the same `{ url, fileName, size, mimeType }`
   shape as `/fileupload`.

SVG, HTML, JavaScript, and XML files can't use this flow and must go through `/fileupload`.

## Validation

Errors from these endpoints (other than a missing or invalid API key) have the shape `{ "statusCode", "error", "message" }`. 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 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.