Skip to main content
Blob Storage accepts three credentials, all sent as Authorization: Bearer <credential>. Use an API key on your server, an upload token in a browser.

API keys

Create keys under Settings → API keys. Two scopes control Blob Storage: The full preset includes both. Give automation the narrowest scope: a job that only serves downloads needs blob:read. A key missing a scope is refused with API_KEY_SCOPE_DENIED. See Scopes.

Restrict a key to one folder

A key can be limited to a single Blob folder (blob_prefix): a path ending in /, such as invoices/. Pick the folder when you create the key in the dashboard (Settings → API keys); it works only with blob:* scopes and cannot be changed afterwards. Inside that folder the key behaves like any other: listing, uploads, shares, upload tokens and the S3 credential it derives are all confined to it. Everything outside the folder is refused with BLOB_PREFIX_DENIED, and so are the account-level routes (rules, domains, stats), even for reading. Keys created by a stack that includes Blob work this way: the stack creates a key named “Stack <name> (Blob)” limited to its own folder, and you cannot edit, rotate or delete it yourself.

Upload tokens

Never put an API key in a browser. Instead your backend asks for an upload token, which is short-lived, limited and bound to your API key (revoking the key kills its tokens). The token only works on the upload routes and carries the rules you fixed:
  • path (one exact file) or prefix (a folder), visibility, cache_control, content_disposition, expires_at and metadata;
  • max_size and allowed_extensions (1 to 20);
  • overwrite (default false): without it, an upload with the token never replaces an existing file;
  • expires_in from 60 to 3600 seconds (default 900) and max_uses from 1 to 100 (default 1).
A token without a fixed path always adds a random suffix to the file name so users cannot overwrite each other. Using a token outside its path, folder or fixed options answers BLOB_UPLOAD_TOKEN_CONSTRAINT, an extension it doesn’t allow answers BLOCKED_FILE_TYPE, and a file above its max_size answers BLOB_FILE_TOO_LARGE; an expired or revoked one answers BLOB_UPLOAD_TOKEN_INVALID.
Full walkthrough in Serve user uploads.

Workspaces

Add ?workspace_id=<id> (or the SDK’s workspace option) to act on the Blob Storage of a workspace’s owner. Files and quota belong to the owner. A member needs a workspace permission: Existing workspace roles do not receive these permissions automatically; the owner grants them explicitly. Without them the call answers WORKSPACE_PERMISSION_DENIED. See Workspaces.
Last modified on October 28, 2026