---
title: "Trim Video Endpoint"
method: PUT
path: "/v1/videos/{video_id}/trim"
tags: ["Video Emotion API"]
---

# Trim Video Endpoint

`PUT /v1/videos/{video_id}/trim`

## 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/v1/videos/{video_id}/trim`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Crop an uploaded video by trimming time off the beginning and/or the end.

On a processed video this drops the cut-out portion's faces, speakers,
transcript, and facial/audio/text emotion data by re-analyzing only the
kept window (timestamps re-based to the new start). The video re-enters
`processing`; poll the status endpoint for completion.

## Path parameters

- `video_id` string, required: Unique identifier of the video to crop

## Request body `application/x-www-form-urlencoded`

- BodyTrimVideoEndpointV1VideosVideoIdTrimPut
  - `start_millis` integer, required: Kept-window start in ms (seconds trimmed off the beginning).
  - `end_millis` integer, required: Kept-window end in ms (> start_millis, <= video duration).
  - `callback_url` string, nullable: Optional callback url notified when reprocessing completes. Must be an https URL on a publicly reachable host.

## Response `200`

Successful Response

- TrimVideoResponse: Result of a trim request — the video re-enters processing.
  - `id` string, required
  - `status` string, required
  - `message` string, required

## Other responses

- `422`: Request validation failed (`{"detail": str}` only), or `processing_fps_over_budget`: the video is too long to process at its frame rate. Nothing was charged. The body then also offers the frame rates that fit (`recommended_processing_fps`, `fits_processing_fps`) and each tier's longest video (`duration_s`, `max_duration_by_fps`), so the client can suggest a lower frame rate or a trim.

## Changes

- **2026-11-06** `bc15cec7e794`: 1 breaking, 7 info
  - the `detail` response's property type changed from `array` to `string` for status `422`
  - added the optional property `code` to the response with the `422` status
  - added the optional property `duration_s` to the response with the `422` status
  - added the optional property `fits_processing_fps` to the response with the `422` status
  - …4 more
- **2026-08-20** `74ceee4a5c98`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/changes/v1/videos/:video_id/trim/put.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/bc15cec7e794?raw)
