Skip to content
Start here

Stream

List videos
GET/accounts/{account_id}/stream
Retrieve video details
GET/accounts/{account_id}/stream/{identifier}
Initiate video uploads using TUS
POST/accounts/{account_id}/stream
Edit video details
POST/accounts/{account_id}/stream/{identifier}
Delete video
DELETE/accounts/{account_id}/stream/{identifier}
ModelsExpand Collapse
AllowedOrigins = string
Video { allowedOrigins, clippedFrom, created, 23 more }
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.

clippedFrom: optional string

The unique identifier of the source video this video was clipped from.

created: optional string

The date and time the media item was created.

formatdate-time
creator: optional string

A user-defined identifier for the media creator.

maxLength64
duration: optional number

The duration of the video in seconds. A value of -1 means the duration is unknown. The duration becomes available after the upload and before the video is ready.

input: optional { height, width }
height: optional number

The video height in pixels. A value of -1 means the height is unknown. The value becomes available after the upload and before the video is ready.

width: optional number

The video width in pixels. A value of -1 means the width is unknown. The value becomes available after the upload and before the video is ready.

liveInput: optional string

The live input ID used to upload a video with Stream Live.

maxLength32
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.

maximum36000
minimum1
maxSizeBytes: optional number

The maximum size in bytes for the video upload.

formatint64
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 media item was last modified.

formatdate-time
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.

formaturi
publicDetails: optional { channel_link, logo, media_id, 2 more }

Public details for the video including title, share link, channel link, and logo.

media_id: optional number
title: optional string
readyToStream: optional boolean

Indicates whether the video is playable. The field is empty if the video is not ready for viewing or the live stream is still in progress.

readyToStreamAt: optional string

Indicates the time at which the video became playable. The field is empty if the video is not ready for viewing or the live stream is still in progress.

formatdate-time
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.

scheduledDeletion: optional string

Indicates the date and time at which the video will be deleted. Omit the field to indicate no change, or include with a null value to remove an existing scheduled deletion. If specified, must be at least 30 days from upload time.

formatdate-time
size: optional number

The size of the media item in bytes.

status: optional { errorReasonCode, errorReasonText, pctComplete, state }

Specifies a detailed status for a video. If the state is inprogress or error, the step field returns encoding or manifest. If the state is inprogress, pctComplete returns a number between 0 and 100 to indicate the approximate percent of completion. If the state is error, errorReasonCode and errorReasonText provide additional details.

errorReasonCode: optional string

Specifies why the video failed to encode. This field is empty if the video is not in an error state. Preferred for programmatic use.

errorReasonText: optional string

Specifies why the video failed to encode using a human readable error message in English. This field is empty if the video is not in an error state.

pctComplete: optional string

Indicates the progress as a percentage between 0 and 100.

state: optional "pendingupload" or "downloading" or "queued" or 4 more

Specifies the processing status for all quality levels for a video.

One of the following:
"pendingupload"
"downloading"
"queued"
"inprogress"
"ready"
"error"
"live-inprogress"
thumbnail: optional string

The media item’s thumbnail URI. This field is omitted until encoding is complete.

formaturi
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.

maximum1
minimum0
uid: optional string

A Cloudflare-generated unique identifier for a media item.

maxLength32
uploaded: optional string

The date and time the media item was uploaded.

formatdate-time
uploadExpiry: optional string

The date and time when the video upload URL is no longer valid for direct user uploads.

formatdate-time
watermark: optional Watermark { created, downloadedFrom, height, 8 more }

StreamAudio Tracks

List additional audio tracks on a video
GET/accounts/{account_id}/stream/{identifier}/audio
Edit additional audio tracks on a video
PATCH/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}
Delete additional audio tracks on a video
DELETE/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}
Add audio tracks to a video
POST/accounts/{account_id}/stream/{identifier}/audio/copy
ModelsExpand Collapse
Audio { default, label, status, uid }
default: optional boolean

Denotes whether the audio track will be played by default in a player.

label: optional string

A string to uniquely identify the track amongst other audio track labels for the specified video.

status: optional "queued" or "ready" or "error"

Specifies the processing status of the video.

One of the following:
"queued"
"ready"
"error"
uid: optional string

A Cloudflare-generated unique identifier for a media item.

maxLength32
AudioTrackGetResponse { audio }
audio: optional array of Audio { default, label, status, uid }

Array of audio tracks for the video.

default: optional boolean

Denotes whether the audio track will be played by default in a player.

label: optional string

A string to uniquely identify the track amongst other audio track labels for the specified video.

status: optional "queued" or "ready" or "error"

Specifies the processing status of the video.

One of the following:
"queued"
"ready"
"error"
uid: optional string

A Cloudflare-generated unique identifier for a media item.

maxLength32
AudioTrackDeleteResponse = string

StreamVideos

Storage use
GET/accounts/{account_id}/stream/storage-usage
ModelsExpand Collapse
VideoStorageUsageResponse { creator, totalStorageMinutes, totalStorageMinutesLimit, videoCount }
creator: optional string

A user-defined identifier for the media creator.

maxLength64
totalStorageMinutes: optional number

The total minutes of video content stored in the account. May contain decimal values.

formatfloat
totalStorageMinutesLimit: optional number

The storage capacity alloted for the account.

videoCount: optional number

The total count of videos associated with the account.

StreamClip

Clip videos given a start and end time
POST/accounts/{account_id}/stream/clip
ModelsExpand Collapse
Clip { allowedOrigins, clippedFromVideoUID, created, 12 more }
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).

maxLength32
created: optional string

The date and time the clip was created.

formatdate-time
creator: optional string

A user-defined identifier for the media creator.

maxLength64
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.

maximum36000
minimum1
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.

formatdate-time
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.

formaturi
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.

One of the following:
"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.

maximum1
minimum0
watermark: optional { uid }
uid: optional string

The unique identifier for the watermark profile.

maxLength32

StreamCopy

Upload videos from a URL
POST/accounts/{account_id}/stream/copy

StreamDirect Upload

Upload videos via direct upload URLs
POST/accounts/{account_id}/stream/direct_upload
ModelsExpand Collapse
DirectUploadCreateResponse { scheduledDeletion, uid, uploadURL, watermark }
scheduledDeletion: optional string

Indicates the date and time at which the video will be deleted. Omit the field to indicate no change, or include with a null value to remove an existing scheduled deletion. If specified, must be at least 30 days from upload time.

formatdate-time
uid: optional string

A Cloudflare-generated unique identifier for a media item.

maxLength32
uploadURL: optional string

The URL an unauthenticated upload can use for a single HTTP POST multipart/form-data request.

watermark: optional Watermark { created, downloadedFrom, height, 8 more }

StreamKeys

List signing keys
GET/accounts/{account_id}/stream/keys
Create signing keys
POST/accounts/{account_id}/stream/keys
Delete signing keys
DELETE/accounts/{account_id}/stream/keys/{identifier}
ModelsExpand Collapse
Keys { id, created, jwk, pem }
id: optional string

Identifier.

maxLength32
created: optional string

The date and time a signing key was created.

formatdate-time
jwk: optional string

The signing key in JWK format.

pem: optional string

The signing key in PEM format.

KeyGetResponse { id, created, key_id }
id: optional string

Identifier.

maxLength32
created: optional string

The date and time a signing key was created.

formatdate-time
key_id: optional string

The unique identifier for the signing key.

KeyDeleteResponse = string

StreamLive Inputs

List live inputs
GET/accounts/{account_id}/stream/live_inputs
Retrieve a live input
GET/accounts/{account_id}/stream/live_inputs/{live_input_identifier}
Create a live input
POST/accounts/{account_id}/stream/live_inputs
Update a live input
PUT/accounts/{account_id}/stream/live_inputs/{live_input_identifier}
Delete a live input
DELETE/accounts/{account_id}/stream/live_inputs/{live_input_identifier}
ModelsExpand Collapse
LiveInput { created, deleteRecordingAfterDays, enabled, 11 more }

Details about a live input.

created: optional string

The date and time the live input was created.

formatdate-time
deleteRecordingAfterDays: optional number

Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a null value to remove an existing scheduled deletion.

minimum30
enabled: optional boolean

Indicates whether the live input is enabled and can accept streams.

meta: optional unknown

A user modifiable key-value store used to reference other systems of record for managing live inputs.

modified: optional string

The date and time the live input was last modified.

formatdate-time
recording: optional { allowedOrigins, hideLiveViewerCount, mode, 2 more }

Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.

allowedOrigins: optional array of string

Lists the origins allowed to display videos created with this input. Enter allowed origin domains in an array and use * for wildcard subdomains. An empty array allows videos to be viewed on any origin.

hideLiveViewerCount: optional boolean

Disables reporting the number of live viewers when this property is set to true.

mode: optional "off" or "automatic"

Specifies the recording behavior for the live input. Set this value to off to prevent a recording. Set the value to automatic to begin a recording and transition to on-demand after Stream Live stops receiving input.

One of the following:
"off"
"automatic"
requireSignedURLs: optional boolean

Indicates if a video using the live input has the requireSignedURLs property set. Also enforces access controls on any video recording of the livestream with the live input.

timeoutSeconds: optional number

Determines the amount of time a live input configured in automatic mode should wait before a recording transitions from live to on-demand. 0 is recommended for most use cases and indicates the platform default should be used.

rtmps: optional { streamKey, url }

