# Moderate

> Robots API reference, generated from the OpenAPI spec.

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

## Get a 'moderate' job

`GET https://api.mux.com/robots/v1/jobs/moderate/{JOB_ID}`

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

Operation ID: `get-moderate-job`. HTML version: https://www.mux.com/docs/api-reference/robots/moderate/get-moderate-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: `"moderate"`.
  - `parameters` (object, required)
    - `asset_id` (string, required, minLength: 1): The Mux asset ID of the video to moderate.
    - `language_code` (string, minLength: 1): BCP 47 language code of the caption source. An explicit language must match a ready source exactly, including case; for example, en does not match en-US. Translation target exclusion and track replacement instead compare base languages case-insensitively. When omitted, automatic selection applies. Uses the first ready subtitle in asset track order without English preference. Audio-only assets with one ready text track lacking subtitle metadata can use that legacy transcript. If no ready track matches, the request is rejected. Ignored for video assets when include_transcript is false.
    - `thresholds` (object, default: {"sexual":0.7,"violence":0.8}): Score thresholds that determine whether content is flagged. When combined with sampling_interval or max_samples, the exceeds_threshold flag reflects whether any category's highest observed score exceeds its configured threshold. Defaults to {sexual: 0.7, violence: 0.8}.
      - `sexual` (number, minimum: 0, maximum: 1): Score threshold for sexual content. Content scoring above this value triggers exceeds_threshold.
      - `violence` (number, minimum: 0, maximum: 1): Score threshold for violent content. Content scoring above this value triggers exceeds_threshold.
    - `sampling_interval` (integer, minimum: 5): Interval, in seconds, between sampled thumbnails. Minimum 5 seconds. When max_samples is also set, the actual sampling density is the more restrictive of the two constraints.
    - `max_samples` (integer, minimum: 1): Maximum number of thumbnails to sample. Acts as a cap — if sampling_interval produces fewer samples than this limit, the interval is respected; otherwise samples are evenly distributed with first and last frames pinned.
    - `output_steering` (object): Curated controls that optionally restrict moderation to an asset time range.
      - `scope` (object): Optional execution window in seconds on the original asset timeline. Omit start_time to begin at the asset start and omit end_time to continue through the asset end. Moderation is restricted to media within this window, while returned timestamps remain absolute asset timestamps. At least one of start_time and end_time is required, and start_time must be less than end_time. An end_time past the end of the media is clamped to it, and a window that starts at or after the end of the media is rejected.
        - `start_time` (number, minimum: 0): Start of the execution window in seconds from the beginning of the media. When omitted, the window starts at the beginning.
        - `end_time` (number, exclusiveMinimum: 0): End of the execution window in seconds from the beginning of the media. When omitted, the window extends to the end.
    - `on_flagged` (object): Optional action taken automatically when exceeds_threshold is true. When omitted, the job only reports scores and takes no action. Note: in a directive run that targets the same asset with other workflows, deleting playback IDs can break sibling workflows that need a playback ID.
      - `action` (string, required): Action to take when exceeds_threshold is true. "delete_playback_ids" deletes every playback ID on the asset, making it unplayable while preserving the underlying asset so it can be re-published or reviewed. Possible values: `"delete_playback_ids"`.
    - `include_transcript` (boolean, default: true): Whether to moderate the asset's caption transcript in addition to sampled thumbnails. Applies to video assets with a ready caption track; audio-only assets are always moderated on their transcript. Set to false to moderate thumbnails only.
  - `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'.
    - `thumbnail_scores` (array of object, required): Per-thumbnail moderation scores. Empty for audio-only assets.
      - `time` (number, required, minimum: 0): Time in seconds of the thumbnail within the video.
      - `sexual` (number, required, minimum: 0, maximum: 1): Sexual content score from 0.0 to 1.0.
      - `violence` (number, required, minimum: 0, maximum: 1): Violence content score from 0.0 to 1.0.
    - `max_scores` (object, required): Highest scores across every moderated thumbnail and transcript window for each category.
      - `sexual` (number, required, minimum: 0, maximum: 1)
      - `violence` (number, required, minimum: 0, maximum: 1)
    - `exceeds_threshold` (boolean, required): True if any category's max score exceeds its configured threshold.
    - `flagged_action` (object): Present only when on_flagged was set and exceeds_threshold was true. Records the action taken and which playback IDs were deleted.
      - `action` (string, required) Possible values: `"delete_playback_ids"`.
      - `deleted_playback_ids` (array of string, required): Playback IDs that were deleted from the asset because it exceeded the threshold.
    - `transcript_scores` (array of object, required): Per-window transcript moderation scores. Empty when transcript moderation was skipped.
      - `start_time` (number, required, minimum: 0): Time in seconds where the moderated transcript window starts.
      - `end_time` (number, required, minimum: 0): Time in seconds where the moderated transcript window ends.
      - `sexual` (number, required, minimum: 0, maximum: 1): Sexual content score from 0.0 to 1.0.
      - `violence` (number, required, minimum: 0, maximum: 1): Violence content score from 0.0 to 1.0.
    - `thumbnail_moderation` (object, required): Outcome of thumbnail moderation.
      - `status` (string, required): "completed" if at least one thumbnail was moderated, "skipped" if nothing could be moderated on this surface (see skip_reason), "failed" if every thumbnail errored so this surface contributed no scores. Possible values: `"completed"`, `"skipped"`, `"failed"`.
      - `skip_reason` (string): Present only when status is "skipped". Machine-readable reason nothing was moderated. Possible values: `"no_video_track"`, `"no_video_in_scope"`.
      - `skip_message` (string): Present only when status is "skipped". Human-readable explanation of skip_reason.
    - `transcript_moderation` (object, required): Outcome of transcript moderation.
      - `status` (string, required): "completed" if at least one transcript window was moderated, "skipped" if nothing could be moderated on this surface (see skip_reason), "failed" if every transcript window errored so this surface contributed no scores. Possible values: `"completed"`, `"skipped"`, `"failed"`.
      - `skip_reason` (string): Present only when status is "skipped". Machine-readable reason nothing was moderated. Possible values: `"no_ready_text_track"`, `"no_cues"`, `"disabled"`.
      - `skip_message` (string): Present only when status is "skipped". Human-readable explanation of skip_reason.

### 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.
