---
title: "Test the error pages on the site"
url: https://docs.corefinity.com/api/reference/site-settings/test-site-error-pages
type: endpoint
last_updated: 2026-11-13
feature: error-pages
related:
  - https://docs.corefinity.com/guides/sites/site-settings/error-and-maintenance-pages.md
  - https://docs.corefinity.com/mcp/tools/corestack_error_pages_test.md
---
# Test the error pages on the site

Runs a check against the site that changes none of its pages. `live` asks one of the site's own addresses for a path, as a visitor would, and answers the status, the main headers and who drew the answer; `render` answers which version of each page the site serves now (while maintenance is on, only the maintenance page). The first `render` on a site that has never been checked prepares the site instead, which takes a person who may change the site (anyone else is answered 404): the answer then has `preparing: true`, no pages and the `operation_id` of the preparation. Follow that id with the general operation endpoint (`GET /corestack/operations/{operation}`) until its `status` is `completed`, then send the request again. The error pages operation endpoint answers changes to the pages only, so it answers 404 for a preparation.

```http
POST /api/corestack/sites/{site}/error-pages/test
```

- Scope: `read`
- Two-factor: required on your account (all)
- Rate limit: 60 a minute; 6 a minute for each environment
- Try it in the console: on

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Body

- `kind` (string, required) One of `live`, `render`.
- `path` (string): For `live`: the path to ask for, with its query string if any. It starts with a single `/` and has no spaces, control characters or `#` fragment. Defaults to `/`.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/error-pages/test \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "live",
    "path": "/"
  }'
```

### PHP

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

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/corestack/sites/1042/error-pages/test', [
        'kind' => 'live',
        'path' => '/',
    ]);

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/error-pages/test', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    kind: 'live',
    path: '/',
  }),
});

// 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/sites/1042/error-pages/test",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "kind": "live",
        "path": "/",
    },
)

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

## Responses

### 200 The check's result. `pages` is shortened here.

```json
{
  "body_head": "<!doctype html><html lang=\"en\"><head><title>Harbour & Finch</title>",
  "bytes": 5120,
  "checked_at": "2026-11-06T09:16:40Z",
  "error": null,
  "headers": {
    "cache-control": null,
    "cf-cache-status": null,
    "content-type": "text/html; charset=UTF-8",
    "retry-after": null,
    "server": "nginx"
  },
  "kind": "live",
  "message": null,
  "refused": null,
  "status": 200,
  "truncated": true,
  "url": "https://harbourandfinch.example.com/",
  "who": "app"
}
```

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

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

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), or your company requires two-factor authentication and you have not set it up. For routes outside Managed Clusters.

```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 check cannot run now. `reason` says why: `managed_elsewhere`, or, for a `render` that has to prepare the site first, `operation_in_progress` (another change to the site has not finished) or `restore_running` (a restore of the site is running).

```json
{
  "code": "managed_elsewhere",
  "message": "This site is managed by another control panel",
  "reason": "managed_elsewhere"
}
```

### 422 A field is missing or wrong (`invalid`, with `field` and `errors`): a `kind` that is neither check, or a `path` the check does not send.

```json
{
  "code": "invalid",
  "errors": {
    "kind": [
      "kind is live or render."
    ]
  },
  "field": "kind",
  "message": "kind is live or render.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`): the API's general limit, or the six tests a minute this environment takes from the API, the Control Panel and AI assistants together. Wait for `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many attempts on this environment. Try again shortly.",
  "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 | `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 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 409 | `operation_in_progress` | A change to the environment is in progress. Try again when it has finished. |
| 409 | `restore_running` | A restore is running on the site. Wait for it to finish, then try again. |
| 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: [Error pages](https://docs.corefinity.com/guides/sites/site-settings/error-and-maintenance-pages.md)
- MCP tool: [`corestack_error_pages_test`](https://docs.corefinity.com/mcp/tools/corestack_error_pages_test.md)
