Operators
Sync Operators
Batch upsert operators from external systems.
POST /api/operators/sync
Bulk upsert operators using type + external_id as composite match key.
Auth: Required — SYNC_OPERATORS permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
items | array | Yes | Array of operator objects |
Each operator object:
| Field | Type | Required | Description |
|---|---|---|---|
external_id | string | Yes | External identifier (part of match key) |
type | string | Yes | SALESMAN, ACTIVATOR, or CALLCENTER (part of match key) |
name | string | Yes | Operator name |
email | string | No | Email (unique per tenant) |
phone | string | No | Phone number |
metadata | object | No | Arbitrary JSON |
Example
curl -X POST https://api.reten.ai/api/operators/sync \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"external_id": "emp-001",
"type": "SALESMAN",
"name": "John Doe",
"email": "john@example.com",
"phone": "+56912345678"
}
]
}'import axios from 'axios';
const response = await axios.post(
'https://api.reten.ai/api/operators/sync',
{
items: [
{
external_id: 'emp-001',
type: 'SALESMAN',
name: 'John Doe',
email: 'john@example.com',
phone: '+56912345678',
},
],
},
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);Response 201 Created
{
"created": 1,
"updated": 0,
"total": 1
}