Activity Reason Configs
Per-tenant configuration of active activity reasons.
GET /api/activity-reason-configs
List all tenant activity reason configurations.
Auth: Required — VIEW_ACTIVITIES permission
Example
curl https://api.reten.ai/api/activity-reason-configs \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>"import axios from 'axios';
const response = await axios.get(
'https://api.reten.ai/api/activity-reason-configs',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);
const configs = response.data;Response 200 OK
[
{
"id": "880e8400-e29b-41d4-a716-446655440000",
"code": "recurrent",
"label": "🔁 Reposición de stock",
"isActive": true,
"createdAt": "2026-06-18T06:00:00.000Z",
"updatedAt": "2026-06-18T06:00:00.000Z"
},
{
"id": "990e8400-e29b-41d4-a716-446655440000",
"code": "retain",
"label": "❤️ Retención",
"isActive": true,
"createdAt": "2026-06-18T06:00:00.000Z",
"updatedAt": "2026-06-18T06:00:00.000Z"
}
]GET /api/activity-reason-configs/defaults
Return the platform default activity reasons as a flat { code, label } catalog. The admin app uses this to prefill the import dialog with the reasons a tenant can adopt.
Auth: Required — VIEW_ACTIVITIES permission
This endpoint is prefill, not an entity. The payload is the hardcoded defaults catalog — non-authoritative and NOT persisted — and always lists every default regardless of what the tenant already has. To adopt them, the admin picks the ones that are still missing and creates them via POST /api/activity-reason-configs/bulk. Nothing is created by calling this endpoint.
Example
curl https://api.reten.ai/api/activity-reason-configs/defaults \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>"import axios from 'axios';
const response = await axios.get(
'https://api.reten.ai/api/activity-reason-configs/defaults',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);
const defaults = response.data;Response 200 OK
[
{
"code": "recurrent",
"label": "🔁 Reposición de stock"
},
{
"code": "retain",
"label": "❤️ Retención"
}
]POST /api/activity-reason-configs
Create a tenant activity reason configuration.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Unique code identifying this reason in the tenant catalog |
label | string | Yes | Display label for this tenant |
Example
curl -X POST https://api.reten.ai/api/activity-reason-configs \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"code": "retention",
"label": "Retencion"
}'import axios from 'axios';
const response = await axios.post(
'https://api.reten.ai/api/activity-reason-configs',
{
code: 'retention',
label: 'Retencion',
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 201 Created
POST /api/activity-reason-configs/bulk
Bulk create tenant activity reason configurations.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
items | array | Yes | Array of configurations to create |
items[].code | string | Yes | Unique code identifying this reason in the tenant catalog |
items[].label | string | Yes | Display label for this tenant |
Example
curl -X POST https://api.reten.ai/api/activity-reason-configs/bulk \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"code": "retention",
"label": "Retencion"
},
{
"code": "upsell",
"label": "Upsell"
}
]
}'import axios from 'axios';
const response = await axios.post(
'https://api.reten.ai/api/activity-reason-configs/bulk',
{
items: [
{
code: 'retention',
label: 'Retencion',
},
{
code: 'upsell',
label: 'Upsell',
},
],
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 201 Created
PATCH /api/activity-reason-configs/:id
Update a tenant activity reason configuration.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
label | string | No | Display label |
is_active | boolean | No | Enable or disable this config |
Example
curl -X PATCH https://api.reten.ai/api/activity-reason-configs/<id> \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"label": "Updated Label"
}'import axios from 'axios';
const response = await axios.patch(
'https://api.reten.ai/api/activity-reason-configs/<id>',
{
label: 'Updated Label',
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 200 OK
DELETE /api/activity-reason-configs/:id
Deactivate a tenant activity reason configuration.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Example
curl -X DELETE https://api.reten.ai/api/activity-reason-configs/<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/activity-reason-configs/<id>',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);