Conversations API

Create a new debug chat session

post
https://api.dev.poly.ai/v1/agents/{agentId}/debug-chat

Path Parameters

agentIdstringrequired

Body

application/json

CreateDebugChatBody

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

clientEnvstringrequired

Client environment (sandbox, pre-release, live)

asrLangCodestring

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

ttsLangCodestring

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

conversationIdstring

Custom conversation ID. Auto-generated if omitted.

variantIdstring

Variant ID to use

channelstring

Channel type (e.g. chat.polyai)

integrationAttributesobject

Custom attributes accessible via conv.integration_attributes in project functions

Response

application/json

Successful response

DebugChatResponse

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

conversationIdstringrequired
userInputstringrequired
responsestringrequired
metadataobjectrequired

Metadata returned with each chat response.

Show Child Parameters
conversationEndedbooleanrequired
delayedResponsebooleanrequired
post/v1/agents/{agentId}/debug-chat

Body

{ "clientEnv": "clientEnv" }
 
application/json

Send a message to a debug chat session

post
https://api.dev.poly.ai/v1/agents/{agentId}/debug-chat/{conversationId}

Path Parameters

agentIdstringrequired
conversationIdstringrequired

Body

application/json

RespondDebugChatBody

A user turn sent into an existing debug chat session, with the
runtime overrides that apply to this message.

clientEnvstringrequired

Client environment (sandbox, pre-release, live)

asrLangCodestring

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

ttsLangCodestring

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

messagestring

User input message

Default:

metadataobject

User input metadata

Response

application/json

Successful response

DebugChatResponse

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

conversationIdstringrequired
userInputstringrequired
responsestringrequired
metadataobjectrequired

Metadata returned with each chat response.

Show Child Parameters
conversationEndedbooleanrequired
delayedResponsebooleanrequired
post/v1/agents/{agentId}/debug-chat/{conversationId}

Body

{ "clientEnv": "clientEnv" }
 
application/json

AddAnnotationsBody

object

Request body for adding annotations to a conversation.

annotationsarray[object]required

>= 1 items

Example

ChatMetadataResponse

object

Metadata returned with each chat response.

stateobjectrequired
currentNodestringrequired
nodeTracearray[string]required
metricsobjectrequired
functionEventsarrayrequired
handoffDestinationstring
retrievedTopicsarray[string]
retrievedSourcesarray[string]
citedTopicstring
inFlowstring
inStepstring
llmRequestsarray[object]
asrLangCodestring
ttsLangCodestring
Example

ConversationDetailResponse

object

Public-facing conversation detail (includes turns, metrics).

conversationIdstringrequired
accountIdstringrequired
projectIdstringrequired
createdAtstring
startedAtstring
finishedAtstring
channelstring
fromNumberstring
toNumberstring
languagestring
variantIdstring
clientEnvstring
totalDurationinteger
polyaiDurationinteger
durationinteger
inProgressboolean
handoffboolean
handoffDestinationstring
handoffReasonstring
directionstring
tagsarray[string]
polyScorenumber
shortSummarystring
deploymentIdstring
notestring
audioUrlstring
turnsarray[object]
metricsobject
functionEventsobject
Example