Retrieve a list of agents
Updated
Retrieves Conversational AI agents that match specified conditions.
https://api.agora.io/api/conversational-ai-agent/v2/projects/{appid}/agentsGet a list of Conversational AI agents that meet the specified conditions.
Path Parameters
appidstringThe App ID of the project.
Query Parameters
channelstringThe channel to query for a list of agents.
from_timenumberThe start timestamp (in seconds) for the query. Defaults to 2 hours ago.
to_timenumberThe end timestamp (in seconds) for the query. Defaults to the current time.
statearray<integer>The agent state to filter by. Specify one or more states as a comma-separated list. For example, state=0,1,2.
-
0:IDLEAgent is idle. -
1:STARTINGThe agent is starting. -
2:RUNNINGThe agent is running. -
3:STOPPINGThe agent is stopping. -
4:STOPPEDThe agent has exited. -
6:FAILEDThe agent failed to execute.
limitintegerThe maximum number of entries returned per page.
cursorstringThe paging cursor, indicating the starting position (agent_id) of the next page of results.
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 thedetailandreasonfor failure. Refer to status codes to understand the possible reasons for failure.
Response Body
The request was successful. The response body contains the result of the request.
dataobjectAgent data.
countintegerThe number of agents returned.
listarray<object>A list of agents that meets the criteria.
start_tsintegerAgent creation timestamp.
statusstringThe current state of the agent.
agent_idstringThe agent ID.
metaobjectReturns meta information about the list.
cursorstringPaging cursor.
totalintegerThe total number of agents that meet the query conditions.
statusstringRequest status.
Request examples
curl --request get \ --url 'https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/agents?state=0,1,2&limit=20' \ --header 'Authorization: Basic <credentials>'Response example
{ "data": { "count": 1, "list": [ { "start_ts": 1735035893, "status": "RUNNING", "agent_id": "1234567890ABCDE1CVGZNU80BEIN56XF" } ] }, "meta": { "cursor": "", "total": 1 }, "status": "ok"}