Skip to main content
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

meta is optional and carries pagination (page, totalPages, totalCount).
See Conventions for the full envelope, money/date rules, and the error-code table, and Authentication for the session/role model.

Authentication

Most endpoints require a Better Auth session cookie. Each endpoint notes its minimum role. Roles are hierarchical: customer is the lowest, then staff, receptionist, manager, owner, developer — a handler requiring receptionist also admits everyone above it.
GET /api/services, GET /api/services/[slug], GET /api/branches, GET /api/availability, GET /api/offers, POST /api/leads, and GET /api/health need no session.

Quick index

The endpoints reached for most often, in one place.

Endpoint groups

Services & Availability

Catalogue, service detail, branches, slot availability.

Bookings (customer)

Create, view, and cancel a booking.

Admin — Bookings

Approve, assign, complete, no-show.

Customers & CRM

Directory, profiles, notes, tags.

Leads

Lead capture plus the admin pipeline.

Memberships

Customer view plus admin management.

Loyalty & Offers

Gems and promotional offers.

Notifications & Realtime

In-app, push, and the Ably token route.

Background Jobs

QStash-triggered job routes.

Health

Liveness and dependency checks.

AI-discovery files

The platform publishes machine-readable descriptions of itself so assistants and crawlers can answer questions about the salon without scraping the UI.

/llms.txt

Concise site summary with live service names.

/llms-full.txt

Full menu with prices, durations, policies, and FAQs.

/sitemap.xml

Crawler discovery — all major AI crawlers allowed.

/robots.txt

Crawl rules; AI crawlers explicitly allowed.
A complete, auto-generated reference (via Mintlify’s native OpenAPI support from a published OpenAPI spec) is a planned follow-up. This page documents the stable, agent-facing surface in the meantime.
Last modified on September 27, 2026