Get Activity
Get a single activity with relations.
GET /api/activities/:id
Returns a single activity with its commerce assignment and status events. For the catalog of possible values of the status field, see Activity States.
Auth: Required — activity:view permission
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | Activity ID |
Example
curl https://api.reten.ai/api/activities/ee0e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "x-project-id: <project-id>"const activityId = "ee0e8400-e29b-41d4-a716-446655440000";
const response = await fetch(`https://api.reten.ai/api/activities/${activityId}`, {
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"x-project-id": "<project-id>",
},
});
const activity = await response.json();import requests
activity_id = "ee0e8400-e29b-41d4-a716-446655440000"
response = requests.get(
f"https://api.reten.ai/api/activities/{activity_id}",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"x-project-id": "<project-id>",
},
)
activity = response.json()Response 200 OK
{
"id": "ee0e8400-e29b-41d4-a716-446655440000",
"projectId": "3f6c2b1a-8d4e-4f7a-9b2c-5e1d0a7f6c34",
"type": "TASK",
"reasonConfigId": "990e8400-e29b-41d4-a716-446655440000",
"userStatusConfigId": "aa0e8400-e29b-41d4-a716-446655440000",
"score": null,
"templateId": null,
"channel": "SALESMAN",
"intentCategory": "RETENTION",
"originReasons": [
{
"code": "seller_scheduled",
"description": "El cliente pidió reagendar la visita"
},
{
"code": "repurchase",
"description": "Recompra: compra cada 15 días"
}
],
"originActivityResultId": "ab0e8400-e29b-41d4-a716-446655440000",
"scheduledAt": "2025-01-16T09:00:00.000Z",
"suggestedExecutionTime": null,
"status": "READY",
"idempotencyKey": "task-2025-01-15-001",
"dispatchConfigId": null,
"providerActivityId": null,
"dispatchAttemptCount": 0,
"errorCode": null,
"errorMessage": null,
"rawPayload": null,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"reasonConfig": {
"id": "990e8400-e29b-41d4-a716-446655440000",
"code": "retain",
"label": "❤️ Retención",
"intentCategory": null,
"isActive": true,
"createdAt": "2024-12-01T12:00:00.000Z",
"updatedAt": "2024-12-01T12:00:00.000Z"
},
"userStatusConfig": {
"id": "aa0e8400-e29b-41d4-a716-446655440000",
"code": "at_risk",
"label": "En Riesgo",
"isActive": true,
"createdAt": "2024-12-01T12:00:00.000Z",
"updatedAt": "2024-12-01T12:00:00.000Z"
},
"commerceAssignment": {
"activityId": "ee0e8400-e29b-41d4-a716-446655440000",
"commerceId": "880e8400-e29b-41d4-a716-446655440000",
"assignmentReason": null,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"commerce": {
"id": "880e8400-e29b-41d4-a716-446655440000",
"externalId": "STORE-001",
"globalExternalId": null,
"name": "Main Street Store",
"taxId": null,
"isPlaceholder": false,
"isActive": true,
"metadata": null,
"createdAt": "2024-12-01T12:00:00.000Z",
"updatedAt": "2024-12-01T12:00:00.000Z"
}
},
"statusEvents": [
{
"id": "ff0e8400-e29b-41d4-a716-446655440001",
"activityId": "ee0e8400-e29b-41d4-a716-446655440000",
"fromStatus": null,
"toStatus": "READY",
"eventType": "CREATED",
"errorCode": null,
"errorMessage": null,
"rawPayload": null,
"occurredAt": "2025-01-15T10:30:00.000Z",
"createdAt": "2025-01-15T10:30:00.000Z"
}
],
"reason": {
"code": "retain",
"label": "❤️ Retención"
},
"userStatus": {
"code": "at_risk",
"label": "En Riesgo"
},
"originActivityResult": {
"id": "ab0e8400-e29b-41d4-a716-446655440000",
"activityId": "ac0e8400-e29b-41d4-a716-446655440000",
"occurredAt": "2025-01-14T16:20:00.000Z",
"result": {
"code": "visit_rescheduled",
"label": "📅 Agenda visita"
}
},
"lifecycleStatus": "READY",
"lifecycleStatusLabel": "Lista",
"lifecycleStatusDetail": null
}intentCategory is the activity's intent category, fixed when it was created: the one sent in intent_category or, if the key was omitted, the reason's category at that moment. It does not change if the reason is reclassified later. reasonConfig.intentCategory is the reason's current default category, and is null when the reason is context-dependent. The two can differ, as in this example: a context-dependent reason and an activity created with RETENTION.
originReasons is the list sent in origin_reasons when the activity was created, in the same order: the commercial context of the activity, with no main item. It is [] when the activity was created without it.
originActivityResultId and originActivityResult are the activity result sent in origin_activity_result_id when the activity was created. originActivityResult summarizes it as it is now: its id, the activityId it belongs to (null for a STANDALONE result), occurredAt, and result, with its code and its current label in the tenant's catalog — or, when that result was submitted with the answers to a result form, the label of the option that was chosen. Both are null when the activity was created without it.
When the result was submitted with the answers to a result form, activityResult.taskDetails also carries answers, modality, formId and formVersion; the four are null on any other result. Such a result takes isEffective from the platform's catalog of result codes and has resultConfig: null. futureScheduledAt is a date with time in both cases.