Update task configuration

Updated

Updates the configuration of a Real-time STT task.

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

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.

Format
int64
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
optional
array

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.

Max items
4
keywords
optional
array

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

Max items
500
uidLanguagesConfig
optional
array

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

Max items
5
rtcConfig
optional
object

Subscription configuration.

translateConfig
optional
object

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

200
application/json

OK

agent_id
optional
string

The ID of the agent.

create_ts
optional
integer

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

status
optional
string

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
Allowed
IDLE | STARTING | RUNNING | STOPPING | STOPPED | RECOVERING | FAILED
default
application/json

Error response.

detail
optional
string

Details of the request failure.

reason
optional
string

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