---
title: "Create clip"
method: POST
path: "/cameras/{camera_id}/clips/"
tags: ["clip"]
---

# Create clip

`POST /cameras/{camera_id}/clips/`

## Request

- Base URL: `https://api.angelcam.com/v1`
- URL: `https://api.angelcam.com/v1/cameras/{camera_id}/clips/`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://my.angelcam.com/oauth/authorize/`, token URL `https://my.angelcam.com/oauth/token/`
    - Password, token URL `https://api.angelcam.com/oauth/token/`
    - Scopes: `recording_clips_access`, `recording_clips_create`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/angelcam/apis/angelcam-api/docs/cameras/:camera_id/clips/post.ts> (a function with typed inputs; its response is checked against the schema)

Request creation of a recording clip for the given camera. Clip processing is **asynchronous** — the response will have status `PENDING`. Poll `cameras/{camera_id}/clips/{clip_id}/` until status reaches `READY` or `ERROR`. The maximum clip length is 3 hours.

## Path parameters

- `camera_id` integer, required

## Request body

- object
  - `name` string, required: Clip name
  - `start` string, date-time, required: Start time of clip (ISO 8601)
  - `end` string, date-time, required: End time of clip (ISO 8601)
  - `recording` string, uuid: Optional recording_id; if not specified, continuous recording will be used

## Response `201`

Clip request was received and clip processing will start

- ClipObject
  - `id` string, required: Clip UUID
  - `created_by` integer, required: User who created the clip
  - `created_at` string, required: Time when the clip was created
  - `name` string, required: Clip name
  - `status` 'PENDING' | 'BUILDING' | 'SCREENSHOTTING' | 'READY' | 'ERROR', required: Status of clip processing
  - `start` string, required: Start time of the clip
  - `end` string, required: End time of the clip
  - `sharing_token` string, required: Security token for sharing the clip without authentication (UUID)
  - `snapshots` string[], required: List of URLs of snapshot images (JPEG) taken from the beginning of the clip. The snapshots are generated automatically during clip processing and can be used as a thumbnail/preview of the clip. The list is empty until the clip reaches the `SCREENSHOTTING` stage, and it may stay empty if the snapshot could not be taken. The URLs contain a security token valid for a limited time.
  - `download_url` string, required: URL for download of the clip as TS/MP4 file (TS for HLS cameras, MP4 for MJPEG cameras). The URL contains security token valid for a limited time.

## Other responses

- `400`: The request is invalid. Common reasons: no recording footage exists for the requested time range, or the requested clip length exceeds the 3 hour maximum.
- `401`: Missing or invalid authorization.
- `403`: Missing permission.

---

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