Skip to main content
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.
Each agent has a System Prompt that defines its behaviour. You can sprinkle placeholders into the prompt that are resolved at call-start time from two sources:
  • System variables — populated automatically by Agentix (date/time, channel context, telephony identifiers).
  • Custom variables — supplied by you under session_variables in 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:
Sent to the LLM at runtime:
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

Fallback rule: any non-system.* {{key}} is pulled from session_variables. If the key is missing or empty, instruct the LLM to ask the user for it rather than leaving the literal {{key}} in dialogue.

Custom variables

You define these yourself. Anything you send under session_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:
The corresponding session_variables payload at call time:
Build contextSummary server-side by concatenating relevant fields from your DB. Sending one pre-formatted string keeps the prompt readable and lets you change the surface format without touching the agent config.

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.