Permissions
Permissions decide what each secret key can do. Every operation requires one permission, such as deposit.read or payout.create. A key holds the permissions you chose when you created it in the Stridge dashboard, and it can call an operation only if it holds that operation's permission.
Each operation's page names its permission beside its credential. If you work from the OpenAPI document, every operation carries it as x-stridge-permission.
A call from a key without the operation's permission returns 403 permission_denied. The error's message names the missing permission for whoever reads the log, for example insufficient permissions: the api key does not hold payout.create. Branch on code, never on message. See Errors.
What a key holds
A key holds what you created it with, plus a few permissions it gets automatically:
- Every key holds
reference.readandsimulation.read. They cover the reference data, and in a sandbox its simulations. - A sandbox key also holds
sandbox.simulate, which runs the test helpers that simulate deposits. Only a sandbox key can hold it. - A key holding
payout.createcan also quote a payout (payout.quote), because a payout can name the quote it was priced at.
Some permissions can be given to live keys only: webhook.read and webhook.write. Only live keys reach the operations that require them, so a sandbox key never holds them.
A second factor for live keys
A few permissions get an extra check on live keys. When someone creates, rolls or widens a live key that holds one of them, the dashboard asks that person for a fresh second factor. A sandbox never asks.
uda.writepayout.createpayout.quote- An authenticator code, or a backup code
webhook.write- Any second factor, an emailed code included
The publishable key
The publishable key holds no permission. On its own it reaches only the reference data a browser shows, such as a deposit quote, the supported assets and prices. Publishable keys lists the operations it takes, and which of them also need a session for one of your customers.
Giving a key its permissions
Give each key only what its job needs, and give each service its own key. This is the principle of least privilege (opens in a new tab). A key that only reads deposits and settlements cannot move money, even if it leaks.
Every permission
The catalogue below lists every permission a secret key can hold, grouped by what it governs, with the operations that require it.
- A permission is marked when only live keys or only sandbox keys can hold it. Every other permission can be given to both.
- Link to a permission as
/reference/permissions#<name>, such as#payout.create.
Deposit addresses
- List and read deposit addresses, their settlements and settlement attempts, and routings.
- List and read routing policies.
- Create deposit addresses.
- uda.writeSecond factor: authenticator codeUpdate a deposit address.
- Retry a failed settlement.
Deposits and transactions
- List, search and read deposits.
- List and read transactions.
Payouts
- List and read payouts.
- payout.createSecond factor: authenticator codeCreate payouts, and simulate, release and fail payouts in a sandbox. A key holding it can also quote payouts.
- payout.quoteSecond factor: authenticator codeComes with payout.createQuote a routed payout.
- Reject a payout that is still pending.
Vaults and treasuries
- Read the total value the environment holds across its vaults, gas stations and deposit addresses.
- List and read treasuries and their changes.
- List and read vaults, their addresses and what they hold.
- List and read gas stations.
Webhooks and events
- webhook.readLive keys onlyList and read webhook endpoints.
- List and read events through the Events API.
- webhook.writeLive keys onlySecond factor: anyCreate, update and delete webhook endpoints, and rotate their signing secrets.
- Ping and re-enable webhook endpoints. In a sandbox, also make a failing endpoint look as if it has been failing for longer.
Reference data
- reference.readEvery keyRead networks, prices, deposit quotes and the supported assets.
Sandbox
- simulation.readEvery keyRead the sandbox's simulations and the options the test helpers accept.
- sandbox.simulateSandbox keys onlyEvery sandbox key