# Health check

This API command returns the server's health status, including license information.

**Command name:** `health_check`

## Request URL (GET):

{% tabs %}
{% tab title="On-premises" %}

```
http(s)://endpoint/virtual_directory/api?cmd=health_check
```

{% endtab %}

{% tab title="Cloud" %}

```
https://svc.webspellchecker.net/api?cmd=ver
```

{% endtab %}
{% endtabs %}

## Response:

{% tabs %}
{% tab title="On-premises" %}

```json
{
  "pid": 25300,
  "license": {
    "valid": true,
    "remaining_seconds": 12701397
  }
}
```

{% endtab %}

{% tab title="Cloud" %}

```json
{
  "pid": 25300,
  "license": {
    "valid": true,
    "remaining_seconds": 0
  }
}
```

For cloud deployments, `valid` is always `true` and `remaining_seconds` is always `0`.
{% endtab %}
{% endtabs %}

## Response fields:

{% tabs %}
{% tab title="On-premises" %}

| Field                       | Type    | Description                               |
| --------------------------- | ------- | ----------------------------------------- |
| `pid`                       | number  | Process ID of the running server          |
| `license.valid`             | boolean | Indicates whether the license is valid    |
| `license.remaining_seconds` | number  | Time in seconds until the license expires |
| {% endtab %}                |         |                                           |

{% tab title="Cloud" %}

| Field                       | Type    | Description                      |
| --------------------------- | ------- | -------------------------------- |
| `pid`                       | number  | Process ID of the running server |
| `license.valid`             | boolean | Always `true`                    |
| `license.remaining_seconds` | number  | Always `0`                       |
| {% endtab %}                |         |                                  |
| {% endtabs %}               |         |                                  |

## Health status:

The service is healthy when the response status code is <mark style="color:green;">`200`</mark>.

{% tabs %}
{% tab title="On-premises" %}

| `200`        | `true`  | The service is healthy                          |
| ------------ | ------- | ----------------------------------------------- |
| `200`        | `false` | The service isn't working due to license issues |
| Other        | —       | The service is unavailable                      |
| {% endtab %} |         |                                                 |

{% tab title="Cloud" %}

| HTTP status   | Meaning                    |
| ------------- | -------------------------- |
| `200`         | The service is healthy     |
| Other         | The service is unavailable |
| {% endtab %}  |                            |
| {% endtabs %} |                            |

## See also:

For more detailed server information, use the [status](/api-reference/auxiliary-api-commands/status-api.md) command.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wproofreader.com/api-reference/auxiliary-api-commands/health-check.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
