Overview
Dynamic variables let you personalize a conversation before it starts. Instead of writing a generic persona prompt, you define placeholders in the admin panel and fill them in per session — for example, greeting a customer by name or giving the AI a booking reference to look up. Variables are injected once, at session open, viaconversation_initiation_data.variables. They
are available to the persona prompt for the lifetime of the session.
When to use dynamic variables:
- Greeting a logged-in user by name.
- Passing a booking, order, or ticket reference the AI should reference or look up.
- Carrying context from an upstream system (a CRM, a booking engine) into the conversation without the user having to repeat it.
Configuring variable definitions
Variables must be declared on the kiosk before they can be injected:- Open Kiosk → Persona → Variables in the admin panel.
-
Click Add variable and give it a name — this is the key the session open call must match
(e.g.
customer_name,booking_ref). -
Reference it in the persona prompt using
{{variable_name}}syntax: - Mark the variable secret if its value should never appear in transcripts, webhook payloads, or logs (see Secret variables below).
-
Save. The variable is available to
conversation_initiation_data.variablesimmediately.
Session open contract
POST/v1/sessions
conversation_initiation_data entirely if the session has no variables to inject.
JavaScript / TypeScript SDK
variables is omitted or empty, the client does not send conversation_initiation_data at all.
Python SDK
Go SDK
.NET SDK
C SDK
The C library takes variables as two parallel,NULL-terminated arrays rather than a map:
variable_keys / variable_values into
conversation_initiation_data.variables before sending. Leave both arrays as NULL (the
default in a zero-initialized struct) if the session has no variables.
Secret variables
A variable marked secret in the admin panel is injected into the persona prompt exactly like any other variable, but the server treats its value as sensitive everywhere else:- Not logged — secret values are redacted (
[REDACTED]) from server-side request logs. - Not in webhook payloads —
session.openedwebhook events include variable names but omit the values of any variable marked secret. - Not in transcripts — if you export conversation history, secret variable values are redacted even if the AI echoed them back in a response.
Marking a variable secret does not prevent the model itself from referencing the value in its
response to the end user — it only controls what Humain stores and forwards. If the persona
prompt tells the model to read a value aloud, the model will still do so.
Testing with the persona preview
The admin panel’s Persona → Preview tool lets you test a prompt with sample variable values before deploying:- Open Kiosk → Persona → Preview.
- Enter sample values for each declared variable.
- Send test messages — the preview uses the same prompt-building pipeline as production sessions, so what you see is what a real session would produce.
- Secret variables show a masked input field in the preview, matching production redaction behaviour.