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

# Scrubbe API Reference: Overview and Getting Started

> Everything you need to start integrating with the Scrubbe API — base URL, authentication methods, response formats, rate limits, and versioning.

The Scrubbe REST API gives you programmatic access to incidents, postmortems, team management, integrations, and analytics. All requests are made over HTTPS to a versioned base URL, and all request and response bodies use JSON. This reference covers the conventions that apply across every endpoint.

## Base URL

All API endpoints are relative to the following base URL:

```
https://your-api-domain.com/api/v1
```

## Authentication

Scrubbe supports two authentication methods. Use whichever fits your use case — both are accepted on all protected endpoints unless stated otherwise.

### Bearer token

Obtain a short-lived access token by calling `POST /auth/login`. Include it in the `Authorization` header of every subsequent request.

```http theme={null}
Authorization: Bearer <accessToken>
```

### API key

For server-to-server or ingestion use cases, generate a long-lived API key from the dashboard or via the [API Keys](/api-reference/api-keys) endpoints, then pass it in the `X-API-Key` header.

```http theme={null}
X-API-Key: <key>
```

<Note>
  The ingestion endpoints (`/api/v1/ingestion/*`) accept **only** `X-API-Key` authentication. Bearer tokens are not valid on those routes.
</Note>

## Content type

Every request with a body must include the following header:

```http theme={null}
Content-Type: application/json
```

## Response format

### Success response

```json theme={null}
{
  "success": true,
  "message": "Operation completed successfully.",
  "data": { ... }
}
```

### Paginated response

```json theme={null}
{
  "success": true,
  "message": "Records retrieved.",
  "data": {
    "items": [ ... ],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 143,
      "totalPages": 8
    }
  }
}
```

### Error response

```json theme={null}
{
  "success": false,
  "message": "Validation failed.",
  "errors": ["email is required", "password must be at least 8 characters"]
}
```

## Rate limits

Rate limits are enforced per IP address and per authenticated user. When a limit is exceeded, the API returns `429 Too Many Requests`.

| Scope     | Limit        | Window |
| --------- | ------------ | ------ |
| Global    | 200 requests | 15 min |
| Auth      | 10 requests  | 15 min |
| Email OTP | 3 requests   | 1 min  |
| API Key   | 100 requests | 1 min  |

<Tip>
  Check the `Retry-After` response header when you receive a `429`. It contains the number of seconds to wait before retrying.
</Tip>

## Versioning

The current API version is `v1`, reflected in every endpoint path. Breaking changes will be introduced under a new version prefix (e.g., `/api/v2`). Non-breaking additions such as new fields or optional parameters may be added to `v1` without a version bump.

## Further reading

<Columns cols={2}>
  <Card title="Authentication" icon="lock" href="/api-reference/auth">
    Login, register, token refresh, and profile management.
  </Card>

  <Card title="Error reference" icon="circle-exclamation" href="/api-reference/errors">
    HTTP status codes, error shapes, and remediation guidance.
  </Card>

  <Card title="API keys" icon="key" href="/api-reference/api-keys">
    Create, rotate, and revoke programmatic API keys.
  </Card>

  <Card title="Ingestion" icon="arrow-down-to-line" href="/api-reference/ingestion">
    Push events from external tools into Scrubbe.
  </Card>
</Columns>
