For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • BedrockAgent
      • CLI Tools
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions
      • LiveWire
      • MCP Gateway
      • PomBuilder
      • Prefabs
      • Search
      • SkillBase
      • Skills
      • SWAIGFunction
      • SWMLBuilder
      • SWMLService
      • WebService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • Chat
      • Compat
      • Datasphere
      • Fabric
      • Imported Numbers
      • Logs
      • Lookup
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSub
      • Queues
      • Recordings
      • Registry
      • RestClient
      • Short Codes
        • get
        • list
        • update
      • SignalWireRestError
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Response Example
  • Example
REST ClientShort Codes

list

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

update

Next
Built with

List short codes in the project.

Query parameters

filter_namestringOptional
Filter by name. Returns all short codes containing this value as a substring.
filter_numberstringOptional
Filter by number. Returns all short codes containing this value as a substring.
page_numberintegerOptionalDefaults to 0
The page number to retrieve.
page_sizeintegerOptional1-1000Defaults to 50
The number of results per page.
page_tokenstringOptional
Token for cursor-based pagination.

Response

linksobjectRequired
Pagination links.
datalist of objectsRequired
List of short codes.

Response Example

Response
1{
2 "links": {
3 "self": "string",
4 "first": "string",
5 "next": "string",
6 "prev": "string"
7 },
8 "data": [
9 {
10 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
11 "name": "My Short Code",
12 "number": "12345",
13 "capabilities": [
14 "sms"
15 ],
16 "number_type": "shortcode",
17 "code_type": "vanity",
18 "country_code": "US",
19 "created_at": "2023-01-15T10:30:00Z",
20 "updated_at": "2023-01-15T10:30:00Z",
21 "next_billed_at": "2024-01-15T10:30:00Z",
22 "lease_duration": "12 months",
23 "message_handler": "relay_context",
24 "message_request_url": "https://example.com/message",
25 "message_request_method": "GET",
26 "message_fallback_url": "https://example.com/fallback",
27 "message_fallback_method": "GET",
28 "message_laml_application_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
29 "message_relay_context": "my-context"
30 }
31 ]
32}

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9result = client.short_codes.list()
10for code in result.get("data", []):
11 print(code.get("short_code"), code.get("id"))