{
"success": true,
"phone_number": "<string>",
"provider": "<string>",
"updated_webhooks": {},
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update Phone Number Webhooks
Update voice webhook URL and/or disable SMS webhooks for a phone number.
This endpoint allows you to update the voice webhook URL and optionally disable SMS webhooks. SMS webhook URLs are managed automatically through assistant assignment.
Args: webhook_data: Webhook update details including phone number and voice URL
Returns: UpdateWebhookResponse: Update confirmation with details
{
"success": true,
"phone_number": "<string>",
"provider": "<string>",
"updated_webhooks": {},
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Overview
Update voice webhook URLs and optionally disable SMS webhooks for a phone number. Important: SMS webhook URLs are managed automatically through assistant assignment. This endpoint only allows you to disable SMS webhooks when needed.Request Body
phone_number(string, required): The phone number to update in E.164 format (e.g.,+1234567890)voice_webhook_url(string, optional): URL for voice call webhooksdisable_sms(boolean, optional): Set totrueto disable SMS webhooks. Default:falseenable_sms(boolean, optional): Set totrueto enable SMS webhooks based on assigned assistant. Default:falseprovider(string, optional): Provider (twilioortelnyx). Auto-detected if not provided
disable_sms and enable_sms to true in the same request.
SMS Webhook Management
SMS webhooks are automatically configured when you assign a phone number to an assistant with ansms_webhook_url. Use this endpoint to temporarily disable SMS handling:
Disabling SMS Webhooks
{
"phone_number": "+15551234567",
"disable_sms": true
}
- Twilio: Sets SMS webhook to
https://demo.twilio.com/welcome/sms/reply - Telnyx: Sets SMS webhook to empty URL
- Result: Incoming SMS messages are ignored
Re-enabling SMS Webhooks
{
"phone_number": "+15551234567",
"enable_sms": true
}
- Prerequisites: Phone number must be assigned to an assistant with
sms_webhook_urlconfigured - Twilio: Sets SMS webhook to
/twilio-sms-webhookand enables messaging service - Telnyx: Sets SMS webhook to
/telnyx-webhook - Result: SMS messages are forwarded to assistant’s
sms_webhook_url
Updating Voice Webhooks
{
"phone_number": "+15551234567",
"voice_webhook_url": "https://your-app.com/voice-webhook"
}
Combined Updates
{
"phone_number": "+15551234567",
"voice_webhook_url": "https://your-app.com/voice-webhook",
"disable_sms": true
}
{
"phone_number": "+15551234567",
"voice_webhook_url": "https://your-app.com/voice-webhook",
"enable_sms": true
}
Response
{
"success": true,
"phone_number": "+15551234567",
"provider": "twilio",
"updated_webhooks": {
"voice": "https://your-app.com/voice-webhook",
"sms": "disabled (demo URL)"
},
"message": "Successfully updated 2 webhook(s) for +15551234567 via twilio"
}
Use Cases
- Voice webhook updates - Change where voice call events are sent
- Temporary SMS disable - Disable SMS during maintenance or testing
- Emergency SMS disable - Quickly stop SMS processing if needed
- Re-enable SMS after maintenance - Restore SMS functionality without reassigning phone numbers
Notes
- At least one of
voice_webhook_url,disable_sms, orenable_smsmust be provided - Cannot set both
disable_smsandenable_smstotruein the same request - To enable SMS, the phone number must be assigned to an assistant with
sms_webhook_urlconfigured - Voice webhooks can be updated independently of SMS webhook state
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request model for updating phone number webhooks.
Phone number to update webhooks for
URL for voice call webhooks
Set to true to disable SMS webhooks (sets to demo URL)
Set to true to enable SMS webhooks based on assigned assistant
Provider ('twilio' or 'telnyx'). Auto-detected if not provided