Usual Docs
View as Markdown

Keys and permissions

Every request carries a key, sent as Authorization: Bearer <key>. Keys are created in Usual โ†’ Developers by someone in the store's admin, and belong to that one store.

API keys and agent keys

API keyAgent key
ForYour code and integrationsAI agents
ChangesApplied directly, unless they need approvalAlways a plan first
Must say whyNo (but you can, with X-Change-Reason)Yes
Needs approval forFinancial changesMedium risk and up, or more than 25 records

Use an agent key for anything an AI drives, even through the REST API. It's what tells Usual to be careful.

Permissions

Give each key only what it needs. A key without a permission gets 403 forbidden with the missing permission named.

PermissionAllows
settings:readRead store settings
settings:writeChange store settings
audit:readRead the activity log and plans
subscriptions:readRead subscriptions
subscriptions:writeSkip, reschedule, pause, resume and cancel subscriptions
subscriptions:syncRe-check subscriptions against Shopify
offers:readRead subscription offers
offers:writeCreate and change subscription offers
billing:readRead charges, retries and billing health
billing:writeRetry failed charges (always needs approval for keys and agents)
imports:readRead subscription imports from other apps
imports:writeImport subscriptions from another app and start billing them
integrations:writeConnect and disconnect Klaviyo

Some things only a person in the admin can do, whatever the key: creating and revoking keys, and approving plans. Agent keys also can't connect another app's account (Recharge, Klaviyo): their changes are saved as plans first, and a plan would have to keep the other app's secret.

Keeping keys safe

  • Keys are shown once when created. We store only a hash.
  • Revoke a key from the Developers page and it stops working immediately.
  • Each key shows when it was last used.
  • Never put a key in a web page or app that customers can see.