Where to set the inbound webhook URL
The inbound webhook is configured per phone number (not at the account or agent level, which are for call event webhooks):- Open the Retell dashboard and go to the Phone Numbers page.
- Click the number you want to configure.
- In the number’s settings, set the Inbound Webhook URL field to your endpoint.
- Save the changes.
POST the payload described below to that URL whenever an inbound call or SMS arrives on that number.
Use cases
- Filter and reject unwanted inbound calls / SMS
- Add context (dynamic variables, metadata) to inbound calls / SMS
- Override agent id / version / specific agent settings for inbound calls / SMS
- Pause the call / SMS to pick it up with some delay
- Internal system records of the inbound call / SMS
Webhook spec
The webhookPOSTs the payload to your endpoint with a 10-second timeout. If no success status (2xx) is received within 10 seconds, the webhook is retried up to 3 times.
Verify the webhook using your Retell API key to confirm it comes from Retell AI. Read more at Secure the webhook.
Request payload
These fields might be provided in the payload depending on your configuration:agent_id: if the number has inbound agent id set, you will see it in payloadagent_version: if the number has inbound agent version set, you will see it in payloadfrom_number: this will always show up in payload, helps you identify the caller and process the call / SMS accordinglyto_number: this will always show up in payload, helps you identify the receiver and process the call / SMS accordinglycustom_sip_headers(inbound call only): an object containing custom SIP headers extracted from the inboundINVITE. Only headers whose name starts withX-(case-insensitive), plus the allowlisted headersUser-to-User,Diversion,History-Info, andP-Asserted-Identity, are forwarded. Header names are emitted in lowercase. The object may be empty or omitted when no qualifying headers are present, so treat it as optional. Use this to pass per-call context from your SIP trunk into the webhook (for example, to programmatically manage sessions).
Response
We expect a JSON response with a successful status code (2xx) with fields grouped undercall_inbound or chat_inbound. Here are the allowed fields (all of them are optional):
reject: set totrueto decline this inbound call / SMS. See Reject an inbound call or SMS below.override_agent_id: if you want to override the agent id, you can set it hereoverride_agent_version: if you want to override the agent version, you can set it heredynamic_variables: if you want to set dynamic variables for this inbound call, you can set it heremetadata: if you want to set metadata for this inbound call, you can set it hereagent_override: if you want to override the agent settings.
Agent override
You can also override per-call / per-chat agent behavior without modifying the saved agent by returning anagent_override object. The override applies only for this session.
Supported groups:
agent: Partial Agent settings (voice agents). Useful fields includevoice_id,voice_model,fallback_voice_ids,voice_temperature,voice_speed,volume,language,pronunciation_dictionary,boosted_keywords,stt_mode,vocab_specialization,denoising_mode,responsiveness,interruption_sensitivity,enable_backchannel,backchannel_frequency,backchannel_words,end_call_after_silence_ms,max_call_duration_ms,begin_message_delay_ms,ring_duration_ms,reminder_trigger_ms,reminder_max_count,ambient_sound,ambient_sound_volume,allow_user_dtmf,user_dtmf_options,voicemail_option,webhook_url,webhook_timeout_ms,data_storage_setting,opt_in_signed_url,pii_config,post_call_analysis_data,post_call_analysis_model.retell_llm: Partial Retell LLM settings. Supported keys includemodel,s2s_model,model_temperature,knowledge_base_ids,kb_config,start_speaker,begin_after_user_silence_ms,begin_message.conversation_flow: Partial Conversation Flow settings. Supported keys includemodel_choice,model_temperature,knowledge_base_ids,kb_config,start_speaker,begin_after_user_silence_ms,begin_message.
- If both
override_agent_id/override_agent_versionandagent_overrideare provided, we first resolve the target agent by id/version, then applyagent_overrideon top for this call. - Overrides must satisfy the same validation rules as agent creation (e.g. voice/language compatibility, value ranges). Invalid overrides may cause the call to be rejected.
- Overrides do not persist back to the saved agent.
call_inbound with chat_inbound:
Reject an inbound call or SMS
To decline an inbound call or SMS, returnreject: true in the response. This works whether or not the number has an inbound agent set, so you can keep a default agent configured and reject only the calls you don’t want.
- Only the boolean
truerejects. Any other value (including the strings"true"/"false",1, or omitting the field) is ignored and the call / SMS proceeds as normal. - Rejecting takes priority over agent selection —
override_agent_idandagent_overrideare ignored whenrejectistrue. We recommend returning only{ "reject": true }when declining: other fields such asdynamic_variablesandmetadataare still validated, and an invalid value there is treated as a bad response, in which caserejectis not applied. - For calls, Retell hangs up before any agent or voice setup. No call object is created.
- For SMS, Retell drops the message without replying. No chat object is created.
FAQ
What would happen to the inbound call when the webhook response is not received yet?
What would happen to the inbound call when the webhook response is not received yet?
The call would continue to stay in ringing state.
What would happen to the inbound SMS when the webhook response is not received yet?
What would happen to the inbound SMS when the webhook response is not received yet?
The SMS will not get a reply.
What would happen if webhook was not successful?
What would happen if webhook was not successful?
It would get retried up to 3 times. If all of those attempts fail, it will check whether this number has an inbound agent id set. If it does, it will then try to connect the call to that agent. If not, it will then disconnect the call.
Can I use this webhook to decline inbound calls / SMS based on incoming number?
Can I use this webhook to decline inbound calls / SMS based on incoming number?
Yes. Check
from_number in the webhook request body, and respond with reject: true for the numbers you want to turn away. See Reject an inbound call or SMS. Unlike the older approach of omitting override_agent_id, reject works even when the number has an inbound agent set, so you can serve most callers with your default agent and decline only the ones you don’t want.
