REST ClientPhone Numbers

list

View as MarkdownOpen in Claude

List phone numbers owned by the project.

Query parameters

filter_namestringOptional
The name given to the phone number. Will return all Phone Numbers containing this value as a substring.
filter_numberstringOptional
The phone number in E164 format. Will return all Phone Numbers containing this value as a substring.
page_numberintegerOptionalDefaults to 0
The page number to retrieve (0-indexed).
page_sizeintegerOptional1-1000Defaults to 50
The number of items per page (1-1000).
page_tokenstringOptional
Token for cursor-based pagination. Required when page_number > 0.

Response

datalist of objectsRequired
List of phone numbers.

Response Example

Response
{
"links": {
"self": "string",
"first": "string",
"next": "string",
"prev": "string"
},
"data": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"number": "+15558675309",
"name": "Jenny",
"capabilities": [
"voice"
],
"number_type": "toll-free",
"e911_address_id": "string",
"e911_status": "active",
"cnam": "ACME PLUMBING",
"created_at": "2024-01-15T09:30:00Z",
"updated_at": "2024-01-15T09:30:00Z",
"next_billed_at": "2024-01-15T09:30:00Z",
"call_handler": "relay_context",
"calling_handler_resource_id": "fe4093d9-58c2-4931-b4b9-5679f82652c6",
"call_receive_mode": "voice",
"call_request_url": "string",
"call_request_method": "POST",
"call_fallback_url": "string",
"call_fallback_method": "POST",
"call_status_callback_url": "string",
"call_status_callback_method": "POST",
"call_laml_application_id": "string",
"call_dialogflow_agent_id": "string",
"call_relay_topic": "office",
"call_relay_topic_status_callback_url": "https://myapplication/handle_relay_callbacks",
"call_relay_script_url": "https://example.signalwire.com/relay-bins/60e2ba7b-366e-44de-84e3-0c76cfccf1cc",
"call_relay_context": "my_relay_app",
"call_relay_context_status_callback_url": "https://myapplication/handle_relay_callbacks",
"call_relay_application": "my_relay_app",
"call_relay_connector_id": "string",
"call_sip_endpoint_id": "string",
"call_verto_resource": "string",
"call_video_room_id": "fe4093d9-58c2-4931-b4b9-5679f82652c6",
"message_handler": "relay_application",
"messaging_handler_resource_id": "fe4093d9-58c2-4931-b4b9-5679f82652c6",
"message_request_url": "string",
"message_request_method": "POST",
"message_fallback_url": "string",
"message_fallback_method": "POST",
"message_laml_application_id": "string",
"message_relay_topic": "string",
"message_relay_context": "my_relay_app",
"country_code": "US"
}
]
}

Example

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
result = client.phone_numbers.list(page_size=10)
for number in result.get("data", []):
print(number["number"], number.get("name"))