Reten Docs

List Activities

Query task-type activities visible to your integration.

GET /api/integration/activities/tasks

Returns a paginated list of task-type activities visible to your integration's API key, from one project or from the whole tenant (see Required header).

Authentication: Required — permission activity:view

Required header

HeaderValue
x-api-keyYOUR_API_KEY

x-project-id is optional: this is a project-optional endpoint. With a tenant key or a user token, sending the header narrows the list to that project; without it, the list covers every project of the tenant, and each activity carries its projectId. A project key always lists the activities of its own project. A header that is sent is validated — see Project errors.

Query parameters

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1)
per_pagenumberNoResults per page (default: 25, max: 100)
statusstringNoFilter by activity status (see Activity States). Filterable values: READY, RETRYING, DISPATCHED, COMPLETED, CANCELED, FAILED
result_statusstringNoFilter by result status (see Activity States). Filterable values: COMPLETED, NOT_EXECUTED
channelstringNoFilter by channel (SALESMAN, CALLCENTER, etc.)
external_commerce_idstringNoFilter by commerce external ID
external_operator_idstringNoFilter by operator external ID
scheduled_fromstringNoMinimum scheduled date (ISO 8601)
scheduled_tostringNoMaximum scheduled date (ISO 8601)

Example

curl -X GET "BASE_URL/api/integration/activities/tasks?page=1&per_page=10&status=READY" \
  -H "x-api-key: YOUR_API_KEY"
const params = new URLSearchParams({
  page: "1",
  per_page: "10",
  status: "READY",
});

const response = await fetch(
  `${BASE_URL}/api/integration/activities/tasks?${params}`,
  {
    headers: {
      "x-api-key": "YOUR_API_KEY",
    },
  }
);

const data = await response.json();
import requests

response = requests.get(
    f"{BASE_URL}/api/integration/activities/tasks",
    headers={
        "x-api-key": "YOUR_API_KEY",
    },
    params={
        "page": 1,
        "per_page": 10,
        "status": "READY",
    },
)

data = response.json()

Response 200 OK

The following is an illustrative example of the response shape. Values for fields such as id, scheduledAt, status, lifecycleStatus, etc., vary depending on the actual state of each activity. For the complete catalog of possible status and lifecycleStatus values, see Activity States.

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "activityOrigin": "ACTIVITY",
      "projectId": "3f6c2b1a-8d4e-4f7a-9b2c-5e1d0a7f6c34",
      "type": "TASK",
      "status": "READY",
      "score": 85,
      "channel": "SALESMAN",
      "scheduledAt": "2026-04-10T18:00:00.000Z",
      "occurredAt": null,
      "createdAt": "2026-04-10T14:30:00.000Z",
      "lifecycleStatus": "READY",
      "lifecycleStatusLabel": "Lista",
      "lifecycleStatusDetail": null,
      "canForceRetryDispatch": false,
      "commerceExternalId": "COM-001",
      "commerceName": "Farmacia Central",
      "reason": {
        "code": "CHURN_RISK",
        "label": "Riesgo de fuga"
      },
      "userStatus": null,
      "commerceAssignment": {
        "commerceExternalId": "COM-001",
        "assignmentReason": "Asignación por ruta",
        "commerce": {
          "externalId": "COM-001",
          "name": "Farmacia Central"
        }
      },
      "activityDetails": {
        "type": "TASK",
        "assignedRouteCode": "RUTA-NORTE-01",
        "assignedOperatorExternalId": "OP-042",
        "assignedRoute": {
          "code": "RUTA-NORTE-01",
          "name": "Ruta Norte"
        },
        "assignedOperator": {
          "externalId": "OP-042",
          "name": "Carlos Pérez",
          "type": "SALESMAN"
        }
      },
      "activityResult": null
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 10,
    "total": 47,
    "total_pages": 5,
    "has_next": true,
    "has_previous": false
  }
}

Standalone execution example

Items with activityOrigin: "STANDALONE" come from a result registered as a standalone execution, without a preceding activity: scheduledAt repeats the result's occurredAt, and activityResult is always populated. A populated activityResult also appears on ACTIVITY items once they have been handled.

Only the item is shown below — the surrounding pagination envelope is identical to the one above.

