# Change a web hosting package to a higher plan

> Changes one web hosting package to a higher plan, for its price - after the user agreed to the AGB and the change.

- Effect: Write - Changes the account. Agents ask first.
- Idempotent: no
- Stability: stable
- MCP tool: `manitu_webhosting_upgrade` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/webhosting/upgrade`
- Needs: `service_webhosting`
- Counts against: [writes](/rate-limits/#limit-writes) (60 per hour per account)
- Page: /reference/webhosting/upgrade/

## MCP tool

`manitu_webhosting_upgrade`

**Changes the account. Agents say what will happen and wait for an explicit yes before calling it.**

### Description for the model

Changes a web hosting package to a higher plan, for a higher price, by its site_id and an option_id from [`manitu_webhosting_upgrade_option_list`](/reference/webhosting/upgrade/option/list.md) (tell the user the price from there first). The change takes effect at once. Waits for the user's approval in the customer panel: the call is answered with approval_required and a pending_action, its approval holding as elements the AGB as a document with a link, the change as a text and the new plan's price as a price - nothing is changed until the user approves it there. Refused per field when the option is not on offer for the package (option_not_available), and with a conflict when the account may not order (order_not_allowed, with reason_list) or the package cannot be changed now (not_configurable).

### Arguments

- `site_id` (integer | string, required) - The site_id of the package. Never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `option_id` (string, required) - The option_id of the plan to change to. Never guess one. (minLength `1`; maxLength `64`; pattern `"^[^\\x00-\\x1F\\x7F]*$"`)
- `approval_token` (string, write-only) - The token of the way call_again from the approval_required answer of the same call - only after the user said yes to everything in its elements. Valid 15 minutes, once. (minLength `1`; maxLength `255`)

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_webhosting_upgrade",
    "arguments": {
      "site_id": 12345,
      "option_id": "string"
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/webhosting/upgrade`

**This request changes something.**

### Description

Changes a web hosting package to a higher plan, for a higher price, by its site_id and an option_id of [`POST /v1/webhosting/upgrade/option/list`](/reference/webhosting/upgrade/option/list.md); the change takes effect at once. Refused per field when the option is not on offer for the package (option_not_available), and with a conflict when the account may not order (order_not_allowed, with reason_list) or when the package cannot be changed now (not_configurable). Made with a session of the customer panel, the call is carried out at once; otherwise it waits until a person signed in to the customer panel approves it (approval_required; its state: [`POST /v1/approval/get`](/reference/approval/get.md)).

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `site_id` (integer | string, required) - The site_id of the package. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `option_id` (string, required) - The option_id of the plan to change to. (minLength `1`; maxLength `64`; pattern `"^[^\\x00-\\x1F\\x7F]*$"`)
- `approval_token` (string, write-only) - The token of the way call_again from the approval_required answer of the same call - only after the user said yes to everything in its elements. Valid 15 minutes, once. (minLength `1`; maxLength `255`)

### Response

In `data`; the rest of the body as on every call.

- `site_id` (integer, required) - The package.
- `previous_plan` (object, required) - The plan the package had.
  - `previous_plan.name` (string, required) - The plan, e.g. Webhosting M.
  - `previous_plan.price_cent` (integer, required) - The price per period, in euro cent.
  - `previous_plan.price_type` (string, required) - net: without VAT; gross: with VAT. (one of `"net"`, `"gross"`)
  - `previous_plan.period_type` (string, required) - What the price is for: month or year (times period_length), onetime, or none. (one of `"none"`, `"onetime"`, `"month"`, `"year"`)
  - `previous_plan.period_length` (integer, required) - How many months or years one period has.
- `plan` (object, required) - The plan the package has now.
  - `plan.name` (string, required) - The plan, e.g. Webhosting M.
  - `plan.price_cent` (integer, required) - The price per period, in euro cent.
  - `plan.price_type` (string, required) - net: without VAT; gross: with VAT. (one of `"net"`, `"gross"`)
  - `plan.period_type` (string, required) - What the price is for: month or year (times period_length), onetime, or none. (one of `"none"`, `"onetime"`, `"month"`, `"year"`)
  - `plan.period_length` (integer, required) - How many months or years one period has.

### Statuses

- `200` Success.
- `400` The input is wrong, or the request itself (INVALID_INPUT). Each entry names its field and its reason - correct the input and call again.
- `401` No credential was presented, or it was not recognised (UNAUTHENTICATED).
- `403` The credential is valid, but may not do this (PERMISSION_DENIED). The reason says why - another credential is the way, not a repeat.
- `429` Too many calls. The Retry-After header says when to try again.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST \
  'https://api.manitu.de/v1/webhosting/upgrade' \
  -H "X-API-Key: $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"site_id":12345,"option_id":"string"}'
```

## Example result

```json
{
  "site_id": 12345,
  "previous_plan": {
    "name": "example.com",
    "price_cent": 1190,
    "price_type": "net",
    "period_type": "none",
    "period_length": 1
  },
  "plan": {
    "name": "example.com",
    "price_cent": 1190,
    "price_type": "net",
    "period_type": "none",
    "period_length": 1
  }
}
```
