# PATCH /v1/servers/{id}

Rename a server

The id, the keys, the mode and everything the server holds stay. The new name must be free within the account. A body that names a mode is refused: a server is live or test from its creation.

Takes an account key (`ak_…`) as a bearer token. TypeScript: `account.servers.update(serverId, { name })`. Python: `account.servers.update(server_id, name=...)`.

## Parameters

- `id` (path, required, string (uuid)): The server id.

## Request body

- `name` (string (at least 1, at most 100 characters), required): 1 to 100 characters.

Example:

```json
{
  "name": "Ekonomi"
}
```

## Responses

### 200 A server of the account: an isolation boundary with its own keys, streams, log, suppressions and webhooks.

- `serverId` (string (uuid), required): The id every server key, stream and message of the server refers to.
- `name` (string (at least 1, at most 100 characters), required): The name given at creation, unique within the account.
- `mode` ("live" | "test", required): live delivers; test goes through everything but delivery, so nothing reaches a recipient. Fixed when the server is created.
- `createdAt` (string (date-time), required)

Example:

```json
{
  "serverId": "7c1e4d2a-0b9f-4a3e-8d6c-5e2f1a9b8c70",
  "name": "Ekonomi",
  "mode": "live",
  "createdAt": "2026-09-20T12:00:00.000Z"
}
```

## Errors

Every error answers `error`, the code, and `message`, a sentence for a person. A code that adds fields is shown in full below the table.

| Code | Status | Meaning |
| --- | --- | --- |
| `invalid_request` | 400 | The body, the query or a header does not match what the route takes. |
| `mode_immutable` | 400 | A server’s mode is fixed when it is created; create a new server for the other mode. |
| `unauthorized` | 401 | The key is missing, malformed or revoked. |
| `wrong_token_kind` | 403 | The key is of the other kind: a server key (sk_) where an account key (ak_) is needed, or the reverse. The message names the kind the operation takes. |
| `not_found` | 404 | No such server of this account. |
| `server_exists` | 409 | The account already has a server with that name. |
| `server_reserved` | 409 | This server sends Sendora’s own sign-in mail and cannot be renamed or removed. |

### `invalid_request`

- `issues` (array of object): One entry per invalid field; absent when a header is wrong.
  - `path` (string, required): The field, dotted, such as to.0.email; empty when the whole body is wrong.
  - `message` (string, required)

Example:

```json
{
  "error": "invalid_request",
  "message": "The request is invalid: to.0: Invalid email address",
  "issues": [
    {
      "path": "to.0",
      "message": "Invalid email address"
    }
  ]
}
```
