## Clip videos given a start and end time **post** `/accounts/{account_id}/stream/clip` Clips a video based on the specified start and end times provided in seconds. ### Path Parameters - `account_id: string` The account identifier tag. ### Body Parameters - `clippedFromVideoUID: string` The unique video identifier (UID). - `endTimeSeconds: number` Specifies the end time for the video clip in seconds. - `startTimeSeconds: number` Specifies the start time for the video clip in seconds. - `allowedOrigins: optional array of AllowedOrigins` Lists the origins allowed to display the video. Enter allowed origin domains in an array and use `*` for wildcard subdomains. Empty arrays allow the video to be viewed on any origin. - `creator: optional string` A user-defined identifier for the media creator. - `maxDurationSeconds: optional number` The maximum duration in seconds for a video upload. Can be set for a video that is not yet uploaded to limit its duration. Uploads that exceed the specified duration will fail during processing. A value of `-1` means the value is unknown. - `requireSignedURLs: optional boolean` Indicates whether the video can be a accessed using the UID. When set to `true`, a signed token must be generated with a signing key to view the video. - `thumbnailTimestampPct: optional number` The timestamp for a thumbnail image calculated as a percentage value of the video's duration. To convert from a second-wise timestamp to a percentage, divide the desired timestamp by the total duration of the video. If this value is not set, the default thumbnail image is taken from 0s of the video. - `watermark: optional { uid }` - `uid: optional string` The unique identifier for the watermark profile. ### Returns - `errors: array of { code, message, documentation_url, source }` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional { pointer }` - `pointer: optional string` - `messages: array of { code, message, documentation_url, source }` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional { pointer }` - `pointer: optional string` - `success: true` Whether the API call was successful. - `true` - `result: optional Clip` - `allowedOrigins: optional array of AllowedOrigins` Lists the origins allowed to display the video. Enter allowed origin domains in an array and use `*` for wildcard subdomains. Empty arrays allow the video to be viewed on any origin. - `clippedFromVideoUID: optional string` The unique video identifier (UID). - `created: optional string` The date and time the clip was created. - `creator: optional string` A user-defined identifier for the media creator. - `endTimeSeconds: optional number` Specifies the end time for the video clip in seconds. - `maxDurationSeconds: optional number` The maximum duration in seconds for a video upload. Can be set for a video that is not yet uploaded to limit its duration. Uploads that exceed the specified duration will fail during processing. A value of `-1` means the value is unknown. - `meta: optional unknown` A user modifiable key-value store used to reference other systems of record for managing videos. - `modified: optional string` The date and time the live input was last modified. - `playback: optional { dash, hls }` - `dash: optional string` DASH Media Presentation Description for the video. - `hls: optional string` The HLS manifest for the video. - `preview: optional string` The video's preview page URI. This field is omitted until encoding is complete. - `requireSignedURLs: optional boolean` Indicates whether the video can be a accessed using the UID. When set to `true`, a signed token must be generated with a signing key to view the video. - `startTimeSeconds: optional number` Specifies the start time for the video clip in seconds. - `status: optional "pendingupload" or "downloading" or "queued" or 4 more` Specifies the processing status for all quality levels for a video. - `"pendingupload"` - `"downloading"` - `"queued"` - `"inprogress"` - `"ready"` - `"error"` - `"live-inprogress"` - `thumbnailTimestampPct: optional number` The timestamp for a thumbnail image calculated as a percentage value of the video's duration. To convert from a second-wise timestamp to a percentage, divide the desired timestamp by the total duration of the video. If this value is not set, the default thumbnail image is taken from 0s of the video. - `watermark: optional { uid }` - `uid: optional string` The unique identifier for the watermark profile. ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/stream/clip \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "clippedFromVideoUID": "023e105f4ecef8ad9ca31a8372d0c353", "endTimeSeconds": 0, "startTimeSeconds": 0, "allowedOrigins": [ "example.com" ], "creator": "creator-id_abcde12345", "requireSignedURLs": true, "thumbnailTimestampPct": 0.529241 }' ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "allowedOrigins": [ "example.com" ], "clippedFromVideoUID": "023e105f4ecef8ad9ca31a8372d0c353", "created": "2014-01-02T02:20:00Z", "creator": "creator-id_abcde12345", "endTimeSeconds": 0, "maxDurationSeconds": 1, "meta": { "name": "video12345.mp4" }, "modified": "2014-01-02T02:20:00Z", "playback": { "dash": "https://customer-m033z5x00ks6nunl.cloudflarestream.com/ea95132c15732412d22c1476fa83f27a/manifest/video.mpd", "hls": "https://customer-m033z5x00ks6nunl.cloudflarestream.com/ea95132c15732412d22c1476fa83f27a/manifest/video.m3u8" }, "preview": "https://customer-m033z5x00ks6nunl.cloudflarestream.com/ea95132c15732412d22c1476fa83f27a/watch", "requireSignedURLs": true, "startTimeSeconds": 0, "status": "inprogress", "thumbnailTimestampPct": 0.529241, "watermark": { "uid": "ea95132c15732412d22c1476fa83f27a" } } } ```