Skip to main content
Examples use the blob client from Creating the client.

Rules

Rules set defaults and limits for every object under a prefix: visibility, expiration, maximum size, allowed extensions, cache and automatic deletion. They apply to every upload under the prefix, whether it comes from the SDK, an upload token or the dashboard. See Update Settings for plan limits and matching.

rules.get()

Returns the saved rules as an array. Each rule has the fields below plus created_at, and active_from when it has delete_after_days.
active_from is optional: the API only sends it for rules with delete_after_days. In TypeScript, handle it being undefined.

rules.set(rules)

rules.set() replaces the whole list. Send every rule you want to keep; rules.set([]) removes them all. To add one rule, read the list first:
It returns the saved list, like rules.get().
delete_after_days only takes effect 24 hours after the rule is saved (see active_from). Once active, deleted objects cannot be recovered.
When a rule is rejected, the error’s extra carries the offending prefix:
rules.get() is a read and is retried. rules.set() gets a single attempt.

Stats

Stats are an estimate, cached by the server for 60 seconds. billing is only an estimate of the storage above your plan, not an invoice.
See Account Stats.

Next steps

S3

Reach Blob Storage with any S3 client.

Settings API reference

The REST endpoints behind these methods.