How It Works
- A call arrives (inbound) or is initiated (outbound).
- Dograh sends a POST request to your configured endpoint with a standardized payload.
- The caller hears a ring-back tone while waiting for the response.
- Your API responds with a JSON object containing
dynamic_variables. - The variables are merged into the call’s initial context.
- The voice agent starts with full access to the fetched data via
{{variable_name}}syntax.
Configuration
Open the Start Call node editor and expand Advanced Settings. Toggle Pre-Call Data Fetch and configure:| Field | Description |
|---|---|
| Endpoint URL | The URL Dograh will send the POST request to. |
| Authentication | Optional credential for authenticating the request. Supports API key, bearer token, basic auth, and custom header. |
Request Format
Dograh sends aPOST request with the following JSON payload:
| Field | Description |
|---|---|
event | Always "call_inbound". |
call_inbound.agent_id | The workflow (agent) ID. |
call_inbound.from_number | The caller’s phone number (caller_number from initial context). |
call_inbound.to_number | The called phone number (called_number from initial context). |
Content-Type header is set to application/json. If you configured a credential, the corresponding authentication header is included.
Expected Response Format
Your API should return a JSON object with a2xx status code. The variables to inject into the call context should be placed inside the dynamic_variables key:
dynamic_variables at the top level:
- Greeting:
Hello {{customer_name}}, thank you for calling! - Prompt:
The customer is a {{loyalty_tier}} member with {{open_tickets}} open support tickets.
If the response is not a valid JSON object, does not contain
dynamic_variables, or the request fails or times out, the call proceeds normally without the additional context. The pre-call fetch never blocks or fails a call.Nested Variables
If yourdynamic_variables contain nested objects, you can access them using dot notation:
{{customer.name}} and {{customer.address.city}}.
Timeout
The request has a 10-second timeout. If your API does not respond within this window, the call proceeds without the fetched data. Design your endpoint to respond as quickly as possible to minimize the ring-back tone duration.Testing with Test Calls
When a real phone call comes in, the
caller_number and called_number context variables are automatically set by the telephony provider and included in the pre-call data fetch request as from_number and to_number. However, when you make a test call — either a web call (WebRTC) or a phone test call from the workflow editor — these variables are not available by default.
To simulate telephony data during testing:
- Open your workflow and go to Settings.
- Under Context Variables, add the following variables:
caller_number— set to a phone number you want to simulate as the caller (e.g.,+12137771234).called_number— set to the number that would be dialed (e.g.,+12137771235).
- Save the settings.
These context variables are only used during test calls from the workflow editor. On production inbound calls and campaign outbound calls, the actual telephony data is used and these values are ignored.