# Generate Chapters (v0)

> Robots API v0 reference, generated from the OpenAPI spec.

Generate chapters for a video.

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

Operations on this page:

- Create a 'generate-chapters' job: `POST /robots/v0/jobs/generate-chapters`
- Get a 'generate-chapters' job: `GET /robots/v0/jobs/generate-chapters/{JOB_ID}`

## Create a 'generate-chapters' job

`POST https://api.mux.com/robots/v0/jobs/generate-chapters`

**Deprecated.**

Deprecated: use `POST /robots/v1/jobs/generate-chapters` instead. Creates a new job that uses AI to generate chapters for a Mux Video asset. Optional output steering can guide chapter style, granularity, audience, and brand terms without changing the response schema.

Operation ID: `create-generate-chapters-job-v0`. HTML version: https://www.mux.com/docs/api-reference/robots-v0/generate-chapters-v0/create-generate-chapters-job-v0

### Request body

- `passthrough` (string): Arbitrary string stored with the job and returned in responses. Useful for correlating jobs with your own systems.
- `parameters` (object, required)
  - `asset_id` (string, required, minLength: 1): The Mux asset ID of the video to generate chapters for.
  - `language_code` (string, minLength: 1): BCP 47 language code of the caption track to analyze (e.g. "en", "fr"). When omitted, the first ready text track on the asset is selected.
  - `output_language_code` (string, minLength: 1): BCP 47 language code for the output chapter titles. Auto-detected from the transcript if omitted.
  - `output_steering` (object): Curated output_steering controls for chapter style, granularity, audience, and brand terminology. These controls guide model behavior but do not guarantee exact output.
    - `chapter_style` (string): Best-effort style guidance for generated chapter titles. Possible values: `"descriptive"`, `"punchy"`, `"educational"`, `"seo"`, `"platform_neutral"`.
    - `chapter_granularity` (string): Best-effort guidance for how coarse or fine chapter boundaries should be. Possible values: `"coarse"`, `"balanced"`, `"fine"`.
    - `audience` (string, minLength: 1, maxLength: 160): Intended audience used as best-effort model guidance. Does not change the output schema.
    - `brand_terms` (array of string, minItems: 1, maxItems: 10): Preferred brand or domain terms to use when supported by the source content. Each item: minLength: 1, maxLength: 40.
  - `prompt_overrides` (object, deprecated): Deprecated: use `output_steering`. Raw prompt-section overrides; any section supplied here takes precedence over the equivalent `output_steering` guidance.
    - `task` (string, minLength: 1): Override the core task instruction for chapter generation.
    - `output_format` (string, minLength: 1): Override the JSON output format instructions.
    - `chapter_guidelines` (string, minLength: 1): Override the chapter density and timing constraints.
    - `title_guidelines` (string, minLength: 1): Override the chapter title style requirements.
  - `update_asset_chapters` (boolean): When true, the generated chapters are written back to the Mux asset as a chapters text track once the job completes, making them deliverable with the asset. Overwrites existing chapters: an asset holds a single chapters track, so any chapters track already on the asset is deleted and replaced — including one in a different language, and one you created yourself. Best-effort — a failed write does not fail the job — so check `asset_updates.chapters` in the job outputs for the outcome.

Example request body:

```json
{
  "parameters": {
    "asset_id": "mux_asset_123abc",
    "update_asset_chapters": true,
    "output_steering": {
      "chapter_style": "descriptive",
      "chapter_granularity": "balanced",
      "audience": "Developers"
    }
  }
}
```

### Response `202`

Chapters job queued

