# Rename a Computer

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

Change a Computer's name and its website, SSH and mail addresses. The old addresses stop working and the Computer's hostname changes at its next boot.

`POST /v1/computer/modify`

## Parameters

- `computer` (string, required): Computer name or ID.
- `name` (string, required): New Computer name of 3 to 63 lowercase letters, digits and hyphens. Start and end with a letter or digit.

## Returns

- `data` (object, always present): A rename operation or an unchanged name.
  - `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): The Computer already has the requested setting.
    - `changed` (boolean, always present): False when the setting was already correct.
    - `computer` (string, always present): Computer with the unchanged setting.
    - `message` (string, always present): Why the request made no change.

## 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: `rename`.

## Examples

```sh tab="heaven CLI"
heaven rename COMPUTER NAME [--request-id ID]
```

```sh tab="SSH"
ssh cli@heaven.dev rename COMPUTER NAME [--request-id ID]
```

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

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

Response:

```json title="Response excerpt"
{
  "version": 1,
  "data": {
    "operation": {
      "completed_at": "2026-11-16T12:00:00Z",
      "computer_id": "3f1c9e2a-7b4d-4c8e-9a6f-2d5b8e1c7a90",
      "created_at": "2026-11-16T12:00:00Z",
      "id": "ccbed7e5-3963-4664-aef9-54a5ed53fbc1",
      "kind": "rename",
      "state": "complete"
    },
    "renamed": {
      "https": "https://my-shop.heaven.dev",
      "mail": "my-shop.heaven.dev",
      "note": "The old name's addresses (SSH, website, mail, terminal and public-port names) stopped at once; names on the organization's domains keep working, and a name made with the Computer follows its new name. Inside, its hostname changes at its next restart. The old name stays held for this account for 12 hours, and meanwhile a public website's old address links to its new one; after that, any account can take the name.",
      "ssh": "ssh my-shop@heaven.dev"
    },
    "request_id": "2b720592-847a-4754-a3b1-6ff4d0628411"
  }
}
```
