Initiate video uploads using TUS
client.stream.create(StreamCreateParams { account_id, body, tusResumable, 4 more } params, RequestOptionsoptions?): void
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.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Initiate video uploads using TUS
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
await client.stream.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
body: {},
'Tus-Resumable': '1.0.0',
'Upload-Length': 0,
});{}Returns Examples
{}