## GET /api/v2/vps/{id}/actions/upgrade

**Get VPS upgrade options**

Return available plan changes and current configurable resource options for one VPS. Get `{id}` from `GET /api/v2/vps` `data[].id`. Use `availablePlans[].slug` with `POST /api/v2/vps/{id}/actions/upgrade` when changing plan. Use `configurableOptions[].key` with `POST /api/v2/vps/{id}/actions/config` when changing only options such as `bandwidthGb`, `backupSlots`, `snapshotSlots`, `ipv4Count`, or `additionalStorageGb`. Snapshot endpoints do not sell snapshot capacity directly; if `GET /api/v2/vps/{id}/snapshots` or `/snapshot-schedules` reports `available: false` or `limits.totalSnapshots: 0`, add snapshot slots here through `snapshotSlots` or change to a plan that includes snapshots.

### Related Endpoints

- `POST /api/v2/vps/{id}/actions/upgrade`: Change VPS plan
- `POST /api/v2/vps/{id}/actions/config`: Change VPS resource options
- `GET /api/v2/vps/{id}`: Get VPS details

### Headers

- `Accept`: application/json
- `Authorization`: Bearer YOUR_API_KEY
- Required API scope: `read:vm`

### Parameters

- `id` (path, string, required): Public VPS ID from `GET /api/v2/vps` `data[].id`. Do not invent this value; use the exact ID returned by the referenced API response. Example: `vps_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

```bash
curl -X GET "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/upgrade" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

### Response Schema

- `vpsId` (string, optional) Example: `vps_01hxa3b4c5d6e7f8g9h0j1k2m3`
- `currentProduct` (null, optional)
- `configurableOptions` (array<object>, optional): Current product configurable options such as `bandwidthGb`, `backupSlots`, `ipv4Count`, or `additionalStorageGb`. To change only these values, use `POST /api/v2/vps/{id}/actions/config`, not `actions/upgrade`.
- `configurableOptions[].key` (string, required): Canonical resource option key accepted under `resources` by `POST /api/v2/vps/{id}/actions/config`. Example: `bandwidthGb`
- `configurableOptions[].label` (string, required) Example: `Bandwidth`
- `configurableOptions[].type` (string, required) Example: `slider`
  Allowed values: slider, quantity, toggle, input, select
- `configurableOptions[].min` (number, optional) Example: `1024`
- `configurableOptions[].max` (number, optional) Example: `10240`
- `configurableOptions[].step` (number, optional) Example: `1024`
- `configurableOptions[].default` (number,string,boolean,null, optional) Example: `2048`
- `configurableOptions[].currentValue` (number,string,boolean,null, required) Example: `2048`
- `configurableOptions[].unit` (string,null, optional) Example: `GB`
- `configurableOptions[].pricing` (array<object>, optional)
- `configurableOptions[].includedAtBase` (number,null, optional): Option amount included by the current VPS plan before paid adjustments. Example: `2048`
- `configurableOptions[].constraints` (object, optional): Runtime constraints. For bandwidth this can raise the effective minimum above the product minimum based on current usage.
- `configurableOptions[].constraints.min` (number, optional) Example: `2048`
- `configurableOptions[].constraints.max` (number, optional) Example: `10240`
- `configurableOptions[].constraints.step` (number, optional) Example: `1024`
- `configurableOptions[].constraints.unit` (string,null, optional) Example: `GB`
- `configurableOptions[].constraints.currentValue` (number,string,boolean,null, optional) Example: `2048`
- `configurableOptions[].constraints.effectiveMin` (number, optional) Example: `2048`
- `configurableOptions[].constraints.effectiveMax` (number, optional) Example: `10240`
- `configurableOptions[].constraints.usage` (object, optional)
- `configurableOptions[].constraints.usage.bandwidthUsedGb` (number, optional): Current-period bandwidth already used, when it affects the minimum orderable bandwidth. Example: `193.483`
- `configurableOptions[].constraints.actions` (object, optional)
- `configurableOptions[].constraints.actions.canDecrease` (object, optional)
- `configurableOptions[].constraints.actions.canDecrease.allowed` (boolean, required) Example: `true`
- `configurableOptions[].constraints.actions.canDecrease.reason` (string,null, required) Example: `null`
- `configurableOptions[].constraints.actions.canDecrease.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `configurableOptions[].constraints.actions.canIncrease` (object, optional)
- `configurableOptions[].constraints.actions.canIncrease.allowed` (boolean, required) Example: `true`
- `configurableOptions[].constraints.actions.canIncrease.reason` (string,null, required) Example: `null`
- `configurableOptions[].constraints.actions.canIncrease.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `configurableOptions[].actions` (object, optional)
- `availablePlans` (array<object>, optional)
- `availablePlans[].id` (string,null, required) Example: `vpsprod_01hxa3b4c5d6e7f8g9h0j1k2m3`
- `availablePlans[].slug` (string,null, required): Canonical plan slug to send as `productSlug` when changing plan. Example: `vps-sm`
- `availablePlans[].tier` (string, required) Example: `sm`
- `availablePlans[].name` (string,null, required) Example: `VPS SM`
- `availablePlans[].resources` (object, required)
- `availablePlans[].resources.cpuCores` (number,null, optional) Example: `2`
- `availablePlans[].resources.memoryGb` (number,null, optional) Example: `4`
- `availablePlans[].resources.storageGb` (number,null, optional) Example: `80`
- `availablePlans[].bandwidth` (object, required)
- `availablePlans[].bandwidth.limitGb` (number,null, optional) Example: `2048`
- `availablePlans[].billing` (object, required)
- `availablePlans[].billing.amount` (number, optional) Example: `149`
- `availablePlans[].billing.currencyCode` (string, optional) Example: `SEK`
- `availablePlans[].billing.billingCycle` (string, optional) Example: `monthly`
- `availablePlans[].billingCycles` (array<object>, required) Example: `[{"billingCycle":"monthly","amount":149,"currencyCode":"SEK","isPrimary":true,"setupAmount":null}]`
- `availablePlans[].billingCycles[].billingCycle` (string, optional) Example: `monthly`
- `availablePlans[].billingCycles[].amount` (number, optional) Example: `149`
- `availablePlans[].billingCycles[].currencyCode` (string, optional) Example: `SEK`
- `availablePlans[].billingCycles[].isPrimary` (boolean, optional) Example: `true`
- `availablePlans[].billingCycles[].setupAmount` (number,null, optional): One-time setup fee for this billing cycle. Null when no setup fee applies. Example: `null`
- `availablePlans[].availabilityStatus` (string, required) Example: `available`
  Allowed values: available, hidden, out_of_stock
