Skip to main content

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​

FieldTypeRequiredDescription
canArchiveBoolean✓
eventRuleBlockersArray<EventRuleBlockerResponse>
workflowBlockersArray<WorkflowBlockerResponse>✓
workspaceDefaultBlockerBooleanDefault: False

Example:

{
"canArchive": false,
"workflowBlockers": [],
"workspaceDefaultBlocker": false
}

CreatePhoneNumberRequest​

FieldTypeRequiredDescription
brandDescriptionString
brandNameString
brandWebsiteString
directMemberIdInteger
enableSmsBooleanDefault: True
enableVoiceBooleanDefault: True
enableWhatsAppBooleanDefault: False
faxFolderIdInteger
faxOwnerMemberIdInteger
inboundCallHandlingLiteral['agent', 'fax']Default: agent
nameString
numberStringDefault: ``
operatorGroupIdInteger
providerPhoneUuidString
routingRulesArray<RoutingRuleWrite> | nullAt most 50 rules for each of the four routing channels.
smsUnavailableMessageString
voiceGreetingMessageString
voiceRequireConsentBooleanDefault: False
voiceUnavailableMessageString

Example:

{
"enableSms": true,
"enableVoice": true,
"voiceRequireConsent": false,
"inboundCallHandling": "agent",
"enableWhatsApp": false,
"number": ""
}

EventRuleBlockerResponse​

FieldTypeRequiredDescription
idInteger✓
nameString
uuidString✓

Example:

{
"id": 0,
"uuid": "string"
}
FieldTypeRequiredDescription
providerPhoneUuidString

Example:

{}

PhoneNumberResponse​

FieldTypeRequiredDescription
a2pStatusLiteral[not_requested, pending, active, failed, not_required]
brandDescriptionString✓
brandNameString✓
brandWebsiteString✓
createdAtDateTime✓
defaultWorkflowIdInteger
directMemberIdInteger
enableSmsBoolean✓
enableVoiceBoolean✓
enableWhatsAppBoolean✓
faxFolderIdInteger
faxOwnerMemberIdInteger
faxReadyBooleanDefault: False
idInteger✓
inboundCallHandlingString✓
isArchivedBoolean✓
isMappedBoolean✓
nameString✓
numberString✓
operatorGroupIdInteger
ownerMemberIdInteger
providerPhoneUuidString
routingMode<enum RoutingMode✓
routingRulesArray<RoutingRuleResponse>✓
signupMemberRoleIdInteger
smsUnavailableMessageString
twilioInboundReadyBoolean✓
twilioNumberSidString
updatedAtDateTime✓
uuidString✓
voiceGreetingMessageString
voiceRequireConsentBooleanDefault: False
voiceUnavailableMessageString
voiceWorkflowIdInteger
webhookWarningString

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​

FieldTypeRequiredDescription
dayLiteral['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']✓
enabledBoolean✓
endString
startString

Example:

{
"day": "monday",
"enabled": false
}

RoutingRuleResponse​

FieldTypeRequiredDescription
actionParamsDict[str, Any]✓
actionType<enum RoutingActionType✓
audience<enum RoutingAudience✓
callerMemberFilterIdInteger✓
channel<enum RoutingChannel✓
createdAtDateTime✓
idInteger✓
inboxIdInteger✓
orderInteger✓
phoneNumberIdInteger✓
scheduleRoutingSchedule✓
templateUuidString✓
updatedAtDateTime✓
uuidString✓

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​

FieldTypeRequiredDescription
actionParamsDict[str, Any]
actionType<enum RoutingActionType✓
audience<enum RoutingAudienceDefault: anyone
callerMemberFilterIdInteger
channel<enum RoutingChannel✓
scheduleRoutingSchedule
templateUuidString
uuidString

Example:

{
"channel": null,
"audience": "anyone",
"actionType": null
}

RoutingSchedule​

FieldTypeRequiredDescription
kind<enum RoutingTimeWindowDefault: always
windowsArray<RoutingCustomWindow> | null

Example:

{
"kind": "always"
}

UpdatePhoneNumberRequest​

FieldTypeRequiredDescription
brandDescriptionString
brandNameString
brandWebsiteString
directMemberIdInteger
enableSmsBooleanDefault: True
enableVoiceBooleanDefault: True
enableWhatsAppBooleanDefault: False
faxFolderIdInteger
faxOwnerMemberIdInteger
inboundCallHandlingLiteral['agent', 'fax']Default: agent
nameString
operatorGroupIdInteger
providerPhoneUuidString
routingRulesArray<RoutingRuleWrite> | nullAt most 50 rules for each of the four routing channels.
smsUnavailableMessageString
voiceGreetingMessageString
voiceRequireConsentBooleanDefault: False
voiceUnavailableMessageString

Example:

{
"enableSms": true,
"enableVoice": true,
"voiceRequireConsent": false,
"inboundCallHandling": "agent",
"enableWhatsApp": false
}

WorkflowBlockerResponse​

FieldTypeRequiredDescription
archivedBoolean✓
idInteger✓
nameString✓
uuidString✓

Example:

{
"id": 0,
"uuid": "string",
"name": "string",
"archived": false
}

Endpoints​

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:

Response: See PhoneNumberResponse