---
title: "Set the content check"
method: PUT
path: "/v1/domains/{id}/content"
tags: ["Domains"]
---

# Set the content check

`PUT /v1/domains/{id}/content`

## Request

- Base URL: `https://api.upcheck.so`
- URL: `https://api.upcheck.so/v1/domains/{id}/content`
- Auth: HTTP bearer

Watch a page on this website — or the part of it a CSS selector picks — for change. Every 5 minutes the page's visible text is compared with the previous probe's; `mode` decides whether any change counts, or only a change, drop or rise in the first number in the selection. A change alerts on the probe that sees it and becomes the new baseline; an unreadable page, an unmatched selector or a missing number is confirmed by a second probe before any rule fires. Replaces any previous setting and probes immediately, which records the baseline. If the organization has no alert rule for content checks yet, an email rule is created so changes reach the key's creator.

## Path parameters

- `id` string, required

## Request body

- object: Which page, which part of it, and what kind of change the content check watches for.
  - `path` string: The page to request on the website's hostname. Defaults to `/`.
  - `selector` string: CSS selector for the part of the page to watch: type, class, id and attribute selectors, `:nth-child`, `:not`, and the descendant and child combinators. Empty watches the whole page's text.
  - `mode` 'text' | 'number' | 'decrease' | 'increase': What the content check compares between probes. `text`: the selected text, so any change alerts. `number`: the first number in the selection, so a change to it alerts. `decrease`: only when that number goes down (a price drop). `increase`: only when it goes up.
  - `enabled` boolean: Pause the check without forgetting its settings.

## Response `200`

The content monitor after the first probe.

- object: One scheduled check of one subject against one website.
  - `id` string, required: Opaque identifier.
  - `organizationId` string, required: Opaque identifier.
  - `domainId` string, required: Opaque identifier.
  - `subject` 'http' | 'certificate' | 'dns' | 'registration' | 'keyword' | 'content' | 'port', required: Which check a monitor, rule or history row is about.
  - `enabled` boolean, required: Whether the scheduler runs it. The keyword, content and port checks are disabled until they have a config.
  - `intervalMs` number, required
  - `nextCheck` number, required: Unix ms.
  - `lastChecked` number, required
  - `status` 'checking' | 'ok' | 'warn' | 'crit' | 'unknown', required
  - `summary` string, required
  - `detail` unknown, required
  - `config` union, required: Set on the keyword, content and port checks once configured, and on the uptime check once it has HTTP options; null elsewhere.
    - KeywordConfig: What a keyword check looks for, and on which page.
      - `type` 'keyword', required
      - `keyword` string, required
      - `mode` 'present' | 'absent', required: What the page is expected to do with the text. `present`: it must contain the text, so the check fails when the text disappears (a login button, a product name). `absent`: it must not contain the text, so the check fails when the text appears ("Database error", "Out of stock").
      - `caseSensitive` boolean, required
      - `path` string, required
    - ContentConfig: Which page, which element, and what kind of change a content check watches.
      - `type` 'content', required
      - `path` string, required
      - `selector` string, required
      - `mode` 'text' | 'number' | 'decrease' | 'increase', required: What the content check compares between probes. `text`: the selected text, so any change alerts. `number`: the first number in the selection, so a change to it alerts. `decrease`: only when that number goes down (a price drop). `increase`: only when it goes up.
    - HttpConfig: How the uptime check requests the website and what counts as up. Absent on a website probed at its root over GET.
      - `type` 'http', required
      - `path` string, required
      - `method` 'GET' | 'HEAD' | 'POST', required: How the uptime probe requests the page. `HEAD` skips the body, so it cannot be combined with `bodyContains`.
      - `headers` object, required
      - `expectedStatuses` number[], required
      - `bodyContains` string, required
      - `maxResponseMs` number, required
    - PortConfig: Which host and TCP ports a port check connects to.
      - `type` 'port', required
      - `host` string, required: Empty means the website's own hostname.
      - `ports` number[], required
  - `lastError` string, nullable, required
  - `consecutiveFailures` number, required
  - `failingSince` number, nullable, required

## Other responses

- `400`: The request body or parameters are invalid. `error` names the first problem.
- `401`: The API key is missing, invalid, or revoked.
- `403`: The key's role does not allow this action.
- `404`: No such resource in this organization.
- `429`: The key's rate limit was exceeded. Honour `Retry-After`.

---

[API](https://skmtc.dev/upcheck/apis/upcheck-api.md) · [All operations](https://skmtc.dev/upcheck/apis/upcheck-api/llms.txt) · [OpenAPI document](https://skmtc.dev/upcheck/apis/upcheck-api/revisions/56f55512eb8a?raw)
