---
title: "Cut a person out of a stretch of a video"
description: "Cuts the person (or people) out of `from`–`to` seconds of a ready\nvideo (at most 6 s, snapped to its frames), so a composition can put\ntext behind them: a matte model (MODNet, run by Mosio; it separates\nthe subject and makes no new imagery) writes a transparent VP9 WebM\nof that stretch, about 20–25 s per second of footage. One at a time\nper workspace, 20 a day, counted in the media space. The answer comes\nat once with `status: processing`; `GET /v1/media/{id}` lists the\ncutout with its status and, once ready, a snippet: the base clip of\nthe same video, the text, then the cutout clip at `path`, in the same\nbox and time. Needs the `videos:create` permission.\n"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.mosio.me/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Mosio REST API › Videos

`POST /v1/media/{id}/cutouts`

Cuts the person (or people) out of `from`–`to` seconds of a ready
video (at most 6 s, snapped to its frames), so a composition can put
text behind them: a matte model (MODNet, run by Mosio; it separates
the subject and makes no new imagery) writes a transparent VP9 WebM
of that stretch, about 20–25 s per second of footage. One at a time
per workspace, 20 a day, counted in the media space. The answer comes
at once with `status: processing`; `GET /v1/media/{id}` lists the
cutout with its status and, once ready, a snippet: the base clip of
the same video, the text, then the cutout clip at `path`, in the same
box and time. Needs the `videos:create` permission.

## Authentication

- `apiKey`, apiKey, in header, header `x-api-key`

## Path parameters

- `id` (`createCutout.path.id`; string, required) — The video's id (`upl_…`) or its path (`assets/media/upl_….mp4`).

## Request body

_Required._

- `from` (`createCutout.from`; number, required) — Where the stretch starts in the video, in seconds.
  - min 0
- `to` (`createCutout.to`; number, required) — Where it ends, in seconds (at most 6 s after `from`).

## Example request

```json
{
  "from": 0,
  "to": 0
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://app.mosio.me/v1/media/<id>/cutouts' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "from": 0,
  "to": 0
}
'
```

### TypeScript

```typescript
const url = 'https://app.mosio.me/v1/media/<id>/cutouts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'x-api-key': '<x-api-key>'},
  body: JSON.stringify({from: 0, to: 0})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.mosio.me/v1/media/<id>/cutouts"

payload = {
    "from": 0,
    "to": 0
}
headers = {
    "Content-Type": "application/json",
    "x-api-key": "<x-api-key>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 202

The cutout, being made.

#### Example

```json
{
  "id": "cut_6f1d2c3b-0a4e-4b8f-9c21-5d6e7f8a9b0c",
  "media_id": "string",
  "path": "assets/media/cut_6f1d2c3b-0a4e-4b8f-9c21-5d6e7f8a9b0c.webm",
  "from": 0,
  "to": 0,
  "duration_seconds": 0,
  "status": "processing",
  "error": "string",
  "poster_url": "string",
  "width": 0,
  "height": 0,
  "snippet": "string",
  "created_at": "2019-08-24T14:15:22Z"
}
```

- `id` (`createCutout.response.202.id`; string, required)
  - example `"cut_6f1d2c3b-0a4e-4b8f-9c21-5d6e7f8a9b0c"`
- `media_id` (`createCutout.response.202.media_id`; string, required) — The video it was cut from.
- `path` (`createCutout.response.202.path`; string, required) — The path a composition uses for the cutout clip.
  - example `"assets/media/cut_6f1d2c3b-0a4e-4b8f-9c21-5d6e7f8a9b0c.webm"`
- `from` (`createCutout.response.202.from`; number, required)
- `to` (`createCutout.response.202.to`; number, required)
- `duration_seconds` (`createCutout.response.202.duration_seconds`; number, required)
- `status` (`createCutout.response.202.status`; string, required)
  - one of `"processing"`, `"ready"`, `"failed"`
- `error` (`createCutout.response.202.error`; string | null, required) — Why it failed, for the user.
- `poster_url` (`createCutout.response.202.poster_url`; string | null, required) — A still from the middle, transparent around the person (short-lived URL).
- `width` (`createCutout.response.202.width`; integer | null, required)
- `height` (`createCutout.response.202.height`; integer | null, required)
- `snippet` (`createCutout.response.202.snippet`; string | null, required) — A ready-to-paste base clip, text and cutout clip for this stretch.
- `created_at` (`createCutout.response.202.created_at`; string, required)
  - format `date-time`

### 400

The request body is not valid JSON or does not match the schema.

#### Example

```json
{
  "error": "unauthorized",
  "message": "string",
  "details": null
}
```

- `error` (`createCutout.response.400.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`createCutout.response.400.message`; string, required) — A message for people, in Indonesian.
- `details` (`createCutout.response.400.details`; unknown, optional) — More about the error, such as the fields to fix.

### 401

The API key is missing or not valid.

#### Example

```json
{
  "error": "unauthorized",
  "message": "Kirim API key di header x-api-key."
}
```

- `error` (`createCutout.response.401.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`createCutout.response.401.message`; string, required) — A message for people, in Indonesian.
- `details` (`createCutout.response.401.details`; unknown, optional) — More about the error, such as the fields to fix.

### 404

No such video or file in this workspace.

#### Example

```json
{
  "error": "unauthorized",
  "message": "string",
  "details": null
}
```

- `error` (`createCutout.response.404.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`createCutout.response.404.message`; string, required) — A message for people, in Indonesian.
- `details` (`createCutout.response.404.details`; unknown, optional) — More about the error, such as the fields to fix.

### 422

Not a video (`cutout_not_video`) or the stretch is not valid (`cutout_range`).

#### Example

```json
{
  "error": "unauthorized",
  "message": "string",
  "details": null
}
```

- `error` (`createCutout.response.422.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`createCutout.response.422.message`; string, required) — A message for people, in Indonesian.
- `details` (`createCutout.response.422.details`; unknown, optional) — More about the error, such as the fields to fix.

### 429

Another cutout is being made (`cutout_busy`), or the daily limit is reached (`cutout_limit`).

#### Example

```json
{
  "error": "unauthorized",
  "message": "string",
  "details": null
}
```

- `error` (`createCutout.response.429.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`createCutout.response.429.message`; string, required) — A message for people, in Indonesian.
- `details` (`createCutout.response.429.details`; unknown, optional) — More about the error, such as the fields to fix.


Source: https://docs.mosio.me/api/create-cutout/index.md
