Skip to content

Authentication and scopes

Academy has one credential for each kind of caller. Pick by who acts: the organisation (an automation), one person (an AI assistant or a script of their own), or another system with its own protocol (SCIM, LTI, connectors, webhooks).

Caller Credential Prefix Lifetime Where it works
Automation of an organisation (n8n, Zapier, Make, Power Automate, HR, scripts) Machine client → OAuth 2 client credentials acm_ 15 minutes /v1/integration-api/*, /v1/integrations/events
AI assistant of one person, signed in with OAuth OAuth 2.1 authorization code with PKCE acad_ (access), acr_ (refresh) 1 hour; refresh 60 days, rotating /v1/mcp; the REST API within its scopes
AI assistant or script of one person, set up by hand Personal access token acad_ 1 to 366 days, or never /v1/mcp; integration routes if the person is an organisation administrator
The portal in the browser Session – JWT_TTL, 8 hours by default the portal’s own routes
Identity provider SCIM token scim_ until revoked /scim/v2/* (SSO and SCIM)
Knowledge or HR connector Connector token ck_ until revoked /v1/connector/* (connector protocol)
Your webhook receiver Signing secret whsec_ until rotated checks what Academy sends (webhooks)

All secrets are shown once, when they are made. For the tokens and client secrets you send to Academy (acm_, acad_, acr_, scim_, ck_ and the machine client’s secret) only a hash is stored. A webhook signing secret (whsec_) is different: Academy needs it itself to sign every delivery, so it is stored encrypted, not hashed, and the portal shows only its first characters afterwards. Send every token as Authorization: Bearer <token>.

A machine client belongs to the organisation, not to a person, so a flow keeps working when its author leaves.

  1. An organisation administrator creates it under Admin → Integrations → Interfaces → Machine clients with a name and only the scopes the flow needs. The portal shows the client id and the secret once. An organisation has at most 25 active machine clients (409 integration_limit). Machine clients are made only in the administrator’s own signed-in session; a token can’t make them (403 own_session_required).

  2. The flow exchanges id and secret for a token:

    Terminal window
    curl -s -X POST "$API/v1/integration-oauth/token" \
    -u "$CLIENT_ID:$CLIENT_SECRET" \
    -d grant_type=client_credentials
    { "access_token": "acm_…", "token_type": "Bearer", "expires_in": 900, "scope": "people:read people:write webhooks:read webhooks:write" }
    • The body is application/x-www-form-urlencoded. The client may also send client_id and client_secret in the body instead of HTTP Basic, but not both (400 invalid_request).
    • Without scope, the token gets all of the client’s scopes; with scope (space-separated), only those. A scope the client doesn’t hold is 400 invalid_scope.
    • Wrong id or secret: 401 {"error":"invalid_client"}.
    • There is no refresh token: ask for a new token when this one runs out. The token endpoint allows 30 requests a minute per IP address, so cache the token for its 15 minutes.
  3. Revoking the client under Machine clients ends all its tokens at once, on the next request. A client’s scopes can’t be changed later: for more, create a new client and revoke the old one.

Scope Allows
people:read / people:write read people; find or create them, change employment fields, invite, deactivate, reactivate
courses:read / courses:write read courses; find a course by title or create a draft
enrollments:write enrol people in courses; assign courses to classes
programs:read read programmes
classes:read / classes:write read classes; create them, add and remove members
teams:read / teams:write read teams; members of teams kept by hand
requirements:read / requirements:write required trainings of teams
training:read training records (rounds of required trainings)
certificates:read issued certificates
live:read / live:write live sessions; register and unregister people
mentoring:write pair mentors and mentees
course-runs:read / course-runs:write have the course factory write courses, within the organisation’s budget
webhooks:read / webhooks:write the event catalogue; subscriptions (REST hooks) and webhooks

The API reference names the scope of every route. A call without it is 403 insufficient_scope, with the missing scope as the message.

The routes under /v1/integration-api/ also accept an organisation administrator’s session, their personal access token, and an AI agent the administrator allowed everything (mcp). They act as that person, with that person’s current roles: someone who is no longer an administrator gets 403 forbidden, and an administrator who still has to set up the second sign-in step gets 403 two_factor_required. Use a machine client for automations: it doesn’t depend on a person, and its scopes limit what it can do.

AI assistants that support the MCP authorization flow (OAuth 2.1 with PKCE) sign in by themselves: the person only allows them on a consent page of the portal. This is the recommended way for agents; nobody copies a token.

  1. Discovery. The MCP endpoint answers an unauthenticated request with 401 and

    WWW-Authenticate: Bearer realm="academy", error="invalid_token", resource_metadata="https://<api>/.well-known/oauth-protected-resource/v1/mcp"

    That document names the resource (https://<api>/v1/mcp), the authorization server (the API itself) and the scopes. /.well-known/oauth-authorization-server (also served as /.well-known/openid-configuration) lists the endpoints:

    Endpoint Path
    Registration POST /v1/oauth/register
    Authorization GET /v1/oauth/authorize
    Token POST /v1/oauth/token
    Revocation POST /v1/oauth/revoke
  2. Registration (RFC 7591). The agent registers itself as a public client, without a secret: 1 to 10 redirect_uris, each https://… or http:// to localhost, 127.0.0.1 or [::1], without a fragment. Names that pass for the platform’s own apps are refused. 20 registrations an hour per IP address.

  3. Authorization. response_type=code with PKCE code_challenge_method=S256 only. The person signs in if needed and sees what the agent asked for. A malformed request is shown to the person as an error page and never sent to the agent’s redirect address. The code is valid for 5 minutes and once.

  4. Tokens. The code gives an access token (acad_…, expires_in: 3600) and a refresh token (acr_…, 60 days). Every refresh returns a new refresh token; using an old one a second time ends the whole connection, as a stolen token would. A refresh may keep or narrow the scopes (scope), never widen them. The token endpoint allows 120 requests a minute per IP address.

  5. Revocation. POST /v1/oauth/revoke always answers 200 {} and ends the connection. The person sees every agent under My account → My AI agents and can disconnect it there.

OAuth errors follow RFC 6749: {"error": "invalid_grant", "error_description": "…"}.

Scope Allows
mcp everything the person may do. Asking for mcp gives only mcp; an agent that asks for no scope of ours gets it too
learn:read read what every learner may: courses, lessons, progress, notes, classes, appointments, Creative Space, groups, mentoring
learn:write change those: progress, notes, quizzes, assignments, registrations, Creative Space, the AI companion, Pro
messages one’s conversations with people and with the platform team
purchase prices, checkouts, orders on invoice, vouchers, one’s purchases and subscriptions
voice speaking and listening through the platform’s servers

Scopes Academy doesn’t know (for example openid) are ignored. A scope never gives more than the person’s roles allow, and the API checks it on every request, not only in the tool list (403 insufficient_scope). Teaching, managing a team, administration and finances need mcp. Each MCP tool’s scope is in MCP tools.

For an assistant without OAuth, or a script that acts as you.

  • Create one under My account → My AI agents → Access tokens for AI assistants: a name, an expiry (30, 90 or 365 days, or never; the API takes 1 to 366 days, 90 by default) and optionally Read only. You confirm it with your password, second step or passkey unless you signed in a moment ago. You can have 20 active tokens.
  • The format is acad_<cell>_<secret>. The answer also gives the MCP address (mcpUrl).
  • A personal access token works on /v1/mcp. On the portal’s other routes it is refused with 403 use_mcp: scripts that act as a person go through MCP. Organisation administrators can also use theirs on the integration routes (above).
  • Read only limits the token to reading tools on MCP, and the portal’s routes refuse every change made with it.
  • Sign out on all devices revokes all your tokens; erasing a person deletes theirs. Organisation administrators can list and revoke the organisation’s tokens (GET /v1/admin/access-tokens, DELETE /v1/admin/access-tokens/{id}).

The portal signs people in with a session token (POST /v1/auth/login and the other sign-in routes) and keeps it in an HttpOnly cookie. A session is not meant for integrations: it is tied to one person, expires after JWT_TTL (8 hours by default) and ends when they sign out. Only the reference pages of the API (/v1/openapi.json, /v1/integration-api/openapi.json, /v1/integration-api/docs, /v1/api-docs) need a session, so they open in the browser of someone signed in.

On a local instance with AUTH_MODE=dev, POST /v1/auth/dev-login with {"tenantSlug": "…", "email": "…"} gives a session token without a password (quickstart). It doesn’t exist in production.

  • Store secrets in your tool’s credential store, never in a flow’s text, a repository or a URL.
  • One machine client per flow, with only the scopes it needs; revoke it when the flow goes.
  • Tokens of a regional cell work only there: a request to another cell is answered 421 {"error": "wrong_cell", "cell": {…}}, naming the right one. Every answer names its cell in the header x-academy-cell.
  • Browsers: the API answers cross-origin requests only from the portal’s own addresses. Call it from your server, not from a web page of yours.