Update a phone number’s configuration including nickname, agent assignments, webhook URLs, and other settings. Only provided fields will be updated.
curl -X PATCH "https://api.zudu.ai/api/phone-numbers/+14155551234" \
-H "X-API-KEY: sk_Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234Yz" \
-H "X-API-SECRET: s3cr3t_Xyz789Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234" \
-d '{
"nickname": "Updated Office Line",
"inbound_agent_id": "agent_123",
"outbound_agent_id": "agent_456",
"inbound_webhook_url": "https://example.com/webhook"
}'
{
"message": "Phone number updated successfully",
"status": "success",
"error": null,
"data": {
"phone_number": "+14155551234",
"nickname": "Updated Office Line",
"organization_id": "org_1234567890",
"area_code": 415,
"phone_number_type": "ZUDU_TWILIO",
"number_provider": "twilio",
"inbound_agent_id": "agent_123",
"outbound_agent_id": "agent_456",
"inbound_webhook_url": "https://example.com/webhook",
"updated_at": "2024-01-15T11:00:00Z"
}
Path Parameters
The phone number to update in E.164 formatExample: +14155551234Note: The phone number should be URL-encoded if it contains special characters (e.g., %2B14155551234 for +14155551234)
Your API key (format: sk_...)
Your API secret (format: s3cr3t_...)
Request Body
All fields are optional. Only provided fields will be updated.
Update the nickname/label for the phone numberAlternative field name: label (both are accepted)Example: "Updated Office Line"
Update the agent ID assigned for inbound callsSet to null to unassign the inbound agentExample: "agent_123"
Update the agent ID assigned for outbound callsSet to null to unassign the outbound agentExample: "agent_456"
Update the inbound agent versionExample: 1
Update the outbound agent versionExample: 1
Update the webhook URL for inbound callsExample: "https://example.com/webhook"
Update the outbound trunk IDExample: "trunk_outbound_abc123"
Update the number providerExample: "twilio"
Response Fields
The phone number in E.164 format
Area code (for US numbers)
Assigned inbound agent ID (or null)
Assigned outbound agent ID (or null)
Webhook URL for inbound calls (if set)
ISO 8601 timestamp when the phone number was last updated
Error Responses
Bad Request - Validation error{
"message": "Validation error",
"status": "error",
"error": "Invalid webhook URL format"
}
Unauthorized - Missing or invalid API key/secret
Not Found - Phone number does not exist{
"message": "Phone number not found",
"status": "error",
"error": "Phone number '+14155551234' does not exist in organization 'org_1234567890'"
}
Internal Server Error - Failed to update phone number{
"message": "Failed to update phone number",
"status": "error",
"error": "Database connection failed"
}
Notes
- Only provided fields in the request body will be updated
- Fields not included in the request will remain unchanged
- Phone number, organization ID, area code, and phone number type cannot be updated
- Use
null to unassign agents (e.g., "inbound_agent_id": null)
- Both
nickname and label field names are accepted for updating the nickname
- Phone numbers should be URL-encoded in the path (e.g.,
%2B for +)
- The
updated_at timestamp is automatically updated when any field changes