Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.chamelio.ai/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

GET /tasks/{task_id}/files

Authentication

This endpoint requires authentication via API key. Include your API key in the X-API-Key header:
X-API-Key: ca_your_api_key_here

Path Parameters

ParameterTypeRequiredDescription
task_idintegerYesUnique identifier for the task

Request Example

curl -X GET "https://platform.chamelio.ai/tasks/12345/files" \
  -H "X-API-Key: ca_your_api_key_here"

Response

Success Response

Status Code: 200 OK
{
  "task_id": 12345,
  "files": [
    {
      "file_id": "document_789",
      "file_name": "acme_contract.pdf",
      "variable_id": "contract_file",
      "created_at": "2025-01-20T10:30:00Z",
      "step_id": "intake_step"
    },
    {
      "file_id": "document_790",
      "file_name": "reviewed_contract.pdf",
      "variable_id": null,
      "created_at": "2025-01-20T10:45:00Z",
      "step_id": "review_step"
    },
    {
      "file_id": "attachment_123",
      "file_name": "insurance_certificate.pdf",
      "variable_id": "insurance_doc",
      "created_at": "2025-01-20T11:00:00Z",
      "step_id": "approval_step"
    }
  ],
  "total_files": 3
}

Response Fields

FieldTypeDescription
task_idintegerID of the task
filesarrayList of files associated with the task (maximum 10 files returned)
total_filesintegerTotal number of files for this task

File Object Fields

FieldTypeDescription
file_idstringUnique file identifier (format: document_{id} for documents, attachment_{id} for attachments)
file_namestringName of the file
variable_idstringID of the variable this file is associated with (null if generated by a step)
created_atstringISO 8601 timestamp when the file was created/uploaded
step_idstringID of the workflow step that created or collected this file

Error Responses

401 Unauthorized

Returned when authentication fails. See the authentication errors section for details.
{
  "detail": "Invalid API key"
}

404 Not Found

Returned when the task doesn’t exist or you don’t have access to it.
{
  "detail": "Task not found"
}

500 Internal Server Error

Returned when the request fails due to a server error.
{
  "detail": "Failed to list task files"
}

Notes

This endpoint returns up to 10 files by default. If the task has more than 10 files, only the first 10 are returned. Use the total_files count to determine if there are more files.
Use the file_id from this response with the Download File endpoint to retrieve the actual file content.
File IDs are prefixed with document_ for documents and attachment_ for attachments. Ensure you pass the complete file ID including the prefix when downloading files.

Use Cases

This endpoint is useful for:
  • File inventory - List all files involved in a workflow task
  • Document tracking - Track which documents were uploaded or generated at each step
  • Bulk download - Retrieve file IDs for downloading all task-related files
  • Audit trails - Document what files were part of a workflow execution