> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hasdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Checks and Changes

A **check** is one run of a monitor: every resource is requested, snapshotted and compared. Checks run on the schedule, and whenever you ask for one.

## Check Now

`POST /monitors/{id}/check` queues a check and answers at once with `202`. Pass `resourceIds` to check only some resources.

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.hasdata.com/monitors/:id/check' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <your-api-key>'
```

```javascript Node.js theme={null}
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: 'https://api.hasdata.com/monitors/:id/check',
  headers: {'Content-Type': 'application/json', 'x-api-key': '<your-api-key>'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```python Python theme={null}
import requests

url = "https://api.hasdata.com/monitors/:id/check"

headers = {
    "Content-Type": "application/json",
    "x-api-key": "<your-api-key>"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```json theme={null}
{
  "data": {
    "id": "0c3b…",
    "monitorId": "fe452d1e-…",
    "trigger": "manual",
    "status": "queued",
    "scheduledFor": "2026-11-12T12:00:00.000Z",
    "startedAt": null,
    "finishedAt": null,
    "creditsSpent": 0,
    "resourceIds": null,
    "results": []
  }
}
```

## Polling a Check

Read `GET /monitors/{id}/checks/{checkId}` until `status` is `done` or `failed`. A check takes as long as the slowest request to the API, usually seconds.

```json theme={null}
{
  "data": {
    "id": "0c3b…",
    "status": "done",
    "creditsSpent": 20,
    "results": [
      {
        "id": 4812,
        "resourceId": "3f1c…",
        "status": "changed",
        "diff": { "kind": "fields", "changes": [{ "path": "product.price.currentPrice", "before": 249.99, "after": 198.16 }], "lists": [] },
        "patch": [ … ],
        "error": null,
        "judge": null,
        "createdAt": "2026-11-12T12:00:04.000Z"
      },
      {
        "id": 4813,
        "resourceId": "9a7e…",
        "status": "unchanged",
        "diff": null,
        "patch": null,
        "error": null,
        "judge": null,
        "createdAt": "2026-11-12T12:00:05.000Z"
      }
    ]
  }
}
```

One result per resource, with one of these statuses:

| `status` | Meaning |
| - | - |
| `baseline` | The first snapshot of this resource with these settings; nothing to compare against yet. |
| `unchanged` | The tracked fields are the same as last time. |
| `changed` | They differ; `diff` and `patch` say how. |
| `error` | The request failed; `error.code` is `upstream_failed`, `target_http_error`, `fetch_failed`, `invalid_params` or `not_enough_credits`. Credits are charged only when the API request itself succeeded. |

`GET /monitors/{id}/checks` lists the latest checks of a monitor, newest first.

## The Changes Feed

`GET /monitors/changes` lists every `changed` and `error` result across your monitors; `GET /monitors/{id}/changes` narrows it to one. `unchanged` results never appear.

For polling, pass `after` with the cursor from the previous call: results come oldest first, and `meta.nextCursor` is where to continue. Without `after`, the newest come first and `before` pages back.

```bash cURL theme={null}
curl --request GET -G \
  --url 'https://api.hasdata.com/monitors/changes' \
  --data-urlencode 'after=4810' \
  --data-urlencode 'limit=50' \
  --header 'x-api-key: <your-api-key>'
```

```javascript Node.js theme={null}
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: 'https://api.hasdata.com/monitors/changes',
  params: {after: '4810', limit: '50'},
  headers: {'x-api-key': '<your-api-key>'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```python Python theme={null}
import requests

url = "https://api.hasdata.com/monitors/changes"

querystring = {"after": "4810", "limit": "50"}

headers = {"x-api-key": "<your-api-key>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```json theme={null}
{
  "data": [
    { "id": 4812, "monitorId": "fe452d1e-…", "resourceId": "3f1c…", "checkId": "0c3b…", "status": "changed", "diff": { … }, "patch": [ … ], "error": null, "judge": null, "createdAt": "…" }
  ],
  "meta": { "nextCursor": 4812 }
}
```

`matters=true` keeps only the changes the [AI judge](https://docs.hasdata.com/apis/monitoring/notifications.md#the-ai-judge) found relevant to the monitor's goal.

## Snapshots

`GET /monitors/{id}/resources/{resourceId}/snapshot` returns what the last check kept of a resource: the tracked fields in the shape of the response, or `{ "markdown": "…" }` for a page.

```json theme={null}
{
  "data": {
    "resultId": 4812,
    "checkId": "0c3b…",
    "createdAt": "2026-11-12T12:00:04.000Z",
    "data": { "product": { "price": { "currentPrice": 198.16 }, "isAvailable": true } }
  }
}
```

## Pauses

A monitor pauses itself in two cases, and tells you through its delivery settings:

* `pauseReason: "no_credits"`: the balance ran out during a check.
* `pauseReason: "failures"`: five checks in a row failed for every resource, for example a page that no longer exists.

`POST /monitors/{id}/resume` schedules the next run from now and clears the failure count. `POST /monitors/{id}/pause` stops scheduled checks until then; manual checks still work.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.