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 webhook willPOST the payload to your endpoint. The webhook has a timeout of 10 seconds. If within 10 seconds no success status (2xx) is received, the webhook will be retried, up to 3 times.
The webhook can be verified using your Retell API Key to make sure 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 accordingly
Response
We expect a JSON response with a successful status code (2xx) with fields grouped undercall_inbound or chat_inbound. Here’re the allowed fields (all of them are optional):
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 is applied 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,normalize_for_speech,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:
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, you can. To selectively reject some inbound calls:
- Unset the
Inbound Call Agentin the phone number setting - Enable the
Inbound Webhook - Find
from_numberin the webhook request body to check if it matches the number you want to reject.- If you want to pick up / reply, respond with a 200 status code containing the “call_inbound.override_agent_id” as a JSON object.
- If you want to reject, respond with a 200 status code without containing the “call_inbound.override_agent_id” as a JSON object.