Documentation Index
Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
Use this file to discover all available pages before exploring further.
POST /v1/sessions/{session_id}/resources
Attaches file resources to a session. Once attached, the agent can access these files when processing messages.
Path parameters
| Parameter | Type | Description |
|---|
session_id | string | Session ID with the sess_ prefix |
| Header | Required | Description |
|---|
Authorization | Yes | Bearer $QODER_PAT |
Content-Type | Yes | application/json |
Request body
| Field | Type | Required | Description |
|---|
resources | array | Yes | Array of resource objects |
resources[].type | string | Yes | Always "file" |
resources[].file_id | string | Yes | File ID obtained from the Files API |
Example request
curl -X POST https://openapi.qoder.sh/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/resources \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json" \
-d '{
"resources": [
{"type": "file", "file_id": "file_abc123def456"}
]
}'
Example response
HTTP 200 OK
Returns the updated Session object with the new resources list.
Errors
| HTTP | Type | Trigger |
|---|
| 400 | invalid_request_error | Malformed request (e.g., type is not "file" or file_id is missing) |
| 401 | authentication_error | PAT invalid or expired |
| 404 | not_found_error | Session or file does not exist |
Error response examples
Invalid type:
{
"error": {
"message": "resources[0]: field 'type' must be 'file'.",
"type": "invalid_request_error"
},
"type": "error"
}
Missing file_id:
{
"error": {
"message": "resources[0]: field 'file_id' must be a non-empty string.",
"type": "invalid_request_error"
},
"type": "error"
}
File not found:
{
"error": {
"message": "File 'file_fake_test_id' was not found.",
"type": "not_found_error"
},
"type": "error"
}
See Errors for the full error envelope.