ResoneraDocs
Knowledge base

Upload a document

POST
/knowledge-base/items

Uploads a file for agents to answer questions from. Indexing starts immediately. Check progress with GET /knowledge-base/jobs/{job_id}, or later with the file's index_status. A file with the same name in the same folder is replaced and indexed again.

Supported formats: PDF, DOCX, XLSX, XLS, CSV, TXT, MD, RST, PNG, JPG, and WebP, up to 50 MB. Scanned PDF pages and images are read with OCR.

To use the file on calls, add the returned id to an agent's kb_item_ids.

Requires the agents:write scope.

Authorization

apiKey
headerX-API-Key<token>

Your API key, from Settings → API access in the dashboard.

Request Body

multipart/form-data
  1. body
file*file
Formatbinary
folder?string

Folder to put it in, e.g. docs/prices. Created if missing.

Response Body

Uploaded; indexing has started.

application/json
  1. response
item?
job_id?string
Formatuuid
curl -X POST "https://example.com/knowledge-base/items" \  -F file="string"
{  "item": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "type": "file",    "mime_type": "string",    "size_bytes": 0,    "path": "string",    "parent_path": "string",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "index_status": "queued",    "index_error": "string",    "index_chunks": 0,    "index_facts": 0,    "index_updated_at": "2019-08-24T14:15:22Z"  },  "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f"}