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 '
{
  "clientEnv": "<string>",
  "asrLangCode": "<string>",
  "ttsLangCode": "<string>",
  "conversationId": "<string>",
  "variantId": "<string>",
  "channel": "<string>",
  "integrationAttributes": {}
}
'
{
  "conversationId": "<string>",
  "userInput": "<string>",
  "response": "<string>",
  "metadata": {
    "state": {},
    "currentNode": "<string>",
    "nodeTrace": [
      "<string>"
    ],
    "metrics": {},
    "functionEvents": [
      "<unknown>"
    ],
    "handoffDestination": "<string>",
    "retrievedTopics": [
      "<string>"
    ],
    "retrievedSources": [
      "<string>"
    ],
    "citedTopic": "<string>",
    "inFlow": "<string>",
    "inStep": "<string>",
    "llmRequests": [
      {}
    ],
    "asrLangCode": "<string>",
    "ttsLangCode": "<string>"
  },
  "conversationEnded": true,
  "delayedResponse": true
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

agentId
string
required

Body

application/json

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

clientEnv
string
required

Client environment (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

Successful response

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

conversationId
string
required
userInput
string
required
response
string
required
metadata
object
required

Metadata returned with each chat response.

conversationEnded
boolean
required
delayedResponse
boolean
required
Last modified on June 4, 2026