Files
hope-events/backend/API_DOCUMENTATION.md
T
joshuaandClaude Opus 5.5 9913a13f70 WIP 2.0.0: v1 removed; Argon2id passwords; node-fetch gone
- /api (v1) answers 410 API_V1_REMOVED, except provider webhooks
  (/api/webhooks/*, /api/whatsapp/webhook) and links in sent messages
  (308s, one-click POST). 43 v1 route files and deprecation.ts removed;
  /docs redirects to /docs/v2; API_DOCUMENTATION.md points there.
- Read-only and impersonation lists name v2 paths only. The campus
  scope route test now runs over v2 routes (v2CampusScope.test.ts).
- Passwords hashed with Argon2id (@node-rs/argon2); bcrypt hashes still
  sign in and are re-hashed at the next sign-in.
- e2e on /api/v2 only (v2() helper); Playwright waits on /api/v2.
- MIGRATING-TO-2.md with the full v1 -> v2 table.
- Two documented response shapes corrected.

Backend 690 tests and e2e 102/102 (PayFast sandbox skipped) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:35:06 +02:00

17 lines
975 B
Markdown

# Cross Events — API Documentation
Since 2.0 the API is `/api/v2` only, described by **OpenAPI 3.1** generated from the route
declarations (`backend/src/v2/`), so it is never out of date:
- **Reference:** `/docs/v2` on the running backend (admin token).
- **Document:** `GET /api/v2/openapi.json` (admin); the frontend's copy is
`frontend/src/lib/api-v2/openapi.json` (regenerate with `npm run api:types` in the repo root).
Every answer is `{ "data": … }`; lists add `meta: { page, limit, total, pages }` (`?page=&limit=`);
errors are `{ "error": { "code", "message", "reason"?, "fields"? } }`. Send the sign-in token as
`Authorization: Bearer <token>` (`POST /api/v2/auth/login`).
Version 1 (`/api/…`) was removed in 2.0 and answers `410 Gone`, except the incoming webhooks and the
links in messages already sent. What changed and the full v1 → v2 table are in
[MIGRATING-TO-2.md](../MIGRATING-TO-2.md). The old v1 reference is in git history (tag `v1.52.3`).