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

# Upload through a link

> For a slow or unreliable connection: reserve a slot, upload the file to its link (resumable), then confirm it.

[Upload files](https://docs.verbeo.ai/api-reference/knowledge-bases/upload-files.md) sends files in one request, which is what most integrations want. On a slow or unreliable connection, upload through a link instead, the way the dashboard does: the file goes straight to Verbeo's file storage, in pieces that carry on where they stopped if the connection drops. It takes three steps:

1. **Reserve a slot**: this endpoint, with JSON. Your plan's limits are checked here.
2. **Upload the file** to the slot's link, within 2 hours.
3. **Confirm** it: Verbeo checks the file it received and starts reading it.

## 1. Reserve a slot

**id** `string` *required*

UUID of the knowledge base.

**file\_name** `string` *required*

The file's name, 1 to 255 characters. Its extension decides the type.

**file\_size** `number` *required*

Its size in bytes. `wc -c < prices.pdf` prints it.

**content\_hash** `string` *required*

Its SHA-256, as 64 lowercase hex characters. `sha256sum prices.pdf` prints it. A file with the same bytes as one already in the knowledge base is refused here.

```bash theme={null}
curl -X POST "https://api.verbeo.ai/v1/knowledge-base/5df09066-0842-4c92-8ef0-6cf2ff6d7455/files" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"file_name\": \"prices.pdf\", \"file_size\": $(wc -c < prices.pdf), \"content_hash\": \"$(sha256sum prices.pdf | cut -d' ' -f1)\" }"
```

`201 Created`: the slot, a [file object](https://docs.verbeo.ai/api-reference/knowledge-bases/overview.md#the-file-object) with `status: "uploading"`, and where to send the file.

```json theme={null}
{
  "success": true,
  "data": {
    "file": {
      "id": "c4ff0c9c-4b3b-4a94-a86e-3d3b64088ae0",
      "status": "uploading",
      "upload_expires_at": "2026-11-07T11:12:44.833957+00:00",
      "…": "every field of the file object"
    },
    "upload": {
      "signed_url": "https://…/storage/v1/object/upload/sign/kb/5df09066-…/c4ff0c9c-…/prices.pdf?token=eyJhbGciOi…",
      "path": "5df09066-…/c4ff0c9c-…/prices.pdf",
      "token": "eyJhbGciOi…",
      "content_type": "application/pdf",
      "bucket": "kb",
      "resumable_url": "https://…/storage/v1/upload/resumable/sign"
    }
  }
}
```

## 2. Upload the file

Send the whole file with one `PUT` to `upload.signed_url`, with `upload.content_type`:

```bash theme={null}
curl -X PUT "UPLOAD_SIGNED_URL" \
  -H "Content-Type: application/pdf" \
  --data-binary @prices.pdf
```

For a resumable upload, use a TUS client such as `tus-js-client` with `upload.resumable_url` as its endpoint, pieces of 6 MB, the header `x-signature` set to `upload.token`, and the metadata `bucketName`, `objectName` and `contentType` set to `upload.bucket`, `upload.path` and `upload.content_type`.

The link goes to Verbeo's file storage, not to `api.verbeo.ai`: the token is the credential, so no API key goes with it. It works for 2 hours.

## 3. Confirm it

```bash theme={null}
curl -X POST "https://api.verbeo.ai/v1/knowledge-base/files/c4ff0c9c-4b3b-4a94-a86e-3d3b64088ae0/confirm" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

`200 OK` with the [file object](https://docs.verbeo.ai/api-reference/knowledge-bases/overview.md#the-file-object), now `processing`. Verbeo checks the size and SHA-256 of the file it received against your plan again; a refused file is removed, slot and all. Confirming twice is harmless.

To give up on a slot, [delete it](https://docs.verbeo.ai/api-reference/knowledge-bases/delete-file.md). An unconfirmed slot is removed on its own once its link expires.

The same JSON body on [`POST /knowledge-base/files/{fileId}/replace`](https://docs.verbeo.ai/api-reference/knowledge-bases/replace-file) reserves a replacement the same way.

## Errors

| Code | Status | When |
| - | - | - |
| `VALIDATION_FAILED` | 422 | `file_name`, `file_size` or `content_hash` missing or malformed (`content_hash: must be the file's SHA-256 as 64 lowercase hex characters`), or a type that is not taken. |
| `KB_*` | 409 | The reserve or the confirm was refused by your [plan's limits](https://docs.verbeo.ai/api-reference/knowledge-bases/overview.md#errors). |
| `KB_UPLOAD_EXPIRED` | 409 | `This upload took longer than 2 hours and has expired. Upload the file again.` |
| `KB_UPLOAD_CLOSED` | 409 | `This upload is no longer open. Upload the file again.` |
| `CONFLICT` | 409 | `The file did not finish uploading. Upload it again.` The confirm found no file. |
| `BAD_GATEWAY` | 502 | `The file could not be read from storage just now. Try again in a moment.` Nothing was removed. |
| `INTERNAL_ERROR` | 500 | `The upload could not be started. Try again in a moment.` No slot was kept. |


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