Update task configuration
Update task configuration
https://api.agora.io/v1/projects/{appId}/rtsc/speech-to-text/tasks/{taskId}
Use this method to update the configuration of a Real-Time STT task.
Request
Path parameters
The App ID of the project
The unique identifier of the Real-Time STT task you received in the response body of the start method.
Query parameters
The tokenName
value you obtained in the response body of the acquire
method.
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.
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
BODYrequired
- languages array[string]nullable
The transcription languages to recognize. You can specify up to 4 languages. Refer to Supported Languages for details.
- uidLanguagesConfig objectnullable
Configure the transcription language for the specified user ID. Supports up to 5 configuration items.
- uid stringrequired
The ID of the user to be transcribed.
- languages stringrequired
You can specify up to 4 languages. Refer to Supported Languages for details.
- rtcConfig objectnullable
- subscribeAudioUids array[string]nullable
The user IDs of the audio streams you want to subscribe to. Specify this parameter only if you need to subscribe to specific users. To subscribe to audio streams of all users, use
["all"]
. Maximum array length: 32.
- translateConfig objectnullable
Subtitle translation configuration
- enable booleanrequired
Whether to translate the transcribed text:
true
: Translate.false
: Do not translate.
If you enabled translation when callingstart
, you can turn it off by settingenable
tofalse
. If you did not enable translation, you can turn it on by settingenable
totrue
and specifyinglanguages
.
- languages arrayrequired
The translation languages array. You can specify a maximum of 2 different source languages. The source language and target language must be different, otherwise an error is reported.
Each array item is an object with:- source stringrequired
The source language for translation. Refer to Supported Languages for details.
- target array[string]required
The target languages for translation. You can specify a maximum of 5 target languages for each source language. Refer to Supported Languages for details.
Response
-
If the returned status code is
200
, the request was successful. The response body contains the result of the request.OK
- taskId stringrequired
The unique identifier of this transcription task.
- createTs integerrequired
The Unix timestamp (in seconds) when the transcription task was created.
- status stringrequired
The current status of the transcription task:
IDLE
: Task not initializedPREPARING
: Task has received an initialization requestPREPARED
: Task initialization completedSTARTING
: Task is beginning to startCREATED
: Task startup partially completedSTARTED
: Task startup fully completedIN_PROGRESS
: Task is currently runningSTOPPING
: Task is in the process of being pausedSTOPPED
: Task has been terminatedFAILURE_STOP
: Task termination failed
-
If the returned status code is not
200
, the request failed. Refer tomessage
field to understand the possible reasons for failure.Non-200
- message string
The reason why the request failed.
Authorization
This endpoint requires Basic Auth.
Request example
- curl
- Python
- Node.js
Response example
- 200
- Non-200