Skip to main content
GET
/
api
/
v1
/
tasks
List Tasks
curl --request GET \
  --url https://api.example.com/api/v1/tasks

Documentation Index

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

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

List Tasks

Retrieve a paginated list of all tasks created with your API key, sorted by most recent activity.

Request

GET /api/v1/tasks
Authorization: Bearer {api_key}

Query Parameters

ParameterTypeDefaultDescription
limitnumber50Maximum number of tasks to return (max 100)
offsetnumber0Number of tasks to skip (for pagination)

Response

{
  "success": true,
  "data": [
    {
      "id": "c37c1d78-4d23-4e53-949a-ddd775f25e01",
      "apiKeyId": "82344182-b81e-4f9a-8e7f-c14d8324caac",
      "username": "testuser",
      "sessionId": "80513b3f-9030-4776-a209-f2d96b1abce1",
      "conversationId": "1769442659997-70avfyadp",
      "status": "completed",
      "message": "What is 2+2?",
      "systemPrompt": null,
      "showInHistory": true,
      "autoExecute": true,
      "env": null,
      "error": null,
      "createdAt": "2026-01-26T15:50:54.870Z",
      "startedAt": "2026-01-26T15:50:59.998Z",
      "completedAt": "2026-01-26T15:56:03.070Z",
      "lastActivityAt": "2026-01-26T15:56:03.070Z",
      "messageCount": 2
    }
  ],
  "pagination": {
    "total": 42,
    "limit": 50,
    "offset": 0,
    "hasMore": false
  }
}

Response Fields

Each task item includes all standard task fields plus enrichment fields:
FieldTypeDescription
idstringUnique task identifier
apiKeyIdstringID of the API key used to create the task
usernamestringUsername associated with the API key
sessionIdstringID of the agent session
conversationIdstringID of the conversation for history
statusstringCurrent task status
messagestringOriginal task message
systemPromptstring | nullCustom system prompt if provided
showInHistorybooleanWhether task appears in conversation history
autoExecutebooleanWhether tools auto-execute
envobject | nullNon-sensitive env vars provided at creation
errorstring | nullError message if task failed
createdAtstringISO timestamp when task was created
startedAtstring | nullISO timestamp when execution started
completedAtstring | nullISO timestamp when task completed
lastActivityAtstringISO timestamp of most recent activity (latest of completedAt, startedAt, createdAt)
messageCountnumberNumber of messages in the conversation (0 if no conversation yet)

Pagination Object

FieldTypeDescription
totalnumberTotal number of tasks for this user
limitnumberNumber of tasks requested
offsetnumberNumber of tasks skipped
hasMorebooleanWhether more tasks exist beyond this page

Task Status Values

StatusDescription
pendingTask created, not yet started
runningTask is currently executing
awaiting_approvalWaiting for tool call approval
completedTask finished successfully
failedTask failed with an error
cancelledTask 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

curl -s https://api.sigmic.ai/api/v1/tasks \
  -H "Authorization: Bearer sigmic_your_key_here"

With Pagination

# Get the second page of 10 tasks
curl -s "https://api.sigmic.ai/api/v1/tasks?limit=10&offset=10" \
  -H "Authorization: Bearer sigmic_your_key_here"

Paginate All Tasks

async function getAllTasks(apiKey) {
  const tasks = [];
  let offset = 0;
  const limit = 50;

  while (true) {
    const response = await fetch(
      `https://api.sigmic.ai/api/v1/tasks?limit=${limit}&offset=${offset}`,
      { headers: { 'Authorization': `Bearer ${apiKey}` } }
    );
    const { data, pagination } = await response.json();
    tasks.push(...data);

    if (!pagination.hasMore) break;
    offset += limit;
  }

  return tasks;
}

Errors

CodeDescription
AUTH_REQUIREDNo authentication provided
INVALID_API_KEYInvalid or expired API key