Authentication
One API key, sent in the x-api-key header. Scoped, rotatable, and never minted by the API.
Every request carries your API key in the x-api-key header.
curl https://api.trytushe.com/v1/accounts \
-H "x-api-key: $TUSHE_KEY"Not Authorization: Bearer. That scheme exists, but it is the dashboard's signed-in session
— a JWT, for operators in a browser. It does not open /v1, and an API key does not open the
dashboard. Two audiences, two credentials.
The prefix selects the environment: nsk_test_ or nsk_live_. See Test and
live.
Scopes
A scope is {resource}:{action}. The full set:
| Resource | Scopes |
|---|---|
accounts | accounts:read · accounts:write |
customers | customers:read · customers:write |
payments | payments:write |
cards | cards:read · cards:write |
savings | savings:read · savings:write · savings:declare |
bills | bills:read · bills:write |
compliance | compliance:read · compliance:write |
events | events:read |
audit | audit:read |
config | config:write |
Give each key only the scopes its service needs.
Scopes are evaluated literally and never expanded. payments:write does not quietly grant
accounts:read, even though a payout touches an account. The set you were granted is the set you
have.
Keys are managed in the dashboard
Issuing, rotating, revoking, scoping and IP-restricting keys all happen under Developers → API keys. Rotation issues a replacement that inherits the old key's scopes, with a grace window you choose — up to 7 days, or none at all when a key may be compromised.
There is no API-key-callable endpoint that issues or revokes API keys. A credential that can mint its own successors cannot be contained once it leaks. Key management is an operator action.
A leaked key is bounded by what you gave it
- Scopes — a key can only do what it was granted.
- Access policies — bind a key to your egress IP ranges, so a leaked key is useless from
anywhere else. A request from a blocked address gets the same
401as an invalid key; we do not confirm to the caller that the key is real. - Expiry — keys expire in 365 days by default, configurable up to 730, or set to never expire.
- A cap — 25 active keys per environment by default; minting past it is refused with
API_KEY_LIMIT_REACHED.