# Computers

Your cloud computer and paired machines: their state, and starting, sleeping or resetting them.

Web version: https://www.svanja.com/docs/api/computers/

Tasks use a computer when they run scripts or open websites. That can be Svanja's cloud computer or your own machine, paired through the command line. You can see your paired machines in [Connections](https://app.svanja.com/connections). These endpoints let you check a computer's state and start, sleep, or reset it. To read computer info, you need the Computers area, which is included in Full access and Read-only. To control a computer, you need Full access or Computers set to **Read and write**. For more background, see [The computer and its browser](https://www.svanja.com/docs/computer-and-browser/).

Use `GET /computers` to list your cloud computer and paired machines, or `GET /computers/{id}` to view a single one. To control a computer, send `POST /computers/{id}/actions` with `action` set to `start`, `sleep`, `stop`, `reset`, or `refresh`.

To pair your own machine, run `svanja runner start` on it (see [svanja runner](https://www.svanja.com/docs/cli/computers/)). Calling `POST /computers` only begins that handoff. Once a person approves it, the endpoint returns a link to the command-line sign-in, and the pairing happens in the command.

## Operations

| Operation | What it does | Effect | Endpoints |
| --- | --- | --- | --- |
| `computer.read` | Read computer status. | Reads only | `GET /computers`<br>`GET /computers/{id}` |
| `computer.start` | Start or wake a computer. | Changes data in Svanja | `POST /computers/{id}/actions` |
| `runner.pair` | Pair a local runner. | Changes access or automation | `POST /computers` |

## Endpoints

### GET /api/v1/computers

List computers

### POST /api/v1/computers

Pair a runner

### GET /api/v1/computers/{id}

Read a computer

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### POST /api/v1/computers/{id}/actions

Run a computer action

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |
