Assign Phone Number to Agent
Assign a specific phone number to an agent's call flow, configure recording options, office hours, metadata, and automatically update SIP trunks.
Path Parameters
agentIdstringrequiredThe ID of the agent whose call flow will be bound to the phone number.
phoneNumberIdstringrequiredThe ID of the phone number to bind.
Headers
x-workspace-idstringrequiredWorkspace identifier for the API. Required to scope the binding operation.
Request Body
recordCallsbooleanWhether calls should be recorded. When enabled, updates Twilio trunk recording settings (record-from-ringing).
Default: false.
recordingPublicbooleanWhether recordings are publicly accessible.
Default: false.
officeHoursobjectCustom office hours configuration for the phone number (stored with the binding).
Example: { "monday": ["09:00-17:00"], "tuesday": [] }.
metadataTagsobjectArbitrary metadata key/value tags to store with the phone number.
Example: { "department": "sales", "priority": "high" }.
Response Fields
agentobjectThe updated agent object, including its bound phone number IDs.
phoneNumberobjectThe updated phone number object after binding and SIP trunk configuration.
pathwayIdstringThe ID of the call flow associated with this assignment.
directionstringThe direction of the call flow (inbound, outbound, or bidirectional).
{
"agent": {
"_id": "64f9b12a",
"status": "ready",
"phoneNumberIds": ["750cd920"]
},
"phoneNumber": {
"_id": "750cd920",
"agentId": "64f9b12a",
"recordingEnabled": true,
"recordingPublic": false,
"officeHours": {
"monday": ["09:00-17:00"],
"tuesday": []
},
"metadataTags": {
"department": "support",
"priority": "high"
}
},
"pathwayId": "pwy_abc123",
"direction": "bidirectional"
}
