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

# Dashboard Settings

> What every setting on the Settings → Headless API page does.

All Headless settings live in the admin panel under **Settings → Headless API** (`/dashboard`). You need the **MANAGE\_SETTINGS** permission. The **API Documentation** button at the top opens the interactive docs (`/headless/docs`) in a new tab.

> [!NOTE]
>
> The Headless API is not a *module*; it is a built-in feature of the site. Settings are stored in the `Settings` table and every change is written to the admin log.

## Headless API Status

The master switch. While it is off, every `/headless/v1/*` request returns `404 HEADLESS_DISABLED`. The toggle is saved the moment you flip it; you do not need to press **Save**.

> [!TIP]
>
> Make sure the API is on before you publish your theme. For maintenance, use LeaderOS's **maintenance mode** instead of turning the API off: during maintenance staff can keep using the API while everyone else gets `503 MAINTENANCE`.

## Public Key

The key sent in the `X-LeaderOS-Key` header of every API request (`pk_live_` + 32 hex characters).

* **It is public by design**: it may appear in browser code. There is no secret key. Security comes from allowed origins and per-player Bearer tokens.
* **Copy**: copies the key to the clipboard.
* **Generate New Key**: creates a new key. You are asked to confirm because **every frontend using the old key stops working until you update it** (`INVALID_API_KEY`). Use it if the key leaks or a team member leaves.
* **API URL**: `https://your-site.com/headless/v1`. In the SDK you pass the site root (`https://your-site.com`) as `baseUrl`.

## Allowed Origins (CORS)

The list of websites that may call the API directly from a browser. Write **one origin per line** (scheme + host + optional port, no path):

```
https://shop.example.com
http://localhost:3000
https://*.example.com
```

* `*.` works as a subdomain wildcard.
* **Your site's own address and the Frontend URL below are always allowed.**
* Requests without an `Origin` header (server-side, `curl`, mobile apps) are always accepted, because the origin check only targets browsers.
* An invalid format (for example a trailing path or a missing scheme) is rejected when you save.

### Allow all origins (development only)

Turns the origin check off completely. Handy for local development, but it **must be off on a live site**; otherwise any website could call the API from a browser with your key.

## Frontend URL & Pages

The API sends players to **your frontend** from e-mails and from external providers (payments, login). Define your frontend address and page paths here.

### Frontend URL

The root of your frontend, for example `https://shop.example.com`. **If empty, your LeaderOS site address is used.** No trailing `/` (it is stripped when saving).

### Page paths

Each row is a path template and must start with `/`. Leave it empty to use the default (shown as the placeholder). Placeholders such as `{token}` are filled in automatically; **only the placeholders listed under each field are allowed.**

| Key | Default path | Used when |
| - | - | - |
| Home | `/` | Generic returns, redirects after errors |
| Reset password | `/reset-password/{token}` | Link in the password-reset e-mail |
| Verify e-mail | `/verify-email/{token}` | Link in the verification e-mail |
| Recover 2FA | `/tfa/recover/{token}` | Two-factor recovery e-mail |
| Confirm e-mail change | `/account/settings/security/confirm-email-change/{token}` | E-mail change confirmation link |
| Payment success | `/payment/success?order={orderId}` | Successful return from a payment provider |
| Payment error | `/payment/error?order={orderId}&error={error}` | Failed or cancelled payment |
| Manual payment instructions | `/payment/pay/manual/{orderId}` | Manual payments such as bank transfer |
| Account linked | `/account/settings/linked-accounts?status={status}&provider={provider}&message={message}` | Return from Discord and other account linking |
| Login callback | `/auth/callback?authToken={authToken}&exchange={exchange}&error={error}` | Return from external-provider login |
| Blog post | `/blog/posts/{slug}` | Link in Discord notifications |
| Forum thread | `/forum/threads/{id}/{slug}` | Link in Discord notifications |
| Support ticket | `/support/tickets/{id}` | Link in Discord notifications |

> [!WARNING]
>
> **Create these pages in your theme**, or change the paths to match your own pages. Otherwise the password-reset e-mail or the payment return will land on a 404. The template from `create-leaderos-theme` already has all of them.

## Sessions

**Session lifetime (minutes)**: how long a session without "remember me" survives inactivity. Default `1440` (1 day), allowed range `5` – `525600`. The lifetime is extended on every request. Sessions started with **"remember me"** last 1 year.

When the password or e-mail changes, all sessions are closed like on the main site and the player who made the change receives a new token (the SDK stores it automatically).

## Endpoint Groups

You can switch off feature groups your frontend does not need. A disabled group returns **404**. Only the **site** group cannot be disabled. Groups of disabled modules are unavailable anyway.

| Group | Contents |
| - | - |
| Login & Registration (`auth`) | Login, registration, password reset, e-mail |
| Account (`account`) | Profile, settings, security, avatar |
| Store (`store`) | Categories, products |
| Cart & Orders (`cart`) | Cart, coupons, order details |
| Credits (`credits`) | Credit top-up, transfer |
| Chest (`chest`) | Chest and gifting |
| Gift Codes (`gifts`) | Redeeming codes |
| Bazaar (`bazaar`) | Player market |
| Gaming Night (`gaming-night`) | Event purchases |
| Fortune Wheel (`fortune-wheel`) | Spinning the wheel |
| Blog (`blog`) | Posts, categories, comments |
| Forum (`forum`) | Categories, threads, replies |
| Support (`support`) | Support tickets |
| Suggestions (`suggestions`) | Suggestion system |
| Help Center (`help`) | Articles, search |
| Applications (`applications`) | Staff applications |
| Forms (`forms`) | Custom forms |
| Downloads (`downloads`) | Files |
| Members (`members`) | Member list |
| Leaderboards (`leaderboards`) | Rankings |
| Games (`games`) | Game pages |
| Punishments (`punishments`) | Punishment list |
| Changelog (`changelog`) | Update notes |
| Pages (`pages`) | Custom CMS pages |
| Vote (`vote`) | Voting sites |
| Staff (`staff`) | Staff list |
| Discord (`discord`) | Discord linking |
| Account Linking (`account-linking`) | External account linking |
| AI (`ai`) | AI support replies |

> [!TIP]
>
> Apply least privilege: switching off groups you do not use shrinks the attack surface. If you only build a store, for example, you can turn off forum, support and suggestions.

## Developer Resources

The section at the bottom of the page links to the interactive docs, `openapi.json`, `llms.txt` and `llms-full.txt`. See [Developer resources](https://developer.leaderos.net/headless/en/developer-resources.md).

## Saving

The status toggle and public-key actions apply immediately. All other settings (origins, Frontend URL, page paths, session lifetime, groups) are saved with the **Save Changes** button at the bottom of the page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.