Skip to main content
Hawkings uses two pieces of identity on every authenticated request:
  1. An API keyhk-{...}, 5 segments. Identifies the user.
  2. A learning platform — picked per request by code (slug) or uuid. Identifies which workspace the call operates on.
A single API key gives access to every platform the user belongs to. You pick which one to act on by passing platformCode (preferred) or platform (the 24-char UUID) — the SDK turns them into headers.
code is the human-readable slug. Use it when you have it ("acme-academy", "unimiami"). Fall back to uuid for older platforms where code is still null.

Pass the key to the SDK

The SDK reads HAWKINGS_API_KEY and HAWKINGS_PLATFORM_CODE (or HAWKINGS_PLATFORM for the UUID form) from the environment by default. You can also pass them in code:

Wire headers

The SDK sends: If both are set, the backend cross-checks them — they must point to the same workspace.
The legacy long-form API key (hk-...-{platformUuid}) is no longer accepted by the SDK. Split it: take the first 5 segments as apiKey and pass the trailing 24-hex as platform separately.

Scopes

Every key has one or more scopes. The default key issued in the dashboard carries read:* and write:* for everything in its workspace. For machine-to-machine integrations create scoped keys: The dashboard generates scoped keys via copy-paste; programmatically you’d use the Auth API.

End-user authentication

If you’re building a student-facing product, you don’t want to ship your platform-wide key to a browser. Use the token flow:
The session key inherits only the scopes the student needs: read:lessons, write:submissions, ai:tutor. It expires in 24 hours.

Multiple workspaces

A single API key gives access to every platform the user belongs to. List them and switch by code or uuid:
You can also override the platform on a single call without building a new client — see your SDK’s per-request options.

Rotating a key

Rotating is non-disruptive:
  1. Issue a new key in the dashboard.
  2. Deploy it.
  3. Revoke the old one.
Revoked keys return a 401 authentication_error on the next request.

Self-hosted instances

If you’re running Hawkings on your own infrastructure, point the SDK at your base URL: