Phone Numbers
Tags: communication, phone, sms
Phone number and SMS management
In the product: Phone & Voice
Resources
Request and response models used by the endpoints on this page.
ArchiveBlockersResponse
| Field | Type | Required | Description |
|---|---|---|---|
canArchive | Boolean | ✓ | |
eventRuleBlockers | Array<EventRuleBlockerResponse> | ||
workflowBlockers | Array<WorkflowBlockerResponse> | ✓ | |
workspaceDefaultBlocker | Boolean | Default: False |
Example:
{
"canArchive": false,
"workflowBlockers": [],
"workspaceDefaultBlocker": false
}
CreatePhoneNumberRequest
| Field | Type | Required | Description |
|---|---|---|---|
brandDescription | String | ||
brandName | String | ||
brandWebsite | String | ||
directMemberId | Integer | ||
enableSms | Boolean | Default: True | |
enableVoice | Boolean | Default: True | |
enableWhatsApp | Boolean | Default: False | |
faxFolderId | Integer | ||
faxOwnerMemberId | Integer | ||
inboundCallHandling | Literal['agent', 'fax'] | Default: agent | |
name | String | ||
number | String | Default: `` | |
operatorGroupId | Integer | ||
providerPhoneUuid | String | ||
routingRules | Array<RoutingRuleWrite> | null | At most 50 rules for each of the four routing channels. | |
smsUnavailableMessage | String | ||
voiceGreetingMessage | String | ||
voiceRequireConsent | Boolean | Default: False | |
voiceUnavailableMessage | String |
Example:
{
"enableSms": true,
"enableVoice": true,
"voiceRequireConsent": false,
"inboundCallHandling": "agent",
"enableWhatsApp": false,
"number": ""
}
EventRuleBlockerResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | Integer | ✓ | |
name | String | ||
uuid | String | ✓ |
Example:
{
"id": 0,
"uuid": "string"
}
LinkPhoneRequest
| Field | Type | Required | Description |
|---|---|---|---|
providerPhoneUuid | String |
Example:
{}
PhoneNumberResponse
| Field | Type | Required | Description |
|---|---|---|---|
a2pStatus | Literal[not_requested, pending, active, failed, not_required] | ||
brandDescription | String | ✓ | |
brandName | String | ✓ | |
brandWebsite | String | ✓ | |
createdAt | DateTime | ✓ | |
defaultWorkflowId | Integer | ||
directMemberId | Integer | ||
enableSms | Boolean | ✓ | |
enableVoice | Boolean | ✓ | |
enableWhatsApp | Boolean | ✓ | |
faxFolderId | Integer | ||
faxOwnerMemberId | Integer | ||
faxReady | Boolean | Default: False | |
id | Integer | ✓ | |
inboundCallHandling | String | ✓ | |
isArchived | Boolean | ✓ | |
isMapped | Boolean | ✓ | |
name | String | ✓ | |
number | String | ✓ | |
operatorGroupId | Integer | ||
ownerMemberId | Integer | ||
providerPhoneUuid | String | ||
routingMode | <enum RoutingMode | ✓ | |
routingRules | Array<RoutingRuleResponse> | ✓ | |
signupMemberRoleId | Integer | ||
smsUnavailableMessage | String | ||
twilioInboundReady | Boolean | ✓ | |
twilioNumberSid | String | ||
updatedAt | DateTime | ✓ | |
uuid | String | ✓ | |
voiceGreetingMessage | String | ||
voiceRequireConsent | Boolean | Default: False | |
voiceUnavailableMessage | String | ||
voiceWorkflowId | Integer | ||
webhookWarning | String |
Example:
{
"id": 0,
"uuid": "string",
"number": "string",
"name": "string",
"brandName": "string",
"brandDescription": "string",
"brandWebsite": "string",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"faxReady": false,
"routingMode": null,
"enableSms": false,
"enableVoice": false,
"enableWhatsApp": false,
"voiceRequireConsent": false,
"inboundCallHandling": "string",
"isArchived": false,
"isMapped": false,
"twilioInboundReady": false,
"routingRules": []
}
RoutingCustomWindow
| Field | Type | Required | Description |
|---|---|---|---|
day | Literal['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'] | ✓ | |
enabled | Boolean | ✓ | |
end | String | ||
start | String |
Example:
{
"day": "monday",
"enabled": false
}
RoutingRuleResponse
| Field | Type | Required | Description |
|---|---|---|---|
actionParams | Dict[str, Any] | ✓ | |
actionType | <enum RoutingActionType | ✓ | |
audience | <enum RoutingAudience | ✓ | |
callerMemberFilterId | Integer | ✓ | |
channel | <enum RoutingChannel | ✓ | |
createdAt | DateTime | ✓ | |
id | Integer | ✓ | |
inboxId | Integer | ✓ | |
order | Integer | ✓ | |
phoneNumberId | Integer | ✓ | |
schedule | RoutingSchedule | ✓ | |
templateUuid | String | ✓ | |
updatedAt | DateTime | ✓ | |
uuid | String | ✓ |
Example:
{
"id": 0,
"uuid": "string",
"templateUuid": "string",
"channel": null,
"phoneNumberId": 0,
"inboxId": 0,
"order": 0,
"schedule": null,
"audience": null,
"callerMemberFilterId": 0,
"actionType": null,
"actionParams": {},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
RoutingRuleWrite
| Field | Type | Required | Description |
|---|---|---|---|
actionParams | Dict[str, Any] | ||
actionType | <enum RoutingActionType | ✓ | |
audience | <enum RoutingAudience | Default: anyone | |
callerMemberFilterId | Integer | ||
channel | <enum RoutingChannel | ✓ | |
schedule | RoutingSchedule | ||
templateUuid | String | ||
uuid | String |
Example:
{
"channel": null,
"audience": "anyone",
"actionType": null
}
RoutingSchedule
| Field | Type | Required | Description |
|---|---|---|---|
kind | <enum RoutingTimeWindow | Default: always | |
windows | Array<RoutingCustomWindow> | null |
Example:
{
"kind": "always"
}
UpdatePhoneNumberRequest
| Field | Type | Required | Description |
|---|---|---|---|
brandDescription | String | ||
brandName | String | ||
brandWebsite | String | ||
directMemberId | Integer | ||
enableSms | Boolean | Default: True | |
enableVoice | Boolean | Default: True | |
enableWhatsApp | Boolean | Default: False | |
faxFolderId | Integer | ||
faxOwnerMemberId | Integer | ||
inboundCallHandling | Literal['agent', 'fax'] | Default: agent | |
name | String | ||
operatorGroupId | Integer | ||
providerPhoneUuid | String | ||
routingRules | Array<RoutingRuleWrite> | null | At most 50 rules for each of the four routing channels. | |
smsUnavailableMessage | String | ||
voiceGreetingMessage | String | ||
voiceRequireConsent | Boolean | Default: False | |
voiceUnavailableMessage | String |
Example:
{
"enableSms": true,
"enableVoice": true,
"voiceRequireConsent": false,
"inboundCallHandling": "agent",
"enableWhatsApp": false
}
WorkflowBlockerResponse
| Field | Type | Required | Description |
|---|---|---|---|
archived | Boolean | ✓ | |
id | Integer | ✓ | |
name | String | ✓ | |
uuid | String | ✓ |
Example:
{
"id": 0,
"uuid": "string",
"name": "string",
"archived": false
}
Endpoints
GET /api/v2/w/{workspace_uuid}/phone-numbers- ListPOST /api/v2/w/{workspace_uuid}/phone-numbers- CreateGET /api/v2/w/{workspace_uuid}/phone-numbers/linkable-phones- Linkable PhonesGET /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}- Get Phone Number IdPUT /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}- Update Phone Number IdPOST /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}/archive- ArchiveGET /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}/archive-blockers- Archive BlockersPOST /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}/link- Link
List
GET /api/v2/w/{workspace_uuid}/phone-numbers
Description:
List phone numbers for the workspace, filtered by archive status.
Access: All workspace members can view phone numbers (workspace-scoped
resource). The embedded routingRules need no scope beyond
phones:read — a routing rule is configuration and carries no PHI.
load_routing_rules=True costs ONE extra query for the whole page
(selectinload batches the collection by parent id), not one per number.
Authorization: Requires phones:read scope
Parameters:
is_archived(Boolean)
Response: List of PhoneNumberResponse
Create
POST /api/v2/w/{workspace_uuid}/phone-numbers
Description:
Create a new phone number for the authenticated user. Requires phones:write scope.
If providerPhoneUuid is provided, it names the provider phone; otherwise a
number must be one GLB holds (400 "not provisioned" if not). Either way the
provider phone passes the shared eligibility checks (organization 403,
another workspace 400, billing) before the workspace row is written, and the
GLB claim runs after that commit. A claim that loses a race is logged and
left for the daily consistency check; the created row stands.
Sending routingRules sets the number's voice/messaging rules in the same
transaction; routing rules use the phone number's own permissions, so
phones:write covers them. Omitting it leaves the creation seed to apply.
Authorization: Requires phones:write scope
Parameters:
phone(CreatePhoneNumberRequest)
Response: See PhoneNumberResponse
Linkable Phones
GET /api/v2/w/{workspace_uuid}/phone-numbers/linkable-phones
Description:
List provider phones available for linking to workspace phone numbers.
Returns org-owned provider phones that are either:
- Unassigned (available to any workspace in the org)
- Already assigned to this workspace (for re-linking or viewing)
Requires PHONES_WRITE scope.
Authorization: Requires phones:write scope
Response: Array<Object>
Get Phone Number Id
GET /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}
Description:
Get a specific phone number by ID or UUID.
The embedded routingRules need no scope beyond phones:read — a
routing rule is configuration and carries no PHI.
Authorization: Requires phones:read scope
Parameters:
phone_number_id(String)
Response: See PhoneNumberResponse
Update Phone Number Id
PUT /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}
Description:
Update an existing phone number by ID or UUID. Requires phones:write scope.
Sending routingRules replaces this number's rules for the channels the
list names (channels it does not name are untouched) in the same
transaction as the update; routing rules use the phone number's own
permissions, so phones:write covers them. Reading the routingRules
embed on the response needs only phones:read.
Authorization: Requires phones:write scope
Parameters:
phone_number_id(String)phone_update(UpdatePhoneNumberRequest)
Response: See PhoneNumberResponse
Archive
POST /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}/archive
Description:
Archive a phone number, releasing the Twilio number back to the pool.
Call and SMS history is preserved. This action cannot be undone.
Authorization: Requires phones:admin scope
Parameters:
phone_number_id(String)
Response: See PhoneNumberResponse
Archive Blockers
GET /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}/archive-blockers
Description:
Return everything that prevents archiving this phone number.
canArchive is the authoritative answer — it covers the workspace default
as well as workflow references. A client gating on workflowBlockers
alone would offer an archive the POST refuses.
Authorization: Requires phones:admin scope
Parameters:
phone_number_id(String)
Response: See ArchiveBlockersResponse
Link
POST /api/v2/w/{workspace_uuid}/phone-numbers/{phone_number_id}/link
Description:
Link or unlink a workspace phone number to/from a provider phone.
If providerPhoneUuid is provided, sets bidirectional references between the workspace phone and the GLB provider phone. If null, clears the link.
Requires PHONES_WRITE scope.
Authorization: Requires phones:write scope
Parameters:
phone_number_id(String)request- See LinkPhoneRequest
Response: See PhoneNumberResponse