Envie
ReferenceErrors

unauthorized

401 — no credentials, or credentials that don't match any installed shop.

https://docs.getenvie.com/errors/unauthorized · 401 — the request carried no usable credentials, or they matched nothing.

Frequent causes

  • No Authorization header on a private endpoint. Send Authorization: Bearer env_sk_….
  • A revoked or rotated key. Deleting a key in Developers takes effect within a minute — including for requests already in flight from old deploys still holding it.
  • A public key where a secret key belongs (or vice versa). env_pk_… authenticates the public storefront surface via X-Envie-Public-Key; env_sk_… authenticates Bearer on everything.
  • The app was uninstalled. Keys die with the install. Reinstalling mints a working state again, but old keys stay dead.

Fix

Check which surface you're calling and which credential it expects, then check the key still exists in Envie → Developers. If it might have leaked, rotation is one click there.

On this page