SunoVoiceAI

Building your agent

Dynamic variables

Personalize your agent's prompt, greeting, and messages per call with {{placeholders}} — built-in values and custom ones you pass at call time.

Dynamic variables let your agent personalize each call. Anywhere in an agent's system prompt or greeting, you can drop a placeholder like {{customer_name}}, and it's replaced with a real value when the call happens.

How placeholders work

Write a variable as a name wrapped in double curly braces:

Hi {{customer_name}}, this is a reminder about your appointment on {{appointment_time}}.

When the call runs, each {{...}} is swapped for its value. If a variable has no value for that call, it's replaced with nothing (blank) — so a half-filled template never reads "{{customer_name}}" out loud.

Built-in variables (always available)

These are filled automatically on every call, with no setup:

VariableValue
{{caller_number}}The other party's phone number
{{today}}The current date, e.g. "Friday, June 5, 2026" (server time)

Use them in any agent — for example: "You're speaking with the caller at {{caller_number}}."

Custom variables (you supply the values)

You can invent any variable name — {{customer_name}}, {{order_id}}, {{appointment_time}} — and provide its value when you place an outbound call:

  • In the dashboard: when you place an outbound call, use the Variables section to add each name and its value.
  • Via the API: include a variables object in your request to POST /calls/outbound — see API configuration:
{
  "agent_id": "AGENT_ID",
  "to_number": "+14155550142",
  "objective": "Confirm tomorrow's appointment",
  "variables": {
    "customer_name": "Sarah",
    "appointment_time": "tomorrow at 3pm"
  }
}

Inbound calls don't carry custom values (there's no caller record to pull from), so on inbound calls custom variables resolve to blank — only the built-ins are filled. Custom variables shine on outbound calls, where you know who you're calling.

Use them in post-call SMS too

If you've enabled post-call SMS, the message template also supports variables — for example: "Thanks {{customer_name}}! {summary}" (the {summary} placeholder inserts the AI call recap).

Tips

  • Design for blanks. Since unknown variables become empty, write greetings that still read well without them — e.g. "Hi{{customer_name_with_leading_space}}" patterns aren't needed; just keep punctuation sensible.
  • Names are case-insensitive and use letters, numbers, and underscores ({{order_id}}, not {{order-id}}).
  • Test it. Place an outbound test call to yourself with a couple of variables and listen to how it sounds.

Next step

Put variables to work on a campaign: outbound calling.

Still stuck? Contact our team and we'll help you out.