# Browser checks

> Browser checks endpoints of the StatusTick REST API: zones a browser check can run in, run a browser script now, get a browser run.

## Zones a browser check can run in

`GET /v1/monitors/browser-zones`

The browser runner's zones (none while browser checks are off), then your organization's private locations. Use the `locationId` values in a `BROWSER` monitor's `locationIds` setting and a `zone` value to run a script now. A private location has no `zone`; `runsBrowserChecks` is false while none of its agents has browser runs above 0, and a `BROWSER` monitor cannot pick it then (`location.no_browser_runs.unprocessable`).

## Run a browser script now

`POST /v1/monitors/browser-runs`

Needs a `READ_WRITE` key. Runs the saved script of `monitorId` once, or `browser` against `url` (both are needed without `monitorId`; with it they replace the saved ones for this run only). The run is kept with the monitor's runs but never changes its status. 5 runs a minute per organization.

## Get a browser run

`GET /v1/monitors/browser-runs/{runId}`

Runs are kept 30 days. The screenshot and trace links work for a few minutes; get the run again for new ones.

## Write a browser script with AI

`POST /v1/monitors/browser-checks/generate`

Needs a `READ_WRITE` key. Writes a script for `url` from `description` and runs it once; nothing is saved.

## Change a browser check's script

`PUT /v1/monitors/{monitorId}/browser`

Needs a `READ_WRITE` key. Only for `BROWSER` monitors. Replaces the script, variables, allowed hosts and step thresholds; send `********` as a variable's value to keep the stored one.

## List a browser monitor's runs

`GET /v1/monitors/{monitorId}/browser-runs`

Scheduled runs and "Run now" runs, newest first. Runs are kept 30 days.

## Suggest a fix for a failed run

`POST /v1/monitors/{monitorId}/browser-runs/{runId}/repair`

Needs a `READ_WRITE` key. A new locator for the one the failed run could not find. Changes nothing.

## Save a suggested fix

`POST /v1/monitors/{monitorId}/browser-runs/{runId}/repair/accept`

Needs a `READ_WRITE` key. Saves `script` of a suggestion as the check's script.
