Two quick rules of thumb:
- Building an app that logs members in as themselves? Use OAuth 2.0. It is the supported path for third-party apps and agents.
- Running a backend job that acts as itself, with no end user in the loop? Use an Api-Token.
Every URL below is on your tenant’s host. The host is the tenant selector: the bare
app.orgo.space domain resolves no tenant and returns 404. Examples use acme.orgo.space; substitute your own. See Tenancy.OAuth 2.0 (third-party apps and agents)
Orgo is a standards OAuth 2.0 authorization server with OIDC discovery. Use the authorization code flow with PKCE.Discovery
Read the metadata rather than hardcoding URLs:
The consent screen sits at
/authorize while the machine endpoints sit under /api/v1/oauth/*. That asymmetry is intentional, so use the URLs exactly as discovery returns them.
Registering a client
Two kinds of client, differing in whether a secret exists.- Public (self-registered)
- Confidential (admin-created)
Any developer can register a public client. No authentication required, rate limited to 10 registrations per hour per IP:Returns
201 with a client_id, client_id_issued_at, and your echoed metadata. No client secret is issued, so PKCE is the only client authentication.Optional metadata: client_uri, logo_uri, policy_uri, tos_uri. When no scopes are requested the defaults are profile and email.Step 1: send the member to the consent screen
Step 2: exchange the code
redirect_uri must exactly equal the one used in step 1.
Step 3: refresh
Token lifetimes
Authorization code rules
- Single use. Redeeming twice fails with
invalid_grant. - A replay by an authenticated client revokes the tokens that code produced. This is the OAuth 2.1 interception defence, so never retry a code blindly after a successful exchange.
- A failed client authentication leaves the code redeemable, so a client that fixes its credentials can safely retry the same code.
Client authentication
Use exactly one method:
- Credentials sent by more than one method →
invalid_request. - A
client_idin the Basic header disagreeing with the body →invalid_request. - A confidential client omitting its secret →
invalid_client(401, withWWW-Authenticate: Basic realm="orgo-oauth").
Cache-Control: no-store:
invalid_request, invalid_client, invalid_grant, unsupported_grant_type, rate_limit_exceeded.
Wrong secrets are throttled. Repeated failed client authentications for the same client_id are rate limited: after 10 failures in 5 minutes, further failures return 429 rate_limit_exceeded with a Retry-After header instead of 401. A request presenting the correct secret is never throttled, however many failed attempts preceded it. A healthy client is unaffected, and a 429 here means your credentials are wrong, not that you are calling too often.
Using the access token
profile adds name, given_name, family_name and picture; email adds email and email_verified; groups adds groups (the name of the member’s local center); roles adds roles (always ["ROLE_USER"] for an app token). sub and tenant_id are always present. The same token works against the rest of the API:
jwks_uri.
What actually bounds a token
Two limits surprise most integrators. Neither is configurable per request. An app acts as a member, never as an administrator. A token issued to an app that a tenant admin created is capped to member level (ROLE_USER), regardless of what the authorizing member can do in the Orgo UI. If a tenant administrator authorizes your app, your token still cannot perform administrator actions.
Read-only apps are gated by HTTP method. Every app is flagged either read-only or permitted to act on the member’s behalf. A read-only app may use GET, HEAD and OPTIONS only; any POST, PUT, PATCH or DELETE is rejected with 403:
Scopes
profile, email, groups and roles are advertised in discovery, shown on the consent screen, and recorded in the token’s scope claim.
Scopes describe what an application requests and what the member approves when they authorize it. What the resulting token can actually reach is bounded by the member-level cap and the application’s read-only / act-on-behalf setting described above.
Api-Token (server-to-server)
A user with organization-wide admin rights creates a token at Settings → Developers → API Tokens (the screen appears when the API module is on), or withPOST /api/v1/user-api-tokens. The raw token is shown once and cannot be read back. Send it as a raw header, with no Bearer prefix and no encoding:
- Full access, read/write: everything the owning user can do.
- Full access, read-only (
isReadOnly): anyPOST,PATCH,PUTorDELETEis rejected with403 Forbiddenand the messageThis API token has read-only access.Useful for analytics integrations. - Scoped (
scopes): the token reaches only the categories you grant (financial,events,members,communications), each atreadorwritelevel. Anything outside is refused with403, and a scoped token never writes role-group structures.
expiresAt and a name. Tokens inherit the permissions of the user that created them. If the user loses a role, the token loses the same access. Revoke a token in the same screen, or with PATCH /api/v1/user-api-tokens/{id}/revoke.
Session JWT (password, emailed code, social and identity-provider sign-in)
Every interactive sign-in ends the same way: Orgo mints a JWT, records a session for it, and hands it to the browser as anHttpOnly cookie named BEARER_<tenant slug>. The JWT is not returned in the JSON body (only the Orgo native app receives it there). The API accepts the same JWT either in that cookie or in an Authorization: Bearer <jwt> header. For server-side integrations prefer an Api-Token or OAuth; the flows below exist for the Orgo web app and for clients that drive it.
Password
200 with a Set-Cookie: BEARER_acme=... header and a JSON body such as {"hasMultipleSpaces": false} (plus forcePasswordReset: true when the member must choose a new password). If the member has multi-factor authentication on, the answer is 202 with {"mfaRequired": true, "tempToken": "..."}, and no cookie is set until the code is verified at POST /api/v1/verify-mfa-otp.
Send the JWT on later calls through the cookie, or in the header:
401. Five failed password attempts for one username or one IP address within 15 minutes are answered with 429; successful logins never count against that limit.
JWTs are scoped to the tenant the login was made against. Calling a different tenant’s host with the same JWT fails with 401.
Emailed code (OTP)
For members who prefer not to type a password, Orgo can email a 6-digit code. Two steps, both on the tenant host, and the first needs the tenant slug:429 with a Retry-After header.
A code login is a full login. There is no reduced-power “code session”: the session it creates is a normal session with a session record, the same permissions as a password login, and the same JWT lifetime. The event app has its own pair of code endpoints (POST /api/v1/event-app/login-otp and POST /api/v1/event-app/verify-otp). Its sessions are equally full, and they additionally carry an auth_strength: otp claim and a verified_email, which prove an email address when a member opens a different organization’s event (see Tenancy). Switching organizations that way never widens what a session can do: a session that did not come through an emailed code can only open an account it is already signed in to.
Sign-in through an identity provider
An organization can connect its own OpenID Connect provider (Okta, Microsoft Entra ID, Google Workspace, Keycloak or any other) so its team signs in with a work account. Setup is a screen for administrators, described in Single Sign-On. Two things matter to an API client:- A connected provider is an extra way in. Every existing path keeps working until the organization chooses to require it. A session created through the provider is a normal session with its own lifetime (1 hour to 7 days, set by the organization), and it is refused at the same endpoints as any other session once revoked.
- A required provider closes every other path for that email domain. When an organization requires single sign-on for a verified email domain, password login, the emailed code, password reset and the Google, Apple and Microsoft buttons all refuse addresses on that domain, and OAuth apps and the legacy
*-ssohandshake cannot sign those members in with a password either. Sessions open at the moment of enforcement end. The refusal carries the identifier of the connection that must be used:
The decision is made on the email domain alone, before any account lookup, so the answer does not reveal whether an address belongs to a member. Treat
SSO_REQUIRED as “start the sign-in at the identity provider” (the login page does this for you), not as a bad credential. The same rule applies when a session opened elsewhere is exchanged for a session in an organization that requires its provider: only a session that came through that provider is accepted.
X-Contact-Hash (anonymous contacts)
When Orgo emails a Contact (someone without a user account) an event invitation or a form link, the email contains a magic URL with a hash. That hash is also the auth header:Legacy SSO (deprecated)
If you arrived here from aDeprecation header, this is the flow you are using. It is a proprietary handshake that predates Orgo’s OAuth support:
verify-success-token-sso returns a flat member profile (id, cardId, firstName, lastName, email, status, localCenter, town, membership dates) alongside a 1-year access token with no refresh token. The access token is minted once per login; re-reading the profile does not mint a new one or invalidate the existing token.
Only the token exchange is deprecated. Creating apps and regenerating their secrets is not deprecated, and tokens issued this way are subject to the same member-level cap and read-only gate as OAuth tokens.
Migrating to OAuth 2.0
- Keep your existing
client_idandclient_secret. The secret hash format is unchanged, so no rotation is required to migrate. - Replace the
request-token-ssoredirect withGET /authorize, adding PKCE. - Replace
verify-success-token-ssowithPOST /api/v1/oauth/token. - Replace the profile payload from
verify-success-token-ssowithGET /api/v1/oauth/userinfo. - Expect a 1-hour access token plus a rotating refresh token instead of the legacy 1-year token, so add refresh handling before you switch.
Picking the right method
I'm building an integration that runs on a server I control
I'm building an integration that runs on a server I control
Api-Token. Read-only if you only need to fetch data; read/write if you need to create or update.
I'm building a mobile or web app that logs users in with their Orgo password
I'm building a mobile or web app that logs users in with their Orgo password
Prefer OAuth 2.0, so your app never handles Orgo passwords. A password login (
POST /api/v1/login-check) returns its session as a BEARER_<tenant slug> cookie, not in the JSON body, so it fits the Orgo web app better than a third-party client.I want users to click 'Log in with Orgo' on my third-party site
I want users to click 'Log in with Orgo' on my third-party site
OAuth 2.0. Self-register a public client at
/api/v1/oauth/register, or have an administrator create a confidential one, then run the authorization code flow with PKCE.I'm building an AI agent that acts for a member
I'm building an AI agent that acts for a member
OAuth 2.0, registered with acting enabled. Remember the two bounds: the token is capped to member level, and a read-only app cannot issue any
POST, PUT, PATCH or DELETE, including reads implemented as POST.I want password-less login by email code
I want password-less login by email code
Emailed code. Two steps:
request-login-otp then verify-login-otp. The result is a full session, exactly like a password login.The organization requires its own identity provider and my login now fails with SSO_REQUIRED
The organization requires its own identity provider and my login now fails with SSO_REQUIRED
Every password and emailed-code path is closed for that email domain by design. Send the member through the provider instead, as described in Sign-in through an identity provider. Only Orgo support can switch the requirement off once it is on.
I'm building the receiving end of an Orgo-sent email link for non-members
I'm building the receiving end of an Orgo-sent email link for non-members
X-Contact-Hash. The hash is in the URL Orgo emails; lift it into the header on subsequent API calls.
I already use the *-sso endpoints
I already use the *-sso endpoints
That is the legacy handshake, still supported and now deprecated. Follow the migration steps when you can; there is no removal date.
Common authentication errors
Token-endpoint errors use the RFC 6749 envelope instead, see client authentication. The other envelopes are listed in Errors.
Related
- Tenancy: getting the tenant context right is half of getting auth right
- Integrate “Log in with Orgo”: end-to-end OAuth walkthrough
- Errors: full error envelope reference
- OAuth Server: admin-side setup for OAuth applications
- Single Sign-On: connecting and requiring an identity provider (admin side)

