Skip to main content
GET
/
phone-numbers
from dari import Dari

client = Dari(api_key="YOUR_API_KEY")

phone_numbers = client.list_phone_numbers()
print(f"Found {len(phone_numbers)} phone numbers")
for phone in phone_numbers:
    print(f"- {phone['label']}: {phone['phone_e164']}")
[
  {
    "id": "phone-uuid",
    "phone_e164": "+18782511407",
    "label": "Support Line",
    "active": true,
    "created_at": "2025-11-09T22:39:45.689803",
    "updated_at": "2025-11-09T22:39:45.689804"
  }
]
This endpoint allows you to retrieve a list of all phone numbers that have been purchased for your workspace. These phone numbers can be used for SMS-based two-factor authentication.

Headers

X-API-Key
string
required
Your API key for authentication

Response Fields

id
string
The unique identifier of the phone number
phone_e164
string
The phone number in E.164 format (e.g., “+18782511407”)
label
string
A descriptive label for this phone number
active
boolean
Whether this phone number is active and ready for use
created_at
string
ISO 8601 timestamp of when the phone number was purchased
updated_at
string
ISO 8601 timestamp of when the phone number was last updated
from dari import Dari

client = Dari(api_key="YOUR_API_KEY")

phone_numbers = client.list_phone_numbers()
print(f"Found {len(phone_numbers)} phone numbers")
for phone in phone_numbers:
    print(f"- {phone['label']}: {phone['phone_e164']}")
[
  {
    "id": "phone-uuid",
    "phone_e164": "+18782511407",
    "label": "Support Line",
    "active": true,
    "created_at": "2025-11-09T22:39:45.689803",
    "updated_at": "2025-11-09T22:39:45.689804"
  }
]

Usage Notes

  • API Key: Get your API key from the Dari dashboard in workspace settings
  • Workspace Scoped: Only returns phone numbers for your workspace
  • SMS 2FA: Phone numbers are configured to receive SMS messages for two-factor authentication
  • Active Status: Only active phone numbers can receive SMS messages

Error Responses

{
  "detail": "Invalid API key"
}
{
  "detail": "Failed to retrieve phone numbers"
}