Purchase a phone number from your configured phone number providers (Twilio, Plivo, etc.).
curl -X GET "https://api.zudu.ai/purchasePhoneNumbers/buyPhoneNumber?provider=TWILIO&phoneNumber=%2B15551234567" \
-H "X-API-KEY: sk_Abc123Def456..." \
-H "X-API-SECRET: s3cr3t_Xyz789..." \
{
"phone_number": "+15551234567",
"provider": "TWILIO",
"status": "ACTIVE",
"organization_id": "org_1234567890"
}
Query Parameters
Phone number providerOptions: TWILIO, PLIVOExample: TWILIO
Phone number to purchase (E.164 format, URL encoded)Example: %2B15551234567 (URL encoded +15551234567)Must be available from the specified provider.
Your API key (format: sk_...)
Your API secret (format: s3cr3t_...)
Response Fields
The purchased phone number in E.164 format
The provider from which the number was purchased
Phone number status: ACTIVE, PENDING, FAILED
Error Responses
Bad Request - Phone number not available or invalid provider{
"message": "Phone number not available",
"status": "error",
"error": "Number +15551234567 is not available from TWILIO"
}
Conflict - Phone number already exists in your organization
Notes
- Phone number must be available from the specified provider
- Use the Fetch Available Numbers endpoint to see available numbers
- Phone numbers are immediately available after purchase
- Charges may apply based on your provider’s pricing