{
  "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "activityOrigin": "STANDALONE",
  "projectId": "3f6c2b1a-8d4e-4f7a-9b2c-5e1d0a7f6c34",
  "type": null,
  "reason": null,
  "userStatus": null,
  "status": null,
  "score": null,
  "scheduledAt": "2026-04-12T16:45:00.000Z",
  "occurredAt": "2026-04-12T16:45:00.000Z",
  "createdAt": "2026-04-12T16:47:00.000Z",
  "lifecycleStatus": null,
  "lifecycleStatusLabel": null,
  "lifecycleStatusDetail": null,
  "canForceRetryDispatch": false,
  "channel": "SALESMAN",
  "commerceExternalId": "COM-001",
  "commerceName": "Farmacia Central",
  "commerceAssignment": null,
  "activityResult": {
    "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
    "resultStatus": "COMPLETED",
    "source": "STANDALONE",
    "origin": "PLATFORM",
    "channel": "SALESMAN",
    "occurredAt": "2026-04-12T16:45:00.000Z",
    "createdAt": "2026-04-12T16:47:00.000Z",
    "resultDetails": {
      "type": "TASK",
      "result": {
        "code": "RESCHEDULE",
        "label": "Reprogramar visita"
      },
      "comment": null,
      "requiresFutureScheduledAt": true,
      "externalOperatorId": "OP-042",
      "operator": {
        "externalId": "OP-042",
        "name": "Carlos Pérez"
      }
    }
  },
  "activityDetails": {
    "type": "TASK",
    "assignedRouteCode": null,
    "assignedOperatorExternalId": "OP-042",
    "assignedRoute": null,
    "assignedOperator": {
      "externalId": "OP-042",
      "name": "Carlos Pérez",
      "type": "SALESMAN"
    }
  }
}

Activity fields

FieldTypeDescription
idstringUnique activity identifier
activityOrigin"ACTIVITY" | "STANDALONE"Activity origin
projectIdstringProject the activity belongs to
typestring | nullActivity type (e.g., "TASK")
statusstring | nullCurrent activity status — see Activity States for the complete catalog
scorenumber | nullActivity priority score (set at creation)
channelstring | nullActivity channel (SALESMAN, CALLCENTER, etc.)
scheduledAtstring | nullScheduled date (ISO 8601)
occurredAtstring | nullDate when the activity was handled (ISO 8601)
createdAtstring | nullCreation date (ISO 8601)
lifecycleStatusstring | nullLifecycle status for display (read-only, computed) — see Activity States
lifecycleStatusLabelstring | nullHuman-readable lifecycle status label
lifecycleStatusDetailstring | nullAdditional status detail
canForceRetryDispatchbooleanIndicates whether a re-dispatch can be forced
commerceExternalIdstringExternal ID of the associated commerce
commerceNamestringCommerce name
reasonobject | nullActivity reason (code, label)
userStatusobject | nullCustom user status (code, label)
commerceAssignmentobject | nullCommerce assignment information
activityDetailsobject | nullType-specific activity details
activityResultobject | nullActivity result (if exists)

activityDetails fields (TASK type)

FieldTypeDescription
type"TASK"Type discriminator
assignedRouteCodestring | nullAssigned route code
assignedOperatorExternalIdstring | nullAssigned operator external ID
assignedRouteobject | nullAssigned route (code, name)
assignedOperatorobject | nullAssigned operator (externalId, name, type)

activityResult fields

FieldTypeDescription
idstringResult identifier
resultStatusstringResult status — see Activity States §resultStatus
sourcestringResult source
originstringOrigin channel
channelstring | nullResult channel
occurredAtstringDate when it occurred (ISO 8601)
createdAtstringCreation date (ISO 8601)
resultDetailsobject | nullTask result details

resultDetails fields (TASK type)

FieldTypeDescription
type"TASK"Type discriminator
resultobjectSubmitted result type (code, label)
commentstring | nullComment submitted along with the result
requiresFutureScheduledAtbooleanIndicates whether the submitted result type requires a future_scheduled_at date
externalOperatorIdstring | nullExternal ID of the operator who submitted the result
operatorobject | nullOperator who submitted the result (externalId, name)

Errors

StatusDescription
401API key missing or invalid
403The key does not have the activity:view permission
400 / 403 / 404The x-project-id that was sent is not valid — see Project errors