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",
      "intentCategory": "SALES",
      "formId": "3f6c2a9e-8b41-4d7a-9c15-2e7f0b6d4a81",
      "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"
      },
      "originReasons": [
        {
          "code": "repurchase",
          "description": "Recompra: compra cada 15 días"
        }
      ],
      "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,
  "intentCategory": null,
  "formId": null,
  "reason": null,
  "originReasons": [],
  "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"
      },
      "isEffective": true,
      "modality": null,
      "futureScheduledAt": "2026-04-20",
      "formId": null,
      "formVersion": null,
      "answers": null
    }
  },
  "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")
intentCategorystring | nullCategory of the activity, fixed when it is created: one of the intentCategory values of a form. It is always the category of the form of its formId, and it does not serve to choose a form: several forms can share a category. null only on STANDALONE items
formIdstring | nullId of the result form the activity is answered with. The item does not carry the version: the form does. null on STANDALONE items and on a task created before result forms existed, which is answered only with the current format
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)
originReasonsarrayOrigin reasons the activity was created with (code, description), in the order they were sent. [] on an activity created without them and on STANDALONE items
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
resultobjectResult (code, label). In a result submitted with answers, label is the label of the chosen option in the version of the form that was answered, and it does not change if the form changes later. In a result without answers, it is the label of the tenant's result type. In an auto-close, code is NOT_EXECUTED and label is null
commentstring | nullComment submitted along with the result
requiresFutureScheduledAtbooleanIndicates whether the submitted result type requires a future_scheduled_at date. In a result submitted with answers, it is the flag that code has among the tenant's result types, active or not, and false if the tenant does not have that code. An integration that sends answers does not need it: the form says it, with the future_scheduled_at question
externalOperatorIdstring | nullExternal ID of the operator who submitted the result
operatorobject | nullOperator who submitted the result (externalId, name)
isEffectivebooleanWhether the result counts as an effective contact
modalitystring | nullvisit or remote: the answer to the modality question. null when the result was not submitted with answers, or the modality question was not answered or is not in the form
futureScheduledAtstring | nullScheduled date as YYYY-MM-DD. With answers, exactly as it was answered; without answers, the day of the stored date and time in the tenant's time zone
formIdstring | nullForm the result was validated against. null when the result did not come from a submission with answers: one sent in the current format, an auto-close, or a standalone execution
formVersionnumber | nullVersion of the form the result was validated against. null in the same cases as formId
answersarray | nullEvery answer of the submission, in the order of the form, with the shape of the response of the submission: key, keyLabel, value and valueLabel. null in the same cases as formId

The item and resultDetails each carry a formId: the one of the item is the form the activity is answered with; the one of resultDetails, the form its result was validated against.

The resultDetails of a result submitted with answers:

{
  "type": "TASK",
  "result": {
    "code": "call_rescheduled",
    "label": "Pide que lo llamen otro día"
  },
  "comment": "Pide que lo llamen la próxima semana.",
  "requiresFutureScheduledAt": true,
  "externalOperatorId": "OP-042",
  "operator": {
    "externalId": "OP-042",
    "name": "Carlos Pérez"
  },
  "isEffective": true,
  "modality": "remote",
  "futureScheduledAt": "2026-11-12",
  "formId": "3f6c2a9e-8b41-4d7a-9c15-2e7f0b6d4a81",
  "formVersion": 3,
  "answers": [
    {
      "key": "modality",
      "keyLabel": "¿Cómo hiciste esta gestión?",
      "value": "remote",
      "valueLabel": "Llamado o mensaje"
    },
    {
      "key": "contact",
      "keyLabel": "¿Hubo contacto con el cliente?",
      "value": "yes",
      "valueLabel": "Sí"
    },
    {
      "key": "code",
      "keyLabel": "¿Cómo terminó la gestión?",
      "value": "call_rescheduled",
      "valueLabel": "Pide que lo llamen otro día"
    },
    {
      "key": "future_scheduled_at",
      "keyLabel": "¿Para cuándo queda agendada?",
      "value": "2026-11-12"
    },
    {
      "key": "comment",
      "keyLabel": "Comentarios",
      "value": "Pide que lo llamen la próxima semana."
    }
  ]
}

Errors

StatusDescription
401Invalid, revoked or expired API key, or its owner is inactive (see Errors)
403The key does not have the activity:view permission
400 / 403 / 404The x-project-id that was sent is not valid — see Project errors