Skip to content

๐Ÿ”Œ API Overview โ€‹

KitchenAsty exposes a RESTful JSON API at /api/.

๐ŸŒ Base URL โ€‹

http://localhost:3000/api

๐Ÿ” Authentication โ€‹

Protected endpoints require a JWT token in the Authorization header:

Authorization: Bearer <token>

Obtain a token via the Authentication endpoints.

๐Ÿ“ฆ Response Format โ€‹

All responses follow a consistent shape:

โœ… Success โ€‹

json
{
  "success": true,
  "data": { ... }
}

๐Ÿ“„ Success with Pagination โ€‹

json
{
  "success": true,
  "data": [ ... ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  }
}

โŒ Error โ€‹

json
{
  "success": false,
  "error": "Description of the error"
}

๐Ÿ“‘ Pagination โ€‹

List endpoints support pagination via query parameters:

ParameterDescriptionDefault
pagePage number1
limitItems per page20

๐Ÿ”ข Common HTTP Status Codes โ€‹

CodeMeaning
200โœ… Success
201โœ… Created
400โš ๏ธ Bad request (validation error)
401๐Ÿ”’ Unauthorized (missing or invalid token)
403๐Ÿšซ Forbidden (insufficient permissions)
404๐Ÿ” Not found
429โฑ๏ธ Too many requests (rate limited)
500๐Ÿ’ฅ Internal server error

โฑ๏ธ Rate Limiting โ€‹

All /api/ endpoints are rate-limited:

  • 100 requests per 15-minute window per IP address
  • Returns 429 with a JSON error when exceeded
  • Standard RateLimit-* headers are included in responses

๐Ÿ“š OpenAPI / Swagger โ€‹

Interactive API documentation is available at:

๐Ÿ’š Health Check โ€‹

GET /api/health
json
{
  "success": true,
  "data": {
    "status": "ok",
    "timestamp": "2025-01-01T00:00:00.000Z",
    "version": "1.0.0"
  }
}