# Transfer resources to another team

`POST https://console.advinservers.com/api/v1/client/transfers`

### Overview

Moves resources from the current team to another team. Send the destination team's UUID as `team` and a `moves` list with one `{resource, uuids}` entry per kind. Supported resources are `server`, `ssh_key`, `user_script`, `iso`, `firewall_group`, `firewall_ip_group`, `private_network`, `floating_ip` and `snapshot_storage`. Website hosting and licenses move between teams too, but only from the panel by the account holder, never with an API key. Up to 100 resources can move in one request.

A floating IP attached to a server moves only with that server: list it in a `floating_ip` entry beside the server. Attached floating IPs left out of the list are detached from the server and stay in the current team, with their billing unchanged. A server's primary address always moves with it. A detached floating IP can move on its own. A snapshot storage takes every snapshot in it along; a server's snapshots stay in their storage.

Move attached resources together. For example, a server and its firewall group cannot move separately while attached. If anything in the list cannot move, nothing moves.

The permission needed depends on what moves: `network.transfer` for a floating IP moved on its own, `snapshot.transfer` for a snapshot storage, and `server.transfer` for a server (including the floating IPs listed with it) and every other kind.

A member working in another customer's team can move one server with its chosen floating IPs, one detached floating IP or one snapshot storage onto their **own** account. Ownership changes require settled invoices for everything being transferred, matching billing currencies and enough address quota. Automatic payments are cancelled; shared subscriptions must be stopped first. The paid service period is kept. Ownership changes cannot be reversed through this endpoint. Moves between the account's own teams keep billing and automatic payments unchanged.

Servers, floating IPs and snapshot storages can move from a prepaid team into one of the account's postpaid teams, but never back. Their prepaid billing ends at that moment: paid time not used yet is added to account credit (each period still to come in full, and the current one less the hours used), their unpaid and draft invoices are cancelled, or only their lines removed when an invoice also bills something else, and automatic payments for them are stopped. From then on they are billed by the hour on the monthly postpaid invoice at the price they renewed at, which counts toward the postpaid spending limit. Send `accept_postpaid: true` to confirm this; without it such a move returns 422. A resource that is due for renewal, has a cancellation request, has an invoice with a payment on it or is busy with another operation cannot move this way. A snapshot storage moved this way is closed: each finished snapshot in it moves to the team and is billed by the hour for its size. A storage that is suspended, being resized or still taking a snapshot cannot move this way. Postpaid resources cannot move to a prepaid team.

The response names the kinds that moved (`resource`, or null when several kinds moved), the number of resources moved, including floating IPs listed with a server, and the destination team.

### Permissions

Requires one of the `server.transfer` (Transfer servers to their own account), `network.transfer` (Transfer floating IPs to their own account) or `snapshot.transfer` (Transfer snapshot storage to their own account) permissions for the selected team, depending on the request. 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.

## Body

Sent as `application/json`.

- `moves` (object[], required): The value of `moves`. 1 to 11 items
  - `resource` (string, required): The type of resource this entry describes. One of: `server`, `ssh_key`, `user_script`, `iso`, `firewall_group`, `firewall_ip_group`, `private_network`, `floating_ip`, `snapshot_storage`, `website_hosting`, `license`.
  - `uuids` (string[], required): The resource UUIDs to act on. At least 1 items
- `team` (string, required): The destination team UUID. Exactly 36 characters
- `accept_postpaid` (boolean): The value of `accept_postpaid`.

## Response 200

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

- `resource` (string | null, required): The type of resource this entry describes.
- `resources` (string[], required): The value of `resources`.
- `moved` (integer, required): The value of `moved`.
- `team` (object, required): The destination team UUID.
  - `id` (string<uuid>, required): The id ID.
  - `name` (string, required): The name shown to customers.

```json
{
  "resource": null,
  "resources": [
    "server",
    "iso",
    "firewall_group",
    "firewall_ip_group",
    "private_network",
    "floating_ip"
  ],
  "moved": 7,
  "team": {
    "id": "48454223-c5ac-461f-bead-ba8dda13eea9",
    "name": "Lambda Complex"
  }
}
```

## 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.
- `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/transfers' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "moves": [
    {
      "resource": "server",
      "uuids": [
        "ecc6f4f1-c89b-4dce-a20b-a330641c5b0b",
        "304e1794-a5b7-41f2-9a20-c0d444eb6683"
      ]
    },
    {
      "resource": "iso",
      "uuids": [
        "ec4fa5b5-cc7c-4fcf-b280-ee55eca8d44b"
      ]
    },
    {
      "resource": "firewall_group",
      "uuids": [
        "72a4a737-236f-456f-827f-6145d9c95727"
      ]
    },
    {
      "resource": "firewall_ip_group",
      "uuids": [
        "145e6e6f-a6b0-4b9e-9060-2d4f017baff8"
      ]
    },
    {
      "resource": "private_network",
      "uuids": [
        "5220f263-0e8e-4917-bf4f-4cae109ca4c5"
      ]
    },
    {
      "resource": "floating_ip",
      "uuids": [
        "1b8349e5-3568-43e0-bf89-fc3350dd7a08"
      ]
    }
  ],
  "team": "48454223-c5ac-461f-bead-ba8dda13eea9"
}'
```
