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 |
Headers
| 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 | One of: "file", "github_repository" |
resources[].file_id | string | Yes | File ID obtained from the Files API |
Example request
Example response
HTTP 200 OK Returns the updated Session object with the newresources list.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Malformed request (e.g., type is not "file" or "github_repository", 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
Invalidtype:
file_id: