Update task configuration

Updated

Updates the configuration of a Real-time STT task.

POST
https://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. Updating the transcription languages, translation languages, or subscribed users does not reset the idle-timeout timer or the maximum task lifetime timer. Both timers start from the moment the task was created.

Path Parameters

appidstring
Required

The App ID of the project.

agentIdstring
Required

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

Query Parameters

sequenceIdinteger
Required
Deprecated

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.

updateMaskstring
Required
Deprecated

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

languagesarray<string>

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.

keywordsarray<string>

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

uidLanguagesConfigarray<object>

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 [].

rtcConfigobject

Subscription configuration.

translateConfigobject

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

OK

agent_idstring

The ID of the agent.

create_tsinteger

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

statusstring

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

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"}