List Tasks
Task API
List Tasks
List all tasks for the authenticated API key with pagination
GET
List Tasks
List Tasks
Retrieve a paginated list of all tasks created with your API key, sorted by most recent activity.Request
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Maximum number of tasks to return (max 100) |
offset | number | 0 | Number of tasks to skip (for pagination) |
Response
Response Fields
Each task item includes all standard task fields plus enrichment fields:| Field | Type | Description |
|---|---|---|
id | string | Unique task identifier |
apiKeyId | string | ID of the API key used to create the task |
username | string | Username associated with the API key |
sessionId | string | ID of the agent session |
conversationId | string | ID of the conversation for history |
status | string | Current task status |
message | string | Original task message |
systemPrompt | string | null | Custom system prompt if provided |
showInHistory | boolean | Whether task appears in conversation history |
autoExecute | boolean | Whether tools auto-execute |
env | object | null | Non-sensitive env vars provided at creation |
error | string | null | Error message if task failed |
createdAt | string | ISO timestamp when task was created |
startedAt | string | null | ISO timestamp when execution started |
completedAt | string | null | ISO timestamp when task completed |
lastActivityAt | string | ISO timestamp of most recent activity (latest of completedAt, startedAt, createdAt) |
messageCount | number | Number of messages in the conversation (0 if no conversation yet) |
Pagination Object
| Field | Type | Description |
|---|---|---|
total | number | Total number of tasks for this user |
limit | number | Number of tasks requested |
offset | number | Number of tasks skipped |
hasMore | boolean | Whether more tasks exist beyond this page |
Task Status Values
| Status | Description |
|---|---|
pending | Task created, not yet started |
running | Task is currently executing |
awaiting_approval | Waiting for tool call approval |
completed | Task finished successfully |
failed | Task failed with an error |
cancelled | Task was cancelled |
Tasks are sorted by
lastActivityAt descending — the most recently active task appears first. This is ideal for building a conversation list sidebar. For real-time progress (output) or the final response, use Get Task. For real-time streaming, use Stream Events.Examples
With Pagination
Paginate All Tasks
Errors
| Code | Description |
|---|---|
AUTH_REQUIRED | No authentication provided |
INVALID_API_KEY | Invalid or expired API key |