Retrieve agent history

Updated

Retrieves conversation history for a running Conversational AI agent.

https://api.agora.io/api/conversational-ai-agent/v2/projects/{appid}/agents/{agentId}/history

Call this endpoint while the agent is running to retrieve the conversation history between the user and the Conversational AI agent.

Path Parameters

appid
*
string

The App ID of the project.

agentId
*
string

The agent instance ID you obtained after successfully calling join to Start a conversational AI agent.

Response

  • If the returned status code is 200, the request was successful. The response body contains the result of the request.

  • 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

200
application/json

The request was successful. The response body contains the result of the request.

agent_id
optional
string

Unique identifier of the agent.

start_ts
optional
integer

Agent creation timestamp.

status
optional
string

Agent status. Only supports querying the running agent.

contents
optional
array

Agent history.

default
application/json

The request failed. The response body includes the error details.

detail
optional
string

Detailed error information.

reason
optional
string

The reason for the failure.

Authorization

This endpoint requires authentication.

tokenAuthbasicAuth

Request examples

curl --request get \
        --url https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/agents/:agentId/history \
        --header 'Authorization: Basic <credentials>'

Response example

{  "agent_id": "xxxx",  "start_ts": 123,  "status": "RUNNING",  "contents": [    {      "role": "user",      "content": "hello."    },    {      "role": "assistant",      "content": "hi, how can I help you?"    }  ]}