Trillet AI logo

Get Phone Number Configuration

Retrieve the agent, call flow and settings bound to a phone number.

GEThttps://api.trillet.ai/v1/api/twilio/phone-numbers/{phoneNumberId}/config

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): only phoneNumberId, status, metadataTags, recordingPublic and officeHours.

Your role needs the phone_number:view permission. Otherwise the request fails with 403 {"error": "Insufficient permissions"}.

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

phoneNumberIdstringrequired

The number's _id from List Phone Numbers.

Response Fields

phoneNumberIdstring

The phone number's _id.

agentIdobject | null

The 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 | null

The bound agent's name. call and message numbers only.

flowTypestring | null

call or message. Not returned for other numbers.

pathwayNamestring | null

Name of the bound call flow (call) or message flow (message).

directionstring | null

The call flow's direction: inbound, outbound or bidirectional. call numbers only.

messageChannelstring | null

The message flow's channel. message numbers only.

statusstring

The number's status: ready (no call agent bound yet), active (bound to an agent with a call flow), reserved or error.

recordingboolean

Whether call recording is on for this number. call numbers only.

recordingPublicboolean

Whether recordings for this number are publicly reachable.

officeHoursobject | null

Office hours: enabled, start and end (HH:MM), timezone (IANA), allowedDays (for example ["Mon","Tue"]) and blockedDates.

transferCallerIdModestring

Caller ID shown on transferred calls: from-transferee (default, the original caller's number) or from-transferor (your Trillet number). call numbers only.

metadataTagsobject

Key/value tags on the number, as an object of strings.

secretBindingsobject

Map of alias to workspace secret name. Names only, never secret values. call numbers only.

Errors

StatusBodyWhen
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