Details for streaming to an live input using RTMPS.

streamKey: optional string

The secret key to use when streaming via RTMPS to a live input.

url: optional string

The RTMPS URL you provide to the broadcaster, which they stream live video to.

rtmpsPlayback: optional { streamKey, url }

Details for playback from an live input using RTMPS.

streamKey: optional string

The secret key to use for playback via RTMPS.

url: optional string

The URL used to play live video over RTMPS.

srt: optional { passphrase, streamId, url }

Details for streaming to a live input using SRT.

passphrase: optional string

The secret key to use when streaming via SRT to a live input.

streamId: optional string

The identifier of the live input to use when streaming via SRT.

url: optional string

The SRT URL you provide to the broadcaster, which they stream live video to.

srtPlayback: optional { passphrase, streamId, url }

Details for playback from an live input using SRT.

passphrase: optional string

The secret key to use for playback via SRT.

streamId: optional string

The identifier of the live input to use for playback via SRT.

url: optional string

The URL used to play live video over SRT.

status: optional "connected" or "reconnected" or "reconnecting" or 5 more

The connection status of a live input.

One of the following:
"connected"
"reconnected"
"reconnecting"
"client_disconnect"
"ttl_exceeded"
"failed_to_connect"
"failed_to_reconnect"
"new_configuration_accepted"
uid: optional string

A unique identifier for a live input.

maxLength32
webRTC: optional { url }

Details for streaming to a live input using WebRTC.

url: optional string

The WebRTC URL you provide to the broadcaster, which they stream live video to.

webRTCPlayback: optional { url }

Details for playback from a live input using WebRTC.

url: optional string

The URL used to play live video over WebRTC.

LiveInputListResponse { liveInputs, range, total }
liveInputs: optional array of { created, deleteRecordingAfterDays, enabled, 3 more }
created: optional string

The date and time the live input was created.

formatdate-time
deleteRecordingAfterDays: optional number

Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a null value to remove an existing scheduled deletion.

minimum30
enabled: optional boolean

Indicates whether the live input is enabled and can accept streams.

meta: optional unknown

A user modifiable key-value store used to reference other systems of record for managing live inputs.

modified: optional string

The date and time the live input was last modified.

formatdate-time
uid: optional string

A unique identifier for a live input.

maxLength32
range: optional number

The total number of remaining live inputs based on cursor position.

total: optional number

The total number of live inputs that match the provided filters.

StreamLive InputsOutputs

List all outputs associated with a specified live input
GET/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs
Create a new output, connected to a live input
POST/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs
Update an output
PUT/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs/{output_identifier}
Delete an output
DELETE/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs/{output_identifier}
ModelsExpand Collapse
Output { enabled, streamKey, uid, url }
enabled: optional boolean

When enabled, live video streamed to the associated live input will be sent to the output URL. When disabled, live video will not be sent to the output URL, even when streaming to the associated live input. Use this to control precisely when you start and stop simulcasting to specific destinations like YouTube and Twitch.

streamKey: optional string

The streamKey used to authenticate against an output’s target.

uid: optional string

A unique identifier for the output.

maxLength32
url: optional string

The URL an output uses to restream.

StreamWatermarks

List watermark profiles
GET/accounts/{account_id}/stream/watermarks
Watermark profile details
GET/accounts/{account_id}/stream/watermarks/{identifier}
Create watermark profiles via basic upload
POST/accounts/{account_id}/stream/watermarks
Delete watermark profiles
DELETE/accounts/{account_id}/stream/watermarks/{identifier}
ModelsExpand Collapse
Watermark { created, downloadedFrom, height, 8 more }
created: optional string

The date and a time a watermark profile was created.

formatdate-time
downloadedFrom: optional string

The source URL for a downloaded image. If the watermark profile was created via direct upload, this field is null.

height: optional number

The height of the image in pixels.

name: optional string

A short description of the watermark profile.

opacity: optional number

The translucency of the image. A value of 0.0 makes the image completely transparent, and 1.0 makes the image completely opaque. Note that if the image is already semi-transparent, setting this to 1.0 will not make the image completely opaque.

maximum1
minimum0
padding: optional number

The whitespace between the adjacent edges (determined by position) of the video and the image. 0.0 indicates no padding, and 1.0 indicates a fully padded video width or length, as determined by the algorithm.

maximum1
minimum0
position: optional string

The location of the image. Valid positions are: upperRight, upperLeft, lowerLeft, lowerRight, and center. Note that center ignores the padding parameter.

scale: optional number

The size of the image relative to the overall size of the video. This parameter will adapt to horizontal and vertical videos automatically. 0.0 indicates no scaling (use the size of the image as-is), and 1.0 fills the entire video.

maximum1
minimum0
size: optional number

The size of the image in bytes.

uid: optional string

