Skip to Content

Add Operator

Attach an operator to a virtual number so inbound calls can be routed to that person.

POSThttps://api.identitycall.ai/api/v1/public/virtual_numbers/:id/add_operator

Attaches an existing operator (by operator_id) or creates a new operator on the fly (by phone_number).

Requires write permission

Scopes

API key scopeBehavior
Account-wideCan attach to any virtual number on the account; can reference any operator on the account.
Project-scopedReturns 404 if the virtual number is not in the key’s project. Existing-operator references are also scoped to the project.

The operator is appended at the end of the priority list (next available priority slot). Re-attaching an already-attached operator is a no-op.

Path Parameters

Parameters

NameTypeRequiredDefaultDescription
idintegerYes-Virtual number ID

Request Body

This endpoint accepts two distinct request shapes. Send exactly one.

Shape A — reference an existing operator

Body Parameters (application/json)

NameTypeRequiredDefaultDescription
operator_idintegerYes-ID of an existing operator on the account (must be visible under the key scope)
{ "operator_id": 22 }

Shape B — auto-create a new operator

Body Parameters (application/json)

NameTypeRequiredDefaultDescription
phone_numberstringYes-E.164 phone number for the new operator
namestringNoOperatorDisplay name for the new operator
{ "phone_number": "+15555550199", "name": "Greta Hall" }

If both operator_id and phone_number are present, operator_id wins.

Request

# Shape A: attach existing operator curl -X POST "https://api.identitycall.ai/api/v1/public/virtual_numbers/7/add_operator" \ -H "Authorization: Bearer $IDENTITYCALL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"operator_id": 22}' # Shape B: create-and-attach curl -X POST "https://api.identitycall.ai/api/v1/public/virtual_numbers/7/add_operator" \ -H "Authorization: Bearer $IDENTITYCALL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"phone_number": "+15555550199", "name": "Greta Hall"}'

Response

Returns the same detail payload as Get Virtual Number, reflecting the new operator list.

Response200 OK
{
"data": {
  "id": 7,
  "phone_number": "+15551234567",
  "name": "US Sales Line",
  "country_code": "US",
  "active": true,
  "recording": true,
  "routing_strategy": "priority",
  "ai_receptionist_enabled": false,
  "stats": { "total_calls": 142, "answered_calls": 118, "missed_calls": 24, "average_duration_seconds": 184 },
  "operators": [
    { "id": 12, "name": "Alice Carter", "phone_number": "+15555550112", "initials": "AC", "priority": 0 },
    { "id": 22, "name": "Greta Hall", "phone_number": "+15555550199", "initials": "GH", "priority": 1 }
  ],
  "available_operators": [],
  "recent_calls": []
}
}

Errors

StatusErrorDescription
404”Resource not found”Virtual number doesn’t exist, isn’t accessible, or operator_id doesn’t resolve under the key scope
422”operator_id or phone_number is required”Neither field was supplied
422Validation errorsNew operator failed validation (invalid phone number, etc.)

See Also

Try It

Try It