# Roles and permissions

A member holds one role per organization. A role is a bundle of permissions, and an API key carries a frozen subset of its creator's permissions as scopes.


## Business roles


Nobody can invite, resend or revoke an invitation for a role ranked above their own, only owners deal in the owner role, and an organization always keeps one active owner (`last_owner`). **Transfer ownership** makes another member owner and steps the caller down to admin in one step.

## Platform roles

Platform organizations have their own roles, shown in the app as Owner, Admin, Operator and Viewer.


## Scopes on API keys

A key's scopes are chosen when it is created and never change. They can only be permissions the creator holds.


`api_keys:manage` and `platform:view_as` never go on a key. Platform-minted customer keys also cannot carry `platform:*`.

## Second factor

In the app, payments, withdrawals, recipients and bank accounts, team changes and restricting a customer need a recent second factor (a passkey or an authenticator app). A key with the right scope replaces that step for its scopes, which is why keys belong only on servers.
