Skip to main content

Update agent configuration

Use this endpoint to adjust Conversational AI agent instance parameters at runtime.

API endpoint

  • Method: POST
  • Endpoint: https://api.agora.io/api/conversational-ai-agent/v2/projects/{appid}/agents/{agentId}/update
  • Authorization: Basic Auth

Path parameters

ParameterTypeRequiredDescription
appidstringYesThe App ID of the project
agentIdstringYesThe agent instance ID you obtained after successfully calling join to start the conversational agent.

Request body parameters

The request body must be a JSON object containing the following parameters:

ParameterTypeRequiredDescription
tokenstringNoThe authentication token used by the agent to join the channel.

Request examples

Use one of the following request examples as a starting point:

Sample request:

curl --request POST   --url https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/agents/:agentId/update \
--header 'Authorization: Basic <your_base64_encoded_credentials>' \
--header 'Content-Type: application/json' \
--data '{
"token": "your_token_value"
}'

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

ParameterTypeDescription
agent_idstringUnique id of the agent instance
create_tsintegerTimestamp of when the agent was created
statusstringCurrent status.
  • IDLE (0): Agent in idle state.
  • STARTING (1): The agent being started.
  • RUNNING (2): The running agent.
  • STOPPING (3): The agent is stopping.
  • STOPPED (4): The agent has completed exit.
  • RECOVERING (5): The recovering agent.
  • FAILED (6): Agent that failed to execute.
vundefined