---
title: "Keep a demo"
url: https://docs.corefinity.com/api/reference/billing/keep-demo
type: endpoint
last_updated: 2026-11-13
feature: demos
related:
  - https://docs.corefinity.com/guides/migrate/keep-a-demo.md
---
# Keep a demo

Keeps the demo, so it carries on as a paid service billed from the next full hour; only an owner or a billing
role of the company may. `confirm_keep` is the site's domain, or the word `cluster` for a CoreCluster; a
bigger package, add-on units or another server type are applied after the Keep, one at a time, and `progress`
follows them. The API never takes billing or card details: when one is missing, the Keep is refused with a
`keep_url` that opens the Keep page in the Control Panel.

```http
POST /api/corestack/demos/{demo}/keep
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 10 a minute
- Long-running: answers with an operation to poll
- 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

- `demo` (integer, required): The id of a demo, as the list gives it. Digits only.

## Body

- `accept_privacy` (boolean): Whether you accept Corefinity's privacy notice. Needed the first time your company keeps anything.
- `addons` (object or null): Add-on units to keep it with, each a whole number that is the total wanted. A unit you leave out stays as it is. The totals are checked before anything is kept: one outside its range, or a disk total that is not a multiple of 10, refuses the Keep (`addon_bounds`).
  - `cores` (integer): Extra cores, 0 to 16.
  - `disk_gb` (integer): Extra disk in GB, 0 to 102400 in steps of 10.
  - `log_storage_gb` (integer): Extra log storage in GB, 0 to 1000.
  - `memory_gb` (integer): Extra memory in GB, 0 to 64.
- `confirm_billing_country` (string): Your billing country as a two-letter code, to confirm a country the demo set for you.
- `confirm_keep` (string, required): The site's domain, or the word `cluster` for a CoreCluster demo. Upper or lower case.
- `family` (string or null): The server type to keep it on. One of `general`, `optimised`, `null`.
- `package` (string or null): A bigger package to keep it on, such as `CS8`. One of the demo's `upgrade_options`.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/corestack/demos/3310/keep \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "accept_privacy": true,
    "confirm_keep": "journal.harbourandfinch.example.com"
  }'
```

### PHP

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

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/corestack/demos/3310/keep', [
        'accept_privacy' => true,
        'confirm_keep' => 'journal.harbourandfinch.example.com',
    ]);

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/demos/3310/keep', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    accept_privacy: true,
    confirm_keep: 'journal.harbourandfinch.example.com',
  }),
});

// 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.post(
    "https://manage.corefinity.com/api/corestack/demos/3310/keep",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "accept_privacy": True,
        "confirm_keep": "journal.harbourandfinch.example.com",
    },
)

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

## Responses

### 200 The demo is kept, and nothing more has started. `upgrade.state` is `none`, `queued` or `refused`. A second Keep of a kept demo answers the same, with `kept.already` true.

```json
{
  "demo": {
    "days_left": null,
    "ends_at": "2026-12-06T09:00:00Z",
    "grace_ends_at": null,
    "id": 3310,
    "keep": {
      "allowed": false,
      "refusal": null,
      "url": "https://manage.corefinity.com/billing/keep?demo=3310&plan=keep"
    },
    "kept_at": "2026-11-09T10:15:00Z",
    "package": "CS4",
    "price_after": {
      "amount": "300.00",
      "currency": "GBP"
    },
    "product_line": "CS",
    "region": "uk",
    "starts_at": "2026-11-06T09:00:00Z",
    "state": "kept",
    "target": {
      "id": 1051,
      "name": "journal.harbourandfinch.example.com",
      "type": "site"
    },
    "upgrade": {
      "next": null
    }
  },
  "kept": {
    "already": false,
    "billed_from": "2026-11-09T11:00:00Z",
    "kept_at": "2026-11-09T10:15:00Z",
    "restored": false,
    "staging": "none"
  },
  "progress": {
    "changes": [],
    "next": null,
    "state": "none"
  },
  "upgrade": {
    "message": null,
    "next": null,
    "operation_id": null,
    "state": "none"
  }
}
```

