Inbound Variable Injection
When a phone call comes in, the agent's prompt template renders against dynamic_variables. For outbound calls you supply those at dial time. For inbound calls, the caller is unknown until they connect — so the platform can call your webhook before the agent speaks, hand it the inbound metadata, and use the values you return as the call's dynamic_variables.
This lets the agent greet a caller by name, look up account context, route based on tier, etc. — without your application having to glue together two systems.
Configuration
Set the webhook URL on the agent (Agent Studio → Conversation → "Inbound webhook" or via API):
Code
Request shape (Neuratel → your webhook)
The platform POSTs JSON to your webhook before the agent's first message. Body:
Code
existing_dynamic_variables reflects whatever was already on the conversation (e.g. set by a prior call or by update_dynamic_variables). The platform merges your response into this dict — it does not wholesale replace.
Signature: the request includes an X-Neuratel-Signature header — the HMAC-SHA256 of the raw body using inbound_webhook_secret. Same scheme as outbound webhooks; see Webhooks.
Response shape (your webhook → Neuratel)
Return JSON with a dynamic_variables dict and an optional replace flag:
Code
| Field | Default | Effect |
|---|---|---|
dynamic_variables | required | Map of {name: value}. Values are coerced to string. system__* keys are rejected. |
replace | false | If false, merges into existing_dynamic_variables. If true, replaces wholesale. |
Timing and timeouts
- Timeout: 1500ms. If your webhook does not respond in time, the call proceeds with
existing_dynamic_variablesonly. - Retries: none. The platform will not retry a failed inbound webhook within the same call — it would delay the greeting beyond the user's tolerance.
- Failures are silent: a 5xx response is logged but does not abort the call. Build for resilience.
For lookups slower than 1500ms (CRM full sync, complex DB joins), pre-warm a cache keyed on from_number rather than blocking the webhook.
Example handler
Code
Outbound calls inheriting chat context
For inbound calls that arrive on an existing chat conversation (e.g. a customer was texting and clicked "Call us"), the platform injects the chat thread's dynamic_variables automatically — your webhook is the layer on top of that. This is also true in reverse: outbound voice calls placed against a contact you've been chatting with inherit the chat thread's dynamic_variables without you having to pass them.
Related
- Dynamic variables — outbound variable supply
- Tool variable writes — mid-call variable updates from tools
- Webhooks — signature verification reference
