Skip to main content

Authentication and scopes

Creating a key​

  1. Ask Rivus to enable API access on your account.
  2. In Credentials, choose the environment (sandbox or production), sign in with your user and create a key choosing its scopes and, optionally, an IP allowlist. The same management is in the Portal, under Settings → API and integrations.
  3. The key is shown only once. Store it in a secrets vault: Rivus cannot recover it, only revoke it.

Only client users with API access enabled can create keys. Each user sees and revokes the keys they created.

Sending the key​

Send the key in the Authorization header on every request:

Authorization: Bearer rvs_live_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Each key belongs to one account (client). Never send a client_id: the account always comes from the key.

Scopes​

ScopeAllows
readQueries: account, balances, statement, indicative quote, history, deposits and webhooks.
tradeQuote and execute conversions; create Pix charges.
withdrawRequest withdrawals and send transfers. Requires an IP allowlist on the key.

A call without the required scope responds 403 forbidden. Create separate keys for separate systems, each with only the scopes it needs.

IP allowlist​

A key can be restricted to a list of IPs or ranges (CIDR). Requests from any other IP respond 403 forbidden. The allowlist is mandatory for the withdraw scope.

Good practices​

  • Keep the key in a secrets vault (environment variable injected at deploy time, AWS Secrets Manager, Vault…), never in code or in a front-end.
  • Revoke in the Portal any key that may have leaked and create a new one.
  • Use rvs_test_… keys for development and rvs_live_… only in production.