Actividades
Listar Actividades
Obtener una lista paginada de actividades con filtros.
GET /api/activities
Devuelve una lista paginada de actividades con filtros opcionales.
Auth: Requerida — permiso VIEW_ACTIVITIES
Parámetros de Consulta
| Parámetro | Tipo | Por Defecto | Descripción |
|---|---|---|---|
page | number | 1 | Número de página |
per_page | number | 25 | Elementos por página (máximo 100) |
search | string | - | Buscar actividades |
status | string | - | Filtrar por estado (READY, UNRESOLVED, DISPATCHED, COMPLETED, CANCELED, FAILED) |
type | string | - | Filtrar por tipo (TASK, MESSAGE) |
channel | string | - | Filtrar por canal |
commerce_id | UUID | - | Filtrar por comercio |
scheduled_from | ISO 8601 | - | Filtrar desde la fecha programada |
scheduled_to | ISO 8601 | - | Filtrar hasta la fecha programada |
Ejemplo
curl "https://api.reten.ai/api/activities?status=READY&type=TASK&page=1&limit=10" \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>"const params = new URLSearchParams({ status: "READY", type: "TASK", page: "1", limit: "10" });
const response = await fetch(`https://api.reten.ai/api/activities?${params}`, {
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.reten.ai/api/activities",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
params={"status": "READY", "type": "TASK", "page": 1, "limit": 10},
)
data = response.json()Respuesta 200 OK
{
"data": [
{
"id": "ee0e8400-e29b-41d4-a716-446655440000",
"type": "TASK",
"reason": {
"code": "retention",
"label": "Retencion"
},
"channel": "SALESMAN",
"status": "READY",
"userStatus": {
"code": "at_risk",
"label": "En Riesgo"
},
"scheduledAt": "2025-01-16T09:00:00.000Z",
"commerceAssignment": {
"commerceId": "880e8400-e29b-41d4-a716-446655440000",
"commerce": {
"name": "Main Street Store"
}
}
}
],
"meta": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1
}
}