OpenAPI 3.0 documentation for the Nova Rewards backend REST API.
Start the backend server:
cd novaRewards/backend
npm run dev
Open your browser at:
http://localhost:3001/api/docs
The /api/docs route is protected by HTTP Basic Auth in production.
Set the following environment variables on your server:
DOCS_USER=nova # username (default: nova)
DOCS_PASS=<your-secret> # password — leave unset to disable the gate
When prompted by the browser, enter the credentials above.
openapi.json into Postmandocs/api/openapi.json from this repository.baseUrl variable to http://localhost:3001/api (or your production URL).To regenerate openapi.json after route changes:
cd novaRewards/backend
npm run generate:openapi
Most user-facing endpoints require a JWT Bearer token.
POST /auth/login with your email and password.accessToken value from the response.Bearer prefix — Swagger adds it automatically).All subsequent requests from the UI will include the Authorization: Bearer <token> header.
Merchant endpoints use an x-api-key header instead of a Bearer token.
POST /merchants/register — the plain-text API key is returned once in the response. Store it securely.| Endpoint group | Auth method |
|---|---|
POST /auth/* |
None (public) |
POST /users |
None (public) |
GET /users/:walletAddress/points |
None (public) |
GET /campaigns/:merchantId |
None (public) |
GET /users/:id, PATCH, DELETE |
Bearer JWT |
GET /redemptions, POST /redemptions |
Bearer JWT |
GET /leaderboard |
Bearer JWT |
GET /admin/* |
Bearer JWT (admin role) |
GET /drops/eligible, POST /drops/:id/claim |
Bearer JWT |
POST /rewards/distribute |
Merchant API key |
POST /campaigns, GET /campaigns |
Merchant API key |
GET /contract-events |
Merchant API key |
GET /admin/email-logs |
Merchant API key |
GET /transactions/merchant-totals |
Merchant API key |
When the server is running, the spec is also served at:
GET /api/docs/openapi.json
This is useful for CI pipelines that need to validate or diff the spec automatically.