Use SIP X-Headers in Prompts, Actions & Transfers
Use SIP X-Headers in Prompts, Actions & Transfers
Synthflow now accepts arbitrary X-* SIP headers on inbound calls. Any custom header your SBC, PBX, or carrier attaches to the SIP INVITE is automatically extracted and made available as a variable throughout the call lifecycle — in prompts, before-the-call and during-the-call custom actions, and outbound transfer headers.
This means you can inject caller context, routing metadata, or business-specific data directly from your telephony infrastructure without building separate API integrations.
How It Works
- Your SBC or PBX adds one or more
X-*headers to the SIP INVITE sent to Synthflow. - Synthflow extracts each header and maps it to a variable using the header name (with the
X-prefix). - You reference those variables in prompts, custom actions, and transfer X-headers using
{X-header-name}syntax.
In this example, Synthflow extracts four variables you can use anywhere in the agent configuration.
Referencing X-Header Values
Use the header name as a variable wherever Synthflow supports dynamic values. The X- prefix is included in the variable name.
Use in Prompts
Reference any incoming X-header directly in your agent’s prompt to personalize the conversation from the first word.
Example prompt:
The values are resolved before the first agent turn, so the AI has full context from the start of the call.
Use in Custom Actions
Before-the-call actions
Pass X-header values in the request body of a pre-call action to enrich the call context from an external system.
Your API can use these values to look up customer records and return additional variables for the prompt.
During-the-call actions
Reference X-header values in actions triggered mid-call — for example, to pass metadata to a CRM or ticketing system.
You can combine X-header variables with system variables like {call_id}, {from_phone_number}, and variables returned by other actions ({results.data.field}).
Use in Transfer Headers
When transferring a call to a SIP endpoint, you can forward incoming X-header values as outbound X-headers. This passes the original caller context through to the next leg of the call.
In Agents → Actions → Call Transfer → Custom X-Headers, add headers that reference the inbound values:
This ensures the receiving PBX or agent inherits the same metadata that was available to Synthflow.
You can also transform values — for example, set a new header X-Handled-By with a static value like synthflow-ai alongside the forwarded headers.
Header Naming Rules
Custom X-headers must follow standard SIP header conventions:
Headers are case-sensitive. If your SBC sends x-customer-name (lowercase), you must reference it as {x-customer-name} in prompts and actions — not {X-Customer-Name}. A mismatch in casing will result in an empty value. Always verify the exact casing your SIP infrastructure uses.
Keep custom headers minimal. Each header increases the SIP INVITE packet size. Excessive headers can cause UDP packet fragmentation and delivery failures — especially on trunks with smaller MTU settings.