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

# Overview

> ChangeGuard API reference

## Base URL

```
https://api.changeguard.ai
```

## Authentication

All API requests require authentication via one of:

* **API Key:** `X-API-Key: cg_your_key` header (for agents and CI/CD)
* **Bearer Token:** `Authorization: Bearer TOKEN` header (for dashboard/user sessions)

## Endpoints

### Agent Endpoints (API Key required)

| Method | Path                 | Description                   |
| ------ | -------------------- | ----------------------------- |
| POST   | `/ingest`            | Push cluster snapshot         |
| POST   | `/ingest/logs`       | Push pod logs                 |
| POST   | `/api/validate`      | Validate a deployment (CI/CD) |
| POST   | `/api/argo/discover` | Register ArgoCD instance      |

### Dashboard Endpoints (Bearer Token required)

| Method | Path                                 | Description          |
| ------ | ------------------------------------ | -------------------- |
| GET    | `/api/clusters`                      | List clusters        |
| GET    | `/api/cluster?id=X`                  | Get cluster snapshot |
| GET    | `/api/score-history?clusterId=X`     | Score history        |
| GET    | `/api/export?clusterId=X&format=csv` | Export report        |
| GET    | `/api/audit`                         | Audit trail          |
| GET    | `/api/correlations`                  | Cross-cluster risks  |
| GET    | `/api/argo/instances`                | ArgoCD instances     |
| GET    | `/api/argo/applications`             | ArgoCD applications  |
| GET    | `/api/keys`                          | List API keys        |
| POST   | `/api/keys`                          | Create API key       |

### Public Endpoints (No auth)

| Method | Path                | Description          |
| ------ | ------------------- | -------------------- |
| GET    | `/health`           | Backend health check |
| POST   | `/api/auth/login`   | Login                |
| POST   | `/api/auth/signup`  | Create account       |
| POST   | `/api/auth/verify`  | Verify token         |
| POST   | `/api/auth/refresh` | Refresh token        |

## Response Format

All responses are JSON. Errors return:

```json theme={null}
{
  "error": "description of the error"
}
```

## Rate Limits

No rate limits are currently enforced for authenticated requests. The WAF rate-limits unauthenticated requests to 2000/5min per IP.
