Authentication
Authenticate server-to-server requests with an API key created in the Roots Client Portal.
Every API request carries an API key as a bearer token. An API key belongs to your client, carries a set of scopes, and is created by an admin in the Client Portal.
Authorization: Bearer rts_live_...Base URL
https://api.sandbox.roots.financeIntegration endpoints sit directly under /api/v1: /api/v1/persons, /api/v1/documents, /api/v1/accounts, /api/v1/counterparties, /api/v1/transfers, /api/v1/fee-rules, /api/v1/fees, /api/v1/billing, /api/v1/scopes, and in sandbox /api/v1/sandbox. There is no token-exchange call: the API key is the credential.
Create an API key
- In the Client Portal at
https://portal.sandbox.roots.finance, use a user with theadminrole. Roots creates your first admin user and emails a link to set its password. - Open API Keys and select Create key.
- Enter an optional name, such as
payouts-worker, and pick the scopes the key needs. - Copy the key from the confirmation screen.
The key is shown once, at creation, and can never be retrieved again. Store it in your secret manager before you close the dialog. The key list shows only its name, its first 12 characters, its status, and when it was last used.
Every key starts with rts_live_, in sandbox too. A request whose Authorization header does not start with Bearer rts_live_ is a 401.
Scopes
A key can do only what its scopes allow. A call outside them is a 403 with code permission_denied.
| Area | Scopes |
|---|---|
| Persons | persons:read, persons:list, persons:create, persons:update, persons:review, persons:documents:upload, persons:associations:write |
| Accounts | accounts:read, accounts:list, accounts:create, accounts:close, accounts:freeze |
| Counterparties | counterparties:read, counterparties:list, counterparties:create, counterparties:update, counterparties:delete, counterparties:freeze |
| Transfers | transfers:read, transfers:list, transfers:create |
| Fees and billing | fee_rules:read, fee_rules:markup, fees:read, billing:write |
The Client Portal's key form offers every scope in this table. Move revenue to billing with POST /api/v1/billing/move-from-revenue (billing:write scope) or in the Client Portal. In sandbox, top up billing with POST /api/v1/sandbox/billing/deposits, which needs transfers:create.
GET /api/v1/scopes lists the scopes of the key that calls it, so a service can check what it may call before calling it.
Some actions are never available to an API key, whatever its scopes:
- Creating, listing, or revoking API keys.
- Managing users.
- Managing webhook endpoints.
- Revoking a person's attestation.
Errors
| Status | code | Cause |
|---|---|---|
401 | unauthorized | The header is missing or malformed, or the key is unknown, expired, or revoked. |
403 | permission_denied | The key is valid but lacks the scope for this call. |
404 | not_found | The id belongs to another client, or does not exist. |
A key that has expired or been revoked answers the same 401 as one that never existed.
Rotate and revoke keys
Revoking a key in the Client Portal stops it working immediately. To rotate without downtime:
- Create a new key with the same scopes.
- Deploy it to your service.
- Confirm the old key's last used time has stopped advancing. It updates at most once a minute.
- Revoke the old key.
Give each service its own key with only the scopes it uses, so you can revoke one without touching the others.
Next steps
- Follow Quickstart to make your first calls.
- Read Idempotency before creating resources or transfers.
- Read Security and data handling for credential storage.
Updated 5 days ago