Files

POST /files/upload-url

Get a presigned URL to upload a file to. PUT the file's bytes to uploadUrl, then pass the returned key to whichever endpoint consumes the file, such as brand assets or import jobs.

Requires the settings:write permission.

Body Parameters

fileNamestringrequired

The file's name, including its extension.

accesspublic | privaterequired

Whether the uploaded file is served from a public URL or kept private and reachable only through signed links.

sizeBytesinteger

Size of the file in bytes, if you know it up front.

contentTypestring

The file's MIME type, such as image/jpeg. Stored alongside the file so anything displaying it knows what it is.

Request
curl \
  -X POST \
  "https://api.cascade.dev/files/upload-url" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "fileName": "string",
  "access": "public",
  "sizeBytes": 0,
  "contentType": "string"
}'
Response
{
  "key": "string",
  "uploadUrl": "https://example.com",
  "expiresAt": "2025-01-15T09:30:00Z"
}