Act for a customer with a key
Your platform's own credential never acts inside a customer. Mint one key per customer, with only the scopes your servers need.
- Mint. POSTMint a customer API key with a
namethat says which system holds it, and explicitscopes. Omitted scopes mean read-only. - Store the secret. It is returned once. Put it in your secrets manager, keyed by the customer's
org_id. - Call the customer API with that key alone:
/v1/orgs/{customerId}/.... - Rotate with POSTRoll a customer API key: the old secret keeps working for the overlap you set, at most 72 hours.
- Revoke with POSTRevoke a customer API key when you stop serving the customer. Unlinking a customer revokes every key you minted for it.
Choosing scopes
| Your servers need to | Scopes |
|---|---|
| Show balances and statements | accounts:view |
| Show funding instructions | accounts:view |
| Manage recipients | counterparties:view, counterparties:manage |
| Send payments | payments:view, payments:create |
| Approve payments on the customer's behalf | payments:approve (opt-in; only if the customer agreed) |
| Receive the customer's events | webhooks:manage |
platform:* and api_keys:manage can never be placed on a customer key.
Every call records source=platform_api and your platform id, on the customer's activity log and on yours.