Activity Config
Target Resolution Config
CRUD for target resolution configurations.
GET /api/activity-config/target-resolution
List all target resolution configs for the current tenant, ordered by priority.
Auth: Required — VIEW_ACTIVITIES permission
Example
curl https://api.reten.ai/api/activity-config/target-resolution \
-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-config/target-resolution',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);
const configs = response.data;Response 200 OK
[
{
"id": "110e8400-e29b-41d4-a716-446655440000",
"resolutionStrategy": "ON_CREATION",
"fallbackToCommerceRep": true,
"fallbackToOwner": true,
"priority": 0,
"isActive": true,
"criteria": [
{
"id": "220e8400-e29b-41d4-a716-446655440000",
"criteriaType": "ROLE_MATCH",
"criteriaConfig": { "role": "COMMERCE_REP" },
"priority": 0
},
{
"id": "330e8400-e29b-41d4-a716-446655440000",
"criteriaType": "LAST_CONTACTED_SAME_CHANNEL",
"criteriaConfig": {},
"priority": 1
}
]
}
]POST /api/activity-config/target-resolution
Create a new target resolution config.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
resolution_strategy | string | Yes | ON_CREATION, ON_DISPATCH, or MANUAL |
fallback_to_commerce_rep | boolean | No | Fall back to commerce representative if no criteria match (default: true) |
fallback_to_owner | boolean | No | Fall back to commerce owner if no criteria match (default: true) |
priority | integer | No | Config priority (lower = higher priority, default: 0). Must be unique among active configs. |
criteria | array | No | Resolution criteria (see below) |
Criteria Object
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | ROLE_MATCH, LAST_CONTACTED_ALL_CHANNELS, or LAST_CONTACTED_SAME_CHANNEL |
config | object | No | Criteria-specific configuration |
priority | integer | No | Criteria priority within this config |
Example
curl -X POST https://api.reten.ai/api/activity-config/target-resolution \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"resolution_strategy": "ON_CREATION",
"fallback_to_commerce_rep": true,
"fallback_to_owner": true,
"priority": 0,
"criteria": [
{ "type": "ROLE_MATCH", "config": { "role": "COMMERCE_REP" }, "priority": 0 }
]
}'import axios from 'axios';
const response = await axios.post(
'https://api.reten.ai/api/activity-config/target-resolution',
{
resolution_strategy: 'ON_CREATION',
fallback_to_commerce_rep: true,
fallback_to_owner: true,
priority: 0,
criteria: [
{ type: 'ROLE_MATCH', config: { role: 'COMMERCE_REP' }, priority: 0 },
],
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 201 Created
PATCH /api/activity-config/target-resolution/reorder
Reorder all active configs. Must include all active configs with their new priorities.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
items | array | Yes | Array of objects with id (UUID) and priority (integer) for every active config |
Example
curl -X PATCH https://api.reten.ai/api/activity-config/target-resolution/reorder \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "id": "110e8400-e29b-41d4-a716-446655440000", "priority": 0 },
{ "id": "220e8400-e29b-41d4-a716-446655440000", "priority": 1 }
]
}'import axios from 'axios';
const response = await axios.patch(
'https://api.reten.ai/api/activity-config/target-resolution/reorder',
{
items: [
{ id: '110e8400-e29b-41d4-a716-446655440000', priority: 0 },
{ id: '220e8400-e29b-41d4-a716-446655440000', priority: 1 },
],
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 200 OK
PATCH /api/activity-config/target-resolution/:id
Update a target resolution config. All fields are optional. When criteria is provided, it replaces all existing criteria atomically.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
resolution_strategy | string | No | ON_CREATION, ON_DISPATCH, or MANUAL |
fallback_to_commerce_rep | boolean | No | Fall back to commerce representative |
fallback_to_owner | boolean | No | Fall back to commerce owner |
priority | integer | No | Config priority |
criteria | array | No | Replaces all existing criteria |
Example
curl -X PATCH https://api.reten.ai/api/activity-config/target-resolution/<id> \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"resolution_strategy": "ON_DISPATCH",
"fallback_to_commerce_rep": false
}'import axios from 'axios';
const response = await axios.patch(
'https://api.reten.ai/api/activity-config/target-resolution/<id>',
{
resolution_strategy: 'ON_DISPATCH',
fallback_to_commerce_rep: false,
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 200 OK
DELETE /api/activity-config/target-resolution/:id
Delete a target resolution config.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Example
curl -X DELETE https://api.reten.ai/api/activity-config/target-resolution/<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-config/target-resolution/<id>',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);