Skip to main content

/o/tasks/task

Endpoint

/o/tasks/task

Overview

Returns a single task record (or selected subtask result flow) for the requested task ID.

Authentication

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Requires read access to feature core.
  • app_id is required for non-global users by read validation rules.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API authentication key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
app_idStringYes (for non-global users)App context for read permission validation.
task_idStringYesTask ID to read.
subtask_keyStringNoOptional subtask key used for task-group subtask retrieval flow.

Response

Success Response

{
"_id": "17f0f6c3a2c42cbced96d4a01f88f9a7f45bc7a5",
"status": "completed",
"type": "tableExport",
"report_name": "events-30days.csv",
"app_id": "6991c75b024cb89cdc04efd2",
"creator": "65a16f6b8e43c117c38d8f00",
"start": 1771199023000,
"end": 1771199042000,
"data": "[...]"
}

Response Fields

FieldTypeDescription
_idStringTask ID.
statusStringTask status.
typeStringTask type label.
report_nameStringExport/report file name when present.
app_idStringTask app context.
creatorStringTask creator member ID.
startNumberTask start timestamp (ms).
endNumberTask end timestamp (ms).
dataString or ObjectTask result payload (format depends on task type and storage mode).

Error Responses

Status Code: 400 Bad Request

{
"result": "Missing parameter \"task_id\""
}

Status Code: 400 Bad Request

{
"result": "Task does not exist"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Standard task modetask_id provided without subtask_keyReads task record by ID and returns task payload.Raw task object
Subtask lookup modesubtask_key is providedResolves matching subtask result from task-group flow when available.Raw task/subtask object
Subtask rerun trigger modesubtask_key is provided for a taskgroup but subtask is missingTriggers parent task rerun in background and returns not-found response for current request.Wrapped string { "result": "Task does not exist" }
Missing-task modeTask lookup returns no resultReturns not-found error response.Wrapped string { "result": "Task does not exist" }

Impact on Other Data

  • Read-only endpoint.

Audit & System Logs

  • No /systemlogs action is emitted by this endpoint.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and visibility scopingReads caller identity used by read validation and task visibility checks.
countly.long_tasksTask metadata/result sourceReads task records and status information.
countly_fs.task_resultsGridFS-backed result dataReads task result bytes when task uses GridFS storage.

Examples

Example 1: Read task record

/o/tasks/task?
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2&
task_id=17f0f6c3a2c42cbced96d4a01f88f9a7f45bc7a5

Example 2: Read subtask flow

/o/tasks/task?
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2&
task_id=17f0f6c3a2c42cbced96d4a01f88f9a7f45bc7a5&
subtask_key=step-2

Operational Considerations

  • Returned payload can be large for heavy export/report tasks.
  • Response structure varies by task type.
  • In taskgroup flows, requesting a missing subtask_key can trigger parent rerun side effects.

Last Updated

2026-02-17