Skip to main content
These API routes are for the Phase 2 web client (apps/web). The mobile app does NOT use these endpoints — it calls Supabase directly via RPC functions, table queries, and supabase.auth methods.

Base URL

EnvironmentURL
Developmenthttp://localhost:3000/api
Productionhttps://recipe-room.vercel.app/api

Authentication

Protected endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <jwt-token>
Tokens are obtained via the login endpoint and managed by Supabase Auth.

Error Format

All errors follow a consistent structure:
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid email format",
    "details": { "field": "email" }
  }
}
CodeStatusDescription
VALIDATION_ERROR400Invalid input data
UNAUTHORIZED401Missing or invalid token
FORBIDDEN403Insufficient permissions
NOT_FOUND404Resource not found
CONFLICT409Duplicate resource
INTERNAL_ERROR500Server error

Pagination

List endpoints support pagination via query parameters:
ParameterDefaultDescription
page1Page number
limit20Items per page
Paginated responses include a pagination object:
{
  "data": [...],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  }
}

Endpoint Groups