Skip to main content
The Orgo API accepts several authentication methods. The one you should use depends on who is calling and from where. 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.
The discovery document is per tenant: issuer reflects the host you fetched it from. Fetch discovery once per tenant host. Never reuse one tenant’s document for another.

Registering a client

Two kinds of client, differing in whether a secret exists.
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.
PKCE is mandatory for every client, confidential ones included. This is stricter than baseline OAuth 2.0 and matches OAuth 2.1. The server rejects violations with invalid_request:
  • code_challenge_method must be S256. plain is not supported.
  • code_challenge must match [A-Za-z0-9-._~]{43,128}.
  • code_verifier must match the same charset and length rules.
If the member is not signed in, Orgo sends them through login and returns them to the consent screen automatically, including when they sign in with Google, Apple or Microsoft. Your app does nothing for this. If the member’s email domain requires their organization’s identity provider, Orgo sends them there instead (see Sign-in through an identity provider).

Step 2: exchange the code

Confidential clients additionally authenticate (see Client authentication below). redirect_uri must exactly equal the one used in step 1.

Step 3: refresh

Refresh tokens rotate. Every refresh returns a new refresh_token and invalidates the one you sent. Persist the new value on each refresh: a client that keeps replaying its original refresh token will stop working.

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_id in the Basic header disagreeing with the body → invalid_request.
  • A confidential client omitting its secret → invalid_client (401, with WWW-Authenticate: Basic realm="orgo-oauth").
Token-endpoint errors are RFC 6749 shaped and sent with Cache-Control: no-store:
Codes in use: 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

Returns an OIDC-shaped profile. Which claims appear follows the approved scopes: 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:
Access tokens are RS256 JWTs, verifiable against jwks_uri.
Tokens are also revocable server-side, and revocation takes effect on the next request. A token that still looks valid locally (unexpired signature, exp in the future) can be rejected. Do not treat a local expiry check as proof a token still works; handle 401 at any time.

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:
The gate is by HTTP method, not intent. An endpoint that performs a read via POST (some search endpoints do) is still blocked for a read-only app. If your integration needs those, it must be registered with acting enabled.
The consent screen shows the member which of these applies before they approve.

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.
Request only the scopes you need. It keeps the consent screen short and makes it clearer to the member what they are approving. Full walkthrough: Integrate “Log in with Orgo”. Admin-side setup: OAuth Server.

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 with POST /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:
When you create a token you choose its reach:
  • Full access, read/write: everything the owning user can do.
  • Full access, read-only (isReadOnly): any POST, PATCH, PUT or DELETE is rejected with 403 Forbidden and the message This 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 at read or write level. Anything outside is refused with 403, and a scoped token never writes role-group structures.
You can also set 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.
A token that does not exist, has expired or has been revoked returns 404, not 401, with the message No user associated with this API Token. Treat a sudden 404 on every call as “this token is dead”, then check the host (see Tenancy).
Tokens grant durable access. Never commit them, log them, or send them to a client browser. Rotate periodically and prefer one token per integration so you can revoke individually.

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 an HttpOnly 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

The username is the member’s email followed by an underscore and the tenant slug. A successful login answers 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:
A JWT lives about 11 days by default. There is no refresh-token endpoint for password sessions: sign in again when you receive 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:
A code expires after 5 minutes and allows 15 attempts. After 10 failed verifications for one address the address is locked out for 10 minutes, a new code can be requested only every 20 seconds, and at most 10 codes can be requested within 5 minutes. All of these answer 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 *-sso handshake 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:
This authenticates the contact for that specific event and that specific contact identity. They cannot use the hash to access other contacts’ data. Most server-to-server integrations will not use this; it is here for completeness.

Legacy SSO (deprecated)

Deprecated. The /api/v1/*-sso token exchange is deprecated in favour of OAuth 2.0. Existing integrations continue to work and no removal date has been set. New integrations must use the authorization code flow. Responses from these endpoints now carry a Deprecation header and a Link: rel="deprecation" pointer to this section.
If you arrived here from a Deprecation 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

  1. Keep your existing client_id and client_secret. The secret hash format is unchanged, so no rotation is required to migrate.
  2. Replace the request-token-sso redirect with GET /authorize, adding PKCE.
  3. Replace verify-success-token-sso with POST /api/v1/oauth/token.
  4. Replace the profile payload from verify-success-token-sso with GET /api/v1/oauth/userinfo.
  5. 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

Api-Token. Read-only if you only need to fetch data; read/write if you need to create or update.
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.
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.
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.
Emailed code. Two steps: request-login-otp then verify-login-otp. The result is a full session, exactly like a password login.
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.
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.