LangBot Docs
Files

Upload a document

Upload a document file up to 10 MB. After the upload, use the file_id to associate the document with a knowledge base.

POST
/api/v1/files/documents

Upload a document file up to 10 MB. After the upload, use the file_id to associate the document with a knowledge base.

Authorization

X-API-Key<token>

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/files/documents" \  -F file="string"
{  "code": 0,  "data": {    "file_id": "string"  }}