POST /v1/files
Uploads a file to the Qoder Cloud Agents platform for use in sessions or tools.
Content-Type: multipart/form-data
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer $QODER_PAT |
Request body (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Binary contents of the file to upload |
purpose | string | No | File purpose. Value: user_upload. Defaults to user_upload |
metadata | JSON string | No | Custom metadata as a JSON object |
Example request
Example response
HTTP 201 CreatedResponse fields
| Field | Type | Description |
|---|---|---|
file_id | string | File unique identifier with the file_ prefix |
filename | string | Original filename |
size_bytes | integer | File size in bytes |
mime_type | string | MIME type, auto-detected by the server |
purpose | string | File purpose |
status | string | File status; ready after a successful upload |
metadata | object | Custom metadata |
created_at | string | Creation time (ISO 8601) |
updated_at | string | Last update time (ISO 8601) |
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Missing file field or invalid purpose value |
| 401 | – | Missing or invalid authentication token |