Dispatch
Dispatch Configs
CRUD for per-tenant dispatch provider channel configurations.
GET /api/dispatch-configs
List all dispatch configs for the current tenant.
Auth: Required — VIEW_ACTIVITIES permission
Example
curl https://api.reten.ai/api/dispatch-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/dispatch-configs',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);
const configs = response.data;Response 200 OK
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"dispatchProviderId": "660e8400-e29b-41d4-a716-446655440000",
"channel": "SALESMAN",
"baseUrl": "https://provider.example.com",
"settings": {},
"isActive": true,
"dispatchProvider": {
"code": "YOM",
"name": "YOM Provider"
}
}
]POST /api/dispatch-configs
Create a dispatch config for a provider+channel combination.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
dispatch_provider_id | UUID | Yes | Global dispatch provider ID |
channel | string | Yes | Channel: SALESMAN, CALLCENTER, WHATSAPP, EMAIL, SMS, PUSH |
base_url | string | No | Provider endpoint URL |
credentials | object | No | Authentication credentials (encrypted at rest) |
settings | object | No | Additional configuration |
Example
curl -X POST https://api.reten.ai/api/dispatch-configs \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"dispatch_provider_id": "660e8400-e29b-41d4-a716-446655440000",
"channel": "SALESMAN",
"base_url": "https://provider.example.com",
"credentials": {
"apiKey": "sk-xxx"
}
}'import axios from 'axios';
const response = await axios.post(
'https://api.reten.ai/api/dispatch-configs',
{
dispatch_provider_id: '660e8400-e29b-41d4-a716-446655440000',
channel: 'SALESMAN',
base_url: 'https://provider.example.com',
credentials: {
apiKey: 'sk-xxx',
},
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 201 Created
Validation
- Provider must support the specified channel (channel definition must exist)
- All required credential fields per the channel definition must be provided
- All required settings fields per the channel definition must be provided
PATCH /api/dispatch-configs/:id
Update a dispatch config.
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Example
curl -X PATCH https://api.reten.ai/api/dispatch-configs/<id> \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"baseUrl": "https://new-provider.example.com"
}'import axios from 'axios';
const response = await axios.patch(
'https://api.reten.ai/api/dispatch-configs/<id>',
{
baseUrl: 'https://new-provider.example.com',
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 200 OK
DELETE /api/dispatch-configs/:id
Deactivate a dispatch config (soft delete).
Auth: Required — MANAGE_ACTIVITY_CONFIG permission
Example
curl -X DELETE https://api.reten.ai/api/dispatch-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/dispatch-configs/<id>',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);