Skip to main content

API Overview

Base URL

http://localhost:3000

Response Format

All API responses follow the envelope format:

  • Success: { "data": <payload>, "meta"?: <pagination> }
  • Error: { "error": "<type>", "message": "<detail>", "statusCode": <number> }

Health Check

GET /health

Check server status. No authentication required.

Response:

{
"status": "ok",
"uptime": 3600.5,
"timestamp": "2026-03-06T12:00:00.000Z"
}

Authentication

Protected endpoints require:

Authorization: Bearer <accessToken>

The JWT middleware automatically injects x-user-id and x-user-role headers for downstream use.

Admin endpoints (/admin/api/*) additionally require x-user-role: admin, which is set automatically when the JWT contains an admin role.