Skip to main content
POST

Overview

Uploading a file from your machine takes three calls:
  1. This call: send the file’s name, MIME type and size. You get a mediaId (status PENDING) and a presigned uploadUrl.
  2. PUT the file to uploadUrl with the headers returned, within 10 minutes (expiresAt). This request goes straight to storage, without your API key.
  3. Complete Upload: Hooked checks that the file arrived and the media becomes COMPLETED.
JPEG, PNG, WEBP, GIF, MP4, MOV or WEBM, up to 100 MB. The extension of fileName must match fileType. Your plan’s storage is checked now with fileSize and again on complete with the size actually uploaded; it is counted only on complete. Uploading is free.

Errors

The file is already online? Import Media from URL takes one call.

Authorizations

x-api-key
string
header
required

Headers

Idempotency-Key
string

Makes the request safe to retry. 1-255 printable ASCII characters, one per operation (your job id, or a UUID you store), reused on every retry. Within 24 hours the same key with the same body answers with the first response and the header Idempotent-Replayed: true, without running or charging again. Keys are scoped to your team and the endpoint. 5xx answers and refusals before anything ran (401, 402, 403, 409, 429) are not kept. See Idempotency.

Required string length: 1 - 255
Pattern: ^[\x20-\x7E]+$

Body

application/json
fileName
string
required

The file's name with its extension: jpg, jpeg, png, webp, gif, mp4, mov or webm.

fileType
enum<string>
required

The file's MIME type. Its extension must match (a video/mp4 named .png is refused).

Available options:
image/jpeg,
image/png,
image/webp,
image/gif,
video/mp4,
video/quicktime,
video/webm
fileSize
integer
required

Size in bytes, at most 100 MB. Checked against your storage now and again, with the real size, on complete.

Required range: 1 <= x <= 104857600
name
string

Name in your library. Defaults to fileName.

Response

Upload URL created

success
boolean
message
string
data
object