Configuración de Actividades
Políticas de Atributos
Gestionar políticas de resolución de atributos por tenant.
GET /api/activity-config/attribute-policies
Lista todas las políticas de atributos del tenant actual.
Auth: Requerida — permiso VIEW_ACTIVITIES
Ejemplo
curl https://api.reten.ai/api/activity-config/attribute-policies \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>"const response = await fetch("https://api.reten.ai/api/activity-config/attribute-policies", {
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
});
const policies = await response.json();import requests
response = requests.get(
"https://api.reten.ai/api/activity-config/attribute-policies",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
)
policies = response.json()Respuesta 200 OK
[
{
"id": "440e8400-e29b-41d4-a716-446655440000",
"attributeKeyId": "220e8400-e29b-41d4-a716-446655440000",
"resolutionStrategy": "UPFRONT",
"resolverType": "INTERNAL_SERVICE",
"attributeKey": {
"key": "commerce_info",
"label": "Commerce Info"
}
}
]POST /api/activity-config/attribute-policies
Crea o actualiza (upsert) una política de atributo. Usa attribute_key_id como clave única por tenant.
Auth: Requerida — permiso MANAGE_ACTIVITY_CONFIG
Cuerpo de la Solicitud
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
attribute_key_id | UUID | Sí | ID de la clave de atributo global |
resolution_strategy | string | Sí | UPFRONT, ON_DISPATCH o CALLER_PROVIDED |
resolver_type | string | Sí | INTERNAL_SERVICE, CLIENT_HOOK o CALLER_PROVIDED |
Ejemplo
curl -X POST https://api.reten.ai/api/activity-config/attribute-policies \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"attribute_key_id": "220e8400-e29b-41d4-a716-446655440000",
"resolution_strategy": "UPFRONT",
"resolver_type": "INTERNAL_SERVICE"
}'const response = await fetch("https://api.reten.ai/api/activity-config/attribute-policies", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
attribute_key_id: "220e8400-e29b-41d4-a716-446655440000",
resolution_strategy: "UPFRONT",
resolver_type: "INTERNAL_SERVICE",
}),
});
const policy = await response.json();import requests
response = requests.post(
"https://api.reten.ai/api/activity-config/attribute-policies",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
json={
"attribute_key_id": "220e8400-e29b-41d4-a716-446655440000",
"resolution_strategy": "UPFRONT",
"resolver_type": "INTERNAL_SERVICE",
},
)
policy = response.json()Respuesta 200 OK
Devuelve la política creada o actualizada.
Notas
- Una política por clave de atributo por tenant (restricción única)
- Si ya existe una política para la clave, se actualiza (comportamiento upsert)