Skip to main content
POST
/
v1
/
knowledgebases
/
{id}
/
files
Upload file to knowledge base
curl --request POST \
  --url http://co-mind-platform-host/v1/knowledgebases/{id}/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form 'filename=<string>' \
  --form sanitize=true
{
  "id": "file_xyz789",
  "object": "knowledgebase.file",
  "knowledgebase_id": "kb_abc123",
  "filename": "documentation.pdf",
  "size_bytes": 51200,
  "status": "completed",
  "created_at": 1699564800
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Supports two token types:

  • JWT Access Token — obtained via POST /v1/auth/login
  • Personal Access Token (PAT) — created via POST /v1/api-tokens, format: cmnd_<tokenId>.<secret>

Path Parameters

id
string
required

The knowledge base ID

Body

multipart/form-data
file
file
required

The file to upload

filename
string

Custom filename (optional)

sanitize
boolean

Whether to sanitize the file (optional)

Response

File uploaded successfully

id
string
Example:

"file_xyz789"

object
string
Example:

"knowledgebase.file"

knowledgebase_id
string
Example:

"kb_abc123"

filename
string
Example:

"documentation.pdf"

size_bytes
integer
Example:

51200

status
enum<string>
Available options:
processing,
completed,
failed
Example:

"completed"

created_at
integer

Unix timestamp

Example:

1699564800