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

# API

> Authenticate with a sei_ token and query health, briefing, analytics, and revenue.

The Seiton API, CLI, and MCP server share the same permissions, safety checks, and JSON envelope. Use the API from a backend.

Base URL: `https://seiton.app/api/v1`

## Which one should I use?

* **Read health, briefing, analytics, revenue, churn, SEO** — account token (`sei_`) against the API
* **AI agent / scripting** — same `sei_` token with the API, the [CLI](/developers/cli), or [MCP](/developers/mcp)
* **Scoped access** — create a token limited to specific websites and resources in **Settings → API / MCP**

There is one token type. Scope it to websites and permissions instead of minting a second prefix.

## Authentication

```bash theme={null}
Authorization: Bearer sei_xxx
```

Create a token in the dashboard under **Settings → API / MCP**, or via `seiton tokens create` / `seiton_tokens_create` with `confirm: true`.

Keep tokens secret. Do not put them in frontend code or public repositories.

## Successful requests

```json theme={null}
{
  "status": "success",
  "data": {}
}
```

## Errors

```json theme={null}
{
  "status": "error",
  "error": {
    "code": 401,
    "message": "Invalid or expired token."
  }
}
```

| Code | Meaning                                                 |
| ---- | ------------------------------------------------------- |
| 400  | Bad request — missing fields or invalid JSON            |
| 401  | Missing or invalid Bearer token                         |
| 402  | Trial expired — subscribe to continue                   |
| 403  | Token lacks permission, or the action is dashboard-only |
| 404  | Project, token, or resource does not exist              |
| 409  | Conflict (for example a token revoking itself)          |
| 429  | Rate limited — check `X-RateLimit-*` headers            |
| 500  | Unexpected server error                                 |

Rate limit: 60 requests per token per minute. A 429 body also includes `limit`, `remaining`, and `reset`.

Website deletion and connecting or disconnecting payment providers are dashboard-only and return 403.

## Common use cases

* `GET /projects` — list websites in scope with a health snapshot
* `GET /projects/{id}/health` — score, confidence, dimensions
* `GET /projects/{id}/briefing` — morning briefing and priorities
* `GET /projects/{id}/signals` — optional `dimension` and `severity`
* `GET /projects/{id}/analytics?period=7d`
* `GET /projects/{id}/revenue`
* `GET /projects/{id}/churn`
* `GET /projects/{id}/seo`
* `GET /projects/{id}/integrations`
* `POST /projects/{id}/integrations/{provider}/sync`
* `GET\|POST\|DELETE /projects/{id}/expenses`
* `GET /tokens` — metadata only, never the secret
* `POST /tokens` — mint; send `confirm: true` or receive a preview
* `DELETE /tokens/{id}` — revoke; same confirmation gate

Periods: `today`, `yesterday`, `7d`, `30d`, `3m`, `12m`, `all`.

## Example

```bash theme={null}
curl https://seiton.app/api/v1/projects \
  -H "Authorization: Bearer sei_xxx"
```
