Trillet AI logo

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.

POSThttps://api.trillet.ai/v1/api/agents/{agentId}/bind/{phoneNumberId}

Path Parameters

agentIdstringrequired

The ID of the agent whose call flow will be bound to the phone number.

phoneNumberIdstringrequired

The ID of the phone number to bind.

Headers

x-workspace-idstringrequired

Workspace identifier for the API. Required to scope the binding operation.

Request Body

recordCallsboolean

Whether calls should be recorded. When enabled, updates Twilio trunk recording settings (record-from-ringing).
Default: false.

recordingPublicboolean

Whether recordings are publicly accessible.
Default: false.

officeHoursobject

Custom office hours configuration for the phone number (stored with the binding).
Example: { "monday": ["09:00-17:00"], "tuesday": [] }.

metadataTagsobject

Arbitrary metadata key/value tags to store with the phone number.
Example: { "department": "sales", "priority": "high" }.

Response Fields

agentobject

The updated agent object, including its bound phone number IDs.

phoneNumberobject

The updated phone number object after binding and SIP trunk configuration.

pathwayIdstring

The ID of the call flow associated with this assignment.

directionstring

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"
}
Assign Phone Number to Agent — Trillet AI