Skip to main content
POST
/
v1
/
agents
/
{agentId}
/
debug-chat
Create a new debug chat session
curl --request POST \
  --url https://api.us.poly.ai/v1/agents/{agentId}/debug-chat \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "asrLangCode": "<string>",
  "ttsLangCode": "<string>",
  "conversationId": "<string>",
  "variantId": "<string>",
  "channel": "<string>",
  "integrationAttributes": {}
}
'
{
  "conversationId": "<string>",
  "userInput": "<string>",
  "response": "<string>",
  "metadata": {
    "asrLangCode": "<string>",
    "ttsLangCode": "<string>",
    "agentResponseAudioUrl": "<string>"
  },
  "conversationEnded": true,
  "delayedResponse": true
}

Documentation Index

Fetch the complete documentation index at: https://docs.poly.ai/llms.txt

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

Authorizations

x-api-key
string
header
required

Contact your PolyAI representative.

Path Parameters

agentId
string
required

Agent ID.

Body

application/json

Starting parameters for a debug chat session: which agent variant, which language codes, and which environment to run in.

clientEnv
enum<string>
required

Client environment (sandbox, pre-release, live).

Available options:
sandbox,
pre-release,
live
asrLangCode
string

ASR language code (e.g. en-US). Defaults to server config.

ttsLangCode
string

TTS language code (e.g. en-US). Defaults to server config.

conversationId
string

Custom conversation ID. Auto-generated if omitted.

variantId
string

Variant ID to use.

channel
string

Channel type (e.g. chat.polyai).

integrationAttributes
object

Custom attributes accessible via conv.integration_attributes in project functions.

Response

Debug chat session created.

A chat turn's result: the agent's reply text, the conversation's updated state, and whether the conversation has ended.

conversationId
string
required

ID of the debug chat session.

userInput
string
required

User input that produced this response.

response
string
required

Agent's reply text.

metadata
object
required

Metadata returned with each chat response.

conversationEnded
boolean
required

Whether the conversation has ended after this turn.

delayedResponse
boolean
required

Whether the agent's response was delayed (e.g. awaiting a long-running tool).

Last modified on June 1, 2026