# HTTP API docwell-server's API is described in [`api/openapi.yaml`](https://github.com/docwell/docwell/blob/main/api/openapi.yaml) (OpenAPI 3.1). It is the source of truth: the web, desktop and mobile apps use clients generated from it. - Base path: `/api/v1`. - Authentication: sign in with `POST /api/v1/auth/login` and send the returned token as `Authorization: Bearer `. Refresh it with `POST /api/v1/auth/refresh`. - Errors are JSON: `{"error": "", "message": "...", "fields": {...}}`, where `fields` holds per-field messages for `validation` errors. - File links (`/api/v1/files/{id}`) also accept `?token=` with a short-lived token from `POST /api/v1/files/token`, because `` tags cannot send headers. Health checks for load balancers: `GET /healthz` (process up) and `GET /readyz` (database reachable). ## Example ```bash TOKEN=$(curl -s -X POST https://wiki.example.com/api/v1/auth/login \ -H 'Content-Type: application/json' \ -d '{"email":"me@example.com","password":"..."}' | jq -r .token) curl -s https://wiki.example.com/api/v1/workspaces -H "Authorization: Bearer $TOKEN" ```