- `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: `"generate-chapters"`.
  - `parameters` (object, required)
    - `asset_id` (string, required, minLength: 1): The Mux asset ID of the video to generate chapters for.
    - `language_code` (string, minLength: 1): BCP 47 language code of the caption track to analyze (e.g. "en", "fr"). When omitted, the first ready text track on the asset is selected.
    - `output_language_code` (string, minLength: 1): BCP 47 language code for the output chapter titles. Auto-detected from the transcript if omitted.
    - `output_steering` (object): Curated output_steering controls for chapter style, granularity, audience, and brand terminology. These controls guide model behavior but do not guarantee exact output.
      - `chapter_style` (string): Best-effort style guidance for generated chapter titles. Possible values: `"descriptive"`, `"punchy"`, `"educational"`, `"seo"`, `"platform_neutral"`.
      - `chapter_granularity` (string): Best-effort guidance for how coarse or fine chapter boundaries should be. Possible values: `"coarse"`, `"balanced"`, `"fine"`.
      - `audience` (string, minLength: 1, maxLength: 160): Intended audience used as best-effort model guidance. Does not change the output schema.
      - `brand_terms` (array of string, minItems: 1, maxItems: 10): Preferred brand or domain terms to use when supported by the source content. Each item: minLength: 1, maxLength: 40.
    - `prompt_overrides` (object, deprecated): Deprecated: use `output_steering`. Raw prompt-section overrides; any section supplied here takes precedence over the equivalent `output_steering` guidance.
      - `task` (string, minLength: 1): Override the core task instruction for chapter generation.
      - `output_format` (string, minLength: 1): Override the JSON output format instructions.
      - `chapter_guidelines` (string, minLength: 1): Override the chapter density and timing constraints.
      - `title_guidelines` (string, minLength: 1): Override the chapter title style requirements.
    - `update_asset_chapters` (boolean): When true, the generated chapters are written back to the Mux asset as a chapters text track once the job completes, making them deliverable with the asset. Overwrites existing chapters: an asset holds a single chapters track, so any chapters track already on the asset is deleted and replaced — including one in a different language, and one you created yourself. Best-effort — a failed write does not fail the job — so check `asset_updates.chapters` in the job outputs for the outcome.
  - `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'.
    - `chapters` (array of object, required, minItems: 1): Generated chapters, ordered by start time.
      - `start_time` (number, required, minimum: 0): Chapter start time in seconds. The first chapter always starts at 0.
      - `title` (string, required, minLength: 1): Concise chapter title.
    - `asset_update` (object, deprecated): Deprecated: use `asset_updates.chapters` instead.
      - `status` (string, required): Outcome of the chapters track write. `created` means the asset now carries these chapters. `failed` means the write was attempted and errored; the chapters in this response are still valid and can be applied manually. Possible values: `"created"`, `"failed"`.
      - `track_id` (string, minLength: 1): Mux text track ID of the chapters track created on the asset. Present when status is `created`.
      - `replaced_track_id` (string, minLength: 1): Mux text track ID of the chapters track that was deleted to make room for the new one. Absent when the asset had no chapters track. On a `failed` status it means the delete succeeded but the create did not, leaving the asset with no chapters track.
    - `asset_updates` (object): Recorded chapters track update outcome. Omitted when no outcome was recorded.
      - `chapters` (object): What happened when the generated chapters were written back to the Mux asset. Present only when update_asset_chapters was true.
        - `status` (string, required): Outcome of the chapters track write. `created` means the asset now carries these chapters. `failed` means the write was attempted and errored; the chapters in this response are still valid and can be applied manually. Possible values: `"created"`, `"failed"`.
        - `track_id` (string, minLength: 1): Mux text track ID of the chapters track created on the asset. Present when status is `created`.
        - `replaced_track_id` (string, minLength: 1): Mux text track ID of the chapters track that was deleted to make room for the new one. Absent when the asset had no chapters track. On a `failed` status it means the delete succeeded but the create did not, leaving the asset with no chapters track.

### Errors

- `400`: Malformed or missing JSON request body, or invalid request parameters
- `401`: Missing or invalid Mux credentials
- `403`: Robots is not enabled for this environment (accept the Robots beta terms in the Mux Dashboard to enable access), or a free-plan limit has prevented job creation.
- `409`: A job with the same workflow and parameters is already pending or processing for this environment.
- `422`: Asset not found, missing public or signed playback ID, or no transcript
- `500`: Server error

Every error response has this body:

- `error` (object, required)
  - `type` (string, required): Machine-readable error type.
  - `message` (string, required, deprecated): Deprecated: use `messages` instead. Human-readable error message describing what went wrong.
  - `messages` (array of string): Individual error messages describing what went wrong.

## Get a 'generate-chapters' job

`GET https://api.mux.com/robots/v0/jobs/generate-chapters/{JOB_ID}`

**Deprecated.**

Deprecated: use `GET /robots/v1/jobs/generate-chapters/{job_id}` instead. Retrieves the current status and results of a 'generate-chapters' job. Jobs are automatically deleted after 30 days.

Operation ID: `get-generate-chapters-job-v0`. HTML version: https://www.mux.com/docs/api-reference/robots-v0/generate-chapters-v0/get-generate-chapters-job-v0

### Path parameters

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

