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

# Set the port check

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

## Request

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

Name the TCP ports that must accept a connection — SSH, a database, a mail server, a game server — on the website's own hostname or on another host such as its origin, and every 5 minutes each one gets a connect and an immediate close from Cloudflare's network. Nothing is sent, so it proves a listener is there, not that the service behind it works. A closed or filtered port is confirmed by a second probe before any rule fires. A host that resolves to Cloudflare's edge is reported as unprobeable rather than closed, since the edge exposes no raw TCP ports; port 25 is refused because Cloudflare blocks outbound SMTP. Replaces any previous setting and probes immediately. If the organization has no alert rule for port checks yet, an email rule is created so failures reach the key's creator.

## Path parameters

- `id` string, required

## Request body

- object: Which host and TCP ports the port check connects to.
  - `host` string: Host to connect to. Empty means the website's own hostname. A website served through Cloudflare needs its origin's hostname or IP here, because the edge exposes no raw TCP ports to probe.
  - `ports` integer[], required: TCP ports that must accept a connection. Up to 10; each is its own connect on every probe.
  - `enabled` boolean: Pause the check without forgetting its settings.

## Response `200`

The port 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)
