Royal Glow internal docs · now fully interactive — Steps, API tables, file trees & live status
Royal Glow Docs
API Reference

API Reference

REST API for the Royal Glow platform — envelope, auth, and endpoint groups.

API Reference

The Royal Glow API is a set of Next.js route handlers under /api. All endpoints share one JSON envelope, human-readable RESTful paths, and stable error codes — so both browsers and AI agents can call them predictably.

Base URLs: customer endpoints are on https://theroyalglow.in (local: http://localhost:3000); admin endpoint groups (Admin — Bookings, Customers & CRM, the admin halves of Leads / Memberships / Loyalty & Offers, and Background Jobs) are a separate app on https://admin.theroyalglow.in (local: http://localhost:3001) and carry no /api/admin/ segment — the subdomain is the namespace. Most endpoints require a Better Auth session cookie and note their minimum role. This reference is hand-authored from the actual route handlers and the shared Zod schemas in packages/types; when a route's schema changes, update the corresponding page.

Base & envelope

{ "success": true, "data": {}, "meta": {} }

meta is optional and carries pagination (page, totalPages, totalCount).

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request data",
    "statusCode": 400,
    "requestId": "req_xxx",
    "retryable": false,
    "details": {}
  }
}

See Conventions for the full envelope, money/date rules, and the error-code table, and Authentication for the session/role model.

Authentication

Endpoint groups

OpenReport an issue

Was this page helpful?

On this page