Configuración de Actividades
Estados de Retencion de Usuario
CRUD del catalogo global de estados de retencion de usuario.
GET /api/user-retention-statuses
Lista todos los estados de retencion de usuario globales.
Auth: Requerida — permiso VIEW_ACTIVITIES
Parámetros de Consulta
| Parámetro | Tipo | Default | Descripción |
|---|---|---|---|
active_only | boolean | false | Cuando es true, retorna solo estados activos |
Ejemplo
curl https://api.reten.ai/api/user-retention-statuses \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>"import axios from 'axios';
const response = await axios.get(
'https://api.reten.ai/api/user-retention-statuses',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);
const statuses = response.data;Respuesta 200 OK
[
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"code": "active",
"label": "Activo",
"description": "Cliente activamente comprometido",
"isActive": true,
"createdAt": "2026-01-15T10:00:00.000Z",
"updatedAt": "2026-01-15T10:00:00.000Z"
},
{
"id": "d4e5f6a7-b8c9-0123-defa-234567890123",
"code": "at_risk",
"label": "En Riesgo",
"description": "Cliente muestra senales de abandono",
"isActive": true,
"createdAt": "2026-01-15T10:00:00.000Z",
"updatedAt": "2026-01-15T10:00:00.000Z"
}
]POST /api/user-retention-statuses
Crea un nuevo estado de retencion de usuario global.
Auth: Requerida — permiso MANAGE_ACTIVITY_CONFIG
Cuerpo de la Solicitud
| Campo | Tipo | Requerido | Descripcion |
|---|---|---|---|
code | string | Si | Codigo unico identificador |
label | string | Si | Etiqueta de visualizacion |
description | string | No | Descripcion del estado de retencion |
Ejemplo
curl -X POST https://api.reten.ai/api/user-retention-statuses \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"code": "churned",
"label": "Abandonado",
"description": "Cliente ha abandonado"
}'import axios from 'axios';
const response = await axios.post(
'https://api.reten.ai/api/user-retention-statuses',
{
code: 'churned',
label: 'Abandonado',
description: 'Cliente ha abandonado',
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Respuesta 201 Created
PATCH /api/user-retention-statuses/:id
Actualiza un estado de retencion de usuario.
Auth: Requerida — permiso MANAGE_ACTIVITY_CONFIG
Cuerpo de la Solicitud
| Campo | Tipo | Requerido | Descripcion |
|---|---|---|---|
label | string | No | Etiqueta de visualizacion |
description | string | No | Descripcion del estado de retencion |
is_active | boolean | No | Habilitar o deshabilitar este estado de retencion |
Ejemplo
curl -X PATCH https://api.reten.ai/api/user-retention-statuses/<id> \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"label": "Etiqueta Actualizada"
}'import axios from 'axios';
const response = await axios.patch(
'https://api.reten.ai/api/user-retention-statuses/<id>',
{
label: 'Etiqueta Actualizada',
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Respuesta 200 OK
DELETE /api/user-retention-statuses/:id
Elimina un estado de retencion de usuario.
Auth: Requerida — permiso MANAGE_ACTIVITY_CONFIG
Ejemplo
curl -X DELETE https://api.reten.ai/api/user-retention-statuses/<id> \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>"import axios from 'axios';
const response = await axios.delete(
'https://api.reten.ai/api/user-retention-statuses/<id>',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);