Retrieve a session

Updated

Retrieves the status of a session.

Preview documentation

You're reading the Conversational AI Platform (Preview) docs. Switch to Main.
GET
https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/sessions/{agent_session_id}

Starting and stopping a session happen asynchronously. Retrieve the session to follow its status. After the session ends, the response includes stop_ts.

Path Parameters

appidstring
Required

The App ID of your project.

agent_session_idstring
Required

The ID of the session, returned in agent_session_id when you start the session.

Response Body

The request was successful. The response body contains the session.

Response Headers

Agora-Request-Idstring

A unique ID for the request. Include it when you contact Agora support.

agent_session_idstring

The ID of the session.

agent_namestring

The name of the agent that the session runs.

statusstring

The status of the session:

  • IDLE: The session is idle.
  • STARTING: The session is starting.
  • RUNNING: The session is running.
  • STOPPING: The session is stopping.
  • STOPPED: The session has ended.
  • FAILED: The session failed.
start_tsinteger

The time the session was created, as a Unix timestamp in seconds.

stop_tsinteger | null

The time the session ended, as a Unix timestamp in seconds. null while the session is active.

messagestring | null

Additional details about the status, such as a failure diagnosis. null when there are none.

Authorization

This endpoint requires authentication.

Request examples

Example Request
curl -X GET 'https://preview.ai.agora.io/conversational-ai/v1/projects/string/sessions/string'

Response example

Example Response
{  "agent_session_id": "a42ac95tp25py49fc37hp94vm67ht52h",  "agent_name": "Customer Support Agent",  "status": "RUNNING",  "start_ts": 1735035893,  "stop_ts": null,  "message": null}