Query conversation turn information
Updated
Retrieves conversation turn information and performance metrics.
https://api.agora.io/api/conversational-ai-agent/v2/projects/{appid}/agents/{agentId}/turnsAfter a conversation with the agent ends, use this endpoint to query the conversation turn information, including the start information, end information, and performance metrics of each conversation turn.
Note
You can query sessions within the last 7 days.
Path Parameters
The App ID of the project.
The agent instance ID you obtained after successfully calling join to Start a conversational AI agent.
Query Parameters
Response
-
If the returned status code is
200, the request was successful. -
If the returned status code is not
200, the request failed. The response body includes the error code and description. Refer to status codes to understand the possible reasons for failure.
Response Body
application/json
application/json
Response schema
200application/jsonThe request was successful. The response body contains the result of the request.
The unique identifier of the agent.
The name of the agent.
The name of the RTC channel the agent joined.
The total number of dialogue turns in the current session.
Pagination information.
A list of conversation turns for the agent session.
Request examples
curl --request GET \ --url https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/agents/:agentId/turns \ --header 'Authorization: Basic <your_base64_encoded_credentials>'Response example
{ "agent_id": "A42Axxxxxxxxx37MT56J", "name": "support_agent_001", "channel": "test_channel", "total_turn_count": 250, "pagination": { "page_index": 1, "total_pages": 5, "is_last_page": false }, "turns": [ { "agent_id": "A42Axxxxxxxxx37MT56J", "channel": "test_channel", "turn_id": 1, "start": { "start_at": 1774579820147, "type": "greeting", "metadata": { "greeting_nth": 1 } }, "end": { "end_at": 1774579822412, "type": "interrupted", "metadata": { "caused_by": "api_interrupt", "transport": "rtm" } }, "metrics": { "e2e_latency_ms": 337, "segmented_latency_ms": [ { "name": "tts_ttfb", "latency": 337 } ] } } ]}{ "detail": "string", "reason": "string"}