### 202 The demo is kept and its first change has started (`upgrade.state` is `started`). Follow `upgrade.operation_id`, or read the demo's `progress`.

```json
{
  "demo": {
    "days_left": null,
    "ends_at": "2026-12-06T09:00:00Z",
    "grace_ends_at": null,
    "id": 3310,
    "keep": {
      "allowed": false,
      "refusal": null,
      "url": "https://manage.corefinity.com/billing/keep?demo=3310&plan=keep"
    },
    "kept_at": "2026-11-09T10:15:00Z",
    "package": "CS4",
    "price_after": {
      "amount": "300.00",
      "currency": "GBP"
    },
    "product_line": "CS",
    "region": "uk",
    "starts_at": "2026-11-06T09:00:00Z",
    "state": "kept",
    "target": {
      "id": 1051,
      "name": "journal.harbourandfinch.example.com",
      "type": "site"
    },
    "upgrade": {
      "next": null
    }
  },
  "kept": {
    "already": false,
    "billed_from": "2026-11-09T11:00:00Z",
    "kept_at": "2026-11-09T10:15:00Z",
    "restored": false,
    "staging": "none"
  },
  "progress": {
    "changes": [
      {
        "ended_at": null,
        "kind": "package",
        "operation_id": 5120,
        "plan": "cs8",
        "started_at": "2026-11-09T10:15:00Z",
        "state": "applying"
      }
    ],
    "next": null,
    "state": "applying"
  },
  "upgrade": {
    "message": null,
    "next": null,
    "operation_id": 5120,
    "reason": null,
    "state": "started"
  }
}
```

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

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

### 403 The token lacks the `write` scope (`scope_required`), you have not set up two-factor authentication (`two_factor_required`), or you are neither an owner nor a billing role of the company (`forbidden_role`).

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 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 The demo cannot be kept now: it is still being set up (`demo_building`), it has ended (`demo_closed`), it is kept already and the request asks for a change (`already_kept`), it is being updated (`busy`), or its site is managed by another control panel (`managed_elsewhere`). Or a step you finish in the browser is missing, with its `keep_url`: billing details or a billing country to confirm (`billing_details_required`), or a payment method (`payment_method_required`).

```json
{
  "code": "already_kept",
  "message": "This site is already kept. Change it from its own page.",
  "reason": "already_kept"
}
```

### 422 A field is missing or wrong (`invalid`), `confirm_keep` or `confirm_billing_country` does not match (`confirm_mismatch`, with `field`), the privacy notice is not accepted (`privacy_required`), the package is not one this demo can be kept on (`package_not_offered`, `package_platform`), or add-on units are outside what can be bought (`addon_bounds`).

```json
{
  "code": "addon_bounds",
  "message": "GB of disk must be a whole number from 0 to 102400, in steps of 10.",
  "reason": "addon_bounds"
}
```

### 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 | `company_unavailable` | Your company is unavailable. |
| 403 | `forbidden_role` | Keeping a demo needs the organisation's owner or a billing role. Ask the owner to keep it. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 409 | `already_kept` | The demo has already been kept. Nothing to do. |
| 409 | `billing_details_required` | Billing details are needed to keep the demo. Add them, then keep it. |
| 409 | `busy` | Another operation is running on the site. Wait for it to finish. |
| 409 | `demo_building` | The demo is still being set up. Keep it once it is ready. |
| 409 | `demo_closed` | The demo has ended and can no longer be kept. Start an order to carry on. |
| 409 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 409 | `payment_method_required` | A payment method is needed to keep the demo. Add one, then keep it. |
| 422 | `addon_bounds` | An add-on quantity is outside what is allowed. Choose a whole number inside the range the message gives. |
| 422 | `confirm_mismatch` | Send the confirmation exactly as the field named in `field` asks for it. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 422 | `package_not_offered` | The package chosen for the demo is not offered. Choose one that is. |
| 422 | `package_platform` | The package is not offered for the site's platform. Choose a package that is. |
| 422 | `privacy_required` | The privacy notice has not been accepted. Accept it to keep the demo. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Keep a demo](https://docs.corefinity.com/guides/migrate/keep-a-demo.md)
