---
title: "Regenerate Video Moments Api"
method: POST
path: "/v2/videos/{video_id}/moments/regenerate"
tags: ["Video Emotion API"]
---

# Regenerate Video Moments Api

`POST /v2/videos/{video_id}/moments/regenerate`

## Request

- Base URL: `https://api.imentiv.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.imentiv.ai/v2/videos/{video_id}/moments/regenerate`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://api.imentiv.ai/oauth/authorize`
    - Token URL: `https://api.imentiv.ai/oauth/token` scopes: `media.write`

Compute a video's Moments again: the Regenerate button, and Retry after a failure.

Answers `202` with the same body as `GET /v2/videos/{video_id}/moments` when this request queued a computation,
and `200` with the current body when nothing was started. `regenerate_credits` on the GET says what a
regeneration costs; it is charged once per out-of-date result, never for a Retry, and never for a video whose
Moments was bought. Repeating a request with the same `Idempotency-Key` within a day returns the first answer's
status code and never starts or charges again.

Requires the same access as the video's other charged analyses (the owner or a member allowed to write) and, for
a delegated app, the `media.write` scope.

## Path parameters

- `video_id` string, required: The unique video ID of the video to regenerate moments for

## Headers

- `Idempotency-Key` string, required: One per click; resend the same key only to retry the same request.

## Response `200`

Nothing was started: the moments are current, a computation is already queued or running, a retry is not allowed yet, or the video has no Moments.

