Authenticate and choose scopes
Send API keys, choose scopes, and understand why a key stops working.
Every request needs an API key in the Authorization header:
Authorization: Bearer enl_...Keys start with enl_. Treat them like passwords: keep them in a secret manager, never in source code or a browser.
Choose scopes
Each key has a set of scopes, per resource and access level. A request to an endpoint whose scope the key lacks returns 403 with the code missing_scope. Writing a resource includes reading it. Give each integration only the scopes it uses.
| Scope | Allows |
|---|---|
members:read | Members, including a group’s members |
members:write | Updating, suspending, and reactivating members |
invites:read | Pending and past invites |
invites:write | Inviting people and revoking invites |
groups:read | Groups |
groups:write | Creating, renaming, and deleting groups, and changing who is in them |
departments:read | Departments |
materials:read | Published courses, policies, and surveys |
learning_paths:read | Learning paths and their steps |
learning_paths:write | Assigning and unassigning learning paths |
assignments:read | Assignments, with their status and due dates |
assignments:write | Assigning and unassigning materials |
attempts:read | Submitted attempts, passed or failed |
reports:read | The users and materials reports from the Reports page |
GET /organisation needs no scope.
Understand who a key acts as
A key acts as the Admin or Owner who created it. Enlytning checks that person’s role on every request, and the activity log records the key against them. An Admin or Owner can reassign a key to another Admin or Owner in Settings > API Keys. Only an Owner can make a key act as an Owner.
A key can’t suspend the person it acts as. Suspending that person another way, in the app or with another key, pauses the key until someone reassigns it.
Know why a key stops working
| Status | Code | Meaning | Fix |
|---|---|---|---|
401 | invalid_api_key | The header is missing, or the key doesn’t exist | Check you sent the whole key |
401 | api_key_revoked | Someone revoked the key | Create a new key |
401 | api_key_expired | The key reached its expiry date | Create a new key |
403 | key_paused | The person the key acts as left the organisation or is no longer an Admin or Owner | Reassign the key in Settings > API Keys |
403 | public_api_not_in_plan | The organisation’s plan no longer includes the API | Upgrade to Professional |
A paused key resumes as soon as you reassign it. You don’t need to change the key in your integration.