# Translate Audio

> Robots API reference, generated from the OpenAPI spec.

HTML version: https://www.mux.com/docs/api-reference/robots/translate-audio. Full OpenAPI spec: https://www.mux.com/api-spec.json

## Get a 'translate-audio' job

`GET https://api.mux.com/robots/v1/jobs/translate-audio/{JOB_ID}`

Retrieves the current status and results of a 'translate-audio' job. Jobs are automatically deleted after 30 days.

Operation ID: `get-translate-audio-job`. HTML version: https://www.mux.com/docs/api-reference/robots/translate-audio/get-translate-audio-job

### Path parameters

- `JOB_ID` (string, required, minLength: 1, maxLength: 255): Robots job ID returned by job creation or listing (rjob_...).

### Response `200`

Current job status and outputs

- `data` (object, required)
  - `id` (string, required): Unique job identifier.
  - `passthrough` (string): Arbitrary string supplied at creation, returned as-is.
  - `units_consumed` (integer, required, minimum: 0): Number of Mux AI units consumed by this job.
  - `directive` (object): The directive run that dispatched this job. Absent for jobs created via direct API POST.
    - `id` (string, required): ID of the directive that dispatched this job.
    - `run_id` (string, required): ID of the specific directive run that dispatched this job.
  - `created_at` (integer, required, minimum: 0): Unix timestamp (seconds) when the job was created.
  - `updated_at` (integer, required, minimum: 0): Unix timestamp (seconds) of the job's last state transition (e.g. when it started processing or reached a terminal state).
  - `workflow` (string, required) Possible values: `"translate-audio"`.
  - `parameters` (object, required)
    - `asset_id` (string, required, minLength: 1): The Mux asset ID of the video to translate.
    - `track_name` (string, minLength: 1): 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`.
    - `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, clips, and assets created from live streams, because Mux cannot add audio tracks to them; the job then returns downloadable audio instead. To keep a clip's dub on Mux, dub its source asset.
    - `replace_existing_tracks` (string, default: "fail"): 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. Possible values: `"fail"`, `"replace_all"`, `"replace_generated"`.
    - `captions` (object): Optional subtitle attachment settings. Omitting this object or its upload_to_mux disables caption upload; the dub's WebVTT download remains available when retrieval succeeds.
      - `upload_to_mux` (boolean, default: false): Whether to attach the dub's translated WebVTT as a subtitle track. Defaults to false, independently of the audio upload_to_mux. Caption conflicts and other attachment failures omit caption_track_id without failing the completed dub.
      - `track_name` (string, minLength: 1): Name for the dubbed subtitle track. Defaults to {Language} (dub), e.g. Spanish (dub). Independent of the audio track_name.
      - `replace_existing_tracks` (string, default: "fail"): Subtitle conflict policy. Defaults to fail. Conflicts under this policy prevent subtitle attachment and omit caption_track_id without failing the dubbing job. replace_generated deletes only Mux-generated subtitles; uploaded tracks, including earlier Robots outputs, block it. replace_all deletes every conflicting subtitle or same-name text track. Conflicts match language ignoring region or name ignoring case. A deleting policy requires captions.upload_to_mux to be true. This policy never applies to audio tracks. Possible values: `"fail"`, `"replace_all"`, `"replace_generated"`.
    - `output_language_code` (string, required, minLength: 1): BCP 47 language tag for the target audio (e.g. "es", "ur", "yue"). See [supported languages](https://www.mux.com/docs/guides/robots-supported-languages#translate-audio). Known ISO 639-3 aliases are accepted. Region and script subtags are retained on Mux tracks, but dubbing uses the base language.
  - `status` (string, required): Current job status. Possible values: `"pending"`, `"processing"`, `"completed"`, `"errored"`, `"cancelled"`.
  - `errors` (array of object): Error details. Present when status is 'errored'.
    - `type` (string, required): Stable public error category identifier. New types may be added, so handle unknown values.
    - `code` (string): Identifies the specific condition that failed, when it has a public code. Absent for other failures. New codes may be added, so handle unknown values.
    - `message` (string, required): Human-readable public error message.
    - `retryable` (boolean): Whether retrying this job may resolve the error.
  - `resources` (object): Related Mux resources linked to this job.
    - `assets` (array of object, required): Mux assets associated with this job.
      - `id` (string, required): Mux asset ID.
      - `meta` (object): Mux asset metadata, if available.
        - `title` (string): Asset title from Mux metadata.
        - `creator_id` (string): Creator identifier from Mux metadata.
        - `external_id` (string): External identifier from Mux metadata.
      - `passthrough` (string): Passthrough string from the Mux asset.
      - `_links` (object, required): Hypermedia links for the asset.
        - `self` (object, required)
          - `href` (string, required): URL to the Mux asset resource.
  - `outputs` (object): Workflow results. Present when status is 'completed'.
    - `temporary_audio_url` (string, minLength: 1): Temporary pre-signed URL to download the dubbed audio with the FLAC output format. Expires 7 days after the job completes.
    - `temporary_vtt_url` (string, minLength: 1): Temporary download URL for the dub's translated WebVTT, available independently of asset uploads when retrieval succeeds. Expires after 7 days. This is the dubbing translation, not a separate caption translation.
    - `caption_track_id` (string, minLength: 1): Mux subtitle track ID when caption upload succeeded. Omitted when caption upload was not requested or failed. Mux has accepted the track, which may still be preparing.
    - `replaced_caption_track_ids` (array of string): Caption tracks deleted during replacement, including when creating the replacement failed. Separate from audio replacement IDs. Each item: minLength: 1.
    - `track_id` (string, minLength: 1): Mux audio track ID, present when upload_to_mux is true.
    - `replaced_track_ids` (array of string): IDs of tracks deleted during replacement. Omitted when no deletions were recorded; historical jobs may lack this information. Each item: minLength: 1.

### Errors

- `401`: Missing or invalid Mux credentials
- `403`: The access token lacks robots:read (insufficient_scope), or Robots access is inactive or suspended. For insufficient_scope, use credentials with the required permission. If using an API access token, create a replacement token with that permission. Enabling Robots for an organization does not grant token permissions.
- `404`: No job exists for the supplied id
- `422`: Invalid job ID
- `500`: Server error

Every error response has this body:

- `error` (object, required)
  - `type` (string, required): Machine-readable error type. New types may be added, so handle unknown values.
  - `code` (string): Identifies the specific condition that failed, when it has a public code. Absent for other errors. New codes may be added, so handle unknown values.
  - `messages` (array of string, required): Individual error messages describing what went wrong.
