- An API key —
hk-{...}, 5 segments. Identifies the user. - A learning platform — picked per request by
code(slug) oruuid. Identifies which workspace the call operates on.
platformCode (preferred) or
platform (the 24-char UUID) — the SDK turns them into headers.
Pass the key to the SDK
The SDK readsHAWKINGS_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.
Scopes
Every key has one or more scopes. The default key issued in the dashboard carriesread:* 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: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 bycode or uuid:
Rotating a key
Rotating is non-disruptive:- Issue a new key in the dashboard.
- Deploy it.
- Revoke the old one.
authentication_error
on the next request.