# Restart a Computer

URL: https://heaven.dev/docs/reference/computers/restart
Updated: 2026-11-21

Reboot a Computer or start it if it is stopped. A reboot ends running processes and keeps the disk.

`POST /v1/computer/modify`

## Parameters

- `computer` (string): Computer name or ID.
- `computers` (string[]): Computer names or IDs, supplied instead of `computer`.
- `wait` (boolean or string): Wait for the operation to finish. Use true for up to 10m or give a shorter duration such as 2m. Accepted work continues after the wait ends.

## Returns

- `data` (object, always present): A restart operation or per-Computer results.
  - `alternative-1` (object): An operation and its request ID.
    - `name` (string): Computer's name after creation, copying or reset. May be omitted.
    - `notes` (string[]): Other effects, including settings or integrations excluded from a copy. May be omitted.
    - `operation` (object, always present): Current operation state.
      - `by` (string): Requester's email address, or user ID if no email is recorded. Omitted for your own requests. May be omitted.
      - `completed_at` (string (date-time)): When the operation reached its final state. Absent while unfinished. May be omitted.
      - `computer_id` (string, always present): Computer's stable ID.
      - `created_at` (string (date-time)): When Heaven accepted the change. May be omitted.
      - `error_code` (string): Recorded failure code. May be omitted.
      - `id` (string, always present): Operation ID for `operation view`.
      - `kind` (string, always present): Change being tracked.
      - `message` (string): An explanation of the recorded failure and any next action. May be omitted.
      - `state` (string, always present): `accepted` means saved and unfinished. `complete` means the change finished. `failed` means it could not finish. `superseded` means a newer change replaced it before completion. Values: `"accepted"`, `"complete"`, `"failed"`, `"superseded"`.
    - `pool_note` (string): How stopping this Computer affects its pool. May be omitted.
    - `renamed` (object): Addresses affected by a rename. May be omitted.
      - `https` (string, always present): Website URL using the new name.
      - `mail` (string, always present): Domain under which the Computer receives mail.
      - `names` (object[]): Custom names created with the Computer and whether they followed its rename. May be omitted.
        - `items` (object): A custom name affected by a Computer rename.
          - `from` (string, always present): Previous custom name.
          - `moved` (boolean, always present): Whether the name moved. False means the destination was occupied and the old custom name was retained.
          - `to` (string, always present): Name corresponding to the Computer's new name.
      - `note` (string, always present): What happened to old addresses and when the guest hostname changes.
      - `ports` (string[]): Published port addresses that use the new name. May be omitted.
      - `ssh` (string, always present): SSH command using the new name.
    - `request_id` (string, always present): Request ID identifying this change across retries.
    - `ssh_dest` (string): SSH destination in `NAME@DOMAIN` form. May be omitted.
    - `url` (string): Computer's website address. May be omitted.
  - `alternative-2` (object): Results for a multi-Computer request. Each target can succeed or fail independently.
    - `request_id` (string, always present): Request ID for this multi-Computer change.
    - `results` (object[] | null, always present): Each target's accepted operation, direct result or error, in request order.
      - `items` (object): One Computer's operation, direct result or error.
        - `computer` (object, always present): Target's ID and name.
          - `id` (string, always present): Computer ID.
          - `name` (string, always present): Computer's name when this result was prepared.
        - `data` (JSON value): Direct command result, with the same meaning as a single-Computer result. May be omitted.
        - `error` (object): Reason this target could not be changed. May be omitted.
          - `action` (object): A suggested command addressing the problem. May be omitted.
            - `command` (string, always present): Command's catalog name.
            - `line` (string, always present): Complete suggested command line.
          - `kind` (string, always present): Error category. `unknown` means the effect is uncertain; reconcile before retrying.
          - `message` (string, always present): What happened and any action needed from you.
          - `operation_id` (string): Operation to read before repeating uncertain work. May be omitted.
          - `request_id` (string): Request ID identifying the change during reconciliation. May be omitted.
          - `retry_after` (integer): Seconds before retrying a rate-limited request or a refused wait. May be omitted.
          - `url` (string): Payment page for a payment-required response. May be omitted.
        - `operation` (object): Accepted operation for this target, if the command returns one. May be omitted.
          - `by` (string): Requester's email address, or user ID if no email is recorded. Omitted for your own requests. May be omitted.
          - `completed_at` (string (date-time)): When the operation reached its final state. Absent while unfinished. May be omitted.
          - `computer_id` (string, always present): Computer's stable ID.
          - `created_at` (string (date-time)): When Heaven accepted the change. May be omitted.
          - `error_code` (string): Recorded failure code. May be omitted.
          - `id` (string, always present): Operation ID for `operation view`.
          - `kind` (string, always present): Change being tracked.
          - `message` (string): An explanation of the recorded failure and any next action. May be omitted.
          - `state` (string, always present): `accepted` means saved and unfinished. `complete` means the change finished. `failed` means it could not finish. `superseded` means a newer change replaced it before completion. Values: `"accepted"`, `"complete"`, `"failed"`, `"superseded"`.

## Errors

Each code is explained in full at https://heaven.dev/docs/reference/errors.

| Code | Status | What happened |
|---|---:|---|
| `invalid` | 400 | An input is missing or invalid. |
| `unauthenticated` | 401 | The credential is missing, invalid, expired or revoked. |
| `denied` | 403 | The caller lacks permission for this action. |
| `not_found` | 404 | The resource is absent or inaccessible to this caller. |
| `conflict` | 409 | The request conflicts with the current resource state or an earlier request. |
| `over_capacity` | 409 | The request exceeds a resource or credential allowance. |
| `access_list_full` | 409 | The change would exceed the access-list allowance. |
| `payment_required` | 402 | Payment or credit is required. |
| `rate_limited` | 429 | The caller's request rate exceeds its limit. |
| `busy` | 429 | Too much work is in progress to accept this request. |
| `unknown` | 503 | The outcome is unconfirmed; a change may have happened. |
| `unavailable` | 503 | The service or requested feature is unavailable. |

## Notes

- API key permission: `restart`.
- Use `computers` instead of `computer` for several targets, each with its own result.

## Examples

```sh tab="heaven CLI"
heaven restart COMPUTER
  [--request-id ID]
  [--wait[=DURATION]]
```

```sh tab="SSH"
ssh cli@heaven.dev restart COMPUTER
  [--request-id ID]
  [--wait[=DURATION]]
```

```sh tab="cURL"
curl https://heaven.dev/v1/computer/modify \
  -H "Authorization: Bearer $HEAVEN_API_KEY" \
  --json '{"action": "restart", "computer": "my-site"}'
```

```json tab="MCP"
{ "tool": "restart",
  "arguments": { "computer": "my-site" } }
```

Response:

```json title="Response excerpt"
{
  "version": 1,
  "data": {
    "operation": {
      "computer_id": "3f1c9e2a-7b4d-4c8e-9a6f-2d5b8e1c7a90",
      "created_at": "2026-11-16T12:00:00Z",
      "id": "90760fa5-9cd9-4243-af3d-d7cebcd7604f",
      "kind": "restart",
      "state": "accepted"
    },
    "request_id": "118fe705-30ab-4d9d-a973-942418b536bd"
  }
}
```
