# Add a spreadsheet

> POST https://api.nabrah.ai/api/ext/document/sheet

Group: Documents. Page: https://www.nabrah.ai/en/docs/api-reference/documents/add-a-spreadsheet

Uploads a CSV or Excel sheet into a tabular knowledge base and queues it for ingestion, so an agent can look up rows during a call. Send `multipart/form-data` with `knowledge_base_id` and `file` (up to 2 MB and 10,000 rows). Optionally add `sheet_desc` to tell the agent what the columns mean, and `searchable_columns` as a JSON array of the column names it may search by. Poll GET /api/ext/document/{document_id} until it is ready.

## Authorization

- `X-API-Key` (string, header, required): your workspace API key.

## Body (multipart/form-data)

## Response

### 201 Successful Response

Content type: `application/json`

```json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "knowledge_base_id": "00000000-0000-4000-8000-000000000000",
  "type": "file",
  "status": "unknown",
  "title": "string",
  "summary": "string",
  "filename": "string",
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z",
  "source_format": "pdf",
  "tabular_schema": {},
  "sheet_desc": "string",
  "searchable_columns": [
    "string"
  ]
}
```

### 422 Validation Error

Content type: `application/json`

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

## Request examples

### cURL

```bash
curl --request POST \
  --url 'https://api.nabrah.ai/api/ext/document/sheet' \
  --header 'X-API-Key: <your-api-key>'
```

### Python

```python
import requests

url = "https://api.nabrah.ai/api/ext/document/sheet"
headers = {"X-API-Key": "<your-api-key>"}

response = requests.post(url, headers=headers)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const form = new FormData();

const response = await fetch("https://api.nabrah.ai/api/ext/document/sheet", {
  method: "POST",
  headers: { "X-API-Key": "<your-api-key>" },
  body: form,
});

const data = await response.json();
console.log(data);
```

### Go

```go
// Send multipart/form-data with mime/multipart:
// POST https://api.nabrah.ai/api/ext/document/sheet
```
