Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vocobase.com/llms.txt

Use this file to discover all available pages before exploring further.

Pre-call Variables

Pre-call variables let you template the agent’s prompt and greeting with per-call data. You declare a list of variable names on the agent (callee_name, mobile_number), supply per-call values via the API or sandbox, and the platform substitutes {{name}} references in Agent.prompt + Agent.greeting before the bot starts.
Partner API (v2) only for the endpoints below.

1. Declare the variable names on the agent

PUT /api/v2/agent/{id}
Authorization: Bearer rg_live_...
Content-Type: application/json

{
  "variables": ["callee_name", "mobile_number"]
}
Names must match ^[a-zA-Z_][a-zA-Z0-9_]*$ (no spaces, dashes, or special characters). Up to 100 variables per agent. Pass null to clear the list.

2. Reference them in the prompt or greeting

The agent’s prompt and intro_message accept {{name}} placeholders. Whitespace inside the braces is tolerated ({{ name }} works the same as {{name}}).
You are calling {{callee_name}} regarding their order. Be friendly,
acknowledge them by name, and confirm we're reaching them on
{{mobile_number}}.
Hi {{callee_name}}, this is your friendly assistant.

3. Supply per-call values

POST /api/v2/calls/start
Authorization: Bearer rg_live_...
Content-Type: application/json

{
  "agent_id": "...",
  "to_number": "+919876543210",
  "provider": "twilio",
  "variables": {
    "callee_name": "Sajal",
    "mobile_number": "+919876543210"
  }
}

4. Echoed in the webhook

The session.completed webhook echoes the same variables map for partner-side audit. See Webhook Payloads for the full payload shape.

Behavior

  • Missing values render as empty strings. A prompt that says Hi {{callee_name}}! produces Hi ! if callee_name is omitted. The platform never errors on missing variables.
  • Type coercion is automatic. Non-string values in the request body ({ age: 25 }, { active: true }) are stringified before substitution.
  • Inbound calls receive no variables field by default; placeholders in the prompt render empty.
  • Custom functions can read variables. Values supplied at call start are available to your configured custom functions, so handlers such as CRM lookup or calendar booking can use fields like customer_id directly.

Campaigns: map CSV columns to variables

When using the Campaigns API, you can map per-row contact metadata into pre-call variables for every call the campaign generates:
POST /api/v2/campaigns
Authorization: Bearer rg_live_...
Content-Type: application/json

{
  "name": "Q2 Outreach",
  "agentId": "...",
  "phoneNumberId": "...",
  "variableMap": {
    "First Name": "callee_name",
    "Phone": "mobile_number"
  }
}
For each campaign contact, Vocobase maps the configured contact fields into the variables field used by /calls/start. Mapping keys are free-form spreadsheet columns; values must match the agent’s variable names.

Next steps

Post-call Extraction

Pull structured fields out of completed call transcripts with an LLM-driven analyzer.

Webhook Payloads

Full reference for the session.completed payload, including the variables echo.