List Task Activities
Get a paginated list of TASK activities with route/operator filters.
GET /api/activities/tasks
Returns a paginated list of TASK-type activities with additional route and operator filters.
Auth: Required — activity:view permission
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
per_page | number | 25 | Items per page (max 100) |
search | string | - | Search task activities: partial, case-insensitive match on the reason code of activities and on the commerce name of STANDALONE rows |
status | string | - | Filter by activity status (see Activity States). It does not exclude STANDALONE rows, which have no status. Filterable values: READY, RETRYING, DISPATCHED, COMPLETED, CANCELED, FAILED |
channel | string | - | Filter by channel |
commerce_id | UUID | - | Filter by commerce |
assigned_route_id | UUID | - | Filter by assigned route. It does not exclude STANDALONE rows, which have no route |
assigned_operator_id | UUID | - | Filter by assigned operator |
scheduled_from | ISO 8601 | - | Filter from scheduled date |
scheduled_to | ISO 8601 | - | Filter to scheduled date |
result_status | string | - | Filter by latest result status — see Activity States §resultStatus. Filterable values: COMPLETED, NOT_EXECUTED |
intent_categories | string (CSV) | - | Filter by intent category. Comma-separated list of ONBOARDING, MARKETING, COLLECTION, RETENTION, NOTIFICATION, SURVEY, VALIDATION, SALES, CREDIT, OPERATIONAL or DIGITAL_ADOPTION values (e.g. SALES,CREDIT). Returns only the activities of those categories, without STANDALONE rows, and pagination.total counts only those |
Example
curl "https://api.reten.ai/api/activities/tasks?assigned_route_id=<routeId>&status=READY" \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "x-project-id: <project-id>"const params = new URLSearchParams({ assigned_route_id: "<routeId>", status: "READY" });
const response = await fetch(`https://api.reten.ai/api/activities/tasks?${params}`, {
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"x-project-id": "<project-id>",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.reten.ai/api/activities/tasks",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"x-project-id": "<project-id>",
},
params={"assigned_route_id": "<routeId>", "status": "READY"},
)
data = response.json()Response 200 OK
{
"data": [
{
"id": "ee0e8400-e29b-41d4-a716-446655440000",
"rowType": "ACTIVITY",
"projectId": "3f6c2b1a-8d4e-4f7a-9b2c-5e1d0a7f6c34",
"type": "TASK",
"reason": {
"code": "recurrent",
"label": "🔁 Reposición de stock"
},
"intentCategory": "SALES",
"originReasons": [
{
"code": "repurchase",
"description": "Recompra: compra cada 15 días"
}
],
"originActivityResultId": "ab0e8400-e29b-41d4-a716-446655440000",
"userStatus": {
"code": "at_risk",
"label": "En Riesgo"
},
"status": "READY",
"scheduledAt": "2025-01-16T09:00:00.000Z",
"createdAt": "2025-01-15T10:30:00.000Z",
"idempotencyKey": "task-2025-01-15-001",
"lifecycleStatus": "READY",
"lifecycleStatusLabel": "Lista",
"lifecycleStatusDetail": null,
"canForceRetryDispatch": false,
"channel": "SALESMAN",
"commerceId": "880e8400-e29b-41d4-a716-446655440000",
"commerceName": "Main Street Store",
"sortDate": "2025-01-16T09:00:00.000Z",
"commerceAssignment": {
"commerceId": "880e8400-e29b-41d4-a716-446655440000",
"assignmentReason": null,
"commerce": {
"id": "880e8400-e29b-41d4-a716-446655440000",
"name": "Main Street Store",
"externalId": "STORE-001"
}
},
"activityResult": null,
"activityDetails": {
"type": "TASK",
"assignedRouteId": "dd0e8400-e29b-41d4-a716-446655440000",
"assignedOperatorId": "cc0e8400-e29b-41d4-a716-446655440000",
"assignedRoute": {
"id": "dd0e8400-e29b-41d4-a716-446655440000",
"code": "ZONE-NORTH",
"name": "North Zone"
},
"assignedOperator": {
"id": "cc0e8400-e29b-41d4-a716-446655440000",
"name": "John Doe",
"type": "SALESMAN"
}
}
}
],
"pagination": {
"page": 1,
"per_page": 25,
"total": 1,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
}Each item carries intentCategory, the activity's intent category, fixed when the activity was created. It is null on rowType: "STANDALONE" rows, which are results registered without an activity.
Each item also carries originReasons, the origin reasons the activity was created with (code, description), in the order they were sent. It is [] on an activity created without them and on rowType: "STANDALONE" rows.
Each item also carries originActivityResultId, the ID of the activity result the activity was created from. It is null on an activity created without it and on rowType: "STANDALONE" rows. The summary of that result comes only in the activity's detail, Get Task Activity.
When an item has a result, activityResult.resultDetails.isEffective says whether that result counted as effective, also on rowType: "STANDALONE" rows. It is copied from its result type when the result is registered or its result code changes, and it does not change if the result type is reclassified later. A NOT_EXECUTED result from the automatic close has no result type: it has isEffective: false and result.label: null.
A result submitted with the answers to a result form differs in two ways: its isEffective comes from the platform's catalog of result codes, not from the tenant's result type, and its result.label is the label of the option that was chosen, in the version of the form that was answered. resultDetails also carries answers (each answer with key, keyLabel, value and, on choice questions, valueLabel), modality (visit, remote or null), formId and formVersion; the four are null on a result that was not submitted with answers.