Stream

stream

Methods

List Videos -> SinglePage<>
get/accounts/{account_id}/stream

Lists up to 1000 videos from a single request. For a specific range, refer to the optional parameters.

Retrieve Video Details -> Envelope<>
get/accounts/{account_id}/stream/{identifier}

Fetches details for a single video.

Initiate Video Uploads Using Tus ->
post/accounts/{account_id}/stream

Initiates a video upload using the TUS protocol. On success, the server responds with a status code 201 (created) and includes a location header to indicate where the content should be uploaded. Refer to https://tus.io for protocol details.

Edit Video Details -> Envelope<>
post/accounts/{account_id}/stream/{identifier}

Edit details for a single video.

Delete Video ->
delete/accounts/{account_id}/stream/{identifier}

Deletes a video and its copies from Cloudflare Stream.

Domain types

AllowedOrigins = string
Video = { allowedOrigins, created, creator, 20 more... }
Stream

Audio Tracks

stream.audio_tracks

Methods

List Additional Audio Tracks On A Video -> SinglePage<>
get/accounts/{account_id}/stream/{identifier}/audio

Lists additional audio tracks on a video. Note this API will not return information for audio attached to the video upload.

Edit Additional Audio Tracks On A Video -> Envelope<>
patch/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}

Edits additional audio tracks on a video. Editing the default status of an audio track to true will mark all other audio tracks on the video default status to false.

Delete Additional Audio Tracks On A Video -> Envelope<string>
delete/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}

Deletes additional audio tracks on a video. Deleting a default audio track is not allowed. You must assign another audio track as default prior to deletion.

Add Audio Tracks To A Video -> Envelope<>
post/accounts/{account_id}/stream/{identifier}/audio/copy

Adds an additional audio track to a video using the provided audio track URL.

Domain types

Audio = { default, label, status, 1 more... }
Stream

Captions

stream.captions

Methods

List Captions Or Subtitles -> SinglePage<>
get/accounts/{account_id}/stream/{identifier}/captions

Lists the available captions or subtitles for a specific video.

Domain types

Caption = { generated, label, language, 1 more... }

stream.captions.language

Methods

List Captions Or Subtitles For A Provided Language -> Envelope<>
get/accounts/{account_id}/stream/{identifier}/captions/{language}

Lists the captions or subtitles for provided language.

Generate Captions Or Subtitles For A Provided Language Via AI -> Envelope<>
post/accounts/{account_id}/stream/{identifier}/captions/{language}/generate

Generate captions or subtitles for provided language via AI.

Upload Captions Or Subtitles -> Envelope<>
put/accounts/{account_id}/stream/{identifier}/captions/{language}

Uploads the caption or subtitle file to the endpoint for a specific BCP47 language. One caption or subtitle file per language is allowed.

Delete Captions Or Subtitles -> Envelope<string>
delete/accounts/{account_id}/stream/{identifier}/captions/{language}

Removes the captions or subtitles from a video.

stream.captions.language.vtt

Methods

Return Web Vtt Captions For A Provided Language -> string
get/accounts/{account_id}/stream/{identifier}/captions/{language}/vtt

Return WebVTT captions for a provided language.

Stream

Clip

stream.clip

Methods

Clip Videos Given A Start And End Time -> Envelope<>
post/accounts/{account_id}/stream/clip

Clips a video based on the specified start and end times provided in seconds.

Domain types

Clip = { allowedOrigins, clippedFromVideoUID, created, 12 more... }
Stream

Copy

stream.copy

Methods

Upload Videos From A URL -> Envelope<>
post/accounts/{account_id}/stream/copy

Uploads a video to Stream from a provided URL.

Stream

Direct Upload

stream.direct_upload

Methods

Upload Videos Via Direct Upload URLs -> Envelope<{ scheduledDeletion, uid, uploadURL, 1 more... }>
post/accounts/{account_id}/stream/direct_upload

Creates a direct upload that allows video uploads without an API key.

Stream

Downloads

stream.downloads

Methods

List Downloads -> Envelope<unknown>
get/accounts/{account_id}/stream/{identifier}/downloads

Lists the downloads created for a video.

Create Downloads -> Envelope<unknown>
post/accounts/{account_id}/stream/{identifier}/downloads

Creates a download for a video when a video is ready to view. Use /downloads/{download_type} instead for type-specific downloads. Available types are default and audio.

Delete Downloads -> Envelope<string>
delete/accounts/{account_id}/stream/{identifier}/downloads

Delete the downloads for a video. Use /downloads/{download_type} instead for type-specific downloads. Available types are default and audio.

