Create Operator
Create a new field operator.
POST /api/operators
Create a new operator with type, contact info, and metadata.
Auth: Required — MANAGE_OPERATORS permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | SALESMAN, ACTIVATOR, or CALLCENTER |
name | string | Yes | Operator name |
email | string | No | Email address |
phone | string | No | Phone number |
external_id | string | No | External system identifier |
is_placeholder | boolean | No | Mark as placeholder record |
metadata | object | No | Arbitrary JSON |
Example
curl -X POST https://api.reten.ai/api/operators \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"type": "SALESMAN",
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+56912345678",
"external_id": "emp-001"
}'const response = await fetch("https://api.reten.ai/api/operators", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
type: "SALESMAN",
name: "John Doe",
email: "john.doe@example.com",
phone: "+56912345678",
external_id: "emp-001",
}),
});
const operator = await response.json();import requests
response = requests.post(
"https://api.reten.ai/api/operators",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
json={
"type": "SALESMAN",
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+56912345678",
"external_id": "emp-001",
},
)
operator = response.json()Response 201 Created
{
"id": "cc0e8400-e29b-41d4-a716-446655440000",
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+56912345678",
"type": "SALESMAN",
"externalId": "emp-001",
"isActive": true,
"isPlaceholder": false
}Error Responses
| Status | Description |
|---|---|
409 | Email already exists or duplicate type + externalId |