---
title: "Create a 'generate-engagement-insights' job"
method: POST
path: "/robots/v1/jobs/generate-engagement-insights"
tags: ["Generate Engagement Insights"]
---

# Create a 'generate-engagement-insights' job

`POST /robots/v1/jobs/generate-engagement-insights`

## Request

- Base URL: `https://api.mux.com`
- URL: `https://api.mux.com/robots/v1/jobs/generate-engagement-insights`
- Auth: one of:
  - HTTP basic
  - HTTP bearer

Creates a new job that uses AI to analyze viewer engagement patterns and generate insights for a Mux Video asset. 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. Caption evidence is optional, including for audio-only assets without captions.

## Request body

- CreateGenerateEngagementInsightsJobRequest
  - `passthrough` string: Arbitrary string stored with the job and returned in responses. Useful for correlating jobs with your own systems.
  - `parameters` GenerateEngagementInsightsJobParameters, required
    - `asset_id` string, required: The Mux asset ID of the video to analyze engagement for.

## Response `202`

Engagement insights job queued

- GenerateEngagementInsightsJobResponse
  - `data` GenerateEngagementInsightsJob, required
    - `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` JobDirectiveContext: 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-engagement-insights', required
    - `parameters` GenerateEngagementInsightsJobParameters, required
      - `asset_id` string, required: The Mux asset ID of the video to analyze engagement for.
    - `status` 'pending' | 'processing' | 'completed' | 'errored' | 'cancelled', required: Current job status.
    - `errors` JobError[]: 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` Resources: Related Mux resources linked to this job.
      - `assets` SlimlineAsset[], 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'.
      - `moment_insights` GenerateEngagementInsightsMomentInsight[], required: Per-moment engagement insights for identified hotspots.
        - `engagement_score` number, required: Normalized engagement score (0-1).
        - `insight` string, required: Primary insight explaining the engagement pattern.
        - `start_time` number, required: Engagement insight start time in seconds on the original asset timeline. Fractional seconds are supported.
        - `end_time` number, required: Engagement insight end time in seconds on the original asset timeline. Fractional seconds are supported.
      - `overall_insight` object, required: Overall engagement analysis across the video.
        - `summary` string, required: Summary of overall engagement patterns.
        - `trends` string[], required: Key trends identified across the video.

## Other responses

- `400`: Malformed JSON request body.
- `401`: Missing or invalid Mux credentials
- `403`: The access token lacks robots:write (insufficient_scope), or Robots access is inactive or suspended. A free-plan workflow or unit limit can also prevent creation. 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.
- `409`: Resource conflict. See the error type and messages for details.
- `422`: Asset not found or missing public or signed playback ID
- `500`: Server error

## Changes

- **2026-10-23** `ed6cb570d60c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/muxinc/apis/mux-api/changes/robots/v1/jobs/generate-engagement-insights/post.md)

---

[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)
