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.finance

Integration 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

  1. In the Client Portal at https://portal.sandbox.roots.finance, use a user with the admin role. Roots creates your first admin user and emails a link to set its password.
  2. Open API Keys and select Create key.
  3. Enter an optional name, such as payouts-worker, and pick the scopes the key needs.
  4. 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.

AreaScopes
Personspersons:read, persons:list, persons:create, persons:update, persons:review, persons:documents:upload, persons:associations:write
Accountsaccounts:read, accounts:list, accounts:create, accounts:close, accounts:freeze
Counterpartiescounterparties:read, counterparties:list, counterparties:create, counterparties:update, counterparties:delete, counterparties:freeze
Transferstransfers:read, transfers:list, transfers:create
Fees and billingfee_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

StatuscodeCause
401unauthorizedThe header is missing or malformed, or the key is unknown, expired, or revoked.
403permission_deniedThe key is valid but lacks the scope for this call.
404not_foundThe 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:

  1. Create a new key with the same scopes.
  2. Deploy it to your service.
  3. Confirm the old key's last used time has stopped advancing. It updates at most once a minute.
  4. 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


Did this page help you?