- VideoMomentsResponse: Moments for a video. `status` is `ready` (moments below), `computing` (first computation in progress; poll again), `failed` (the last computation failed for the current inputs) or `unavailable` (the video has not finished processing, or Moments was not requested for it). `stale` is true when the video changed since the moments were computed; the previous moments are returned while they are recomputed.
  - `video_id` string, required
  - `status` string, required: `ready`, `computing`, `failed` or `unavailable`.
  - `reason` string, nullable: Why there are no current Moments for a complete video. `not_requested` (with `status: unavailable`): Moments has not been requested for this video (see `POST /v2/videos/{video_id}/moments/request`). `purchase_pending`: a purchase of Moments for this video is being completed; `request` is null so it is not offered again, and nothing more is charged. Read again shortly. Null otherwise, including while the video is still processing.
  - `stale` boolean: True when a recomputation is pending for newer inputs.
  - `generation` integer, nullable: Which computation these moments belong to. Null when no moments are returned. Compare it together with `profile_version` and `computed_at`; it does not change on every recomputation.
  - `profile_version` string, nullable: Analysis profile version these moments were computed with, the same value as `profile.version` when a profile is present. Null when no moments are returned.
  - `moments` Moment[]
    - `id` string, required: Id of this moment. A later computation may assign a new id. `GET /v2/videos/{video_id}/moments/resolve` follows an id from an earlier computation to the current one, or reports that it is gone or unknown. Ids from older computations may be reported as unknown.
    - `kind` string, required: What happened, for example `eye_closure.microsleep` or `sentiment_flip`.
    - `category` string, required: The category the kind belongs to; join with `categories[].id`. `other` for a kind this build does not know.
    - `label` string, required: The kind's readable name, for example `Voice energy spike`.
    - `subject` string, required: The subject it belongs to; join with `subjects[].id`. When the subject was merged into another since the moments were computed, this is the surviving subject.
    - `subject_resolution` string, required: How the subject was identified: `face`, `speaker` or `person`.
    - `baseline_source` string, nullable: Which baseline the deviation was measured against, when one was used.
    - `start_ms` integer, required
    - `end_ms` integer, required
    - `duration_ms` integer, required: Observed duration, in milliseconds.
    - `resolution_ms` integer, required
    - `modalities` MomentSpan[]
      - `modality` string, required: `face`, `voice` or `words`.
      - `start_ms` integer, required: Start, in milliseconds of video time.
      - `end_ms` integer, required: End, in milliseconds of video time.
      - `resolution_ms` integer, required: Time resolution of this modality, in milliseconds.
    - `anchor` MomentAnchor: What a moment responds to: a transcript sentence or a stimulus.
      - `kind` string, required: `sentence` or `stimulus`.
      - `id` string, required: The sentence or stimulus id.
      - `start_ms` integer, required
      - `end_ms` integer, required
    - `confidence` number, nullable: 0-1, when calibrated.
    - `score` number, required: Relative importance used to rank moments.
    - `evidence` object: Kind-specific measurements. `contaminated` is `true` when some of the voice or words evidence overlapped known non-human audio; it is absent otherwise.
    - `evidence_quality` string[]: Which evidence overlapped known non-human audio, such as a voice assistant or music: `audio_overlap:voice` and/or `audio_overlap:words`, in that order. Empty when none did, and on moments computed before this field existed.
    - `source_events` string[]: Ids of the signal events it was built from.
    - `helper` MomentHelperRead: An automated second reading of one moment. Experimental and not calibrated: do not threshold or rank on it.
      - `source` string, required: Always `helper`: this is the second reading, not part of the moment itself.
      - `verdict` string, required: `true`, `false` or `unsure`: whether the second reading agrees the moment is real.
      - `p` number, required: 0-1. The second reading's own estimate that the moment is real, on every verdict (a confident `false` is a low value). Not calibrated, and not the same thing as `confidence`.
      - `kind` string, required: What the second reading takes the moment to be; may differ from `kind` on the moment.
      - `sign` integer, required: `-1`, `0` or `1`: the direction the second reading gives the moment.
      - `anchor_id` string, nullable: The sentence or stimulus id the second reading takes the moment to respond to. Null when it names none.
      - `attribution_basis` string, required: What that attribution rests on: `meaning`, `timing` or `none` (`none` exactly when `anchor_id` is null).
      - `reason` string, nullable: A short explanation in the second reading's words (at most 20 words). Null when it gave none.
      - `helper_fingerprint` string, required: Identifies the version of the second reading that produced this value. Values with different fingerprints are not comparable.
  - `coverage` MomentCoverage[]
    - `subject` string, required
    - `kind` string, required
    - `status` string, required: `measured`, `partial` or `unavailable`.
    - `reason` string, nullable: Why coverage is partial or unavailable.
    - `observed_s` number: Seconds in which the kind could be observed.
    - `detail` string, nullable
    - `detected_count` integer, nullable: Set when not every detected moment of this kind is listed (reason `cap_reached`): how many were detected for this subject.
    - `retained_count` integer, nullable: Set together with `detected_count`: how many of those moments are listed in `moments`.
  - `stimulus_coverage` StimulusCoverage[]
    - `subject` string, required
    - `stimulus_id` string, required
    - `status` string, required
    - `reason` string, nullable
    - `observed_s` number: Seconds of the stimulus's response window in which the subject could be observed. For a subject listed in `visibility`, this can instead be the seconds of that window in which its face was visible.
  - `counts` object: Number of moments per kind.
  - `visibility` SubjectVisibility[], nullable: When each face was visible, one entry per subject. A subject not listed has unknown visibility. Null when visibility is not included with these moments.
    - `subject` string, required: The subject; join with `subjects[].id`.
    - `visible_spans` VisibleSpan[]: When the face was visible, in order and never overlapping. Time outside every span is time the face was not visible. Empty when the face was never visible.
      - `start_ms` integer, required: Start, in milliseconds of video time (inclusive).
      - `end_ms` integer, required: End, in milliseconds of video time (exclusive).
    - `visible_ms` integer, required: Total visible time, in milliseconds: the sum of `visible_spans`.
    - `uninterrupted` boolean, required: True when each span is continuous visibility. False when brief absences inside a span were joined over, so a span alone does not prove the face was visible throughout it.
  - `profile` MomentsProfile: The analysis profile the moments were computed with.
    - `id` string, nullable: For example `conversation`, `sales` or `in_vehicle`.
    - `version` string, nullable
    - `schema_version` string, nullable: Version of the moments result format.
    - `safety_kinds` string[], nullable: Kinds of moment this profile treats as safety-relevant and ranks ahead of the others; empty when it has none. Null for moments computed before this was reported.
  - `subjects` MomentSubject[]
    - `id` string, required: `face:{face_id}` or `speaker:{speaker_id}`.
    - `face_id` string, nullable
    - `speaker_id` string, nullable
    - `person_id` string, nullable: The linked project person, if any.
    - `is_driver` boolean, nullable: Set on in-vehicle videos for the driver.
    - `role` string, nullable: The speaker's role, for example `agent` or `customer`.
    - `state` string: `active`; `merged` when the face was merged into another since the moments were computed (its moments are served under `merged_into`); or `removed` when the face was deleted (its moments are left out). Faces only: a speaker subject is always `active` until the moments are computed again.
    - `merged_into` string, nullable: The final surviving subject when `state` is `merged`; always one of `subjects`.
  - `computed_at` string, date-time, nullable: When these moments were computed.
  - `recomputing` boolean: True while a computation is queued or running for this video: the first one (`status: computing`), or newer moments for a `stale` result.
  - `failure` MomentsFailure: The latest computation failed for the video's current inputs.
    - `retryable` boolean, required: False when retrying will not help until the video or its people change.
    - `retry_after` string, date-time, nullable, required: When a retry is allowed; null when `retryable` is false.
  - `categories` MomentCategory[]: Every category, in display order.
    - `id` string, required
    - `label` string, required
    - `color` string, required: A named colour token (for example `amber`), which the app maps to its light and dark themes.
  - `kinds` object: How to present every kind in `moments`, `coverage` and `profile.safety_kinds`.
  - `summary` MomentsSummary, required: Totals over `moments`, for the tab badge and the Overview card.
    - `moments` integer, required: The number of moments listed (`moments.length`).
    - `people` integer, required: The number of distinct subjects with moments, after merges.
    - `by_category` object, required: Moments listed per category id, for every category.
  - `can_regenerate` boolean: This caller may call `POST /v2/videos/{video_id}/moments/regenerate` now: the result is out of date or failed, nothing is recomputing it, a retry is allowed, and the caller may run analyses on the video. Always false for a reader who sees the video only because it is shared or a sample, and on the request route's answer.
  - `regenerate_credits` number: What a regeneration would cost now: what buying Moments for this video costs (per started minute of video, with a minimum), for a result out of date after an edit. `0` when it is free (a video whose Moments was bought, a first computation, a Retry after a failed regeneration, or a result out of date for another reason) or when `can_regenerate` is false. Ask for confirmation only when it is above `0`.
  - `request` MomentsPurchase: Moments can be bought for this video with `POST /v2/videos/{video_id}/moments/request`.
    - `credits` number, required: What the purchase costs this caller for this video.

## Other responses

- `202`: Successful Response
- `400`: The regeneration would be charged but the video has no duration to price it by. Nothing was charged or started.
- `401`: Missing, malformed or rejected credentials — no `X-API-Key` / `Authorization: Bearer <jwt>`, an expired token, or a caller that lacks the role the route requires. Note that this API answers *authorization* failures with 401 as well as 403 (see the 403 entry where a route declares both).
- `402`: Not enough credits, or a workspace budget refuses the charge. Nothing was charged or started.
- `404`: No such resource, or it is not visible to this caller. Ownership failures are reported as 404 rather than 403 so the API does not confirm the existence of another account's records.
- `422`: Validation Error
- `503`: The credits or budgets that would pay could not be checked, or the regeneration could not be completed after its charge. Retry: nothing more is charged.

## Changes

- **2026-11-14** `bb95ad806bdc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/changes/v2/videos/:video_id/moments/regenerate/post.md)

---

[API](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai.md) - [All operations](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/llms.txt) - [OpenAPI document](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/revisions/e3f80b0014bb?raw)