The unique identifier for a watermark profile.

maxLength32
width: optional number

The width of the image in pixels.

WatermarkDeleteResponse = string

StreamWebhooks

View webhooks
GET/accounts/{account_id}/stream/webhook
Create webhooks
PUT/accounts/{account_id}/stream/webhook
Delete webhooks
DELETE/accounts/{account_id}/stream/webhook
ModelsExpand Collapse
WebhookGetResponse { modified, notification_url, notificationUrl, secret }
modified: optional string

The date and time the webhook was last modified.

formatdate-time
notification_url: optional string

The URL where webhooks will be sent.

formaturi
notificationUrl: optional string

The URL where webhooks will be sent.

formaturi
secret: optional string

The secret used to verify webhook signatures.

WebhookUpdateResponse { modified, notification_url, notificationUrl, secret }
modified: optional string

The date and time the webhook was last modified.

formatdate-time
notification_url: optional string

The URL where webhooks will be sent.

formaturi
notificationUrl: optional string

The URL where webhooks will be sent.

formaturi
secret: optional string

The secret used to verify webhook signatures.

WebhookDeleteResponse = string

StreamCaptions

List captions or subtitles
GET/accounts/{account_id}/stream/{identifier}/captions
ModelsExpand Collapse
Caption { generated, label, language, status }
generated: optional boolean

Whether the caption was generated via AI.

label: optional string

The language label displayed in the native language to users.

language: optional string

The language tag in BCP 47 format.

status: optional "ready" or "inprogress" or "error"

The status of a generated caption.

One of the following:
"ready"
"inprogress"
"error"

StreamCaptionsLanguage

List captions or subtitles for a provided language
GET/accounts/{account_id}/stream/{identifier}/captions/{language}
Generate captions or subtitles for a provided language via AI
POST/accounts/{account_id}/stream/{identifier}/captions/{language}/generate
Upload captions or subtitles
PUT/accounts/{account_id}/stream/{identifier}/captions/{language}
Delete captions or subtitles
DELETE/accounts/{account_id}/stream/{identifier}/captions/{language}
ModelsExpand Collapse
LanguageDeleteResponse = string

StreamCaptionsLanguageVtt

Return WebVTT captions for a provided language
GET/accounts/{account_id}/stream/{identifier}/captions/{language}/vtt
ModelsExpand Collapse
VttGetResponse = string

StreamDownloads

List downloads
GET/accounts/{account_id}/stream/{identifier}/downloads
Create downloads
POST/accounts/{account_id}/stream/{identifier}/downloads
Delete downloads
DELETE/accounts/{account_id}/stream/{identifier}/downloads
ModelsExpand Collapse
DownloadGetResponse { audio, default }

An object with download type keys. Each key is optional and only present if that download type has been created.

audio: optional { percentComplete, status, url }

The audio-only download. Only present if this download type has been created.

percentComplete: number

Indicates the progress as a percentage between 0 and 100.

maximum100
minimum0
status: "ready" or "inprogress" or "error"

The status of a generated download.

One of the following:
"ready"
"inprogress"
"error"
url: optional string

The URL to access the generated download.

formaturi
default: optional { percentComplete, status, url }

The default video download. Only present if this download type has been created.

percentComplete: number

Indicates the progress as a percentage between 0 and 100.

maximum100
minimum0
status: "ready" or "inprogress" or "error"

The status of a generated download.

One of the following:
"ready"
"inprogress"
"error"
url: optional string

The URL to access the generated download.

formaturi
DownloadCreateResponse { audio, default }

An object with download type keys. Each key is optional and only present if that download type has been created.

audio: optional { percentComplete, status, url }

The audio-only download. Only present if this download type has been created.

percentComplete: number

Indicates the progress as a percentage between 0 and 100.

maximum100
minimum0
status: "ready" or "inprogress" or "error"

The status of a generated download.

One of the following:
"ready"
"inprogress"
"error"
url: optional string

The URL to access the generated download.

formaturi
default: optional { percentComplete, status, url }

The default video download. Only present if this download type has been created.

percentComplete: number

Indicates the progress as a percentage between 0 and 100.

maximum100
minimum0
status: "ready" or "inprogress" or "error"

The status of a generated download.

One of the following:
"ready"
"inprogress"
"error"
url: optional string

The URL to access the generated download.

formaturi
DownloadDeleteResponse = string

StreamEmbed

Retrieve embed Code HTML
GET/accounts/{account_id}/stream/{identifier}/embed
ModelsExpand Collapse
EmbedGetResponse = string

StreamToken

Create signed URL tokens for videos
POST/accounts/{account_id}/stream/{identifier}/token
ModelsExpand Collapse
TokenCreateResponse { token }
token: optional string

The signed token used with the signed URLs feature.