Reten Docs
Dispatch

Dispatch Providers

CRUD for global dispatch providers and channel definitions.

GET /api/dispatch-providers

List all global dispatch providers with their channel definitions.

Auth: Required — VIEW_ACTIVITIES permission

Example

curl https://api.reten.ai/api/dispatch-providers \
  -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-providers',
  {
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

const providers = response.data;

Response 200 OK

[
  {
    "id": "660e8400-e29b-41d4-a716-446655440000",
    "code": "YOM",
    "name": "YOM Provider",
    "protocolType": "REST",
    "isActive": true,
    "channelDefinitions": [
      {
        "channel": "SALESMAN",
        "credentialSchema": [
          {
            "key": "apiKey",
            "label": "API Key",
            "type": "password",
            "required": true
          }
        ],
        "settingsSchema": []
      }
    ]
  }
]

GET /api/dispatch-providers/:id/channel-definitions

List channel definitions for a specific dispatch provider.

Auth: Required — VIEW_ACTIVITIES permission

Path Parameters

ParameterTypeDescription
idUUIDDispatch provider ID

Example

curl https://api.reten.ai/api/dispatch-providers/660e8400-e29b-41d4-a716-446655440000/channel-definitions \
  -H "Authorization: Bearer <token>"
import axios from 'axios';

const response = await axios.get(
  'https://api.reten.ai/api/dispatch-providers/660e8400-e29b-41d4-a716-446655440000/channel-definitions',
  {
    headers: {
      Authorization: 'Bearer <token>',
    },
  }
);

const channelDefinitions = response.data;

Response 200 OK

[
  {
    "id": "770e8400-e29b-41d4-a716-446655440000",
    "dispatchProviderId": "660e8400-e29b-41d4-a716-446655440000",
    "channel": "SALESMAN",
    "credentialSchema": [
      {
        "key": "apiKey",
        "label": "API Key",
        "type": "password",
        "required": true
      }
    ],
    "settingsSchema": [],
    "createdAt": "2025-01-15T10:00:00.000Z",
    "updatedAt": "2025-01-15T10:00:00.000Z"
  }
]

Error Responses

StatusDescription
404Dispatch provider not found

POST /api/dispatch-providers

Create a new global dispatch provider.

Auth: Required — MANAGE_ACTIVITY_CONFIG permission

Request Body

FieldTypeRequiredDescription
codestringYesUnique provider code
namestringYesProvider name
protocol_typestringYesREST, WEBHOOK, EMAIL, SMS, or WSP

Example

curl -X POST https://api.reten.ai/api/dispatch-providers \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "NEW_PROVIDER",
    "name": "New Provider",
    "protocol_type": "REST"
  }'
import axios from 'axios';

const response = await axios.post(
  'https://api.reten.ai/api/dispatch-providers',
  {
    code: 'NEW_PROVIDER',
    name: 'New Provider',
    protocol_type: 'REST',
  },
  {
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

Response 201 Created


PATCH /api/dispatch-providers/:id

Update a dispatch provider.

Auth: Required — MANAGE_ACTIVITY_CONFIG permission

Request Body

FieldTypeRequiredDescription
namestringNoProvider name
protocol_typestringNoProtocol type
is_activebooleanNoActive status

Example

curl -X PATCH https://api.reten.ai/api/dispatch-providers/<id> \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Provider"
  }'
import axios from 'axios';

const response = await axios.patch(
  'https://api.reten.ai/api/dispatch-providers/<id>',
  {
    name: 'Updated Provider',
  },
  {
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

Response 200 OK