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

FieldTypeRequiredDescription
itemsarrayYesArray of operator objects

Each operator object:

FieldTypeRequiredDescription
external_idstringYesExternal identifier (part of match key)
typestringYesSALESMAN, ACTIVATOR, or CALLCENTER (part of match key)
namestringYesOperator name
emailstringNoEmail (unique per tenant)
phonestringNoPhone number
metadataobjectNoArbitrary 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
}