---
title: "Create Media from Trims"
method: POST
path: "/medias/{mediaHashedId}/trims"
tags: ["Trims"]
---

# Create Media from Trims

`POST /medias/{mediaHashedId}/trims`

## Request

- Base URL: `https://api.wistia.com/modern`
- URL: `https://api.wistia.com/modern/medias/{mediaHashedId}/trims`
- Auth: HTTP bearer

Creates a new media that trims off parts of an existing media.

By default, the `trims` parameter specifies time ranges to **remove** from the media. When `keep_trims` is set to `true`, the `trims` parameter instead specifies time ranges to **keep** in the media.

**NOTE:** currently this endpoint only supports trimming video files.

## Requires api token with one of the following permissions
```
Read, update & delete anything
```

Tokens with the "Act with a team member's permissions" permission
(`all:delegate_to_contact_permissions` scope) can also be used. Requests
made with such a token are authorized using the permissions of the
contact assigned to the token.

An [expiring access token](https://docs.wistia.com/reference/post_expiring-token)
created with the `all:delegate_to_contact_permissions` scope and an
authorization granting the `edit` permission on this media can also be used.

## Path parameters

- `mediaHashedId` string, required

## Headers

- `X-Wistia-API-Version` string, required

## Request body

- object
  - `trims` string[], required: An array of strings matching the format of HH:MM:SS.mmm-HH:MM:SS.mmm where HH is hours, MM is minutes, SS is seconds and mmm is milliseconds. When keep_trims is false (default), the ranges specify parts of the media to remove. When keep_trims is true, the ranges specify parts of the media to keep.
  - `keep_trims` boolean: When set to true, the trims parameter is treated as ranges to keep rather than ranges to remove. Defaults to false.

## Response `200`

Successful queueing of trims worker.

- object
  - `background_job_status` object: A background job keeps track of the progress of an asynchronous task, e.g bulk archiving media, translating media, etc.
    - `id` integer, required: The ID of the background job that's been queued for the request.
    - `hashed_id` string, required: The unguessable hashed ID of the background job. Prefer this over the numeric ID when polling for status.
    - `status` 'queued' | 'started' | 'finished' | 'failed', required: The status of the background job that's been queued for the request.

## Other responses

- `401`: Unauthorized, invalid or missing token
- `403`: Forbidden, token is valid but account does not have access to feature
- `404`: Resource not found
- `422`: Unprocessable entity, the request parameters were invalid.
- `500`: Internal server error

## Changes

- **2026-11-03** `b86cb2a7b420`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/wistia/apis/data-api/changes/medias/:mediaHashedId/trims/post.md)

---

[API](https://skmtc.dev/wistia/apis/data-api.md) - [All operations](https://skmtc.dev/wistia/apis/data-api/llms.txt) - [OpenAPI document](https://skmtc.dev/wistia/apis/data-api/revisions/b86cb2a7b420?raw)
