# Attach a floating IP to a server

`POST https://console.advinservers.com/api/v1/client/floating-ips/{floatingIp}/attach`

### Overview

Attaches the floating IP to a server and removes its previous assignment. Send `server` using an ID from the eligible server list. The server must be in the address's location. Configure the IP inside the server's operating system after attaching it.

### 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

- `floatingIp` (string, required): The floating ip uuid short

## Body

Sent as `application/json`.

- `server` (string, required): The value of `server`. At most 36 characters

## Response 200

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

- `uuid` (string, required): The uuid UUID.
- `uuid_short` (string, required): The first eight characters of the UUID. Either form can identify the address.
- `status` (string, required): The value of `status`. One of: `pending_payment`, `active`, `pending_cancellation`, `deleting`, `expired`, `cancelled`, `payment_review`.
- `status_label` (string, required): The value of `status_label`.
- `progress_message` (string | null, required): One sentence about why a purchase is waiting, or null.
- `needs_funds` (boolean, required): Whether the purchase is waiting on account credit, which is the one wait the customer can end themselves.
- `type` (string, required): The type of operation or resource. One of: `ipv4`, `ipv6`.
- `address` (string | null, required): The IP address. A cancelled or expired one names the address it had.
- `cidr` (integer | null, required): The network prefix length.
- `gateway` (string | null, required): The gateway address for the network.
- `onlink` (string | null, required): The value of `onlink`.
- `is_primary` (boolean, required): Whether the resource is primary.
- `location` (string | null, required): The value of `location`.
- `location_id` (integer | null, required): The location id ID.
- `is_granted` (boolean, required): Whether the resource is granted.
- `can_release` (boolean, required): Whether the customer can release.
- `billing` (object, required): The value of `billing`.
  - `service_id` (integer | null, required): The customer's service number, once a recurring service exists.
  - `invoice_id` (integer | null, required): The customer's invoice number, once an invoice exists.
  - `invoice_url` (string | null, required): A complete URL where the invoice can be paid.
  - `checkout_uuid` (string | null, required): The checkout UUID, or null when no checkout is available.
  - `checkout_uuid_short` (string | null, required): The value of `checkout_uuid_short`.
  - `invoice_status` (string | null, required): The current invoice status, or null before an invoice exists.
  - `amount` (string | null, required): The amount in the currency shown by `currency`.
  - `currency` (string | null, required): The three-letter currency code used for `amount`.
  - `billing_cycle` (string | null, required): How often the service renews, or null for a one-time charge.
  - `payment_due_at` (string | null, required): When payment is due before the reservation is released.
  - `payment_window_minutes` (integer | null, required): How many minutes the original payment window allowed.
  - `paid_at` (string | null, required): When the charge was paid, or null while payment is outstanding.
- `can_cancel_checkout` (boolean, required): Whether the customer can cancel checkout.
- `can_request_cancellation` (boolean, required): Whether the customer can request cancellation.
- `can_withdraw_cancellation` (boolean, required): Whether the cancellation standing against this address can still be taken back. False for an immediate one, which gave the address away as it was filed.
- `cancellation_type` (string | null, required): The value of `cancellation_type`. One of: `immediate`, `end_of_billing`, `null`.
- `cancellation_requested_at` (string | null, required): The date and time for cancellation requested at, in UTC.
- `created_at` (string | null, required): The date and time for created at, in UTC.
- `server` (object | null, required): Null whenever the address is held but parked on nothing, which is a perfectly ordinary state for a floating address to sit in.
  - `id` (string, required): The id ID.
  - `name` (string, required): The name shown to customers.
  - `hostname` (string, required): The fully qualified hostname.
  - `windows` (boolean, required): The value of `windows`.
  - `template_name` (string | null, required): The value of `template_name`.
  - `template_icon_url` (string | null, required): The value of `template_icon_url`.
- `attaching_to` (object | null, required): The server this address was bought for, while it waits to be put there. It is attached as soon as the purchase has been paid for, and this goes back to null.
  - `id` (string, required): The id ID.
  - `name` (string, required): The name shown to customers.
  - `hostname` (string, required): The fully qualified hostname.
  - `windows` (boolean, required): The value of `windows`.
  - `template_name` (string | null, required): The value of `template_name`.
  - `template_icon_url` (string | null, required): The value of `template_icon_url`.
- `attachment_status` (string | null, required): Which way the address is moving while a worker attaches or detaches it, or null once it has settled. An attaching address is not on `attaching_to` yet; a detaching one is still on `server`. One of: `attaching`, `detaching`, `null`.

```json
{
  "uuid": "1b8349e5-3568-43e0-bf89-fc3350dd7a08",
  "uuid_short": "1b8349e5",
  "status": "active",
  "status_label": "Active",
  "progress_message": null,
  "needs_funds": false,
  "type": "ipv4",
  "address": "198.51.100.42",
  "cidr": 24,
  "gateway": "198.51.100.1",
  "onlink": null,
  "is_primary": false,
  "location": "Kansas City, MO",
  "location_id": 3,
  "is_granted": false,
  "can_release": false,
  "billing": {
    "service_id": 7421,
    "invoice_id": 17214,
    "invoice_url": null,
    "checkout_uuid": null,
    "invoice_status": "Paid",
    "amount": "3.00",
    "currency": "USD",
    "billing_cycle": "monthly",
    "payment_due_at": null,
    "payment_window_minutes": null,
    "paid_at": "2026-06-20T14:03:58+00:00"
  },
  "can_cancel_checkout": false,
  "can_request_cancellation": true,
  "can_withdraw_cancellation": false,
  "cancellation_type": null,
  "cancellation_requested_at": null,
  "created_at": "2026-06-20T14:03:51+00:00",
  "server": {
    "id": "304e1794",
    "name": "sector-c-db",
    "hostname": "sector-c-db.blackmesa.example.com",
    "windows": false,
    "template_name": "Debian 13",
    "template_icon_url": "/assets/icons/debian.png"
  },
  "attaching_to": null,
  "attachment_status": null
}
```

## Errors

- `400`: The address or server cannot accept this assignment in its current state.
- `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/floating-ips/{floatingIp}/attach' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "server": "304e1794"
}'
```
