Manage members, invitations and keys
People join your organization by invitation, and each member holds one role. Your backend administers members and publishable keys with a key of its own, the management key.
Create a key that carries the management scope under Organization → API keys in the Mountaya app. It carries no other scope, so it stays on your server. Your organization's id is in the app's address, after /organizations/.
Changes act as an owner or admin, so mint the token for one:
The samples below read the token as MOUNTAYA_ADMIN_TOKEN. It lasts five minutes, so mint another before it expires.
Invite an email address with the role the person holds once they accept:
Mountaya sends nothing to the address, so tell the person yourself. They accept in the Mountaya app, once their account has verified that address. Each member and each waiting invitation holds one of the seats your agreement allows.
List the members, then match each person signed in to your product by email and store their user_id. Their session tokens are minted with it.
Send the role the member holds from their next request on:
Through the API, a member moves between contributor and viewer. Granting or changing admin is the owner's, in the Mountaya app.
Removing a member frees their seat, and what they created stays with your organization. Withdrawing an invitation frees its seat too:
A publishable key reaches only the scopes it carries. Create one per app, with what that app needs:
Revoke a key you no longer use. To rotate one, create its replacement, deploy it, then revoke the old key. Every request with a revoked key fails at once:
Secret keys are created and revoked in the Mountaya app only.