---
title: "Update the automatic upgrades setting"
url: https://docs.corefinity.com/api/reference/sites/update-auto-upgrades
type: endpoint
last_updated: 2026-11-13
feature: upgrades
related:
  - https://docs.corefinity.com/guides/sites/size-and-capacity/upgrade-a-package.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_auto_upgrades_set.md
---
# Update the automatic upgrades setting

Turns automatic upgrades on or off, or changes the monthly limit, and answers the setting as it now stands.
Turning them on or raising the limit is consent to be charged: only the company's own owners and billing
contacts may do it, signed in as themselves, with `confirm_spend: true`. Turning them off or lowering the
limit needs no confirmation.

```http
PUT /api/corestack/companies/{company}/auto-upgrades
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 10 a minute
- Try it in the console: off. It can add to your bill. Copy the request and run it yourself when you are sure.

## Path parameters

- `company` (integer, required): The id of a company you belong to or manage. Digits only.

## Body

- `confirm_spend` (boolean): Needed to turn automatic upgrades on or to raise the limit. `true` says the person agreed to this: "I agree that automatic upgrades may be bought and added to our monthly bill without asking each time: CoreCluster add-ons (more cores, RAM or disk) or the next package when a new site or environment would not fit, and a larger size for a non-production environment that is too small for a copy into it. Each upgrade stays on the monthly bill until it is changed back. The limit caps what new automatic upgrades can add to the bill in one calendar month (UTC), and it starts again on the 1st. A new site or environment created by anyone who can create them in our CoreClusters, including Corefinity staff working for us, can lead to an upgrade."
- `enabled` (boolean, required): Whether automatic upgrades are on.
- `monthly_limit` (number or string): The most that new automatic upgrades may add to the bill in one calendar month (UTC), in the company's billing currency: from 1 up to the setting's `max_monthly_limit`, two decimal places at most, as a number or as text. Needed when `enabled` is `true`.

## Request

### curl

```bash
curl -X PUT https://manage.corefinity.com/api/corestack/companies/1204/auto-upgrades \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "monthly_limit": 100
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->put('https://manage.corefinity.com/api/corestack/companies/1204/auto-upgrades', [
        'enabled' => true,
        'monthly_limit' => 100,
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/companies/1204/auto-upgrades', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    enabled: true,
    monthly_limit: 100,
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.put(
    "https://manage.corefinity.com/api/corestack/companies/1204/auto-upgrades",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "enabled": True,
        "monthly_limit": 100,
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The setting after the change.

```json
{
  "active": true,
  "available": true,
  "can_change": true,
  "can_turn_off": true,
  "company_id": 1180,
  "consented_at": "2026-11-02T09:12:44Z",
  "currency": "GBP",
  "enabled": true,
  "max_monthly_limit": {
    "amount": "100000.00",
    "currency": "GBP"
  },
  "max_purchases_per_month": 20,
  "month": "2026-11",
  "monthly_limit": {
    "amount": "250.00",
    "currency": "GBP"
  },
  "purchases_this_month": 1,
  "recent": [
    {
      "at": "2026-11-09T14:03:27Z",
      "cluster_id": 1017,
      "kind": "cluster_addons",
      "monthly_delta": {
        "amount": "18.00",
        "currency": "GBP"
      },
      "operation_id": 5120,
      "state": "bought",
      "summary": "1 core and 2 GB of RAM added"
    }
  ],
  "remaining_this_month": {
    "amount": "232.00",
    "currency": "GBP"
  },
  "spent_this_month": {
    "amount": "18.00",
    "currency": "GBP"
  },
  "unavailable_reason": null
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the `write` scope (`scope_required`), your company requires two-factor authentication and you have not set it up (`two_factor_required`), or you may not make this change (`billing_forbidden`): turning automatic upgrades on or raising the limit is for the company's owners and billing contacts, and turning them off or lowering the limit is for them too.

```json
{
  "code": "billing_forbidden",
  "message": "Billing is available to your company's owner and billing contacts.",
  "reason": "billing_forbidden"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 Nothing was changed. `auto_upgrades_unavailable`: automatic upgrades cannot be turned on now, and the message says why (the setting's `unavailable_reason` carries the same sentence). `busy`: an automatic upgrade is being made for the company at this moment; try again shortly.

```json
{
  "code": "busy",
  "message": "Another automatic upgrade is being made. Try again in a moment.",
  "reason": "busy"
}
```

### 422 A field is missing or wrong (`invalid`); `field` names it. `enabled` must be `true` or `false`. A `monthly_limit` must be from 1 up to the setting's `max_monthly_limit`, with two decimal places at most. Turning them on or raising the limit needs `confirm_spend: true`. A field the setting does not have is refused too; for it, `errors` carries the word `unknown_key` and `message` the sentence.

```json
{
  "code": "invalid",
  "errors": {
    "confirm_spend": [
      "Confirm that you agree to automatic upgrades: each one is added to the monthly bill and stays there until it is changed back, and the limit caps what new upgrades can add in one calendar month."
    ]
  },
  "field": "confirm_spend",
  "message": "Confirm that you agree to automatic upgrades: each one is added to the monthly bill and stays there until it is changed back, and the limit caps what new upgrades can add in one calendar month.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `billing_forbidden` | Billing is for the organisation's owner and billing contacts. Ask one of them to do this. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 409 | `busy` | Another operation is running on the site. Wait for it to finish. |
| 409 | `auto_upgrades_unavailable` | Automatic upgrades are not available for the organisation yet. Read the message, or contact support. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Upgrade package](https://docs.corefinity.com/guides/sites/size-and-capacity/upgrade-a-package.md)
- MCP tool: [`corestack_company_auto_upgrades_set`](https://docs.corefinity.com/mcp/tools/corestack_company_auto_upgrades_set.md)
