401. A request whose key lacks the scope for the endpoint answers 403.
API keys
A live key is the prefixsaasybill_live_ followed by 43 random characters. A test key uses saasybill_test_ instead.
Create an API key
Only an owner or admin can create, view or revoke keys.1
Open Developer Settings
Go to Organisation Settings, then Developer Settings, then API Keys.
2
Create the key
Click Create API Key and fill in the fields.
3
Copy the key
Click Create Key, then copy the key from the Your New API Key dialog. It cannot be shown again. If you lose it, create a new key and revoke the old one.
Revoke an API key
Open the key’s menu and click Revoke Key. Anything using the key stops working straight away, and this can’t be undone.Key status
Scopes
A scope grants access to one part of the API. An endpoint names the one scope it needs.
A write scope does not include its read scope. A key that creates subscriptions and also needs to read them holds both
subscriptions:write and subscriptions:read.
When a key lacks a scope, the error names it.
Test keys
Keys with the prefixsaasybill_test_ are test keys. You create them inside a sandbox, in the sandbox’s own Developer Settings, in the same way as a live key.
A test key works only in its sandbox, and a live key works only in a live organisation. Using one in the wrong place answers 403 api_key_mode_mismatch, so nothing runs against live data by accident.
Authentication errors
See Errors for the full list.