API
The HTTP API lives at https://api.asknex.dev/v1. Responses are JSON; errors follow RFC 9457 (application/problem+json) with a stable code field and field-level errors in extra.errors.
- Authentication: session cookies with a CSRF double-submit header (
X-CSRF-Token), orAuthorization: Bearerfor API clients. Learners and platform staff use their own cookies. - Concurrency: drafts use
If-Matchwith the draft version; write endpoints acceptIdempotency-Key. - Pagination: cursor based (
cursor,limit). - Attempts: start with
POST /v1/publications/{slug}/attempts, save answers withPUT /v1/attempts/{id}/answers(revision based), navigate withnext/back,submit, readresult. Anonymous attempts receive a capability cookie or token.
The route catalogue is generated from the handlers into docs/api/openapi.yaml.