#Does simulation endpoint use Dynamic Variables -> Test Variables?https://api.elevenlabs.io/v1/conv

1 messages · Page 1 of 1 (latest)

ivory karmaBOT
#
AI-generated Answer for enz0z

Short answer: There’s no documentation stating that the simulate-conversation endpoint automatically reads the agent’s “Dynamic Variables → Test Variables” from the dashboard. To ensure variables are applied in a simulation, pass them explicitly via the dynamic_variables parameter in the simulation request. On June 17, 2025, ElevenLabs added support for dynamic_variables to both simulate-conversation endpoints.

References:

  • Simulate conversation endpoint (spec and usage). (elevenlabs.io)
  • Changelog (June 17, 2025): “Simulate conversation – Added dynamic_variables parameter…”. (elevenlabs.io)
  • Dynamic Variables guide (explains variables and “Set placeholders” for testing in the UI; does not claim API auto-uses them). (elevenlabs.io)
  • Simulate Conversations guide (how to call the simulation endpoints). (elevenlabs.io)

Sources:
Simulate conversation | ElevenLabs Documentation
June 17, 2025 | ElevenLabs Documentation
Dynamic variables | ElevenLabs Documentation
Simulate Conversations | ElevenLabs Documentation

#
AI-generated Answer for enz0z

Short answer: Don’t copy the placeholders object. The simulate-conversation endpoint expects a flat map of runtime values, and the field must be placed correctly in the request.

What to send

  • Put dynamic_variables as a top-level field in the POST body (alongside simulation_specification), not inside simulated_user_config. The parameter was added to this endpoint on June 17, 2025. (elevenlabs.io)
  • Use a plain key→value map where keys are the variable names (no {{ }}), and values are strings, numbers or booleans only. Example:
    {
    "simulation_specification": { "simulated_user_config": { /* … */ } },
    "dynamic_variables": {
    "user_name": "Angelo",
    "account_type": "premium",
    "is_demo": true
    }
    }
    Supported types and naming rules are documented here. (elevenlabs.io)

Common pitfalls

  • Copying conversation_config.agent.dynamic_variables.dynamic_variable_placeholders verbatim: those are dashboard defaults, not the runtime values the API expects. Provide actual values for the variable names you reference in your prompts/tools. (elevenlabs.io)
  • Using {{user_name}} as a key: remove braces; use "user_name". (elevenlabs.io)
  • Including system__* variables: those are auto-populated and should not be set manually. (elevenlabs.io)
  • Wrong placement: dynamic_variables belongs at the request root for this endpoint; see the changelog entry noting the parameter on Simulate conversation (and the endpoint reference for overall schema). (elevenlabs.io)

For a compact example of the dynamic_variables object shape (from conversation initiation docs, same structure applies), see the Twilio personalization example. (elevenlabs.io)

References

  • Simulate conversation API reference. (elevenlabs.io)
  • Dynamic variables (structure, types, troubleshooting). (elevenlabs.io)
  • Changelog (June 17, 2025): dynamic_variables added to simulate endpoints.
#
AI-generated Answer for enz0z

Short answer: you’re sending the dynamic variables with the wrong shape.

What to send

  • The simulate conversation endpoints do accept dynamic variables. Provide them as a single, flat object at the top level of the request body (a sibling to simulation_specification), not nested under another dynamic_variables key. (elevenlabs.io)
  • Example (JSON):
    {
    "simulation_specification": {
    "simulated_user_config": {
    "prompt": { "prompt": "TEST" }
    }
    },
    "dynamic_variables": {
    "user_name": "Angelo",
    "account_type": "premium",
    "is_demo": true
    }
    }
    This follows the documented “dynamic_variables” structure used when initiating conversations; the same key/value mapping is supported for simulations. (elevenlabs.io)

How substitution works

  • In your agent config, reference variables with double curly braces, e.g., {{user_name}}, {{account_type}}, etc. They must match names exactly (case‑sensitive). (elevenlabs.io)
  • Placeholders shown in your agent JSON under conversation_config.agent.dynamic_variables.dynamic_variable_placeholders are defaults for configuration/testing; they are not the payload you send. At runtime you must pass actual values in dynamic_variables as above. (elevenlabs.io)

Troubleshooting checks

  • Verify the variables you reference in the prompt exist in the dynamic_variables object and use {{variable_name}} syntax. (elevenlabs.io)
  • Supported value types are string, number, and boolean (your is_demo: true is valid). Avoid the reserved system__ prefix. (elevenlabs.io)

References

  • Simulate conversation API reference (endpoint description). (elevenlabs.io)
  • Changelog (June 17, 2025): dynamic_variables parameter added to simulate conversation endpoints. (elevenlabs.io)
  • Dynamic variables guide (syntax, types, troubleshooting, and request shape examples). (elevenlabs.io)
  • Get Agent (shows