> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theroyalglow.in/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Agent-friendly REST endpoints for the Royal Glow platform.

# API Reference

The public API uses clean, human-readable RESTful URLs with a consistent JSON
envelope, so both browsers and AI agents can discover and call them.

<Info>
  **Base URLs:** customer endpoints are on `https://theroyalglow.in`
  (local: `http://localhost:3000`); the admin endpoint groups are a separate app
  on `https://admin.theroyalglow.in` (local: `http://localhost:3001`) with **no
  `/api/admin/` segment**. Most endpoints require a Better Auth session cookie;
  public endpoints (services, availability, lead capture, health) need none.
  Every response — except `GET /api/health` — uses the shared `{ success, data }`
  envelope.
</Info>

## Response shape

<Tabs>
  <Tab title="Success">
    ```json theme={null}
    { "success": true, "data": {}, "meta": {} }
    ```
  </Tab>

  <Tab title="Error">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": "VALIDATION_ERROR",
        "message": "Invalid request data",
        "statusCode": 400,
        "requestId": "req_xxx"
      }
    }
    ```
  </Tab>
</Tabs>

## Endpoint groups

<Columns cols={2}>
  <Card title="Services & Availability" href="/docs/api-reference/services">
    Catalogue, service detail, slot availability
  </Card>

  <Card title="Bookings (customer)" href="/docs/api-reference/bookings">
    Create, view, cancel a booking
  </Card>

  <Card title="Admin — Bookings" href="/docs/api-reference/admin-bookings">
    Approve, assign, complete, no-show
  </Card>

  <Card title="Customers & CRM" href="/docs/api-reference/customers-crm">
    Directory, profiles, notes, tags
  </Card>

  <Card title="Leads" href="/docs/api-reference/leads">
    Lead capture + admin pipeline
  </Card>

  <Card title="Memberships" href="/docs/api-reference/memberships">
    Customer view + admin management
  </Card>

  <Card title="Loyalty & Offers" href="/docs/api-reference/loyalty-offers">
    Gems and promotional offers
  </Card>

  <Card title="Notifications & Realtime" href="/docs/api-reference/notifications">
    In-app, push, Ably token
  </Card>

  <Card title="Background Jobs" href="/docs/api-reference/jobs">
    QStash-triggered job routes
  </Card>

  <Card title="Health" href="/docs/api-reference/health">
    Liveness + dependency checks
  </Card>
</Columns>

## Key endpoints (quick index)

| Action                 | Method | Path                                                |
| ---------------------- | ------ | --------------------------------------------------- |
| List services          | GET    | `/api/services`                                     |
| Check availability     | GET    | `/api/availability?date={YYYY-MM-DD}&branchId={id}` |
| Submit booking request | POST   | `/api/bookings`                                     |
| Get booking status     | GET    | `/api/bookings/{id}`                                |
| Submit campaign lead   | POST   | `/api/leads`                                        |
| Health check           | GET    | `/api/health`                                       |

## AI-discovery files

<Columns cols={2}>
  <Card title="/llms.txt" href="/llms.txt">
    Concise site summary with live service names.
  </Card>

  <Card title="/llms-full.txt" href="/llms-full.txt">
    Full menu with prices, durations, policies, and FAQs.
  </Card>

  <Card title="/sitemap.xml" href="/sitemap.xml">
    Crawler discovery — all major AI crawlers allowed.
  </Card>

  <Card title="/robots.txt" href="/robots.txt">
    Crawl rules; AI crawlers explicitly allowed.
  </Card>
</Columns>

<Info>
  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.
</Info>


## Related topics

- [API Reference](/content/docs/api-reference/index.md)
- [Leads](/content/docs/api-reference/leads.md)
- [Memberships](/content/docs/api-reference/memberships.md)
- [Background Jobs](/content/docs/api-reference/jobs.md)
- [Bookings](/content/docs/api-reference/bookings.md)
