Stream

stream

Methods

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.

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

Deletes a video and its copies from Cloudflare Stream.

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

Edit details for a single video.

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

Fetches details for a single video.

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.

Domain types

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

Audio Tracks

stream.audio_tracks

Methods

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.

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.

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.

List Additional Audio Tracks On A Video -> Envelope<Array<>>
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.

Domain types

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

Captions

stream.captions

Methods

List Captions Or Subtitles -> Envelope<Array<>>
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

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.

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

Removes the captions or subtitles from a video.

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.

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.

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

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

Creates a download for a video when a video is ready to view.

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

Delete the downloads for a video.

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

Lists the downloads created for a video.

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

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.

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

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

Domain types

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

Live Inputs

stream.live_inputs

Methods

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.

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.

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

Retrieves details of an existing live input.

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 Stream Read

Parameters
account_id: string

Identifier

live_input_identifier: string

A unique identifier for a live input.

Response fields
errors: Array<>
messages: Array<>
success: true

Whether the API call was successful

result:
Optional

Details about a live input.

Request example
200Example
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.

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

Updates a specified live input.

Domain types

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

stream.live_inputs.outputs

Methods

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.

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.

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.

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

Updates the state of an output.

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

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.

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

Retrieves details for a single watermark profile.

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

Lists all watermark profiles for an account.

Domain types

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

Webhooks

stream.webhooks

Methods

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

Deletes a webhook.

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.