API Keys & Webhooks
Create scoped organization API keys for the REST API, personal tokens for AI assistants, and verify signed webhooks for course, learner and organization events.
Last updated 4 min read
Creating an API key
Owners and Admins: go to Settings → API and, under API Keys, click Create API Key. Organization keys start oc_live_. Give it a name you will recognize later (e.g., 'HR Integration'), choose its scopes, and optionally an expiry (30, 90 or 180 days, or 1 year). The secret is shown exactly once, so copy it straight into a password manager or secrets vault; if you lose it, revoke the key and create another.
A key carries only the scopes you give it, whoever created it: Read Courses (read:courses), Write Courses (write:courses), Read Analytics (read:analytics), Read Users (read:users) and Write Completions (write:completions). Grant the fewest a job needs. Revoke a key at any time from the same page; it stops working immediately.
Note: Treat API keys like passwords. Never commit them to version control, put them in client-side JavaScript or paste them into chat tools. Revoke any key that may have leaked.
Using a key with the REST API
Send the key in the X-API-Key header, against your Scormbusters address: curl -H "X-API-Key: <your-key>" https://<your-scormbusters-address>/api/analytics/events. The REST API covers creating courses, enrollments, analytics events and webhooks; the full reference, with request and response shapes, is at /docs/api.
To read and build course content programmatically, use the MCP server: it is the authoring API, for AI agents and scripts alike. Setup is at /docs/mcp.
Tip: An organization key also works with the MCP server, sent as Authorization: Bearer <your-key>. To connect an AI assistant as yourself, any member can instead create a personal token (oc_pat_…) in the Personal tokens section of the same page; personal tokens work with the MCP server only, not the REST API. See Connect your AI assistant.
Setting up webhooks
Webhooks send an HTTP POST to your server when something happens, so you do not have to poll. In Settings → API, click Add Webhook, enter your endpoint URL and choose its events:
course.publishedandcourse.unpublishedenrollment.created: a learner enrolls themselves from the course catalog (enrollments made by an admin in the editor or through the REST API do not send it)enrollment.completed,lesson.completed,quiz.submittedandcertificate.issueduser.joined,user.removedandinvite.accepted
Payloads for each event are in the webhooks reference.
Each request carries the event name in the X-OpenCourse-Event header, with a JSON body. Recent deliveries are listed under each webhook.
Verifying webhook payloads
Every request has an X-OpenCourse-Signature header of the form sha256=<hex>: an HMAC-SHA256 of the raw request body, keyed with the webhook's signing secret (shown when you create it). Compute the same HMAC over the raw body you received, compare it to the header with a constant-time comparison, and reject the request with a 401 if they differ.
Tip: Respond with a 2xx within 10 seconds. Each event is delivered once and not retried, so if your endpoint may be down, record events as they arrive and reconcile from the REST API.
Part of the documentation: Developers.
Found something here that does not match what the product does? That is a bug in the guide — see all guides or tell us from the Help Center.