- `availablePlans[].available` (boolean, required) Example: `true`
- `availablePlans[].reason` (string,null, required) Example: `null`
- `availablePlans[].actions` (object, required)
- `availablePlans[].actions.canApply` (object, required)
- `availablePlans[].actions.canApply.allowed` (boolean, required) Example: `true`
- `availablePlans[].actions.canApply.reason` (string,null, required) Example: `null`
- `availablePlans[].actions.canApply.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions` (object, optional)
- `actions.canChangeProduct` (object, required)
- `actions.canChangeProduct.allowed` (boolean, required) Example: `true`
- `actions.canChangeProduct.reason` (string,null, required) Example: `null`
- `actions.canChangeProduct.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`

### Responses

#### 200 - VPS plan and configurable-option change options.
```json
{
  "vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "currentProduct": {
    "id": "vpsprod_01hxa3b4c5d6e7f8g9h0j1k2m3",
    "slug": "vps-xs",
    "tier": "xs",
    "name": "VPS XS",
    "resources": {
      "cpuCores": 1,
      "memoryGb": 2,
      "storageGb": 40
    },
    "bandwidth": {
      "limitGb": 2048
    },
    "billing": {
      "amount": 79,
      "currencyCode": "SEK",
      "billingCycle": "monthly"
    },
    "billingCycles": [
      {
        "billingCycle": "monthly",
        "amount": 79,
        "currencyCode": "SEK",
        "isPrimary": true,
        "setupAmount": null
      }
    ],
    "availabilityStatus": "hidden",
    "available": false,
    "reason": "This plan is not currently offered."
  },
  "configurableOptions": [
    {
      "key": "bandwidthGb",
      "label": "Bandwidth",
      "type": "slider",
      "min": 2048,
      "max": 10240,
      "step": 1024,
      "default": 2048,
      "currentValue": 2048,
      "unit": "GB",
      "pricing": [
        {
          "billingCycle": "monthly",
          "amount": 20,
          "currencyCode": "SEK"
        }
      ],
      "constraints": {
        "min": 2048,
        "max": 10240,
        "step": 1024,
        "unit": "GB",
        "currentValue": 2048,
        "effectiveMin": 2048,
        "effectiveMax": 10240,
        "usage": {
          "bandwidthUsedGb": 193.483
        },
        "actions": {
          "canDecrease": {
            "allowed": true,
            "reason": null
          },
          "canIncrease": {
            "allowed": true,
            "reason": null
          }
        }
      },
      "includedAtBase": 2048,
      "actions": {
        "canDecrease": {
          "allowed": true,
          "reason": null
        },
        "canIncrease": {
          "allowed": true,
          "reason": null
        }
      }
    },
    {
      "key": "additionalStorageGb",
      "label": "Attachable Block Storage",
      "type": "slider",
      "min": 0,
      "max": 1000,
      "step": 10,
      "default": 0,
      "currentValue": 100,
      "unit": "GB",
      "pricing": [
        {
          "billingCycle": "monthly",
          "amount": 30,
          "currencyCode": "SEK"
        }
      ],
      "constraints": {
        "min": 100,
        "max": 1000,
        "step": 10,
        "unit": "GB",
        "currentValue": 100,
        "effectiveMin": 100,
        "effectiveMax": 1000,
        "actions": {
          "canDecrease": {
            "allowed": true,
            "reason": null
          },
          "canIncrease": {
            "allowed": true,
            "reason": null
          }
        }
      },
      "includedAtBase": 100,
      "actions": {
        "canDecrease": {
          "allowed": true,
          "reason": null
        },
        "canIncrease": {
          "allowed": true,
          "reason": null
        }
      }
    },
    {
      "key": "snapshotSlots",
      "label": "Snapshot slots",
      "type": "quantity",
      "min": 0,
      "max": 5,
      "step": 1,
      "default": 0,
      "currentValue": 0,
      "unit": "slots",
      "pricing": [
        {
          "billingCycle": "monthly",
          "amount": 10,
          "currencyCode": "SEK"
        }
      ],
      "constraints": {
        "min": 0,
        "max": 5,
        "step": 1,
        "unit": "slots",
        "currentValue": 0,
        "effectiveMin": 0,
        "effectiveMax": 5,
        "actions": {
          "canDecrease": {
            "allowed": false,
            "reason": "No snapshot slots are currently active."
          },
          "canIncrease": {
            "allowed": true,
            "reason": null
          }
        }
      },
      "includedAtBase": 0,
      "actions": {
        "canDecrease": {
          "allowed": false,
          "reason": "No snapshot slots are currently active."
        },
        "canIncrease": {
          "allowed": true,
          "reason": null
        }
      }
    }
  ],
  "availablePlans": [
    {
      "id": "vpsprod_01hxa3b4c5d6e7f8g9h0j1k2m4",
      "slug": "vps-sm",
      "tier": "sm",
      "name": "VPS SM",
      "resources": {
        "cpuCores": 2,
        "memoryGb": 4,
        "storageGb": 80
      },
      "bandwidth": {
        "limitGb": 4096
      },
      "billing": {
        "amount": 149,
        "currencyCode": "SEK",
        "billingCycle": "monthly"
      },
      "billingCycles": [
        {
          "billingCycle": "monthly",
          "amount": 149,
          "currencyCode": "SEK",
          "isPrimary": true,
          "setupAmount": null
        }
      ],
      "availabilityStatus": "available",
      "available": false,
      "reason": "This plan is not currently offered.",
      "actions": {
        "canApply": {
          "allowed": false,
          "reason": "This plan is not currently offered."
        }
      }
    }
  ],
  "actions": {
    "canChangeProduct": {
      "allowed": true,
      "reason": null
    }
  }
}
```

#### 400 - Invalid request. The response body is an RFC 7807 Problem Details document.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/domainName",
      "detail": "`domainName` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 401 - Unauthorized. Authentication is required.
```json
{
  "type": "https://developer.hostup.se/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authentication is required.",
  "code": "unauthorized",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 403 - Forbidden. The caller lacks a required scope or does not own the resource.
```json
{
  "type": "https://developer.hostup.se/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "The caller lacks a required scope or does not own the resource.",
  "code": "forbidden",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 404 - Not found. The resource does not exist or is not owned by the caller.
```json
{
  "type": "https://developer.hostup.se/errors/not_found",
  "title": "Not found",
  "status": 404,
  "detail": "The requested resource could not be found.",
  "code": "not_found",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 429 - Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
```json
{
  "type": "https://developer.hostup.se/errors/rate_limit_exceeded",
  "title": "Too many requests",
  "status": 429,
  "detail": "Too many requests. Retry after the limit resets.",
  "code": "rate_limit_exceeded",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 500 - Internal error. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/internal_error",
  "title": "Internal server error",
  "status": 500,
  "detail": "An unexpected error occurred. Retry later or contact support if the issue persists.",
  "code": "internal_error",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```
