Skip to main content
POST
Create a browser upload token

Authorizations

Authorization
string
header
required

Project API key. Server-side only.

Path Parameters

projectId
string
required
Pattern: ^prj_[A-Za-z0-9]+$

Body

application/json
domain
string<hostname>
required

A verified domain of the project, where the browser runs.

Example:

"courses.example.com"

maxSizeBytes
integer

Hard cap on the uploaded file size, in bytes. Defaults to the plan maximum and is never allowed above it.

Required range: x >= 1
Example:

2147483648

contentType
enum<string>

The one content type the upload may declare. Omit it to allow any supported type.

Available options:
video/mp4,
video/quicktime,
video/webm,
video/x-matroska
title
string
Required string length: 1 - 200
Example:

"Lesson 1 - Introduction"

expiresInSeconds
integer
default:3600

How long the token lives. Keep it short; it is single-use.

Required range: 300 <= x <= 7200

Response

Token created.

token
string
required

Opaque signed token. Send it to the browser, which uses it as Authorization: Bearer <token>. Never send your API key to a browser. Do not log the token.

expiresAt
string<date-time>
required
projectId
string
required

The project the token may upload to.

Example:

"prj_2bN6rD"

domain
string
required

The verified domain the token is bound to.

Example:

"courses.example.com"

maxSizeBytes
integer
required

Hard cap on the uploaded file size, in bytes.

contentTypes
string[]
required

The content types the upload may declare.

title
string
Required string length: 1 - 200
Example:

"Lesson 1 - Introduction"