Learn

Grant course access

After a purchase, add a buyer to a community and enroll them in private courses, inviting them by email if they have no account.

Call this from your checkout or funnel after a successful payment. It needs an org API key with write permission (and the Learn scope, which is on by default).

  • The buyer already has an account: they join the community (if they are not a member yet) and are enrolled in each course. Response status: "granted".
  • No account yet: a single-use invite is emailed to them. The courses wait on the invite and are granted automatically when they accept it. Response status: "invited".
  • Nothing to do (they already have everything): status: "already_had_access".

The call is idempotent. Retrying a webhook never duplicates an enrollment and never sends a second invite email; a later upsell for a buyer who has not accepted yet is added to the same pending invite.

A private course can only be opened by members who were granted it like this (or by an admin from the member's Membership panel). Members cannot enroll themselves in a private course.

POST/v1/learn/access

Authorization

bearerAuth
AuthorizationBearer <token>

API token issued from the dashboard (Settings → API Tokens). Sent as Authorization: Bearer <token>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json