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
| Field | Type | Description |
|---|---|---|
| file* | multipart file | The 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
| Field | Type | Description |
|---|---|---|
| file_id | string | Identifier of the stored file. |
| filename | string | Original file name. |
| status | string | File record status (e.g. active). |
Example response
json
{
"success": true,
"data": {
"file_id": "f7a2…",
"filename": "document.pdf",
"status": "active"
}
}Possible errors
| Code | HTTP | When it occurs |
|---|---|---|
| VALIDATION_ERROR | 400 | No file was provided (wrong field name). |
| UNSUPPORTED_FILE_TYPE | 400 | The file extension isn't supported. |
| FILE_TOO_LARGE | 400 | The 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.