Reten Docs

Assign/Remove Operator

Assign or remove an operator from a route.

POST /api/routes/:id/operators

Assign an operator to a route with an optional role. Assignment is idempotent — if the link exists but is inactive, it gets reactivated.

Auth: Required — route:manage permission

Path Parameters

ParameterTypeDescription
idUUIDRoute ID

Request Body

FieldTypeRequiredDescription
operator_idUUIDYesOperator to assign
rolestringNoLEAD or MEMBER

Example

curl -X POST https://api.reten.ai/api/routes/dd0e8400-e29b-41d4-a716-446655440000/operators \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "operator_id": "cc0e8400-e29b-41d4-a716-446655440000",
    "role": "LEAD"
  }'
const routeId = "dd0e8400-e29b-41d4-a716-446655440000";
const response = await fetch(`https://api.reten.ai/api/routes/${routeId}/operators`, {
  method: "POST",
  headers: {
    "Authorization": "Bearer <token>",
    "x-tenant-id": "<tenant-id>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    operator_id: "cc0e8400-e29b-41d4-a716-446655440000",
    role: "LEAD",
  }),
});
const link = await response.json();
import requests

route_id = "dd0e8400-e29b-41d4-a716-446655440000"
response = requests.post(
    f"https://api.reten.ai/api/routes/{route_id}/operators",
    headers={
        "Authorization": "Bearer <token>",
        "x-tenant-id": "<tenant-id>",
    },
    json={
        "operator_id": "cc0e8400-e29b-41d4-a716-446655440000",
        "role": "LEAD",
    },
)
link = response.json()

Response 201 Created

{
  "routeId": "dd0e8400-e29b-41d4-a716-446655440000",
  "operatorId": "cc0e8400-e29b-41d4-a716-446655440000",
  "role": "LEAD",
  "isActive": true
}

DELETE /api/routes/:id/operators/:opId

Remove an operator from a route. This is a hard delete of the link record.

Path Parameters

ParameterTypeDescription
idUUIDRoute ID
opIdUUIDOperator ID

Example

curl -X DELETE https://api.reten.ai/api/routes/dd0e8400-e29b-41d4-a716-446655440000/operators/cc0e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>"
const routeId = "dd0e8400-e29b-41d4-a716-446655440000";
const operatorId = "cc0e8400-e29b-41d4-a716-446655440000";
const response = await fetch(`https://api.reten.ai/api/routes/${routeId}/operators/${operatorId}`, {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <token>",
    "x-tenant-id": "<tenant-id>",
  },
});
import requests

route_id = "dd0e8400-e29b-41d4-a716-446655440000"
operator_id = "cc0e8400-e29b-41d4-a716-446655440000"
response = requests.delete(
    f"https://api.reten.ai/api/routes/{route_id}/operators/{operator_id}",
    headers={
        "Authorization": "Bearer <token>",
        "x-tenant-id": "<tenant-id>",
    },
)

Response 204 No Content