### Response `200`

Current status for the requested job

- `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: `"generate-chapters"`.
  - `parameters` (object, required)
    - `asset_id` (string, required, minLength: 1): The Mux asset ID of the video to generate chapters for.
    - `language_code` (string, minLength: 1): BCP 47 language code of the caption track to analyze (e.g. "en", "fr"). When omitted, the first ready text track on the asset is selected.
    - `output_language_code` (string, minLength: 1): BCP 47 language code for the output chapter titles. Auto-detected from the transcript if omitted.
    - `output_steering` (object): Curated output_steering controls for chapter style, granularity, audience, and brand terminology. These controls guide model behavior but do not guarantee exact output.
      - `chapter_style` (string): Best-effort style guidance for generated chapter titles. Possible values: `"descriptive"`, `"punchy"`, `"educational"`, `"seo"`, `"platform_neutral"`.
      - `chapter_granularity` (string): Best-effort guidance for how coarse or fine chapter boundaries should be. Possible values: `"coarse"`, `"balanced"`, `"fine"`.
      - `audience` (string, minLength: 1, maxLength: 160): Intended audience used as best-effort model guidance. Does not change the output schema.
      - `brand_terms` (array of string, minItems: 1, maxItems: 10): Preferred brand or domain terms to use when supported by the source content. Each item: minLength: 1, maxLength: 40.
    - `prompt_overrides` (object, deprecated): Deprecated: use `output_steering`. Raw prompt-section overrides; any section supplied here takes precedence over the equivalent `output_steering` guidance.
      - `task` (string, minLength: 1): Override the core task instruction for chapter generation.
      - `output_format` (string, minLength: 1): Override the JSON output format instructions.
      - `chapter_guidelines` (string, minLength: 1): Override the chapter density and timing constraints.
      - `title_guidelines` (string, minLength: 1): Override the chapter title style requirements.
    - `update_asset_chapters` (boolean): When true, the generated chapters are written back to the Mux asset as a chapters text track once the job completes, making them deliverable with the asset. Overwrites existing chapters: an asset holds a single chapters track, so any chapters track already on the asset is deleted and replaced — including one in a different language, and one you created yourself. Best-effort — a failed write does not fail the job — so check `asset_updates.chapters` in the job outputs for the outcome.
  - `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'.
    - `chapters` (array of object, required, minItems: 1): Generated chapters, ordered by start time.
      - `start_time` (number, required, minimum: 0): Chapter start time in seconds. The first chapter always starts at 0.
      - `title` (string, required, minLength: 1): Concise chapter title.
    - `asset_update` (object, deprecated): Deprecated: use `asset_updates.chapters` instead.
      - `status` (string, required): Outcome of the chapters track write. `created` means the asset now carries these chapters. `failed` means the write was attempted and errored; the chapters in this response are still valid and can be applied manually. Possible values: `"created"`, `"failed"`.
      - `track_id` (string, minLength: 1): Mux text track ID of the chapters track created on the asset. Present when status is `created`.
      - `replaced_track_id` (string, minLength: 1): Mux text track ID of the chapters track that was deleted to make room for the new one. Absent when the asset had no chapters track. On a `failed` status it means the delete succeeded but the create did not, leaving the asset with no chapters track.
    - `asset_updates` (object): Recorded chapters track update outcome. Omitted when no outcome was recorded.
      - `chapters` (object): What happened when the generated chapters were written back to the Mux asset. Present only when update_asset_chapters was true.
        - `status` (string, required): Outcome of the chapters track write. `created` means the asset now carries these chapters. `failed` means the write was attempted and errored; the chapters in this response are still valid and can be applied manually. Possible values: `"created"`, `"failed"`.
        - `track_id` (string, minLength: 1): Mux text track ID of the chapters track created on the asset. Present when status is `created`.
        - `replaced_track_id` (string, minLength: 1): Mux text track ID of the chapters track that was deleted to make room for the new one. Absent when the asset had no chapters track. On a `failed` status it means the delete succeeded but the create did not, leaving the asset with no chapters track.

### Errors

- `401`: Missing or invalid Mux credentials
- `403`: Robots is not enabled for this environment. Accept the Robots beta terms in the Mux Dashboard to enable access.
- `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.
  - `message` (string, required, deprecated): Deprecated: use `messages` instead. Human-readable error message describing what went wrong.
  - `messages` (array of string): Individual error messages describing what went wrong.
