Skip to Content
Create an 'edit-captions' job
post

Creates a new job that edits an existing Mux text track using static replacements and optional profanity censoring. Provide at least one of replacements or auto_censor_profanity.

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 whose existing text track should be edited.

parameters.track_id
string

The existing ready Mux text track ID to edit and optionally replace.

Optional LLM-driven profanity detection and censorship rules applied to the selected caption track.

parameters.auto_censor_profanity.detection_method
string
(default: llm)
Possible values: "llm"

How profanity is detected. Currently only llm is supported, which uses an LLM to identify profanity in cue text.

parameters.auto_censor_profanity.mode
string
(default: blank)
Possible values: "blank""remove""mask"

Replacement strategy for detected profanity: blank inserts bracketed underscores, remove drops the match, and mask replaces characters with question marks. Defaults to "blank".

parameters.auto_censor_profanity.always_censor
array

Additional words or short phrases that should always be censored even if the model does not detect them.

parameters.auto_censor_profanity.never_censor
array

Words or short phrases that should never be censored even if the model flags them.

Optional static word or phrase replacements applied directly to cue text.

parameters.replacements[].find
string

Exact word or phrase to replace in cue text.

parameters.replacements[].replace
string

Replacement text to insert when a match is found.

parameters.replacements[].case_sensitive
boolean
(default: false)

When true, find is matched only with exact case. Defaults to false (case-insensitive matching), so "gonna" also matches "Gonna" and "GONNA".

parameters.upload_to_mux
boolean
(default: true)

Whether to upload the edited VTT back to the Mux asset as a new text track. Defaults to true.

parameters.delete_original_track
boolean
(default: true)

Whether to delete the original source text track after the edited track upload succeeds. Has effect only when upload_to_mux is true. Defaults to true.

parameters.track_name_suffix
string

Optional suffix appended to the uploaded replacement track name. Defaults to "edited".

post
202
https://api.mux.com/robots/v0/jobs/edit-captions
Request
(application/json)
{
  "parameters": {
    "asset_id": "mux_asset_123abc",
    "track_id": "text_track_456def",
    "replacements": [
      {
        "find": "Mucks",
        "replace": "Mux",
        "case_sensitive": true
      },
      {
        "find": "gonna",
        "replace": "going to"
      }
    ],
    "upload_to_mux": true,
    "delete_original_track": true
  }
}
Response
(application/json)
{
  "data": {
    "id": "rjob_example123",
    "workflow": "edit-captions",
    "status": "pending",
    "units_consumed": 0,
    "created_at": 1700000000,
    "updated_at": 1700000060,
    "parameters": {
      "asset_id": "mux_asset_123abc",
      "track_id": "text_track_456def",
      "replacements": [
        {
          "find": "Mucks",
          "replace": "Mux",
          "case_sensitive": true
        },
        {
          "find": "gonna",
          "replace": "going to"
        }
      ],
      "upload_to_mux": true,
      "delete_original_track": true
    }
  }
}