# Monitors

Watch a URL on a schedule and webhook on change. Accessed via `client.monitors`.

## create

```ts
client.monitors.create(opts: MonitorCreateRequest, requestOptions?: RequestOptions): Promise<MonitorCreateResponse>
```

POST /v1/monitors — create a page-change monitor (screenshot or scrape capture).
First-capture behavior is the same for both types: the first capture is a silent baseline (has_change=false, change_pct=null) with no change_detected webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.

## list

```ts
client.monitors.list(params?: ListMonitorsParams, requestOptions?: RequestOptions): Promise<ListMonitorsResponse>
```

GET /v1/monitors — list monitors for the account.

`params` is optional and each key is omitted-when-absent, so `list()` with no argument
serializes the bare `/v1/monitors` URL unchanged — existing zero-arg callers are unaffected.

## get

```ts
client.monitors.get(id: MonitorId, requestOptions?: RequestOptions): Promise<MonitorResponse>
```

GET /v1/monitors/\{id\} — get a monitor by ID

## update

```ts
client.monitors.update(id: MonitorId, opts: MonitorUpdateRequest, requestOptions?: RequestOptions): Promise<UpdateMonitorResponse>
```

PATCH /v1/monitors/\{id\} — update a monitor

## delete

```ts
client.monitors.delete(id: MonitorId, requestOptions?: RequestOptions): Promise<void>
```

DELETE /v1/monitors/\{id\} — delete a monitor.

Returns 204 No Content (`operations['deleteMonitor']['responses'][204]`
declares `content?: never`), so there is no JSON arm to derive a payload
from — hence `Promise<void>`. `client.request()` short-circuits the empty
body to `undefined` before it would parse as JSON.

## captures

### list

```ts
client.monitors.captures.list(id: MonitorId, params?: ListMonitorCapturesParams, requestOptions?: RequestOptions): Promise<ListMonitorCapturesResponse>
```

GET /v1/monitors/\{id\}/captures — list captures for a monitor.

`params` is optional and each key is omitted-when-absent, so `list(id)` with no
second argument serializes the bare `/v1/monitors/\{id\}/captures` URL unchanged — existing
zero-arg callers are unaffected (inverse case).