## Initiate video uploads using TUS `client.stream.create(StreamCreateParamsparams, 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. ### Parameters - `params: StreamCreateParams` - `account_id: string` Path param: The account identifier tag. - `body: unknown` Body param - `tusResumable: "1.0.0"` Header param: Specifies the TUS protocol version. This value must be included in every upload request. Notes: The only supported version of TUS protocol is 1.0.0. - `"1.0.0"` - `uploadLength: number` Header param: Indicates the size of the entire upload in bytes. The value must be a non-negative integer. - `direct_user?: boolean` Query param: Provisions a URL to let your end users upload videos directly to Cloudflare Stream without exposing your API token to clients. - `uploadCreator?: string` Header param: A user-defined identifier for the media creator. - `uploadMetadata?: string` Header param: Comma-separated key-value pairs following the TUS protocol specification. Values are Base-64 encoded. Supported keys: `name`, `requiresignedurls`, `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`, `maxdurationseconds`. ### Example ```node 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, }); ``` #### Response ```json {} ```