Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"

Path Parameters

agent_id
string
required

Unique id of the agent.

Query Parameters

version

Agent version to use. Defaults to latest. Agent version reference. Supports a numeric version (for example 3) or a tag/environment name (for example "prod"). The string "latest" resolves to the most recently created version (the largest version number), and "latest_published" resolves to the most recently published version. When a tag is provided, resolution uses that exact tag assignment (including its dynamic variables). If the tag exists but is currently unassigned, it resolves to latest. When a numeric version, latest, or latest_published is provided, resolution applies dynamic variables from the preferred tag for that resolved version (most recently assigned), if any.

Required string length: 1 - 20
Pattern: ^(latest|latest_published|(?!(?:latest|latest_published|v\d+)$)[a-z][a-z0-9_-]{0,19})$
Example:

"latest_published"

Body

application/json
messages
object[]
required

Full conversation history, same shape as chat completion messages. message_id and created_timestamp are optional — server generates them if omitted.

Same shape as chat completion messages. message_id and created_timestamp are optional — server generates them if omitted.

Example:
dynamic_variables
object

Key-value pairs for dynamic variable substitution.

Example:
tool_mocks
object[]

Optional mock responses for tools. When provided, the agent uses these instead of executing real tool calls.

current_state
string

Current state name for retell-llm agents. Used to resume from a specific state.

Example:

"greeting"

current_node_id
string

Current node id for conversation-flow agents. Used to resume from a specific node. Must be provided together with component_id when testing components.

Example:

"start-node-abc123"

component_id
string

Conversation flow component id. Required when current_node_id refers to a node within a component.

Example:

"component_xyz789"

Response

Successfully generated playground completion.

messages
object[]
required

New messages generated by the agent. Same shape as chat completion response messages. Does not include the input messages.

current_state
string

Current state name (retell-llm agents).

Example:

"greeting"

current_node_id
string

Current node id (conversation-flow agents).

Example:

"node_abc123"

dynamic_variables
object

Updated dynamic variables after this turn.

Example:
call_ended
boolean

Whether the agent ended the conversation.

Example:

false

knowledge_base_retrieved_contents
string[]

Knowledge base chunks retrieved for this turn.

Example: