# Check a monitor now

> Runs one check immediately and returns when it is done. A check always fetches the page fresh; it never serves a cached copy.

Source: https://docs.spicrawl.com/api-reference/monitors/monitors-check

## POST /v1/monitors/{monitorID}/check

Operation ID: `monitorsCheck`. API key scope: `monitors`.

Runs one check immediately and returns when it is done. A check always fetches the page fresh; it never
serves a cached copy.

A check that changes the content creates a change event and queues `monitor.changed`, exactly as a scheduled
check does. The first successful check of a new monitor records the baseline and sends no event.

A check that could not read the page returns `outcome: failed`, and counts toward the auto-disable limit.

### Example

```bash
curl -X POST "https://api.spicrawl.com/v1/monitors/{monitorID}/check" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY"
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `monitorID` | path | string | yes | The monitor `id`. An id of another organization answers 404. |

### Responses

#### 200

The result of the check.

Headers: `X-Request-Id`.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `outcome` | string: `unchanged`, `changed`, `not_modified`, `failed` | yes | What one check found. `unchanged` and `changed` are a fetched page. `not_modified` means the target answered `304 Not Modified` to a conditional request, so nothing was re-read. `failed` means the page could not be checked; it counts toward the auto-disable limit. |
| `event_id` | string | no | The change event, present only when `outcome` is `changed`. |
| `credits` | integer | yes | Credits this check cost. The same as the scrape that did the fetch. For a site monitor, the credits the whole run spent. |
| `run` | object (`MonitorRunSummary`) | no | Counts of one site run. Also the `last_run` of a site monitor, and `run` in a site check result. |

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 403

The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 404

No such resource for this key's organization.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
