---
title: "Update SSH Monitor"
description: "Updates an SSH monitor."
---

`PATCH /api/ssh-monitors/:sshMonitorPublicId`

## Authentication

Requires a valid session.

- Header: `Authorization: Bearer <token>`

## Parameters

- `sshMonitorPublicId` (Path, required): SSH monitor public UUID.

## Request Body

All fields are optional.

```json
{
 "name": "Bastion Host (Primary)",
 "hostname": "ssh.deinkunde.com",
 "port": 22,
 "status": "paused",
 "checkInterval": 60,
 "timeoutSeconds": 30,
 "allowedCheckCountryCodes": ["de", "es"],
 "sshConfig": {
  "username": "root",
  "privateKey": "-----BEGIN OPENSSH PRIVATE KEY-----..."
 }
}
```

### Notes

- `status` accepts `active`, `maintenance`, `disabled`, `paused`, `inactive`.
 - `paused` and `inactive` are normalized to `disabled`.
- `allowedCheckCountryCodes` is normalized to uppercase ISO codes (e.g. `DE`, `US`). Empty lists become `null`.
- `checkMode` (string, optional): `protocol` (default) | `tcp`. Switching to `tcp` clears any stored credentials: the monitor performs a bare TCP port-reachability check and `sshConfig` is not stored. Switching back to `protocol` re-enables the full SSH login/handshake check; supply `sshConfig`/`config` to set new credentials.
- SSH config can be provided as `sshConfig` or as `config` (alias). If neither is provided, the stored config is not changed.
- Users with `readonly` role can only change `status`.

## cURL

```bash
curl -X PATCH "https://YOUR_DOMAIN/api/ssh-monitors/44444444-4444-4444-8444-444444444444" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
  "status": "disabled"
 }'
```

## Response

```json
{
 "id": 300,
 "organizationId": 1,
 "customerId": 10,
 "name": "Bastion Host (Primary)",
 "hostname": "ssh.deinkunde.com",
 "port": 22,
 "status": "disabled",
 "checkInterval": 60,
 "timeoutSeconds": 30,
 "notificationEmail": null,
 "notificationPhoneNumber": null,
 "lastCheckedAt": "2026-02-26T12:00:00.000Z",
 "createdAt": "2026-02-26T12:00:00.000Z",
 "updatedAt": "2026-02-26T12:01:00.000Z",
 "config": {
  "username": "root"
 },
 "sshConfig": {
  "username": "root"
 }
}
```

## Errors

- `400` SSH monitor ID is required / invalid fields
- `401` Unauthorized
- `403` Forbidden (readonly users may only update `status`; global supporters cannot update)
- `404` Not found

