Skip to Content
Create a 'translate-audio' job
post

Creates a new job that translates the audio track of a Mux Video asset to another language.

Request body params
passthrough
string

Arbitrary string stored with the job and returned in responses. Useful for correlating jobs with your own systems.

parameters.asset_id
string

The Mux asset ID of the video to translate.

parameters.to_language_code
string

BCP 47 language code for the target translation language (e.g. "es", "fr", "ja").

parameters.track_name
string

Name for the dubbed Mux audio track. Defaults to "{Language} (Auto-dubbed)", e.g. "Spanish (Auto-dubbed)". Mux requires audio track names to be unique on an asset, and an existing track with this name is handled according to replace_existing_tracks.

parameters.upload_to_mux
boolean
(default: true)

Whether to automatically upload the translated audio track to the Mux asset. Defaults to true. Must be false for audio-only assets; the job returns downloadable audio instead.

parameters.replace_existing_tracks
string
(default: fail)
Possible values: "fail""replace_all""replace_generated"

What to do when the asset already has an audio track in the same language as, or with the same name as, the new dubbed track. Defaults to fail, which rejects the request before any dubbing is billed. replace_all deletes every such track first. Audio tracks are never auto-generated by Mux Video, so replace_generated behaves as fail here. The asset's primary audio track is never deleted. Any value other than fail requires upload_to_mux to be true. Existing tracks are matched by language ignoring region subtags, and by name ignoring case, in any status.

post
202
https://api.mux.com/robots/v0/jobs/translate-audio
Request
(application/json)
{
  "parameters": {
    "asset_id": "mux_asset_123abc",
    "to_language_code": "es",
    "upload_to_mux": true,
    "replace_existing_tracks": "fail"
  }
}
Response
(application/json)
{
  "data": {
    "id": "rjob_example123",
    "workflow": "translate-audio",
    "status": "pending",
    "units_consumed": 0,
    "created_at": 1700000000,
    "updated_at": 1700000060,
    "parameters": {
      "asset_id": "mux_asset_123abc",
      "to_language_code": "es",
      "upload_to_mux": true,
      "replace_existing_tracks": "fail"
    }
  }
}