Update task configuration

Updated

Updates the configuration of a Real-time STT task.

posthttps://api.agora.io/api/speech-to-text/v1/projects/{appid}/agents/{agentId}/update

Use this method to update the configuration of a Real-time STT task.

Path Parameters

appid#*string

The App ID of the project.

agentId#*string

The unique identifier of the agent you received in the response body of the join method.

Query Parameters

sequenceId#*integer

The sequence number of update requests. The integer value must be greater than or equal to 0. Ensure that the sequenceId of the next update request is greater than the value you specified for the previous request. The parameter ensures that Agora updates the transcription task according to the latest configuration you specified.

Formatint64
updateMask#*string

The specified update configuration item. To update multiple fields, use a comma separator. For example: updateMask=languages,rtcConfig.subscribeAudioUids,translateConfig.enable,translateConfig.languages.

Request Body

application/json

languages#optionalarray

The transcription languages to recognize. You can specify up to 4 languages. Refer to Supported Languages for details. Choosing multiple transcription languages can affect both quality and cost. For best practices, see Optimize transcription quality and cost.

keywords#optionalarray

Keyword list. Use it to improve the recognition accuracy of specific words during transcription. Supports up to 500 words.

uidLanguagesConfig#optionalarray

Configure the transcription language for the specified user ID. Supports up to 5 configuration items. If you set this field when calling join and now wish to specify no users, set this field to an empty array [].

rtcConfig#optionalobject

Subscription configuration.

translateConfig#optionalobject

Subtitle translation configuration.

Response

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

Response Body

application/json

application/json

Response schema

200application/json

OK

agent_id#optionalstring

The ID of the agent.

create_ts#optionalinteger

The Unix timestamp (in seconds) when the agent was created.

status#optionalstring

The current status of the agent:

  • IDLE: The agent is not initialized
  • STARTING: The agent is starting
  • RUNNING: The agent is running
  • STOPPING: The agent is exiting
  • STOPPED: The agent exited successfully
  • RECOVERING: The agent is recovering
  • FAILED: Agent exit failed
AllowedIDLE | STARTING | RUNNING | STOPPING | STOPPED | RECOVERING | FAILED
defaultapplication/json

Error response.

detail#optionalstring

Details of the request failure.

reason#optionalstring

The reason why the request failed.

Response

Refer to the detail and reason fields to understand the possible reasons for failure.

Authorization

This endpoint requires authentication.

BasicAuth

Request examples

curl --request POST \  --url 'https://api.agora.io/api/speech-to-text/v1/projects/:appid/agents/:agentid/update?sequenceId=1&updateMask=translateConfig.enable,translateConfig.languages' \  --header 'Authorization: Basic <credentials>' \  --data '{  "translateConfig": {    "enable": true,    "languages": [      {        "source": "en-US",        "target": ["ja-JP"]      }    ]  }}'

Response example

{  "agent_id": "Agent ID.",  "create_ts": null,  "status": "RUNNING"}
{  "detail": "Details of the request failure.",  "reason": "The reason why the request failed."}