# Update a monitor

> Update an Uptenna monitor with the API: send only the fields to change, such as URL, interval, keyword or heartbeat period. Pausing works here too.

Source: https://uptenna.com/docs/api-update-monitor  
Markdown: https://uptenna.com/docs/api-update-monitor.md

`PATCH https://uptenna.com/v1/monitors/{id}`

Change any of a monitor's settings. Send only the fields to change; the others keep their values. A monitor's kind can't change.

Changing what is checked (URL, method, expected status, keywords) or resuming starts a fresh streak: the next check runs within a minute. Send `null` for `keyword` or `keyword_absent` to remove it.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The monitor's id (`mon_…`). |

## Request body

JSON. Every field is optional: send only what changes.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | Up to 80 characters. Required for heartbeats; HTTP monitors default to the URL's hostname. |
| `url` | string | no | HTTP: required. A public `http://` or `https://` URL; private and internal addresses are refused. |
| `method` | string | no | HTTP. Default `GET`. One of `GET`, `HEAD`, `POST`. |
| `expect_status` | string | no | HTTP. Codes or ranges, comma separated. Default `200-399`. |
| `keyword` | string or null | no | HTTP. Text the body must contain (needs GET or POST). |
| `keyword_absent` | string or null | no | HTTP. Text the body must not contain. |
| `timeout_ms` | integer | no | HTTP. 1000 to 30000. Default 10000. |
| `interval_s` | integer | no | HTTP. Default 60. Must be allowed by your plan. One of `30`, `60`, `180`, `300`, `600`. |
| `ssl_check` | boolean | no | HTTP. Default true. |
| `period_s` | integer | no | Heartbeat: required. How often the job runs, 60 to 2678400 seconds. |
| `grace_s` | integer | no | Heartbeat. 0 to 604800 seconds. Default 20% of the period, between 1 minute and 1 hour. |
| `paused` | boolean | no | Pause or resume (same as the pause and resume endpoints). |

## Example request

```bash curl
curl -X PATCH "https://uptenna.com/v1/monitors/mon_Xk3v9QmT2bLp" \
  -H "Authorization: Bearer $UPTENNA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"interval_s":300,"keyword":"ok"}'
```

```js Node.js (fetch)
const res = await fetch("https://uptenna.com/v1/monitors/mon_Xk3v9QmT2bLp", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.UPTENNA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"interval_s":300,"keyword":"ok"}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const monitor = await res.json();
```

## Response

Returns **200 OK** with the [monitor object](https://uptenna.com/docs/api-objects#monitor).

```json 200 OK
{
  "id": "mon_Xk3v9QmT2bLp",
  "kind": "http",
  "name": "API",
  "status": "up",
  "paused": false,
  "over_limit": false,
  "url": "https://api.example.com/health",
  "method": "GET",
  "expect_status": "200-399",
  "keyword": "ok",
  "keyword_absent": null,
  "timeout_ms": 10000,
  "interval_s": 300,
  "effective_interval_s": 300,
  "ssl_check": true,
  "heartbeat_url": null,
  "period_s": null,
  "grace_s": null,
  "last_ping_at": null,
  "last_checked_at": "2026-12-01T09:41:00.000Z",
  "last_latency_ms": 182,
  "last_status_code": 200,
  "last_reason": null,
  "reason_text": null,
  "cert_expires_at": "2027-02-14T23:59:59.000Z",
  "cert_issuer": "Let's Encrypt",
  "open_incident_id": null,
  "uptime_24h": 1,
  "uptime_30d": 0.9993,
  "created_at": "2026-11-02T14:03:11.000Z",
  "updated_at": "2026-11-20T08:15:42.000Z"
}
```

## Errors

Errors look like `{ "error": { "code", "message" } }` (see [Errors](https://uptenna.com/docs/api#errors)).

| Status | Code | When |
| --- | --- | --- |
| 400 | `invalid_monitor` | A field is missing or invalid; the message says which. |
| 402 | `interval_not_in_plan` | `interval_s` is faster than your plan allows (Free: 5 minutes, Pro: 1 minute, Team: 30 seconds). |
| 404 | `not_found` | No monitor with this id in your account. |
| 401 | `unauthorized` | The Authorization header is missing, malformed, or the key is unknown or revoked. |
| 429 | `rate_limited` | More than 120 requests in 60 seconds with this key. Wait for the Retry-After header's seconds. |
