Update Operator
Update an operator's fields.
PATCH /api/operators/:id
Update an operator's fields.
Metadata is merged, not replaced: keys sent overwrite keys with the same name, keys not sent are kept, and sending a key with null removes it. The merge is recursive (RFC 7386 JSON Merge Patch): nested objects are merged level by level, so you can update one key inside a nested object without resending its siblings. Any other value replaces the previous one wholesale — arrays included, which are never merged element by element. Sending metadata: null empties the whole bag.
Auth: Required — operator:manage permission
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | Operator ID |
Request Body
All fields are optional:
| Field | Type | Description |
|---|---|---|
name | string | Operator name |
email | string | Email address |
phone | string | Phone number |
is_active | boolean | Active status |
metadata | object | Arbitrary JSON, merged recursively; null empties it |
Example
curl -X PATCH https://api.reten.ai/api/operators/cc0e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"name": "John Smith",
"phone": "+56987654321",
"metadata": { "region": "north" }
}'const operatorId = "cc0e8400-e29b-41d4-a716-446655440000";
const response = await fetch(`https://api.reten.ai/api/operators/${operatorId}`, {
method: "PATCH",
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "John Smith",
phone: "+56987654321",
metadata: { region: "north" },
}),
});
const operator = await response.json();import requests
operator_id = "cc0e8400-e29b-41d4-a716-446655440000"
response = requests.patch(
f"https://api.reten.ai/api/operators/{operator_id}",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
json={
"name": "John Smith",
"phone": "+56987654321",
"metadata": {"region": "north"},
},
)
operator = response.json()Response 200 OK
Returns the updated operator object.