Skip to main content
Rinne supports two authentication methods: API keys for server-to-server integrations and JWT tokens for user-facing applications. Both methods enforce granular permission checks on every request.

API key authentication

Include your API key in the x-api-key header for all requests:
Keep your API keys secure. Never commit them to version control, expose them in client-side code, or share them over insecure channels.

How API keys work

Each API key is:
  • Hashed on creation — Rinne stores only a SHA-256 hash. The raw key is returned exactly once at creation time (show-once) and can never be retrieved again.
  • Scoped with permissions — Every key carries its own set of permissions, enforced on every request. By default, keys are created with full access (*.*), but you can restrict them to specific operations.
  • Optionally time-limited — You can set an expiration date. Expired keys are automatically rejected.
  • Soft-revocable — Revoked keys stop authenticating immediately but their records are retained for audit.

Authentication scope

Your API key determines which resources you can access based on the company it belongs to:
  • Organization scope — Organization API keys can access organization-level resources and all merchants under the organization.
  • Merchant scope — Merchant API keys can only access the merchant’s own resources.

Managing API keys

API key management is available through the API and requires JWT authentication — a leaked API key cannot be used to create or revoke keys, even if it contains permissions for doing so.
API key management endpoints require JWT authentication and the api_key.create, api_key.list, or api_key.delete permissions respectively.

Creating an API key

1

Authenticate with JWT

You must be authenticated with a JWT token (not an API key) and have the api_key.create permission.
2

Create the key

string
required
A label to identify the key (max 100 characters).
string[]
Permission strings granted to the key. Omit for full access (*.*). Must be valid permissions from the permission catalog.
string
Future ISO 8601 datetime when the key stops authenticating. Omit for a non-expiring key.
3

Store the raw key securely

The response includes the full key — this is the only time it will be shown:
Store the key value immediately in a secure location (e.g., a secrets manager or environment variable). You will not be able to retrieve it again.

Listing API keys

Retrieve your company’s active (non-revoked, non-expired) keys. The raw key is never returned — only the masked prefix and last4 are shown:

Revoking an API key

Revoke a key to immediately stop it from authenticating. Revocation is permanent and cannot be undone:
A successful revocation returns a 204 No Content response.

Managing merchant API keys

Organizations can manage API keys for their merchants using the merchant-scoped endpoints:

Limits

Each company (organization or merchant) can have at most 20 active API keys at any time. Active keys are those that are neither revoked nor expired. If you reach the limit, revoke unused keys before creating new ones.

User authentication (JWT)

For user-facing applications, Rinne provides JWT-based authentication for individual users.

Login flow

  1. User login: Authenticate with email/phone and password
  1. Company selection: If user has multiple companies, select one
  1. Use JWT token: Include token in Authorization header

JWT token structure

JWT tokens include:
  • User ID and identifiers
  • Selected company context
  • User permissions and roles
  • Token expiration time

Password management

First access

New users receive a verification code via email:

Forgot password

Request a password reset code:
Reset password with the code:

Change password

Authenticated users can change their password:

Security best practices

  • Use environment variables or a secrets manager for API keys
  • Never commit keys to version control
  • Use scoped permissions — avoid *.* for keys that only need specific operations
  • Set expiration dates on API keys when possible
  • Revoke keys that are no longer in use
  • Rotate keys periodically by creating a new key before revoking the old one
  • If a key is compromised, revoke it immediately via JWT authentication
All API requests must use HTTPS. HTTP requests will be rejected.
Implement exponential backoff for retries and respect rate limits to avoid throttling.
When receiving webhooks, validate the signature to ensure requests are from Rinne.

Error responses

Authentication errors return a 401 status code:
Authorization errors return a 403 status code:
API key management endpoints return a 403 if you attempt to access them with API key authentication instead of JWT. This is a security measure — a leaked API key must not be able to create or revoke other keys.

Next steps

Create your first transaction

Follow the quickstart guide

User management

Manage users, roles, and permissions