Every endpoint on this page requires either a Clerk-issued JWT (
Authorization: Bearer <token>) or
an organization API key (x-api-key: pk_…). Anonymous calls return 401 Unauthorized. See
Authentication for the full setup.- System variables — populated automatically by Agentix (date/time, channel context, telephony identifiers).
- Custom variables — supplied by you under
session_variablesin the call-trigger request.
How dynamic variable replacement works
Placeholders use double-curly syntax:{{variable_name}}.
When a call starts, Agentix runs a templating pass over the system prompt before the very first message is sent to the model. Everything inside {{…}} is replaced with the resolved value. The LLM never sees the placeholder — it only sees the final, hydrated prompt.
Prompt template:
Rules to remember
- If a placeholder has no matching value, it is left as-is (e.g.
{{customerAge}}stays literal). Instruct the LLM to ask the user for it rather than leaving the literal placeholder in dialogue. - Replacement happens once per session, at the start. Mid-call value changes are not propagated.
- Values are always rendered as strings. Pass pre-formatted strings (currency, dates) if you need them styled.
System variables (provided automatically)
These keys are populated by Agentix at call-start — you don’t pass them in. They cover date / time, channel context, and telephony identifiers.Date and time
Use these for time-aware behaviour (“a viewing this week”, “the order placed 3 days ago”, “good morning/afternoon”).
Channel context
Telephony and session identifiers
Custom variables
You define these yourself. Anything you send undersession_variables in the trigger request becomes available as {{key}} in the prompt.
A typical canonical set for an outbound use case:
The CRM mapping key (
crmContactId above) is critical: it’s the thread you’ll use later to map the Agentix call back to your own contact record. It is echoed back verbatim in the webhook payload under metadata.sessionVariables — see Webhook events.Designing a system prompt that uses these variables
A prompt template that exercises both system and custom variables:session_variables payload at call time:
Cheat sheet
Next steps
Trigger an outbound call
Pass
session_variables in the call-start request.Post-call analysis
Configure structured fields that get extracted from the transcript.