Get Phone Number Configuration
Retrieve the agent, call flow and settings bound to a phone number.
The fields returned depend on what the number is used for (flowType):
call: the call agent, recording, office hours, transfer caller ID and the other call fields below.message: the message agent and message flow. No recording or office hours.- Anything else (
both, or nothing bound yet): onlyphoneNumberId,status,metadataTags,recordingPublicandofficeHours.
Your role needs the phone_number:view permission. Otherwise the request fails with 403 {"error": "Insufficient permissions"}.
Headers
x-workspace-idstringrequiredWorkspace identifier for the API.
Path Parameters
phoneNumberIdstringrequiredThe number's _id from List Phone Numbers.
Response Fields
phoneNumberIdstringThe phone number's _id.
agentIdobject | nullThe bound agent as a full object (with _id, name and the agent's settings), or null. For a message number, this is the message agent.
agentNamestring | nullThe bound agent's name. call and message numbers only.
flowTypestring | nullcall or message. Not returned for other numbers.
pathwayNamestring | nullName of the bound call flow (call) or message flow (message).
directionstring | nullThe call flow's direction: inbound, outbound or bidirectional. call numbers only.
messageChannelstring | nullThe message flow's channel. message numbers only.
statusstringThe number's status: ready (no call agent bound yet), active (bound to an agent with a call flow), reserved or error.
recordingbooleanWhether call recording is on for this number. call numbers only.
recordingPublicbooleanWhether recordings for this number are publicly reachable.
officeHoursobject | nullOffice hours: enabled, start and end (HH:MM), timezone (IANA), allowedDays (for example ["Mon","Tue"]) and blockedDates.
transferCallerIdModestringCaller ID shown on transferred calls: from-transferee (default, the original caller's number) or from-transferor (your Trillet number). call numbers only.
metadataTagsobjectKey/value tags on the number, as an object of strings.
secretBindingsobjectMap of alias to workspace secret name. Names only, never secret values. call numbers only.
Errors
| Status | Body | When |
|---|---|---|
400 | {"error": "Workspace ID is required."} | No x-workspace-id |
403 | {"error": "Unauthorized access to the phone number"} | The number belongs to another workspace |
404 | {"error": "Phone number not found"} | No number with that ID |
{
"phoneNumberId": "a4a4a4a4a4a4a4a4a4a4a4a4",
"agentId": {
"_id": "a5a5a5a5a5a5a5a5a5a5a5a5",
"name": "Front Desk"
},
"flowType": "call",
"direction": "bidirectional",
"pathwayName": "Front Desk Call Flow",
"status": "active",
"recording": true,
"agentName": "Front Desk",
"recordingPublic": false,
"officeHours": {
"enabled": true,
"start": "09:00",
"end": "17:00",
"timezone": "America/New_York",
"allowedDays": ["Mon", "Tue", "Wed", "Thu", "Fri"],
"blockedDates": []
},
"metadataTags": {
"location": "Downtown"
},
"secretBindings": {},
"transferCallerIdMode": "from-transferee"
}Last updated on