Reten Docs
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

FieldTypeRequiredDescription
resolution_strategystringYesON_CREATION, ON_DISPATCH, or MANUAL
fallback_to_commerce_repbooleanNoFall back to commerce representative if no criteria match (default: true)
fallback_to_ownerbooleanNoFall back to commerce owner if no criteria match (default: true)
priorityintegerNoConfig priority (lower = higher priority, default: 0). Must be unique among active configs.
criteriaarrayNoResolution criteria (see below)

Criteria Object

FieldTypeRequiredDescription
typestringYesROLE_MATCH, LAST_CONTACTED_ALL_CHANNELS, or LAST_CONTACTED_SAME_CHANNEL
configobjectNoCriteria-specific configuration
priorityintegerNoCriteria 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

FieldTypeRequiredDescription
itemsarrayYesArray 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

FieldTypeRequiredDescription
resolution_strategystringNoON_CREATION, ON_DISPATCH, or MANUAL
fallback_to_commerce_repbooleanNoFall back to commerce representative
fallback_to_ownerbooleanNoFall back to commerce owner
priorityintegerNoConfig priority
criteriaarrayNoReplaces 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>',
    },
  }
);

Response 204 No Content