Skip to main content
PATCH
string
required
The API key for your account. You can find this in your account settings.
Object Update changes files already stored, without uploading them again: make them private or public, set or remove an expiry, and change the cache, disposition or metadata. It accepts one file or up to 50 per request, all getting the same changes. Requires the blob:write scope. Changes are applied in the order of the fields below, each on the result of the previous one. Once the body is valid the route always answers 200, with one result per file.
Changing private or expire changes the file’s id (and its URL, for public files). Store the new id from each result. Share links and temporary links to the old id stop working. The other fields keep the id.
string
The id of one file. Send object or objects.
string[]
Up to 50 ids.
boolean
true makes the file private: the public copy is removed before the request answers, and the CDN drops it in about 60 seconds. false publishes it, which needs a paid plan. See Links and sharing.
string | null
A new expiry counted from now (30d, 6h, 30), or null to keep the file forever. Needs a paid plan, and expiries under 7 days need Enterprise.
string | null
immutable, max-age=N (60 to 31536000) or no-cache (Enterprise only). null removes the header and the CDN default applies.
string | null
inline or attachment (download with the original file name). null removes the header.
object | null
Keys to set or change. A key with a null value is removed, and metadata: null removes all of them. Up to 5 keys and 512 bytes after the change. Setting keys needs Pro or Enterprise; removing is always allowed.

Legacy files

Legacy files, uploaded before the September 2026 update (ids without pub/ or prv/), can be made private and can get a new expiry: both move them to the new storage, with a new id. Their headers (cache_control, disposition, metadata) can’t change in place and answer OBJECT_IS_LEGACY: move the file first with Object Copy (move: true), then update it.

Rate limits

50 files per 10 seconds, counted per file: one full batch of 50 uses the whole window (RATE_LIMITED, 429).

Response

string
“success” if successful, “error” if not.
object

Errors

Errors of the whole request: Codes of a single file, in its result: