Skip to main content

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

ParameterTypeDescription
session_idstringSession ID with the sess_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT
Content-TypeYesapplication/json

Request body

FieldTypeRequiredDescription
resourcesarrayYesArray of resource objects
resources[].typestringYesAlways "file"
resources[].file_idstringYesFile 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

HTTPTypeTrigger
400invalid_request_errorMalformed request (e.g., type is not "file" or file_id is missing)
401authentication_errorPAT invalid or expired
404not_found_errorSession 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.