# Retrieve agent history (/en/api-reference/api-ref/conversational-ai/history)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Retrieves conversation history for a running Conversational AI agent.

- OpenAPI: /openapi/conversational-ai/rest-api.en.yaml
- Operation ID: get-history
- Method: GET
- Path: /v2/projects/{appid}/agents/{agentId}/history

## Servers

- https://api.agora.io/api/conversational-ai-agent

## Parameters

- `appid` (path, required) - The App ID of the project.
- `agentId` (path, required) - The agent instance ID you obtained after successfully calling `join` to [Start a conversational AI agent](/en/api-reference/api-ref/conversational-ai/join).

## Request body

No request body.

## Responses

### 200

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

- `agent_id` (string) - Unique identifier of the agent.
No schema.
- `start_ts` (integer) - Agent creation timestamp.
No schema.
- `status` (string) - Agent status. Only supports querying the running agent.
No schema.
- `contents` (array) - Agent history.
  - `contents.items` (object)
    - `contents.items.role` (string) - The message sender.
- `user`: User
- `assistant`: AI agent
No schema.
    - `contents.items.content` (string) - Message content.
No schema.
    - `contents.items.speech_start_ms` (integer) - Unix timestamp in milliseconds indicating when the user started speaking or the agent started TTS playback. Only returned when `llm.vendor` is `custom`.
No schema.
    - `contents.items.speech_end_ms` (integer) - Unix timestamp in milliseconds indicating when the user stopped speaking, or when TTS playback completed or was interrupted. Only returned when `llm.vendor` is `custom`.
No schema.
    - `contents.items.speech_algorithmic_delay` (integer) - The total delay in milliseconds introduced by audio processing algorithms, including noise reduction, background voice suppression, and voiceprint locking, after audio is captured from the user's microphone. Use this value to align timestamps with cloud recording audio.

Only returned when:
- `llm.vendor` is `custom`
- `contents[].role` is `user`
- Actual voice input is present
No schema.
### default

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

- `detail` (string) - Detailed error information.
No schema.
- `reason` (string) - The reason for the failure.
No schema.
