POST
/
v1
/
api
/
agents
/
{agentId}
/
bind
/
{phoneNumberId}
Bind Phone Number to Agent
curl --request POST \
  --url https://api.trillet.ai/v1/api/agents/{agentId}/bind/{phoneNumberId} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-id: <x-workspace-id>' \
  --data '{
  "recordCalls": true,
  "recordingPublic": true,
  "officeHours": {},
  "metadataTags": {}
}'
{
  "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"
}

Path Parameters

agentId
string
required
The ID of the agent whose call flow will be bound to the phone number.
phoneNumberId
string
required
The ID of the phone number to bind.

Headers

x-workspace-id
string
required
Workspace identifier for the API. Required to scope the binding operation.

Request Body

recordCalls
boolean
Whether calls should be recorded. When enabled, updates Twilio trunk recording settings (record-from-ringing).
Default: false.
recordingPublic
boolean
Whether recordings are publicly accessible.
Default: false.
officeHours
object
Custom office hours configuration for the phone number (stored with the binding).
Example: { "monday": ["09:00-17:00"], "tuesday": [] }.
metadataTags
object
Arbitrary metadata key/value tags to store with the phone number.
Example: { "department": "sales", "priority": "high" }.

Response Fields

agent
object
The updated agent object, including its bound phone number IDs.
phoneNumber
object
The updated phone number object after binding and SIP trunk configuration.
pathwayId
string
The ID of the pathway (call flow) associated with this binding.
direction
string
The 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"
}