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

# API Reference

> Every Autopilot dashboard API endpoint, grouped by function.

All endpoints are served on the dashboard port (default 9090). Responses use the envelope
`{"data": ..., "meta": {"total": N, "timestamp": "..."}}`.

## Core

```
GET /api/v1/cluster                     # Cluster summary (nodes, pods, cost, health score)
GET /api/v1/cluster/usage?duration=24h  # Cluster CPU/memory time-series
GET /api/v1/nodes                       # Node list with metrics
GET /api/v1/nodes/{name}                # Node detail
GET /api/v1/pods                        # Pod list
GET /api/v1/namespaces                  # Namespace list with resource attribution
GET /api/v1/health                      # System health checks
GET /api/v1/mode                        # Controller mode + enabled dashboard features
```

## Optimization

```
GET    /api/v1/recommendations                     # Resize recommendations (60s cache)
GET    /api/v1/recommendations/{ns}/{name}         # Recommendation audit detail
PATCH  /api/v1/overrides/{ns}/{name}/floor         # Set floor/ceiling annotations
DELETE /api/v1/overrides/{ns}/{name}/floor         # Remove floor/ceiling annotations
GET    /api/v1/overrides                            # Workloads with override annotations
POST   /api/v1/overrides/bulk                       # Bulk set/remove floors (≤500)
GET    /api/v1/policies                             # All CRD policies
GET    /api/v1/policy-overrides                     # Active runtime policy overrides
PUT    /api/v1/policy-overrides/{kind}/{name}       # Set a policy field override
GET    /api/v1/scheduled-scales                     # Scheduled scale policies
GET    /api/v1/scaling                              # Scaling activity timeline
GET    /api/v1/scaling/status                       # Bootstrapping suppression + decision log
GET    /api/v1/resize-stats                         # Resize evaluation cycle stats
POST   /api/v1/resize-cycle/trigger                 # Trigger an immediate resize cycle
GET    /api/v1/idle-workloads                       # Workloads currently in idle mode
```

## HPA tuning

```
GET    /api/v1/hpas                                 # Fleet-wide HPA audit list + summary
POST   /api/v1/hpas/bulk                            # Bulk tune ≤500 HPAs
PUT    /api/v1/namespaces/{ns}/hpa/{name}/auto-override         # Per-HPA Auto opt in/out
PUT    /api/v1/namespaces/{ns}/hpa/{name}/target-override       # Per-HPA CPU target
PUT    /api/v1/namespaces/{ns}/hpa/{name}/scaling-sensitivity   # Per-HPA responsiveness
PUT    /api/v1/namespaces/{ns}/hpa/{name}/min-replicas-floor    # Enforced minReplicas floor
PUT    /api/v1/namespaces/{ns}/hpa/{name}/idle-override         # Per-HPA idle mode
```

## Resource audit

```
GET    /api/v1/resource-audit                                      # Template/rec/pod drift per workload
POST   /api/v1/resource-audit/{ns}/{name}/reset-to-deploy          # Strip + delete rec + restart
DELETE /api/v1/resource-audit/{ns}/{name}/recommendation           # Delete Recommendation CRD
DELETE /api/v1/resource-audit/{ns}/{name}/annotations              # Strip resize annotations
POST   /api/v1/resource-audit/bulk                                 # Bulk apply one action (≤500)
```

## Rebalancer

```
POST   /api/v1/rebalancer/plans              # Prepare a rebalance plan
GET    /api/v1/rebalancer/plans/{id}         # Get plan detail
POST   /api/v1/rebalancer/plans/{id}/execute # Execute (async, returns 202)
DELETE /api/v1/rebalancer/plans/{id}         # Discard
GET    /api/v1/rebalancer/runs               # List historical runs
GET    /api/v1/rebalancer/runs/{id}          # Run detail
POST   /api/v1/rebalancer/runs/{id}/cancel   # Cancel an Executing or Planning run
```

## Cost & GCP

