Skip to main content

Endpoint

Description

Retrieves a paginated list of tasks with optional filtering by status and session.

Authentication

Required: Yes Include API key in header:

Request

Headers

Query Parameters

Status Filter Values

  • QUEUED - Tasks waiting to execute
  • RUNNING - Tasks currently executing
  • COMPLETED - Successfully completed tasks
  • FAILED - Failed tasks
  • CANCELLED or CANCELED - Cancelled tasks
  • TIMEOUT - Tasks that exceeded timeout
Filter values use short form (e.g., RUNNING). Response status fields include the TASK_STATUS_ prefix (e.g., TASK_STATUS_RUNNING).

Response

Success Response

Status: 200 OK Body:

Response Fields

Task Summary Fields

The mode field uses the EXECUTION_MODE_ prefix in list responses (e.g., EXECUTION_MODE_STANDARD). The single-task GET endpoint returns the short form (e.g., standard).

Token Usage Fields

Examples

List All Tasks

Response:

Filter by Status

Filter by Session

Response:

Pagination

Combined Filters

Error Responses

401 Unauthorized

429 Too Many Requests

500 Internal Server Error

Code Examples

Python with httpx

Python - List All Tasks (Pagination)

JavaScript/Node.js

Note: The session_id filter accepts a UUID or an external_id.

Bash Script - Monitor Running Tasks

Go

Use Cases

1. Dashboard - Show Recent Tasks

2. Cost Tracking

3. Failure Monitoring

Implementation Notes

Rate Limiting

This endpoint is rate limited. Default limits:
  • 60 requests/minute per API key
  • 20 requests/second burst

Performance

  • Indexed queries: Filtering by status and session_id is fast
  • Pagination: Use limit and offset to avoid large responses
  • Total count: Includes all matching tasks, not just returned page

Ordering

Tasks are returned in reverse chronological order (newest first).

Best Practices

1. Use Pagination

Always paginate for large result sets:

2. Filter by Status

Don’t fetch all tasks if you only need specific statuses:

3. Cache Results

Cache task lists for dashboards:

Submit Task

POST /api/v1/tasks

Get Task Status

GET /api/v1/tasks/

Stream Events

Real-time monitoring

Python SDK

Use the SDK instead

Notes

SDK Alternative: The Python SDK does not expose a list_tasks() method. This endpoint is REST-only. For SDK usage, store task IDs and query status individually using client.get_status(task_id).