Files API

Upload a file to the account's knowledge base. Send it as multipart/form-data under the field name file.

POST/v1/files

Authentication

Requires a secret API key passed as a Bearer token (Authorization: Bearer carrier_sk_…).

Request body

FieldTypeDescription
file*multipart fileThe file to upload (field name must be file).

Example request

bash
curl -X POST https://api.carrieros.ai/v1/files \
  -H "Authorization: Bearer carrier_sk_live_YOUR_KEY" \
  -F "file=@./document.pdf"

Response

FieldTypeDescription
file_idstringIdentifier of the stored file.
filenamestringOriginal file name.
statusstringFile record status (e.g. active).

Example response

json
{
  "success": true,
  "data": {
    "file_id": "f7a2…",
    "filename": "document.pdf",
    "status": "active"
  }
}

Possible errors

CodeHTTPWhen it occurs
VALIDATION_ERROR400No file was provided (wrong field name).
UNSUPPORTED_FILE_TYPE400The file extension isn't supported.
FILE_TOO_LARGE400The file exceeds the 25MB limit.

Notes

Supported types: PDF, DOCX, TXT, CSV, and images. Maximum size 25MB.

Uploading stores the file; run File Processing to extract and index it for search.