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}

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" \
  -H "X-API-Key: ca_your_api_key_here"

Response

Success Response

Status Code: 200 OK
{
  "task": {
    "task_id": 12345,
    "task_url": "https://app.chamelio.ai/workflows/tasks/12345",
    "task_title": "Vendor Contract Review - Acme Corporation",
    "workflow_id": "vendor_contract_review",
    "workflow_name": "Vendor Contract Review",
    "workflow_version": 1,
    "workflow_state_id": "ws_abc123",
    "status": "in_progress",
    "current_step_id": "review_step",
    "current_step_name": "AI Review",
    "current_step_type": "review",
    "created_at": "2025-01-20T10:30:00Z",
    "updated_at": "2025-01-20T10:35:00Z",
    "completed_at": null,
    "owner_email": "john.doe@example.com",
    "assignee_email": "legal@example.com",
    "collaborator_emails": ["contracts@example.com"],
    "step_runs": [
      {
        "step_run_id": "sr_001",
        "step_id": "intake_step",
        "step_name": "Document Intake",
        "step_type": "intake",
        "status": "completed",
        "variables": [
          {
            "variable_type": "text",
            "value": "Acme Corporation",
            "step_id": "intake_step",
            "variable_id": "vendor_name"
          }
        ]
      }
    ],
    "variables": [
      {
        "variable_type": "text",
        "value": "Acme Corporation",
        "step_id": "intake_step",
        "variable_id": "vendor_name"
      },
      {
        "variable_type": "number",
        "value": 150000,
        "step_id": "intake_step",
        "variable_id": "contract_value"
      },
      {
        "variable_type": "email",
        "value": "legal@example.com",
        "step_id": "intake_step",
        "variable_id": "reviewer_email"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
taskobjectComplete task state including status and variables

Task Object Fields

FieldTypeDescription
task_idintegerUnique identifier for the task
task_urlstring or nullDirect URL to the task in the Chamelio web application
task_titlestring or nullHuman-readable title of the task
workflow_idstringIdentifier of the workflow this task is running
workflow_namestring or nullHuman-readable workflow name
workflow_versionintegerWorkflow version number
workflow_state_idstringIdentifier for the specific workflow state
statusstringCurrent task status: created, in_progress, pending, completed, cancelled, failed, archived
current_step_idstring or nullID of the step currently being executed (null if completed)
current_step_namestring or nullName of the current step (null if completed)
current_step_typestring or nullType of the current step (e.g., "approval", "review", "intake", "signature")
created_atstringISO 8601 timestamp when the task was created
updated_atstringISO 8601 timestamp of the last task update
completed_atstring or nullISO 8601 timestamp when the task completed (null if not yet completed)
owner_emailstring or nullEmail of the user who owns the task
assignee_emailstring or nullEmail of the user currently assigned to the task
collaborator_emailsarray of stringsEmails of users collaborating on the task
step_runsarrayHistory of step executions with their collected variables
variablesarrayAll variables aggregated across all step runs

Step Run Object Fields

FieldTypeDescription
step_run_idstringUnique identifier for this step run
step_idstringIdentifier for the step definition
step_namestringHuman-readable step name
step_typestringType of workflow component (e.g., "intake", "approval", "signature", "review")
statusstringStep run status: initiated, pending, in_progress, completed, failed, rejected, cancelled
variablesarrayVariables collected during this step run

Variable Object Fields

Used in both step_runs[].variables and the top-level variables array.
FieldTypeDescription
variable_typestringType of the variable: text, number, boolean, date, email, file, select, multi_select, user_entity, business, dynamic_list, dynamic_table, number_with_currency, conversation
valueanyCurrent value of the variable (string, number, boolean, array, or null)
step_idstringID of the step that collected this variable
variable_idstringUnique identifier for the variable

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 get task"
}

Notes

Poll this endpoint periodically to monitor task progress. The status field can be one of: created, in_progress, pending, completed, cancelled, failed, or archived.
Use current_step_id and current_step_type to understand which step the workflow is currently executing. If current_step_type is "approval", you can use the Get Approval Details endpoint for more information about the approval step.

Use Cases

This endpoint is useful for:
  • Status monitoring - Track workflow progress and completion
  • Variable retrieval - Get values collected during workflow execution
  • Step history - Review which steps have run and what data each collected
  • Debugging - Understand where a workflow is stuck or failed
  • User notifications - Display current workflow status in your application