Stream

Embed

stream.embed

Methods

Retrieve Embed Code HTML -> string
get/accounts/{account_id}/stream/{identifier}/embed

Fetches an HTML code snippet to embed a video in a web page delivered through Cloudflare. On success, returns an HTML fragment for use on web pages to display a video. On failure, returns a JSON response body.

Stream

Keys

stream.keys

Methods

List Signing Keys -> SinglePage<{ id, created }>
get/accounts/{account_id}/stream/keys

Lists the video ID and creation date and time when a signing key was created.

Create Signing Keys -> Envelope<>
post/accounts/{account_id}/stream/keys

Creates an RSA private key in PEM and JWK formats. Key files are only displayed once after creation. Keys are created, used, and deleted independently of videos, and every key can sign any video.

Delete Signing Keys -> Envelope<string>
delete/accounts/{account_id}/stream/keys/{identifier}

Deletes signing keys and revokes all signed URLs generated with the key.

Domain types

Keys = { id, created, jwk, 1 more... }
Stream

Live Inputs

stream.live_inputs

Methods

List Live Inputs -> Envelope<{ liveInputs, range, total }>
get/accounts/{account_id}/stream/live_inputs

Lists the live inputs created for an account. To get the credentials needed to stream to a specific live input, request a single live input.

Retrieve A Live Input -> Envelope<>
get/accounts/{account_id}/stream/live_inputs/{live_input_identifier}

Retrieves details of an existing live input.

Create A Live Input -> Envelope<>
post/accounts/{account_id}/stream/live_inputs

Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.

Security

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Accepted Permissions (at least one required)

Stream Write

path Parameters
account_id: string
(maxLength: 32)

Identifier.

Response fields
errors: Array<{ code, message, documentation_url, 1 more... }>
messages: Array<{ code, message, documentation_url, 1 more... }>
success: true

Whether the API call was successful.

result:
Optional

Details about a live input.

Request example
200Example
Update A Live Input -> Envelope<>
put/accounts/{account_id}/stream/live_inputs/{live_input_identifier}

Updates a specified live input.

Delete A Live Input ->
delete/accounts/{account_id}/stream/live_inputs/{live_input_identifier}

Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls.

Domain types

LiveInput = { created, deleteRecordingAfterDays, meta, 10 more... }

Details about a live input.

stream.live_inputs.outputs

Methods

List All Outputs Associated With A Specified Live Input -> SinglePage<>
get/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs

Retrieves all outputs associated with a specified live input.

Create A New Output Connected To A Live Input -> Envelope<>
post/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs

Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live input — one live input can have many outputs.

Update An Output -> Envelope<>
put/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs/{output_identifier}

Updates the state of an output.

Delete An Output ->
delete/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs/{output_identifier}

Deletes an output and removes it from the associated live input.

Domain types

Output = { enabled, streamKey, uid, 1 more... }
Stream

Token

stream.token

Methods

Create Signed URL Tokens For Videos -> Envelope<{ token }>
post/accounts/{account_id}/stream/{identifier}/token

Creates a signed URL token for a video. If a body is not provided in the request, a token is created with default values.

Stream

Videos

stream.videos

Methods

Storage Use -> Envelope<{ creator, totalStorageMinutes, totalStorageMinutesLimit, 1 more... }>
get/accounts/{account_id}/stream/storage-usage

Returns information about an account's storage use.

Stream

Watermarks

stream.watermarks

Methods

List Watermark Profiles -> SinglePage<>
get/accounts/{account_id}/stream/watermarks

Lists all watermark profiles for an account.

Watermark Profile Details -> Envelope<>
get/accounts/{account_id}/stream/watermarks/{identifier}

Retrieves details for a single watermark profile.

Create Watermark Profiles Via Basic Upload -> Envelope<>
post/accounts/{account_id}/stream/watermarks

Creates watermark profiles using a single HTTP POST multipart/form-data request.

Delete Watermark Profiles -> Envelope<string>
delete/accounts/{account_id}/stream/watermarks/{identifier}

Deletes a watermark profile.

Domain types

Watermark = { created, downloadedFrom, height, 8 more... }
Stream

Webhooks

stream.webhooks

Methods

View Webhooks -> Envelope<unknown>
get/accounts/{account_id}/stream/webhook

Retrieves a list of webhooks.

Create Webhooks -> Envelope<unknown>
put/accounts/{account_id}/stream/webhook

Creates a webhook notification.

Delete Webhooks -> Envelope<string>
delete/accounts/{account_id}/stream/webhook

Deletes a webhook.