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

# Platform API

> Programmatic access to Uniac's control plane.

The Platform API exposes everything the CLI and dashboard do. Use it to integrate Uniac into your own tooling.

## Base URL

```
https://api.uniac.ai
```

## Authentication

Bearer token in the `Authorization` header:

```
Authorization: Bearer <token>
```

The token is the JWT minted by [`uniac auth login`](/cli/auth) and stored in `~/.uniac/auth.json`. Print it for use in scripts with `uniac auth token`.

## Resources

### Projects

| Verb     | Path                           | Purpose                                    |
| -------- | ------------------------------ | ------------------------------------------ |
| `GET`    | `/api/projects`                | List projects you own.                     |
| `POST`   | `/api/projects`                | Create a project. Body: `{"name": "..."}`. |
| `GET`    | `/api/projects/{name}`         | Get a project by name.                     |
| `GET`    | `/api/projects/by-slug/{slug}` | Get a project by slug.                     |
| `DELETE` | `/api/projects/{name}`         | Delete a project (async; returns a task).  |

### Services

| Verb     | Path                                         | Purpose                     |
| -------- | -------------------------------------------- | --------------------------- |
| `GET`    | `/api/projects/{name}/services`              | List Services in a project. |
| `DELETE` | `/api/projects/{name}/services/{service_id}` | Delete a Service (async).   |

### Service instances

| Verb   | Path                                   | Purpose                                                   |
| ------ | -------------------------------------- | --------------------------------------------------------- |
| `GET`  | `/api/services/{service_id}/instances` | List running instances and their status.                  |
| `POST` | `/api/services/{service_id}/scale`     | Scale to N replicas. Body: `{"target_replica_count": N}`. |

### Health

| Verb  | Path      | Purpose                |
| ----- | --------- | ---------------------- |
| `GET` | `/health` | Liveness.              |
| `GET` | `/ready`  | Readiness (checks DB). |

Mutating endpoints return `202` with a task envelope; poll the task to observe completion.
