Skip to content

Authentication

View as Markdown

Every request but the OpenAPI document needs an API key, sent in the Authorization header:

Authorization: Bearer ltk_YOUR_KEY
  • Created on the Integrations page of the staff app, by anyone on your school’s staff. A key is shown once, when it is created. Lernexa keeps only a hash of it, so a lost key cannot be shown again: revoke it and create another.
  • One per system. Give Zapier its own key, your CRM sync its own. Revoking one then stops only that system.
  • Your school’s only. A key reaches your school’s tests and nothing else.
  • Last used shows on the Integrations page, so a key nothing uses any more is easy to spot and revoke.
  • Revoking is immediate: the next request with the key is refused.

Keys are for server-to-server calls: your backend, Zapier, a scheduled job. A web page cannot call the API with a key, as browsers are not allowed to send one to it. Never put a key in front-end code or a mobile app.

The answer is 401 with a WWW-Authenticate: Bearer header:

{ "error": "Send a valid API key, as Authorization: Bearer <key>." }

Check the key is sent whole, starts with ltk_, and has not been revoked.