# Detach a server from a private network

`POST https://console.advinservers.com/api/v1/client/servers/{server}/private-networks/{privateNetwork}/detach`

### Overview

Removes the server from the network and releases its private address. Configuration runs in the background with status `detaching` until complete. Other members remain connected.

### Permissions

Requires the `network.update` (Change networking) permission for the selected team. Resources outside that team return 404.

## Authorization

Send `Authorization: Bearer <token>` with the request. Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.

## Path parameters

- `server` (string, required): The server uuid short
- `privateNetwork` (string, required): The private network uuid short

## Response 200

The record, as a JSON object. There is no envelope.

- `id` (string, required): The id ID.
- `uuid_short` (string, required): The value of `uuid_short`.
- `name` (string, required): The name shown to customers.
- `subnet` (string | null, required): The range members are addressed out of, and below, the address each one holds on it.
- `location` (string | null, required): The network's city name, shared by locations in the same city. Used in the account-wide network list.
- `attached` (boolean, required): Whether the requested server is attached to this network.
- `attachment_status` (string | null, required): The requested server's attachment status, or null when it is not attached. One of: `attaching`, `attached`, `detaching`, `null`.
- `members` (object[], required): The value of `members`.
  - `server_id` (string | null, required): The server id ID.
  - `uuid_short` (string | null, required): The value of `uuid_short`.
  - `name` (string | null, required): The name shown to customers.
  - `hostname` (string | null, required): The fully qualified hostname.
  - `template_name` (string | null, required): Enough to draw the machine the way every other list of servers draws it, and withheld with the name for the same reason.
  - `template_icon_url` (string | null, required): The value of `template_icon_url`.
  - `windows` (boolean, required): The value of `windows`.
  - `nic_index` (integer | null, required): The value of `nic_index`.
  - `ip_address` (string | null, required): The value of `ip_address`.
  - `status` (string, required): The value of `status`. One of: `attaching`, `attached`, `detaching`.
  - `is_current` (boolean, required): Whether this is the requested server.
- `created_at` (string | null, required): The date and time for created at, in UTC.

```json
{
  "id": "5220f263-0e8e-4917-bf4f-4cae109ca4c5",
  "uuid_short": "Uuid short",
  "name": "Sector C backbone",
  "subnet": "10.24.0.0/24",
  "location": "Kansas City, MO",
  "attached": true,
  "attachment_status": "detaching",
  "members": [
    {
      "server_id": "ecc6f4f1-c89b-4dce-a20b-a330641c5b0b",
      "uuid_short": "ecc6f4f1",
      "name": "lambda-core",
      "hostname": "lambda-core.blackmesa.example.com",
      "template_name": "Ubuntu 24.04",
      "template_icon_url": "/assets/icons/ubuntu.png",
      "windows": false,
      "nic_index": 1,
      "ip_address": "10.24.0.10",
      "status": "detaching",
      "is_current": true
    },
    {
      "server_id": "304e1794-a5b7-41f2-9a20-c0d444eb6683",
      "uuid_short": "304e1794",
      "name": "sector-c-db",
      "hostname": "sector-c-db.blackmesa.example.com",
      "template_name": "Debian 13",
      "template_icon_url": "/assets/icons/debian.png",
      "windows": false,
      "nic_index": 1,
      "ip_address": "10.24.0.11",
      "status": "attached",
      "is_current": false
    }
  ],
  "created_at": "2026-05-11T09:20:47+00:00"
}
```

## Errors

- `401`: The key was missing, malformed, revoked, or belongs to an account that no longer exists.
- `403`: Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
- `404`: The resource was not found in the selected team. Resources in another account or team also return 404.
- `422`: A field is missing or invalid, or the resource cannot accept this change in its current state. Check `message` for details. Field validation also includes an `errors` object keyed by field name.
- `429`: Too many requests. The `Retry-After` header says how many seconds to wait. Limits are per account, so several keys on one account share them.

## Example request

```bash
curl --request POST \
  --url 'https://console.advinservers.com/api/v1/client/servers/{server}/private-networks/{privateNetwork}/detach' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json'
```
