---
title: "Create a new monitor"
method: POST
path: "/projects/{project_id}/monitors"
tags: ["Status Page"]
---

# Create a new monitor

`POST /projects/{project_id}/monitors`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/monitors`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required

## Request body

- CreateMonitorRequest
  - `check_interval_seconds` integer, nullable: How often to probe, in seconds. Defaults to 60 when omitted. **Clamped, not rejected**: values below 30 are stored as 30 and non-positive values as 60, and the created monitor comes back with the clamped value — so the response always reports the interval the scheduler will actually use.
  - `check_path` string, nullable
  - `environment_id` integer, required
  - `monitor_type` string, required
  - `name` string, required

## Response `201`

Monitor created successfully

- MonitorResponse
  - `check` MonitorCheckView, nullable: How a monitor outside Temps is checked. Header values are not included.
    - `check` union, required: A target monitor's check, one shape per kind.
      - object
        - `degraded_after_ms` integer, nullable: Slower than this many milliseconds is degraded, not up.
        - `expected_status` string[]: Status codes that count as up: exact codes ("204") or classes ("2xx"). Empty: any 2xx or 3xx.
        - `keyword` KeywordAssertion, nullable: Text that must, or must not, appear in the response body.
          - `present` boolean: `true`: the check fails unless the text is there. `false`: it fails when the text is there (e.g. "maintenance mode").
          - `text` string, required: Case-sensitive, at most 200 characters. Only the first 256 KiB of the body is searched, and the body is never stored.
        - `method` 'GET' | 'HEAD' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'
        - `timeout_ms` integer, nullable: Time limit of one request, 500 to 30,000 ms (default 10,000).
        - `kind` 'http', required
      - object
        - `degraded_after_ms` integer, nullable: Slower than this many milliseconds to connect is degraded.
        - `timeout_ms` integer, nullable
        - `kind` 'tcp', required
      - object
        - `timeout_ms` integer, nullable
        - `warn_days` integer, nullable: A certificate expiring within this many days is degraded (default 14, at most 90). An expired or untrusted one is down.
        - `kind` 'tls', required
      - object
        - `expected` string[]: Up when any answer equals one of these (case-insensitive, trailing dot ignored). Empty: up when the name has any record of the type.
        - `record_type` 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS', required
        - `timeout_ms` integer, nullable
        - `kind` 'dns', required
    - `has_body` boolean, required
    - `header_names` string[], required: Names of the request headers sent; their values are stored encrypted.
    - `target` string, required
  - `check_interval_seconds` integer, required
  - `check_kind` 'environment' | 'http' | 'tcp' | 'tls' | 'dns', required: `environment` for a monitor of a Temps environment, otherwise the check run against `check.target` (ADR 108 D3, D4).
  - `check_path` string, nullable
  - `created_at` string, date-time, required
  - `environment_id` integer, nullable
  - `id` integer, required
  - `is_active` boolean, required
  - `is_managed` boolean, required: Temps-managed HTTP monitor; independent monitors remain visible for workers.
  - `location_results` MonitorLocationResults, nullable: Every location's answer to the latest check.
    - `checked_at` string, date-time, required
    - `results` MonitorLocationResult[], required
      - `location` string, required: `control plane`, or the worker node's name.
      - `message` string, nullable: Why it is not operational, or why the location did not answer.
      - `node_id` integer, nullable: The worker node; `null` for the control plane.
      - `region` string, nullable: The node's `region` label, when it has one.
      - `response_time_ms` integer, nullable
      - `status` 'operational' | 'degraded' | 'major_outage', nullable: A check's verdict. Serialized as the value stored in `status_checks.status`.
  - `monitor_type` string, required
  - `monitor_url` string, required
  - `name` string, required
  - `next_check_at` string, date-time, nullable: When the scheduler will next probe this monitor. Read-only: it is maintained by the health-check scheduler, never accepted on write. `null` means the monitor has not been scheduled yet and is due on the next sweep.
  - `probe_from_nodes` boolean, required: Also checked from worker nodes; down only when most locations agree (ADR 108 D5).
  - `project_id` integer, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-11-21** `d57a37c13a27`: 4 info
  - added the optional property `check` to the response with the `201` status
  - added the optional property `location_results` to the response with the `201` status
  - added the required property `check_kind` to the response with the `201` status
  - added the required property `probe_from_nodes` to the response with the `201` status
- **2026-10-18** `b1faaa2f65bf`: 1 info
  - added the required property `is_managed` to the response with the `201` status
- **2026-09-18** `3b00e058cbc9`: 1 info
  - added the optional property `next_check_at` to the response with the `201` status
- **2026-04-25** `774be20905f2`: 5 info
  - the endpoint scheme security `bearer_auth` was added to the API
  - added the new optional request property `check_path`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - …1 more

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/monitors/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
