Skip to main content

Upload media

POST /api/media/upload Request a presigned upload URL, then PUT the raw file bytes to the returned URL. The media record is created immediately in PENDING state; call finalize once the upload completes to verify the file and mark it LIVE.

Required Scope

posts:write

Request Body Parameters

string
required
Original file name (1–255 characters, alphanumeric, dashes, underscores, dots, and spaces).
string
required
MIME type, e.g. image/jpeg or video/mp4.
string
required
File extension without the dot, e.g. jpg, png, mp4.
string
required
Groups related uploads together. Generate a unique string per upload batch (e.g. sess_v0Kps9Bgnk2...).
number
required
File size in bytes.
string
Optional client-supplied media ID. Omit to let the server generate one.
object
Optional metadata stored with the media asset.

Request Example

Response Example

Upload the file

PUT the raw bytes to the returned url with the same Content-Type. The URL expires after 1 hour and accepts files up to maxSize (~5 GB).

Next step

Once the PUT succeeds, call finalize media to verify the upload, extract dimensions and duration, and mark the asset LIVE.

Error Responses

Invalid Payload (400 Bad Request)

Unauthorized (401 Unauthorized)

Returned when no valid API key or session is present.
Last modified on September 21, 2026