Skip to main content
POST
Create an image upload

Authorizations

Authorization
string
header
default:Bearer brew_your_api_key
required

Send your Brew API key as Authorization: Bearer brew_xxx.

Headers

X-Brand-Id
string

The brand this request acts on. REQUIRED for organization-scoped credentials (otherwise 400 BRAND_ID_REQUIRED — there is no default brand); list ids with GET /v1/brands. Brand-scoped credentials may omit it, and sending a different brand returns 403 BRAND_SCOPE_MISMATCH. A brand outside your organization returns 404 BRAND_NOT_FOUND.

Required string length: 1 - 64

Body

application/json

The file to upload: its name, type and size in bytes.

fileName
string
required

The file name, for example logo.png. It names the converted file; the library description comes from the image caption.

Required string length: 1 - 255
contentType
enum<string>
required

The file type: image/png, image/jpeg, image/gif, image/webp, image/avif, image/tiff or image/svg+xml. It sets the size cap (2 MB for SVG). The bytes decide what is converted: a declared type that differs is ignored, and bytes that are none of these formats are refused when the image is added.

Available options:
image/jpeg,
image/png,
image/gif,
image/webp,
image/avif,
image/tiff,
image/svg+xml
size
integer
required

The file size in bytes: at most 20,000,000 (2,097,152 for SVG).

Required range: 1 <= x <= 20000000

Response

The upload is open. POST the raw file bytes to uploadUrl, then call POST /v1/content/add-image with uploadId.

uploadId
string
required
uploadUrl
string<uri>
required
expiresAt
string<date-time>
required
maxBytes
integer
required