---
title: "POST robots.job.generate_premium_captions.processing"
method: POST
path: "robots.job.generate_premium_captions.processing"
---

# POST robots.job.generate_premium_captions.processing

`POST robots.job.generate_premium_captions.processing` (webhook)

## Payload

- object
  - `type` 'robots.job.generate_premium_captions.processing', required: Type for the webhook event
  - `id` string, required: Unique identifier for the event
  - `created_at` string, date-time, required: Time the event was created
  - `object` object, required
    - `type` string, required
    - `id` string, required
  - `environment` object, required
    - `name` string, required: Name for the environment
    - `id` string, required: Unique identifier for the environment
  - `attempts` object[], required: Attempts for sending out the webhook event
    - `webhook_id` integer: Unique identifier for the webhook
    - `response_status_code` integer: HTTP response status code for the webhook attempt
    - `response_headers` object: HTTP response headers for the webhook attempt
    - `response_body` string, nullable: HTTP response body for the webhook attempt
    - `max_attempts` integer: Max attempts number for the webhook attempt
    - `id` string: Unique identifier for the webhook attempt
    - `created_at` string, date-time: Time the webhook request was attempted
    - `address` string: URL address for the webhook attempt
  - `data` object, required: Job object delivered in the Mux webhook event's data field. The event type identifies the workflow and transition.
    - `id` string, required: Unique job identifier.
    - `passthrough` string: Arbitrary string supplied at creation, returned as-is.
    - `units_consumed` integer, required: 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: Unix timestamp (seconds) when the job was created.
    - `updated_at` integer, required: Unix timestamp (seconds) of the job's last state transition (e.g. when it started processing or reached a terminal state).
    - `workflow` 'generate-premium-captions', required
    - `parameters` object, required
      - `asset_id` string, required: The Mux asset ID of the video to caption.
      - `language_code` string: BCP 47 language code of the audio (e.g. "en", "es"). A best-effort hint that biases transcription toward this language — it is not verified against the audio and does not guarantee the output language. When supplied, language detection is skipped and the captions are labeled with this code. The language will be auto-detected when omitted; existing tracks are then checked against `replace_existing_tracks` after transcription, so a same-language conflict errors the job at track creation instead of being rejected up front, and a deleting policy only applies when the detection is confident.
      - `replace_existing_tracks` 'fail' | 'replace_all' | 'replace_generated': What to do when the asset already has a text track in the same language as, or with the same name as, the new caption track. Defaults to `fail`, which rejects the request before any work is billed. `replace_all` deletes every such track first. `replace_generated` deletes only Mux Video auto-generated tracks and rejects if an uploaded track is in the way. Existing tracks are matched by language ignoring region subtags, and by name ignoring case, in any status. When `language_code` is omitted the detected language is used, and tracks are only deleted when the detection is confident; otherwise the job behaves as `fail`.
      - `replace_existing` boolean: Deprecated: use `replace_existing_tracks`. `true` behaves as `replace_all` and `false` as `fail`. `true` cannot be combined with `replace_existing_tracks`; `false` is ignored when both are present.
      - `track_name` string: Custom name for the uploaded Mux text track. Defaults to "{Language} (Generated)", e.g. "English (Generated)". Mux requires text track names to be unique on an asset.
      - `include_speakers` boolean: When true, speaker labels are identified and added to each caption cue. Useful for interviews, podcasts, and multi-speaker content.
      - `include_words` boolean: When true, word-level timestamps are exported as a JSON file accessible via temporary_words_url in the job outputs. The URL expires 7 days after the job completes. Billed at a higher unit rate.
      - `upload_to_mux` boolean: Whether to upload the generated SRT to the Mux asset as a new text track. Defaults to true. When false, no track is created and `replace_existing_tracks` must be `fail`; the generated SRT remains available via `temporary_srt_url`.
      - `phrases` string[]: Best-effort list of words or short phrases (proper nouns, product names, jargon) likely to appear in the audio, used to bias recognition toward correct spellings. Does not guarantee exact output. Each phrase may contain at most 49 characters and 5 words, and must not contain the characters <, >, {, }, [, ], or \.
    - `status` 'pending' | 'processing' | 'completed' | 'errored' | 'cancelled', required: Current job status.
    - `errors` object[]: Error details. Present when status is 'errored'.
      - `type` string, required: Stable public error category identifier.
      - `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` 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'.
      - `track_id` string: Mux text track ID of the newly uploaded caption track. Omitted when upload_to_mux is false.
      - `language_code` string, required: Resolved language code of the generated captions (may differ from the requested code when auto-detected).
      - `detected_language` string: Language code reported by the transcription model. Only a genuine detection when language_code was omitted from the request; when a language_code hint was supplied, detection is skipped and this echoes the requested language.
      - `auto_language_confidence` number: The transcription model's confidence in its automatic language detection, from 0 to 1. Always 1 when language_code was supplied in the request, since detection is skipped.
      - `temporary_srt_url` string: Temporary pre-signed URL to download the generated SRT file. Expires 7 days after the job completes.
      - `temporary_words_url` string: Temporary pre-signed URL to download the word-level timestamp JSON. Present when include_words is true. Expires 7 days after the job completes. Download and store this file for long-term access.
      - `replaced_track_id` string: Deprecated: use `replaced_tracks`. The ID of the first entry in `replaced_tracks`, kept for compatibility.
      - `replaced_tracks` object[]: Every track deleted before the new track was created. Present when `replace_existing_tracks` was a deleting policy and at least one track was removed.
        - `id` string, required: Mux track ID of the deleted track.
        - `type` 'text' | 'audio': Mux track type of the deleted track.
        - `name` string: Name of the deleted track.
        - `language_code` string: Language code of the deleted track.
        - `text_source` string: Mux `text_source` of the deleted track, e.g. `uploaded` or `generated_vod`. Absent for audio tracks.
        - `passthrough` string: `passthrough` value the deleted track carried, if any.

## Acknowledgement `200`

Return a 200 to indicate that the data was received successfully

---

[API](https://skmtc.dev/muxinc/apis/mux-api.md) - [All operations](https://skmtc.dev/muxinc/apis/mux-api/llms.txt) - [OpenAPI document](https://skmtc.dev/muxinc/apis/mux-api/revisions/75b4251a1d96?raw)