```
GET /api/v1/cost/history               # Cluster cost history
GET /api/v1/cost/packages              # Package cost attribution
GET /api/v1/cost/packages/history      # Package cost history
GET /api/v1/gcp-services               # GCP managed services
GET /api/v1/gcp-services/{type}/{name} # Service detail
GET /api/v1/network                    # Cluster network overview (throughput, top talkers, node health)
GET /api/v1/network/usage?duration=24h # Network time-series (Rx/Tx/errors/drops)
GET /api/v1/network/namespace/{name}   # Per-namespace pod network breakdown
```

## Operations

```
GET /api/v1/events                     # K8s event timeline
GET /api/v1/alerts                     # All alerts
GET /api/v1/alerts/actionable          # Actionable alerts only
GET /api/v1/maintenance/summary        # Maintenance window status
GET /api/v1/maintenance/runs           # Maintenance run history
GET /api/v1/notes?namespace=<ns>       # Operator notes for a namespace
POST /api/v1/notes                     # Add a note
```

## Exceptions & storage

```
GET  /api/v1/limit-exceptions                             # Limit overage exceptions
POST /api/v1/limit-exceptions/{ns}/{name}/approve         # Approve as new normal
POST /api/v1/limit-exceptions/{ns}/{name}/reject          # Reject and revert
GET  /api/v1/storage-exceptions                           # PVC storage exceptions
POST /api/v1/storage-exceptions/{ns}/{name}/expand        # Expand PVC (confirm required)
POST /api/v1/storage-exceptions/{ns}/{name}/acknowledge   # Acknowledge without expanding
POST /api/v1/storage-exceptions/{ns}/{name}/snooze        # Snooze (auto-reopens)
GET  /api/v1/pvcs                                         # Cluster-wide PVC list + days-to-full
POST /api/v1/pvcs/{ns}/{name}/expand                      # Direct expand (confirm required)
PATCH /api/v1/pvcs/{ns}/{name}/override                   # Per-PVC ceiling/threshold/auto-expand
GET  /api/v1/alert-suppressions                           # Alert suppression annotations
PUT  /api/v1/alert-suppressions/{ns}/{name}               # Set suppression
```

## Interruptions

```
GET  /api/v1/interruptions              # Spot interruption events
GET  /api/v1/interruptions/stats        # Aggregate statistics
POST /api/v1/interruptions/simulate     # Trigger a spot interruption simulation (async 202)
```

## Pod tools (admin, double-keyed, audited)

These upgrade to a WebSocket and are live only when their feature flag **and** `auth.enabled`
are set. See [Pod Tools](/operations/pod-tools).

```
GET /api/v1/namespaces/{ns}/pods/{pod}/exec           # Terminal (WebSocket)
GET /api/v1/namespaces/{ns}/pods/{pod}/logs           # Log stream (WebSocket)
GET /api/v1/namespaces/{ns}/logs?pods=a,b,c           # Merged multi-pod log stream
GET /api/v1/namespaces/{ns}/pods/{pod}/files          # List a directory
GET /api/v1/namespaces/{ns}/pods/{pod}/files/download # Download a file or dir (tar)
POST /api/v1/namespaces/{ns}/pods/{pod}/files/upload  # Upload a file
GET /api/v1/terminal/recordings                       # List session recordings
GET /api/v1/terminal/recordings/{id}                  # Recording playback (.cast)
```

## Access & MCP

```
GET  /api/v1/auth/session               # Session identity (never 401)
GET/PUT /api/v1/access-policy           # Read/replace the AccessPolicy (admin)
GET  /api/v1/access-requests            # Pending access-request queue (admin)
POST /api/v1/access-requests/approve    # Approve a request (admin)
GET  /api/v1/access-events              # Login + access audit trail (admin)
POST /api/v1/api-keys                   # Mint a read-only MCP API key (admin)
GET  /api/v1/api-keys                   # List key metadata (admin)
DELETE /api/v1/api-keys/{id}            # Revoke a key (admin)
ALL  /mcp                               # Read-only MCP server (see MCP reference)
```
