Skip to content
Start here

Storage use

client.stream.videos.storageUsage(VideoStorageUsageParams { account_id, creator } params, RequestOptionsoptions?): VideoStorageUsageResponse { creator, totalStorageMinutes, totalStorageMinutesLimit, videoCount }
GET/accounts/{account_id}/stream/storage-usage

Returns information about an account's storage use.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Stream WriteStream Read
ParametersExpand Collapse
params: VideoStorageUsageParams { account_id, creator }
account_id: string

Path param: The account identifier tag.

maxLength32
creator?: string

Query param: A user-defined identifier for the media creator.

maxLength64
ReturnsExpand Collapse
VideoStorageUsageResponse { creator, totalStorageMinutes, totalStorageMinutesLimit, videoCount }
creator?: string

A user-defined identifier for the media creator.

maxLength64
totalStorageMinutes?: number

The total minutes of video content stored in the account.

totalStorageMinutesLimit?: number

The storage capacity alloted for the account.

videoCount?: number

The total count of videos associated with the account.

Storage use

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const response = await client.stream.videos.storageUsage({
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});

console.log(response.videoCount);
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "creator": "creator-id_abcde12345",
    "totalStorageMinutes": 0,
    "totalStorageMinutesLimit": 0,
    "videoCount": 0
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "creator": "creator-id_abcde12345",
    "totalStorageMinutes": 0,
    "totalStorageMinutesLimit": 0,
    "videoCount": 0
  }
}