# Servers

Monitored servers: their state, metrics, processes, services, packages, security findings and the settings the agent reports against.

Its operations need the scopes `servers.edit`, `servers.view`, `servers.delete`, `alarms.view`, `security.policy`, `security.edit`, `alarms.edit` or `security.view`.

**Endpoints**

- `PUT/v1/servers/{server_uuid}`
- `GET/v1/servers/{server_uuid}`
- `GET/v1/servers`
- `DELETE/v1/servers/{server_uuid}`
- `GET/v1/servers/{server_uuid}/alarms`
- `POST/v1/servers/{server_uuid}/approve`
- `POST/v1/servers/{server_uuid}/archive`
- `DELETE/v1/servers/{server_uuid}/indicator-policies/{indicator}`
- `GET/v1/servers/{server_uuid}/containers/{container_uuid}`
- `GET/v1/servers/{server_uuid}/containers`
- `GET/v1/servers/{server_uuid}/volumes/{volume_uuid}/disk-report`
- `POST/v1/servers/{server_uuid}/security-findings/{finding_uuid}/dismiss`
- `DELETE/v1/servers/{server_uuid}/alarm-snooze`
- `POST/v1/servers/{server_uuid}/ports/{port_uuid}/forget`
- `GET/v1/servers/{server_uuid}/incidents`
- `GET/v1/servers/{server_uuid}/indicator-policies`
- `GET/v1/servers/{server_uuid}/latest`
- `GET/v1/servers/{server_uuid}/metrics`
- `GET/v1/servers/{server_uuid}/os-updates`
- `GET/v1/servers/{server_uuid}/os-updates/packages`
- `GET/v1/servers/{server_uuid}/ports`
- `GET/v1/servers/{server_uuid}/processes`
- `POST/v1/servers/{server_uuid}/provision`
- `POST/v1/servers/{server_uuid}/reactivate`
- `POST/v1/servers/{server_uuid}/os-updates/recheck`
- `POST/v1/servers/{server_uuid}/security-posture/recheck`
- `POST/v1/servers/{server_uuid}/security-findings/{finding_uuid}/restore`
- `POST/v1/servers/{server_uuid}/revoke`
- `POST/v1/servers/{server_uuid}/rotate-token`
- `GET/v1/servers/{server_uuid}/security-findings/{finding_uuid}`
- `GET/v1/servers/{server_uuid}/security-findings`
- `PUT/v1/servers/{server_uuid}/alarm-snooze`
- `GET/v1/servers/{server_uuid}/system-services`
- `PUT/v1/servers/{server_uuid}/indicator-policies/{indicator}`
- `PUT/v1/servers/{server_uuid}/ports/{port_uuid}`
- `PUT/v1/servers/{server_uuid}/volumes/{volume_uuid}`
- `GET/v1/servers/{server_uuid}/volumes`

## The Server object

### Attributes

- `uuid` (string): The UUID of the server.
- `name` (string): The display name when one is set, else the hostname.
- `display_name` (string or null): Your own label, as set; null when none (`name` is the shown name).
- `server_profile` (object or null): The server profile; null when none.
  - `uuid` (string): The UUID of the server profile.
  - `name` (string): The name of the server profile.
- `hostname` (string or null): The hostname the agent reports; null when it has not reported one.
- `ip_address` (string or null): The address the agent’s last heartbeat came from: a proxy’s, for a box behind one. The box’s own addresses are `public_ipv4` and `network_interfaces`.
- `supplier_identifier` (string or null): The instance id the cloud supplier gives the server (`i-0abc…`), as you recorded it; null when none is set. The server list’s `search` matches it.
- `supplier_name` (string or null): The cloud supplier’s name, as you recorded it; null when none is set.
- `public_ipv4` (string or null): The box’s own public IPv4 address, from its latest security facts; null until the agent reports one, and when it has none. The server list’s `search` matches it by prefix.
- `connection` (object or null): How the agent reaches the API, from the latest system-information scan; null when that is not reported (agents before 1.1.18, or no system information pushed yet): null is never “direct”.
  - `type` (string): `direct` or `proxy`.
  - `proxy_host` (string or null): The proxy’s host, without credentials; null for a direct connection.
  - `proxy_port` (integer or null): The proxy’s port; null for a direct connection.
- `os_type` (string or null): The operating system, `linux` or `windows`.
- `os_name` (string or null): From the latest system-information scan; null until one is pushed.
- `os_version` (string or null): The operating system’s version; null until a system-information scan is pushed.
- `kernel_version` (string or null): The kernel version; null until a system-information scan is pushed.
- `cpu_model` (string or null): The CPU model; null until a system-information scan is pushed.
- `cpu_cores` (integer or null): The logical core count; null until the agent reports it, never a guessed 1.
- `total_memory_mb` (integer or null): The host’s memory in MB; null until the agent reports it.
- `booted_at` (integer or null): Epoch milliseconds. When the host booted; null when its agent never reported it. An instant: epoch milliseconds, UTC.
- `timezone` (string or null): The host’s own time zone, as its agent reports it.
- `utc_offset_seconds` (integer or null): The host’s offset from UTC, in seconds; null when its agent never reported it.
- `in_container` (boolean or null): Null until an agent that reports it pushes system information.
- `health_status` (string): The server’s Operational Health: one of `unknown`, `healthy`, `warning`, `critical`.
- `security_health_status` (string): The server’s Security Health, from the open incidents of its security alarms (vulnerabilities, updates, posture, exposure, compromise indicators, and the freshness of the package list and the posture facts those findings rest on): one of `unknown`, `healthy`, `warning`, `critical`. `unknown` until a security alarm has measured the server; a fresh package list or fresh posture facts alone never lift it.
- `monitoring_health_status` (string): The server’s Monitoring Health, from the open incidents of the alarms that watch WatchTower15’s own collection from the server (the agent’s heartbeat and its listening-ports and system-services collectors): one of `unknown`, `healthy`, `warning`, `critical`.
- `overall_health_status` (string): The worst known of the three healths: `critical`, else `warning`, else `healthy`, and `unknown` only when all three are.
- `active` (boolean): Whether monitoring is switched on.
- `archived_at` (integer or null): Epoch milliseconds. When the server was archived; null for a server that is not archived. An instant: epoch milliseconds, UTC.
- `notes` (string or null): Your own free-text notes about the server, as `PUT /v1/servers/{server_uuid}` wrote them; null when none. The list does not carry them.
- `agent` (object): The server’s agent.
  - `status` (string): One of `active`, `pending_approval`, `revoked`.
  - `version` (string or null): The agent’s version; null when no agent has reported.
  - `capabilities` (array of strings): What the agent can do, as it reported.
  - `last_seen_at` (integer or null): Epoch milliseconds. When the agent last reported; null when it never did. An instant: epoch milliseconds, UTC.
  - `connectivity_state` (string or null): Connected, catching up, delayed, unreachable, rejected, powered off or never seen: an open set.
- `disks` (array of objects): The server’s disks, as the agent reported them.
  - `mount_point` (string): The mount point of the disk.
  - `device` (string or null): The block device; null when not reported.
  - `filesystem_type` (string or null): The filesystem type; null when not reported.
  - `total_gb` (number or null): The disk’s size in GB; null when not reported.
  - `used_gb` (number or null): Null with no usage sample, never 0.
  - `free_gb` (number or null): The free space in GB; null with no usage sample.
  - `used_percent` (number or null): used / (used + free), what `df` prints; null with no sample.
  - `inodes_used_percent` (number or null): Null for a filesystem that keeps no inode count.
- `network_interfaces` (array of objects): The server’s network interfaces.
  - `interface_name` (string): The name of the interface.
  - `ipv4_address` (string or null): The interface’s IPv4 address; null when it has none.
  - `ipv6_address` (string or null): The interface’s IPv6 address; null when it has none.
  - `is_up` (boolean): Whether the interface is up.
- `alarm_summary` (object): The count of the server’s alarms by state, over its own alarms and its volumes’, ports’ and units’.
  - `critical` (integer): Alarms firing at critical, over the server’s own alarms and its volumes’, ports’ and units’.
  - `warning` (integer): Alarms firing at warning.
  - `ok` (integer): Alarms that are scored and not firing.
  - `inactive` (integer): Alarms the evaluator does not score.
  - `acknowledged` (integer): Of the firing ones, the acknowledged.
- `alarm_snooze` (object or null): The alarm snooze holding this server’s alarm notifications, from its own snooze and its profile’s; null when none is live. The alarms keep evaluating while it lasts; see `PUT /v1/servers/{server_uuid}/alarm-snooze`.
  - `until` (integer or null): Epoch milliseconds. When the server’s alarm notifications are released: the later of its own snooze’s end and its profile’s. An instant: epoch milliseconds, UTC.
  - `source` (string): Which snooze ends later and so sets `until`: `server` or `profile`.
  - `server` (object or null): The server’s own snooze; null when it has none.
    - `until` (integer or null): Epoch milliseconds. When the server’s own snooze ends. An instant: epoch milliseconds, UTC.
    - `reason` (string or null): The reason given when it was set; null when none was.
    - `set_at` (integer or null): Epoch milliseconds. When it was last set. An instant: epoch milliseconds, UTC.
  - `profile` (object or null): The snooze of the server’s profile, which covers the server too; null when the profile has none.
    - `uuid` (string): The UUID of the server profile.
    - `name` (string): The name of the server profile.
    - `until` (integer or null): Epoch milliseconds. When the profile’s snooze ends. An instant: epoch milliseconds, UTC.
    - `reason` (string or null): The reason given when it was set; null when none was.
    - `set_at` (integer or null): Epoch milliseconds. When it was last set. An instant: epoch milliseconds, UTC.
- `tags` (array of objects): The tags the server carries.
  - `uuid` (string): The UUID of the tag.
  - `name` (string): The name of the tag.
  - `group` (object or null): The tag’s group; null only when the group is gone.
    - `uuid` (string): The UUID of the tag group.
    - `name` (string): The name of the tag group.
- `console_url` (string): The server’s page in the console.

**The Server object**

```json
{
  "uuid": "75666699-b77d-4631-b576-041e8102a55b",
  "name": "example",
  "display_name": "example",
  "server_profile": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example"
  },
  "hostname": "example",
  "ip_address": "example",
  "supplier_identifier": "example",
  "supplier_name": "example",
  "public_ipv4": "example",
  "connection": {
    "type": "example",
    "proxy_host": "example",
    "proxy_port": 1
  },
  "os_type": "example",
  "os_name": "example",
  "os_version": "example",
  "kernel_version": "example",
  "cpu_model": "example",
  "cpu_cores": 1,
  "total_memory_mb": 1,
  "booted_at": 1794214800000,
  "timezone": "example",
  "utc_offset_seconds": 1,
  "in_container": true,
  "health_status": "example",
  "security_health_status": "example",
  "monitoring_health_status": "example",
  "overall_health_status": "example",
  "active": true,
  "archived_at": 1794214800000,
  "notes": "example",
  "agent": {
    "status": "example",
    "version": "example",
    "capabilities": [
      "example"
    ],
    "last_seen_at": 1794214800000,
    "connectivity_state": "example"
  },
  "disks": [
    {
      "mount_point": "example",
      "device": "example",
      "filesystem_type": "example",
      "total_gb": 0,
      "used_gb": 0,
      "free_gb": 0,
      "used_percent": 0,
      "inodes_used_percent": 0
    }
  ],
  "network_interfaces": [
    {
      "interface_name": "example",
      "ipv4_address": "example",
      "ipv6_address": "example",
      "is_up": true
    }
  ],
  "alarm_summary": {
    "critical": 1,
    "warning": 1,
    "ok": 1,
    "inactive": 1,
    "acknowledged": 1
  },
  "alarm_snooze": {
    "until": 1794214800000,
    "source": "example",
    "server": {
      "until": 1794214800000,
      "reason": "example",
      "set_at": 1794214800000
    },
    "profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example",
      "until": 1794214800000,
      "reason": "example",
      "set_at": 1794214800000
    }
  },
  "tags": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example",
      "group": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example"
      }
    }
  ],
  "console_url": "example"
}
```

## Update a server

PUT/v1/servers/{server\_uuid}

Changes a server’s display name, notes, monitoring switch, tags and server profile; only the fields sent change, and `null` clears a display name. A new server profile brings its alarm templates, as in the console. `os_type` is accepted only as null or the stored value. Answers the server as `servers.view` does. A move to a profile whose indicator policies change this server’s effective rules also needs the `security.policy` scope; without it the call is refused with 403.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Body parameters

- `display_name` (string or null): A label of your own for the server; the hostname stays the agent’s, and null clears the label.
- `os_type` (string or null): Accepted only as the stored value or null: the operating system is set by the agent at enrolment.
- `notes` (string or null): Free-text notes about the server; null clears them.
- `active` (boolean or null): Whether monitoring is switched on.
- `tag_uuids` (array of strings or null): The uuids of the tags the server carries.
- `server_profile_uuid` (string (uuid) or null): The server profile, as `/v1/server-profiles` lists it; the new profile’s alarm templates follow, as in the console.

### Returns

`200 OK`:

The server after the update.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**PUT /v1/servers/{server_uuid}**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290 \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$server = $wt15->servers->update('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.update('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.update('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "display_name": "example",
    "server_profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "hostname": "example",
    "ip_address": "example",
    "supplier_identifier": "example",
    "supplier_name": "example",
    "public_ipv4": "example",
    "connection": {
      "type": "example",
      "proxy_host": "example",
      "proxy_port": 1
    },
    "os_type": "example",
    "os_name": "example",
    "os_version": "example",
    "kernel_version": "example",
    "cpu_model": "example",
    "cpu_cores": 1,
    "total_memory_mb": 1,
    "booted_at": 1794214800000,
    "timezone": "example",
    "utc_offset_seconds": 1,
    "in_container": true,
    "health_status": "example",
    "security_health_status": "example",
    "monitoring_health_status": "example",
    "overall_health_status": "example",
    "active": true,
    "archived_at": 1794214800000,
    "notes": "example",
    "agent": {
      "status": "example",
      "version": "example",
      "capabilities": [
        "example"
      ],
      "last_seen_at": 1794214800000,
      "connectivity_state": "example"
    },
    "disks": [
      {
        "mount_point": "example",
        "device": "example",
        "filesystem_type": "example",
        "total_gb": 0,
        "used_gb": 0,
        "free_gb": 0,
        "used_percent": 0,
        "inodes_used_percent": 0
      }
    ],
    "network_interfaces": [
      {
        "interface_name": "example",
        "ipv4_address": "example",
        "ipv6_address": "example",
        "is_up": true
      }
    ],
    "alarm_summary": {
      "critical": 1,
      "warning": 1,
      "ok": 1,
      "inactive": 1,
      "acknowledged": 1
    },
    "alarm_snooze": {
      "until": 1794214800000,
      "source": "example",
      "server": {
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      },
      "profile": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      }
    },
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "group": {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      }
    ],
    "console_url": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (402 Payment Required)**

The organisation's payment gate blocks the action: `payment_required` (no payment method) or `invoice_overdue`. Nothing is billed and nothing is started.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/payment_required/",
  "title": "Payment required",
  "status": 402,
  "code": "payment_required",
  "detail": "A payment method must be set before adding resources for monitoring.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Get a server

GET/v1/servers/{server\_uuid}

Returns one server with its latest system information, its disks and network interfaces, its alarm counts and its tags with their groups. Like opening the server’s page in the console, the read adds any default alarm the catalogue gained since the server was enrolled.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The server.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290 \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$server = $wt15->servers->view('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.view('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.view('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "display_name": "example",
    "server_profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "hostname": "example",
    "ip_address": "example",
    "supplier_identifier": "example",
    "supplier_name": "example",
    "public_ipv4": "example",
    "connection": {
      "type": "example",
      "proxy_host": "example",
      "proxy_port": 1
    },
    "os_type": "example",
    "os_name": "example",
    "os_version": "example",
    "kernel_version": "example",
    "cpu_model": "example",
    "cpu_cores": 1,
    "total_memory_mb": 1,
    "booted_at": 1794214800000,
    "timezone": "example",
    "utc_offset_seconds": 1,
    "in_container": true,
    "health_status": "example",
    "security_health_status": "example",
    "monitoring_health_status": "example",
    "overall_health_status": "example",
    "active": true,
    "archived_at": 1794214800000,
    "notes": "example",
    "agent": {
      "status": "example",
      "version": "example",
      "capabilities": [
        "example"
      ],
      "last_seen_at": 1794214800000,
      "connectivity_state": "example"
    },
    "disks": [
      {
        "mount_point": "example",
        "device": "example",
        "filesystem_type": "example",
        "total_gb": 0,
        "used_gb": 0,
        "free_gb": 0,
        "used_percent": 0,
        "inodes_used_percent": 0
      }
    ],
    "network_interfaces": [
      {
        "interface_name": "example",
        "ipv4_address": "example",
        "ipv6_address": "example",
        "is_up": true
      }
    ],
    "alarm_summary": {
      "critical": 1,
      "warning": 1,
      "ok": 1,
      "inactive": 1,
      "acknowledged": 1
    },
    "alarm_snooze": {
      "until": 1794214800000,
      "source": "example",
      "server": {
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      },
      "profile": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      }
    },
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "group": {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      }
    ],
    "console_url": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List servers

GET/v1/servers

Lists the organisation’s servers. Filter by search text (hostname, name, the instance id, the heartbeat address, the public address or an interface address), operating system, agent status, health, security health, connectivity and tags; archived servers are listed only with `archived=true`. Sorts by one column. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `servers.view`.

### Query parameters

- `search` (string or null): Only servers whose hostname, display name, heartbeat IP address or supplier identifier contains this text, or whose public IPv4 or a current network interface’s IPv4 address starts with it (`10.0.3.170`, or `10.0.3.` for the range).
- `os_type` (string or null): Only servers of this operating system: `linux` or `windows`. `freebsd` and `other` are accepted and match nothing. Values:`linux``windows``freebsd``other`(an open set: new values may be added)
- `status` (array of strings or null): Only servers whose agent has one of these statuses: `active`, `pending_approval` or `revoked`. A list: repeat the parameter (`status=active&status=pending_approval`) or send one value (`status=active`); `status[]=active` is accepted too. Values:`active``pending_approval``revoked`(an open set: new values may be added)
- `health` (array of strings or null): Only servers with one of these health statuses: `unknown`, `healthy`, `warning` or `critical`. A list: repeat the parameter (`health=unknown&health=healthy`) or send one value (`health=unknown`); `health[]=unknown` is accepted too. Values:`unknown``healthy``warning``critical`(an open set: new values may be added)
- `connectivity` (array of strings or null): Only servers in one of these connectivity states; an open set, so a client renders a value it does not know neutrally. A list: repeat the parameter (`connectivity=connected&connectivity=delayed`) or send one value (`connectivity=connected`); `connectivity[]=connected` is accepted too. Values:`connected``delayed``unreachable``powered_off``never_seen``rejected``catching_up`(an open set: new values may be added)
- `tag_uuids` (array of strings or null): Only servers carrying at least one of these tags, as tag UUIDs. A list: repeat the parameter (`tag_uuids=<uuid>&tag_uuids=<uuid>`) or send one value (`tag_uuids=<uuid>`); `tag_uuids[]=<uuid>` is accepted too.
- `archived` (string or null): Absent or false lists the servers that are not archived; true lists the archived ones only (`true`, `false`, `1` or `0`). Values:`true``false``1``0`(an open set: new values may be added)
- `sort` (string or null): The column to sort by: `name`, `hostname`, `agent_status`, `last_seen` or `health_status`. Values:`name``hostname``agent_status``last_seen``health_status`(an open set: new values may be added)
- `direction` (string or null): The sort direction, `asc` (the default) or `desc`. Values:`asc``desc`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `security_health` (array of strings or null): Only servers with one of these security health statuses (the Security column’s, as each row’s `security_health_status` reads it): `unknown`, `healthy`, `warning` or `critical`. `health` filters the Operational health only. A list: repeat the parameter (`security_health=unknown&security_health=healthy`) or send one value (`security_health=unknown`); `security_health[]=unknown` is accepted too. Values:`unknown``healthy``warning``critical`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the organisation’s servers.

Each item of the page:

- `uuid` (string): The UUID of the server.
- `name` (string): The display name when one is set, else the hostname.
- `hostname` (string or null): The hostname the agent reports; null when it has not reported one.
- `ip_address` (string or null): The address the agent’s last heartbeat came from: a proxy’s, for a box behind one. See the view’s `network_interfaces` and `public_ipv4` for the box’s own addresses.
- `supplier_identifier` (string or null): The instance id the cloud supplier gives the server (`i-0abc…`), as you recorded it; null when none is set. The search matches it.
- `supplier_name` (string or null): The cloud supplier’s name, as you recorded it; null when none is set.
- `os_type` (string or null): The operating system, `linux` or `windows`.
- `health_status` (string): The server’s Operational Health: one of `unknown`, `healthy`, `warning`, `critical`.
- `security_health_status` (string): The server’s Security Health, from the open incidents of its security alarms (vulnerabilities, updates, posture, exposure, compromise indicators, and the freshness of the package list and the posture facts those findings rest on): one of `unknown`, `healthy`, `warning`, `critical`. `unknown` until a security alarm has measured the server; a fresh package list or fresh posture facts alone never lift it.
- `monitoring_health_status` (string): The server’s Monitoring Health, from the open incidents of the alarms that watch WatchTower15’s own collection from the server (the agent’s heartbeat and its listening-ports and system-services collectors): one of `unknown`, `healthy`, `warning`, `critical`.
- `overall_health_status` (string): The worst known of the three healths: `critical`, else `warning`, else `healthy`, and `unknown` only when all three are.
- `agent_status` (string): One of `active`, `pending_approval`, `revoked`.
- `pending_reason` (string or null): Why a `pending_approval` server waits: `approval` or `limit`.
- `connectivity_state` (string or null): Connected, catching up, delayed, unreachable, rejected, powered off or never seen: an open set. Null when no agent reports (pending, revoked, no agent, or monitoring off).
- `agent_version` (string or null): The version of the agent; null when no agent has reported.
- `agent_last_seen_at` (integer or null): Epoch milliseconds. When the agent last reported; null when it never did. An instant: epoch milliseconds, UTC.
- `active` (boolean): Whether monitoring is switched on.
- `archived_at` (integer or null): Epoch milliseconds. When the server was archived; null for a server that is not archived. An instant: epoch milliseconds, UTC.
- `alarm_snoozed_until` (integer or null): Epoch milliseconds. When a live alarm snooze on the server, its own or its profile’s, whichever ends later, releases its alarm notifications; null when none is live. `GET /v1/servers/{server_uuid}` names both snoozes. An instant: epoch milliseconds, UTC.
- `tags` (array of objects): The tags the server carries.
  - `uuid` (string): The UUID of the tag.
  - `name` (string): The name of the tag.
- `console_url` (string): The server’s page in the console.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->list()->autoPaging() as $server) { echo $server->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.list()) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.list():
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example",
      "hostname": "example",
      "ip_address": "example",
      "supplier_identifier": "example",
      "supplier_name": "example",
      "os_type": "example",
      "health_status": "example",
      "security_health_status": "example",
      "monitoring_health_status": "example",
      "overall_health_status": "example",
      "agent_status": "example",
      "pending_reason": "example",
      "connectivity_state": "example",
      "agent_version": "example",
      "agent_last_seen_at": 1794214800000,
      "active": true,
      "archived_at": 1794214800000,
      "alarm_snoozed_until": 1794214800000,
      "tags": [
        {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      ],
      "console_url": "example"
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Delete a server

DELETE/v1/servers/{server\_uuid}

Deletes a server together with what hangs from it (volumes, ports, units and their alarms). Refuses with an error when something blocks the delete. Answers with no body.

Needs the scope `servers.delete`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`204 No Content`:

The server was deleted; there is no body.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**DELETE /v1/servers/{server_uuid}**

curl:

```bash
curl -X DELETE https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290 \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$wt15->servers->delete('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

await wt15.servers.delete('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

client.servers.delete('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (204 No Content)**

```http
HTTP/1.1 204 No Content
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.delete scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's alarms

GET/v1/servers/{server\_uuid}/alarms

Lists the alarms of the server and of its volumes, ports and systemd units in one call, with each alarm’s thresholds, live state, resource and the policies it notifies. Filter by `entity_type` (the server itself or one kind of child), `rule_slug` (one or more), `active` and `state`. Alarms that a profile left deleted are not listed. For one resource’s alarms use `GET /v1/alarms`; for every alarm of the organisation, `GET /v1/organisation/alarms`. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `alarms.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `entity_type` (string or null): Only alarms on this kind of resource: `server` for the server itself, `server_volume`, `server_port` or `server_system_service` for a volume, a port or a systemd unit; every kind when omitted. Values:`server``server_volume``server_port``server_system_service`(an open set: new values may be added)
- `rule_slug` (array of strings or null): Only alarms on these catalogue rules, by `rule_slug`; every rule when omitted. A bare value is read as a one-item list. A list: repeat the parameter (`rule_slug=<value>&rule_slug=<value>`) or send one value (`rule_slug=<value>`); `rule_slug[]=<value>` is accepted too.
- `active` (string or null): Only alarms that are switched on (`true`) or off (`false`); both when omitted. Values:`true``false``1``0`(an open set: new values may be added)
- `state` (string or null): Only alarms in this live state: `ok`, `warning`, `critical` or `inactive`; every state when omitted. Values:`ok``warning``critical``inactive`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s alarms.

Each item of the page:

- `uuid` (string): The alarm’s uuid.
- `name` (string): The alarm’s own name, else its rule’s.
- `rule_slug` (string): The catalogue rule’s slug.
- `classification` (string): The catalogue rule’s classification: one of `operations`, `security`, `monitoring`. On a server it decides which of the server’s three healths an open incident moves; the other resources keep one health that counts every classification.
- `metric_name` (string): The catalogue rule’s name.
- `description` (string or null): The catalogue rule’s description; null when it has none.
- `alarm_type` (string or null): `boolean` or `threshold`, as the catalogue rule says.
- `unit` (string or null): The unit of the thresholds; null when the rule has none.
- `comparison_operator` (string): How a reading is compared with the thresholds: the alarm’s own operator, else the rule’s default.
- `aggregation` (string or null): How the readings in a window are combined before the comparison; null when the alarm sets none.
- `warning_threshold` (number or null): The alarm’s own value, else the rule’s default.
- `critical_threshold` (number or null): The alarm’s own value, else the rule’s default.
- `warning_window_minutes` (integer or null): The window, in minutes, the warning threshold is judged over; null when the alarm has none.
- `critical_window_minutes` (integer or null): The window, in minutes, the critical threshold is judged over; null when the alarm has none.
- `warning_consecutive_failures_count` (integer): Consecutive evaluations before a warning: the alarm’s own count, else the rule’s default.
- `critical_consecutive_failures_count` (integer): Consecutive evaluations before a critical: the alarm’s own count, else the rule’s default.
- `self_resolving` (boolean): Whether the alarm clears itself when the condition ends (it sends no resolve notification).
- `active` (boolean): Whether the alarm is switched on.
- `notify_on_acknowledge` (boolean): Whether acknowledging an incident of this alarm notifies: the alarm’s own flag, else the catalogue’s. Never null.
- `notify_on_resolve` (boolean): Whether resolving an incident of this alarm notifies: the alarm’s own flag, else the catalogue’s. Never null.
- `entity` (object): The resource the alarm is on, of any type that has alarms.
  - `type` (string): The type of the resource, such as `server`.
  - `uuid` (string or null): The uuid of the resource; null when it no longer resolves.
  - `name` (string or null): The name of the resource; null when it no longer resolves.
- `parent_entity` (object or null): The server of a volume, port or unit; null for every other resource.
  - `type` (string): The type of the server, such as `server`.
  - `uuid` (string): The uuid of the server.
- `alarm_policies` (array of objects): The policies the alarm notifies. A caller holding `policies.view` (the key’s scope and the user’s permission) gets each policy’s `name`; without it, the uuid alone.
  - `uuid` (string): The policy’s uuid.
  - `name` (string): The policy’s name; present only for a caller holding `policies.view`.
- `state` (string): One of `ok`, `warning`, `critical`, `inactive`. Values:`critical``warning``ok``inactive`(an open set: new values may be added)
- `inactive_reason` (string or null): `switched_off` or `resource_inactive` while `state` is `inactive`; null otherwise.
- `state_since` (integer or null): Epoch milliseconds: when the open incident was triggered, while `state` is `warning` or `critical`; null otherwise. An instant: epoch milliseconds, UTC.
- `acknowledged` (boolean): Whether the open incident has been acknowledged.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/alarms**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/alarms \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->alarms('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.alarms('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.alarms('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example",
      "rule_slug": "example",
      "classification": "example",
      "metric_name": "example",
      "description": "example",
      "alarm_type": "example",
      "unit": "example",
      "comparison_operator": "example",
      "aggregation": "example",
      "warning_threshold": 0,
      "critical_threshold": 0,
      "warning_window_minutes": 1,
      "critical_window_minutes": 1,
      "warning_consecutive_failures_count": 1,
      "critical_consecutive_failures_count": 1,
      "self_resolving": true,
      "active": true,
      "notify_on_acknowledge": true,
      "notify_on_resolve": true,
      "entity": {
        "type": "example",
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example"
      },
      "parent_entity": {
        "type": "example",
        "uuid": "75666699-b77d-4631-b576-041e8102a55b"
      },
      "alarm_policies": [
        {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      ],
      "state": "critical",
      "inactive_reason": "example",
      "state_since": 1794214800000,
      "acknowledged": true
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1,
  "meta": {
    "entity": {
      "type": "example",
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the alarms.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Approve a server

POST/v1/servers/{server\_uuid}/approve

Approves a server whose agent waits in `pending_approval`, so it starts reporting as an active server. Counts against the organisation’s server limit. Answers the server as `servers.view` does.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The server after the approval.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/approve**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/approve \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->approve('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.approve('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.approve('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "display_name": "example",
    "server_profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "hostname": "example",
    "ip_address": "example",
    "supplier_identifier": "example",
    "supplier_name": "example",
    "public_ipv4": "example",
    "connection": {
      "type": "example",
      "proxy_host": "example",
      "proxy_port": 1
    },
    "os_type": "example",
    "os_name": "example",
    "os_version": "example",
    "kernel_version": "example",
    "cpu_model": "example",
    "cpu_cores": 1,
    "total_memory_mb": 1,
    "booted_at": 1794214800000,
    "timezone": "example",
    "utc_offset_seconds": 1,
    "in_container": true,
    "health_status": "example",
    "security_health_status": "example",
    "monitoring_health_status": "example",
    "overall_health_status": "example",
    "active": true,
    "archived_at": 1794214800000,
    "notes": "example",
    "agent": {
      "status": "example",
      "version": "example",
      "capabilities": [
        "example"
      ],
      "last_seen_at": 1794214800000,
      "connectivity_state": "example"
    },
    "disks": [
      {
        "mount_point": "example",
        "device": "example",
        "filesystem_type": "example",
        "total_gb": 0,
        "used_gb": 0,
        "free_gb": 0,
        "used_percent": 0,
        "inodes_used_percent": 0
      }
    ],
    "network_interfaces": [
      {
        "interface_name": "example",
        "ipv4_address": "example",
        "ipv6_address": "example",
        "is_up": true
      }
    ],
    "alarm_summary": {
      "critical": 1,
      "warning": 1,
      "ok": 1,
      "inactive": 1,
      "acknowledged": 1
    },
    "alarm_snooze": {
      "until": 1794214800000,
      "source": "example",
      "server": {
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      },
      "profile": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      }
    },
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "group": {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      }
    ],
    "console_url": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (402 Payment Required)**

The organisation's payment gate blocks the action: `payment_required` (no payment method) or `invoice_overdue`. Nothing is billed and nothing is started.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/payment_required/",
  "title": "Payment required",
  "status": 402,
  "code": "payment_required",
  "detail": "A payment method must be set before adding resources for monitoring.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Archive a server

POST/v1/servers/{server\_uuid}/archive

Archives an active server: its open incidents are resolved silently and monitoring stops, and it leaves the default server list (list it with `archived=true`). `servers.reactivate` brings it back.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The server after it was archived.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/archive**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/archive \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->archive('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.archive('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.archive('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "display_name": "example",
    "server_profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "hostname": "example",
    "ip_address": "example",
    "supplier_identifier": "example",
    "supplier_name": "example",
    "public_ipv4": "example",
    "connection": {
      "type": "example",
      "proxy_host": "example",
      "proxy_port": 1
    },
    "os_type": "example",
    "os_name": "example",
    "os_version": "example",
    "kernel_version": "example",
    "cpu_model": "example",
    "cpu_cores": 1,
    "total_memory_mb": 1,
    "booted_at": 1794214800000,
    "timezone": "example",
    "utc_offset_seconds": 1,
    "in_container": true,
    "health_status": "example",
    "security_health_status": "example",
    "monitoring_health_status": "example",
    "overall_health_status": "example",
    "active": true,
    "archived_at": 1794214800000,
    "notes": "example",
    "agent": {
      "status": "example",
      "version": "example",
      "capabilities": [
        "example"
      ],
      "last_seen_at": 1794214800000,
      "connectivity_state": "example"
    },
    "disks": [
      {
        "mount_point": "example",
        "device": "example",
        "filesystem_type": "example",
        "total_gb": 0,
        "used_gb": 0,
        "free_gb": 0,
        "used_percent": 0,
        "inodes_used_percent": 0
      }
    ],
    "network_interfaces": [
      {
        "interface_name": "example",
        "ipv4_address": "example",
        "ipv6_address": "example",
        "is_up": true
      }
    ],
    "alarm_summary": {
      "critical": 1,
      "warning": 1,
      "ok": 1,
      "inactive": 1,
      "acknowledged": 1
    },
    "alarm_snooze": {
      "until": 1794214800000,
      "source": "example",
      "server": {
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      },
      "profile": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      }
    },
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "group": {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      }
    ],
    "console_url": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Clear a server's indicator policy

DELETE/v1/servers/{server\_uuid}/indicator-policies/{indicator}

Removes the policy of one rule on this server, so the rule reads its defaults (or its profile’s). Needs the `security.policy` scope.

Needs the scope `security.policy`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `indicator` (string, required): The rule: `exe_world_writable` or `tmp_executable`. Values:`exe_world_writable``tmp_executable`(an open set: new values may be added)

### Returns

`204 No Content`:

The policy was cleared; the answer has no body.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**DELETE /v1/servers/{server_uuid}/indicator-policies/{indicator}**

curl:

```bash
curl -X DELETE https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/indicator-policies/exe_world_writable \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$wt15->servers->clearIndicatorPolicy('e0f5add1-ce75-48d4-bb62-1712db369290', 'exe_world_writable');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

await wt15.servers.clearIndicatorPolicy('e0f5add1-ce75-48d4-bb62-1712db369290', 'exe_world_writable');
```

Python:

```python
client = Client.from_environment()

client.servers.clear_indicator_policy('e0f5add1-ce75-48d4-bb62-1712db369290', 'exe_world_writable')
```

**Response (204 No Content)**

```http
HTTP/1.1 204 No Content
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.policy scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Get a container

GET/v1/servers/{server\_uuid}/containers/{container\_uuid}

Returns one container of a server, with its inventory state and its open findings by source and level. Its findings are listed by `servers.securityFindings` with `container_uuid`.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `container_uuid` (string (uuid), required): The UUID of the container.

### Returns

`200 OK`:

The container.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/containers/{container_uuid}**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/containers/28bd25cc-08cf-49ee-8f25-fe6365e8085a \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->container('e0f5add1-ce75-48d4-bb62-1712db369290', '28bd25cc-08cf-49ee-8f25-fe6365e8085a');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.container('e0f5add1-ce75-48d4-bb62-1712db369290', '28bd25cc-08cf-49ee-8f25-fe6365e8085a');
```

Python:

```python
client = Client.from_environment()

result = client.servers.container('e0f5add1-ce75-48d4-bb62-1712db369290', '28bd25cc-08cf-49ee-8f25-fe6365e8085a')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "runtime": "example",
    "container_id": "example",
    "image_ref": "example",
    "image_digest": "example",
    "state": "example",
    "started_at": 1794214800000,
    "first_seen_at": 1794214800000,
    "last_seen_at": 1794214800000,
    "gone_at": 1794214800000,
    "inventory": {
      "status": "example",
      "reason": "example",
      "reported_at": 1794214800000,
      "matched_at": 1794214800000
    },
    "findings": {
      "open": 1,
      "critical": 1,
      "warning": 1,
      "info": 1,
      "kev": 1
    },
    "findings_by_source": {
      "os_package": {
        "critical": 1,
        "warning": 1,
        "info": 1
      },
      "runtime": {
        "critical": 1,
        "warning": 1,
        "info": 1
      },
      "library": {
        "critical": 1,
        "warning": 1,
        "info": 1
      }
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's containers

GET/v1/servers/{server\_uuid}/containers

Lists the containers running on one server, as its agent last reported them: runtime, image, inventory state and open findings by level. Gone containers are listed with `state=gone` until they are pruned. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `state` (array of strings or null): Only containers in one of these states: `running` or `gone`. Absent lists the running containers only. A gone container stays listed until it is pruned: 30 days after it went, or 24 hours after when the agent never read its packages. An archived or paused server sends no running set, so its containers are listed as last reported, `running` until a new report says otherwise. A list: repeat the parameter (`state=running&state=gone`) or send one value (`state=running`); `state[]=running` is accepted too. Values:`running``gone`(an open set: new values may be added)
- `runtime` (array of strings or null): Only containers of one of these runtimes: `docker`, `podman`, `containerd`, `cri-o` or `unknown`. A list: repeat the parameter (`runtime=docker&runtime=podman`) or send one value (`runtime=docker`); `runtime[]=docker` is accepted too. Values:`docker``podman``containerd``cri-o``unknown`(an open set: new values may be added)
- `inventory_status` (array of strings or null): Only containers whose inventory has one of these states: `ok`, `failed`, `unsupported` or `pending` (no inventory reported yet). A list: repeat the parameter (`inventory_status=ok&inventory_status=failed`) or send one value (`inventory_status=ok`); `inventory_status[]=ok` is accepted too. Values:`ok``failed``unsupported``pending`(an open set: new values may be added)
- `search` (string or null): Only containers whose image name contains this text, case does not matter; at most 128 characters.
- `image_digest` (string or null): Only containers of this image digest: `sha256:` and 64 lowercase hexadecimal characters.
- `sort` (string or null): The column to sort by: `image_ref` (the default), `started_at`, `last_seen` or `findings` (open critical findings first, then warning, then info). Values:`image_ref``started_at``last_seen``findings`(an open set: new values may be added)
- `direction` (string or null): The sort direction, `asc` (the default) or `desc`. Values:`asc``desc`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s containers.

Each item of the page:

- `uuid` (string): The UUID of the container.
- `runtime` (string): The container runtime: `docker`, `podman`, `containerd`, `cri-o` or `unknown`.
- `container_id` (string): The runtime’s own id of the container (a hexadecimal string), never a WatchTower15 id.
- `image_ref` (string or null): The image the container runs, as the runtime names it; null when the agent could not read it. It comes from the host, so treat it as untrusted text.
- `image_digest` (string or null): The image’s digest, `sha256:` and 64 hexadecimal characters; null when the agent could not read it.
- `state` (string): `running`, or `gone` once the agent no longer lists the container.
- `started_at` (integer or null): Epoch milliseconds. When the container started; null when the agent did not read it. An instant: epoch milliseconds, UTC.
- `first_seen_at` (integer): Epoch milliseconds. When the agent first listed the container. An instant: epoch milliseconds, UTC.
- `last_seen_at` (integer): Epoch milliseconds. When the agent last listed the container. An instant: epoch milliseconds, UTC.
- `gone_at` (integer or null): Epoch milliseconds. When the container was last missing from the agent’s list; null while it runs. An instant: epoch milliseconds, UTC.
- `inventory` (object): The container’s inventory: what the agent read inside it.
  - `status` (string): The inventory’s state.
  - `reason` (string or null): Why the inventory is `failed` or `unsupported`.
  - `reported_at` (integer or null): Epoch milliseconds. When the agent last reported the inventory. An instant: epoch milliseconds, UTC.
  - `matched_at` (integer or null): Epoch milliseconds. When the packages were last matched against known vulnerabilities. An instant: epoch milliseconds, UTC.
- `findings` (object): The container’s open vulnerability findings, by level.
  - `open` (integer): The open findings.
  - `critical` (integer): Open findings at the critical level.
  - `warning` (integer): Open findings at the warning level.
  - `info` (integer): Open findings at the info level.
  - `kev` (integer): Open findings that are known exploited vulnerabilities.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/containers**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/containers \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->containers('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.containers('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.containers('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "runtime": "example",
      "container_id": "example",
      "image_ref": "example",
      "image_digest": "example",
      "state": "example",
      "started_at": 1794214800000,
      "first_seen_at": 1794214800000,
      "last_seen_at": 1794214800000,
      "gone_at": 1794214800000,
      "inventory": {
        "status": "example",
        "reason": "example",
        "reported_at": 1794214800000,
        "matched_at": 1794214800000
      },
      "findings": {
        "open": 1,
        "critical": 1,
        "warning": 1,
        "info": 1,
        "kev": 1
      }
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1,
  "meta": {
    "server": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "agent_reads_containers": true,
    "running_set": {
      "status": "example",
      "reason": "example",
      "reported_at": 1794214800000,
      "capped_count": 1
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## View a volume's disk usage report

GET/v1/servers/{server\_uuid}/volumes/{volume\_uuid}/disk-report

The volume’s latest disk usage report: the biggest directories, the largest and most recently changed files, and quick checks for Docker, the journal, package caches, old kernels and deleted files still held open. A report is made daily, when the volume is first seen and when a disk alarm opens; nothing here starts one. The snapshot is null until a walk has stored one.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `volume_uuid` (string (uuid), required): The UUID of the volume.

### Returns

`200 OK`:

The volume’s disk usage report.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/volumes/{volume_uuid}/disk-report**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/volumes/3e780a9c-afb8-4dc3-bb21-51c3d3d5dd2b/disk-report \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->diskReport('e0f5add1-ce75-48d4-bb62-1712db369290', '3e780a9c-afb8-4dc3-bb21-51c3d3d5dd2b');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.diskReport('e0f5add1-ce75-48d4-bb62-1712db369290', '3e780a9c-afb8-4dc3-bb21-51c3d3d5dd2b');
```

Python:

```python
client = Client.from_environment()

result = client.servers.disk_report('e0f5add1-ce75-48d4-bb62-1712db369290', '3e780a9c-afb8-4dc3-bb21-51c3d3d5dd2b')
```

**Response (200 OK)**

```json
{
  "data": {
    "report": {
      "status": "example",
      "trigger": "example",
      "requested_at": 1794214800000,
      "generated_at": 1794214800000,
      "duration_ms": 1,
      "walked_bytes": 1,
      "unaccounted_bytes": 1,
      "entry_count": 1,
      "truncated": true,
      "largest_path": "example",
      "largest_bytes": 1,
      "alarm_incident_uuid": "55c5387b-196c-4f50-a6d3-4806b0d7c769",
      "error": "example"
    },
    "snapshot": {},
    "snapshot_error": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Dismiss a security finding

POST/v1/servers/{server\_uuid}/security-findings/{finding\_uuid}/dismiss

Dismisses one finding of this server only (a vulnerability, a posture check or an open compromise indicator), with a reason and an optional day on which the dismissal is reviewed. A dismissed finding stays listed with `dismissed` true and its dismissal recorded.

Needs the scope `security.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `finding_uuid` (string (uuid), required): The UUID of the security finding, which must belong to the server.

### Body parameters

- `reason` (string, required): Why the finding is dismissed.
- `review_on` (string (date) or null): The day the dismissal is reviewed, `YYYY-MM-DD`, after today and within two years.

### Returns

`200 OK`:

The finding after it was dismissed.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/security-findings/{finding_uuid}/dismiss**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/security-findings/01c67242-615a-4f61-a230-4f00d737d619/dismiss \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "reason": "example"
  }'
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->dismissSecurityFinding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619', ['reason' => 'example']);
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.dismissSecurityFinding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619', { reason: 'example' });
```

Python:

```python
client = Client.from_environment()

result = client.servers.dismiss_security_finding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619', reason='example')
```

**Response (200 OK)**

```json
{
  "data": {
    "kind": "indicator",
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "title": "example",
    "severity": "example",
    "status": "example",
    "location": {
      "kind": "example",
      "container_uuid": "28bd25cc-08cf-49ee-8f25-fe6365e8085a",
      "image_ref": "example"
    },
    "source": "example",
    "dismissal": {
      "by": "example",
      "at": 1794214800000,
      "reason": "example",
      "review_on": "example",
      "scope": "example"
    },
    "history": [
      {
        "event": "example",
        "occurred_at": 1794214800000,
        "context": {},
        "by": {
          "name": "example"
        }
      }
    ],
    "vulnerability": {},
    "posture": {},
    "indicator": {}
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## End a server's alarm snooze

DELETE/v1/servers/{server\_uuid}/alarm-snooze

Ends the server’s own alarm snooze early, so held notifications are released by the next sweep (up to a minute), as described for `PUT`. The call is safe to repeat: it answers 204 also when the server had no live snooze, since the end state is what you asked for. A snooze on the server’s profile is not ended by this call and still holds the server’s notifications; end it on the profile. Needs the `alarms.edit` scope.

Needs the scope `alarms.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`204 No Content`:

The snooze was ended, or there was none; the answer has no body.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**DELETE /v1/servers/{server_uuid}/alarm-snooze**

curl:

```bash
curl -X DELETE https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/alarm-snooze \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$wt15->servers->endAlarmSnooze('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

await wt15.servers.endAlarmSnooze('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

client.servers.end_alarm_snooze('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (204 No Content)**

```http
HTTP/1.1 204 No Content
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the alarms.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Forget a closed port

POST/v1/servers/{server\_uuid}/ports/{port\_uuid}/forget

Forgets a port that is closed: a port that is tracked or was seen before is retired, an ephemeral one that was never tracked is removed. The open incidents of the port’s alarms are resolved silently.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `port_uuid` (string (uuid), required): The UUID of the port.

### Returns

`200 OK`:

What the forget did: the port’s uuid, when it was retired, whether it was removed and how many incidents were resolved.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/ports/{port_uuid}/forget**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/ports/8b6329bb-5a52-4292-bc66-7c66c4482d81/forget \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->forgetPort('e0f5add1-ce75-48d4-bb62-1712db369290', '8b6329bb-5a52-4292-bc66-7c66c4482d81');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.forgetPort('e0f5add1-ce75-48d4-bb62-1712db369290', '8b6329bb-5a52-4292-bc66-7c66c4482d81');
```

Python:

```python
client = Client.from_environment()

result = client.servers.forget_port('e0f5add1-ce75-48d4-bb62-1712db369290', '8b6329bb-5a52-4292-bc66-7c66c4482d81')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "retired_at": 1794214800000,
    "deleted": true,
    "incidents_resolved": 1
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's incidents

GET/v1/servers/{server\_uuid}/incidents

Lists the incidents of the server and of its volumes, ports and units, by when they were triggered, newest first unless `direction` says otherwise. Filter by status and by a time window; an incident is listed when it was open at any point inside the window. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `status` (array of strings or null): Only incidents in these statuses: `open`, `acknowledged` or `resolved`; every status when omitted. A bare value is read as a one-item list. A list: repeat the parameter (`status=open&status=acknowledged`) or send one value (`status=open`); `status[]=open` is accepted too. Values:`open``acknowledged``resolved`(an open set: new values may be added)
- `direction` (string or null): The order by when the incident was triggered: `desc` (the default) is the newest first, `asc` the oldest. Values:`asc``desc`(an open set: new values may be added)
- `period` (string or null): A relative window ending now: 1 to 9999 minutes, hours, days or weeks (`3h`, `2w`). Not with `from` and `to`. The operation names its longest window and its default.
- `from` (string or null): The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs `to`. A start before the oldest data kept is served from it.
- `to` (string or null): The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after `from`. A window that ends before the oldest data kept, or in the future, is refused.
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `rule_slug` (array of strings or null): Only incidents of alarms on these catalogue rules, by `rule_slug`; every rule when omitted. A bare value is read as a one-item list. An incident of an alarm that was since deleted is still listed. A list: repeat the parameter (`rule_slug=<value>&rule_slug=<value>`) or send one value (`rule_slug=<value>`); `rule_slug[]=<value>` is accepted too.
- `severity` (array of strings or null): Only incidents of these severities: `warning` or `critical`; every severity when omitted. A bare value is read as a one-item list. A list: repeat the parameter (`severity=warning&severity=critical`) or send one value (`severity=warning`); `severity[]=warning` is accepted too. Values:`warning``critical`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s incidents.

Each item of the page:

- `uuid` (string): The UUID of the incident.
- `status` (string): One of `open`, `acknowledged`, `resolved`.
- `severity` (string): One of `warning`, `critical`.
- `message` (string): The incident’s message.
- `rule_name` (string): The alarm’s own name, which tells apart two alarms on one metric.
- `rule_slug` (any): The slug of the catalogue rule behind the alarm; null when none.
- `alarm_uuid` (string or null): The uuid of the alarm that raised the incident; null when the alarm no longer resolves. The alarm may since have been deleted: `GET /v1/alarms/{alarm_uuid}` then answers 404.
- `metric_name` (any): The name of the metric the alarm watches; null when none.
- `scan_type` (any): The kind of scan the alarm reads; null when none.
- `entity` (object): The resource the incident is about: the server, or one of its volumes, ports or units.
  - `type` (any): The kind of resource: the server, or one of its volumes, ports or units.
  - `uuid` (any): The UUID of the resource.
  - `name` (any): The name of the resource.
- `parent_entity` (object or null): The server of a volume, port or unit; null for every other entity.
  - `type` (string): The kind of the server the resource belongs to.
  - `uuid` (string): The UUID of the server the resource belongs to.
- `triggered_at` (integer or null): Epoch milliseconds. When the incident was triggered. An instant: epoch milliseconds, UTC.
- `acknowledged_at` (integer or null): Epoch milliseconds. When the incident was acknowledged; null while it is not. An instant: epoch milliseconds, UTC.
- `acknowledged_by` (object or null): Who acknowledged the incident; null while it is not acknowledged.
  - `name` (string or null): The display name of the person.
- `resolved_at` (integer or null): Epoch milliseconds. When the incident was resolved; null while it is open or acknowledged. An instant: epoch milliseconds, UTC.
- `resolved_by` (object or null): Who resolved the incident; null while it is not resolved or when the system resolved it.
  - `name` (string or null): The display name of the person.
- `resolved_by_system` (boolean): Whether the system resolved it (the condition cleared), not a person.
- `console_url` (string): The incident’s page in the console.
- `notifications` (array of objects): The notifications sent for the incident, one for each channel.
  - `channel` (string): The channel it went out on, such as `email` or `slack`: an open set.
  - `status` (string): How it went: `sent`, `failed`, `skipped` or `queued`, as the notifier records it; an open set.
  - `sent_at` (integer or null): Epoch milliseconds. When the notification was sent; null when it was not sent. An instant: epoch milliseconds, UTC.
- `unit_state` (object or null): The state of the systemd unit when the incident opened, so what it was doing is known after it recovers; null for an incident on anything else and for one opened before this was recorded.
  - `active_state` (string or null): systemd’s `ActiveState` of the unit when the incident opened.
  - `sub_state` (string or null): systemd’s `SubState` of the unit when the incident opened.
  - `result` (string or null): systemd’s `Result` of the unit when the incident opened; null when it was not reported (the unit was active or had not run).
  - `exit_code` (integer or null): The unit’s exit status when the incident opened (systemd’s `ExecMainStatus`, or the signal number when `result` is `signal` or `core-dump`); null when not reported.
  - `state_changed_at` (integer or null): Epoch milliseconds. When the unit’s state last changed, as it stood when the incident opened; null when not known. An instant: epoch milliseconds, UTC.
  - `active_entered_at` (integer or null): Epoch milliseconds. When the unit last entered `active`, as it stood when the incident opened; null when it has not since it was loaded. An instant: epoch milliseconds, UTC.
  - `inventory_at` (integer or null): Epoch milliseconds. When the agent reported the inventory this state was read from, at most one system-info interval before the incident opened. An instant: epoch milliseconds, UTC.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/incidents**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/incidents \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->incidents('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.incidents('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.incidents('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "status": "example",
      "severity": "example",
      "message": "example",
      "rule_name": "example",
      "rule_slug": null,
      "alarm_uuid": "e3dec13b-3b7d-46bc-a5f3-e122d2ad3a75",
      "metric_name": null,
      "scan_type": null,
      "entity": {
        "type": null,
        "uuid": null,
        "name": null
      },
      "parent_entity": {
        "type": "example",
        "uuid": "75666699-b77d-4631-b576-041e8102a55b"
      },
      "triggered_at": 1794214800000,
      "acknowledged_at": 1794214800000,
      "acknowledged_by": {
        "name": "example"
      },
      "resolved_at": 1794214800000,
      "resolved_by": {
        "name": "example"
      },
      "resolved_by_system": true,
      "console_url": "example",
      "notifications": [
        {
          "channel": "example",
          "status": "example",
          "sent_at": 1794214800000
        }
      ],
      "unit_state": {
        "active_state": "example",
        "sub_state": "example",
        "result": "example",
        "exit_code": 1,
        "state_changed_at": 1794214800000,
        "active_entered_at": 1794214800000,
        "inventory_at": 1794214800000
      }
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Read a server's indicator policies

GET/v1/servers/{server\_uuid}/indicator-policies

Reads the policy of the two temporary-execution rules (`exe_world_writable`, `tmp_executable`) of this server: the effective policy, the server’s own and its profile’s.

Needs the scope `security.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The policy of each rule.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/indicator-policies**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/indicator-policies \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->indicatorPolicies('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.indicatorPolicies('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.indicator_policies('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {}
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Get a server's current state

GET/v1/servers/{server\_uuid}/latest

Returns where a server stands now: its health, when its agent was last seen and when the host booted, its alarm counts and the newest telemetry sample of the last 15 minutes, or null when the agent sent nothing in that time. Fails with a 503 when the metric store does not answer.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The server’s current state.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/latest**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/latest \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->latest('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.latest('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.latest('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "health_status": "example",
    "security_health_status": "example",
    "monitoring_health_status": "example",
    "overall_health_status": "example",
    "agent_status": "example",
    "connectivity_state": "example",
    "agent_last_seen_at": 1794214800000,
    "booted_at": 1794214800000,
    "alarm_summary": {
      "critical": 1,
      "warning": 1,
      "ok": 1,
      "inactive": 1,
      "acknowledged": 1
    },
    "sample": {
      "sampled_at": 1794214800000,
      "cpu_usage_percent": 0,
      "memory_usage_percent": 0,
      "memory_used_mb": 0,
      "memory_free_mb": 0,
      "swap_usage_percent": 0,
      "swap_used_mb": 0,
      "memory_commit_percent": 0,
      "load_avg_1m": 0,
      "load_avg_5m": 0,
      "load_avg_15m": 0,
      "disk_usage_percent": 0,
      "disk_used_gb": 0,
      "disk_free_gb": 0,
      "disk_io_read_mbps": 0,
      "disk_io_write_mbps": 0,
      "net_in_mbps": 0,
      "net_out_mbps": 0,
      "process_count": 0
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (503 Service Unavailable)**

A data store did not answer within the request's 10 seconds; try again shortly (`store_unavailable`).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/store_unavailable/",
  "title": "Store unavailable",
  "status": 503,
  "code": "store_unavailable",
  "detail": "A data store did not answer; try again shortly",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Get a server's metric series

GET/v1/servers/{server\_uuid}/metrics

Returns the series of one metric family of a server over a time window, in one shape for every family: each series has its name, unit, labels and `[t, value]` points, with `t` in epoch milliseconds. A series the server does not report is absent, never zero. The window defaults to one day and is at most 31 days; the disk and network families keep 30 days of detail, and a window that starts earlier is shortened, which the answer’s `window.from` shows. Fails with a 503 when the metric store does not answer.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `family` (string, required): The metric family to read: `cpu`, `memory`, `load`, `disk`, `network`, `tcp`, `saturation` or `kernel_limits`. Values:`cpu``memory``load``disk``network``tcp``saturation``kernel_limits`(an open set: new values may be added)
- `period` (string or null): A relative window ending now: 1 to 9999 minutes, hours, days or weeks (`3h`, `2w`). Not with `from` and `to`. The operation names its longest window and its default.
- `from` (string or null): The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs `to`. A start before the oldest data kept is served from it.
- `to` (string or null): The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after `from`. A window that ends before the oldest data kept, or in the future, is refused.

### Returns

`200 OK`:

One family’s series for the window.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/metrics**

curl:

```bash
curl -G https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/metrics \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -d family=cpu
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->metrics('e0f5add1-ce75-48d4-bb62-1712db369290', ['family' => 'cpu']);
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.metrics('e0f5add1-ce75-48d4-bb62-1712db369290', { family: 'cpu' });
```

Python:

```python
client = Client.from_environment()

result = client.servers.metrics('e0f5add1-ce75-48d4-bb62-1712db369290', family='cpu')
```

**Response (200 OK)**

```json
{
  "data": {
    "server": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "family": "example",
    "window": {
      "from": 1794214800000,
      "to": 1794214800000
    },
    "source": "example",
    "step_seconds": 1,
    "series": [
      {
        "name": "example",
        "unit": "example",
        "labels": {
          "mount": "example",
          "device": "example",
          "interface": "example",
          "state": "example",
          "cpu": "example"
        },
        "point_meaning": "example",
        "points": [
          [
            0
          ]
        ]
      }
    ],
    "oom_kills_in_window": 1,
    "conntrack_loaded": true,
    "files_host_limited": true
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (503 Service Unavailable)**

A data store did not answer within the request's 10 seconds; try again shortly (`store_unavailable`).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/store_unavailable/",
  "title": "Store unavailable",
  "status": 503,
  "code": "store_unavailable",
  "detail": "A data store did not answer; try again shortly",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Get a server's OS updates

GET/v1/servers/{server\_uuid}/os-updates

Returns what is waiting to be installed on one server: the updates its own package manager sees (`host`), and for a server locked to an Amazon Linux 2023 release the updates it would have at the latest release (`at_latest`), each with its security count and the five severities, the release lock, the running and newest kernel, whether a reboot is needed, how fresh the report is, and whether and when a recheck is available (`recheck`). A server that has not reported answers `not_reported`. Package names are not listed here: see `servers.osUpdatesPackages`.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The server’s OS-updates summary.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/os-updates**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/os-updates \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->osUpdates('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.osUpdates('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.os_updates('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "status": "example",
    "reason": "example",
    "package_manager": "example",
    "observed_at": 1794214800000,
    "reported_at": 1794214800000,
    "metadata_refreshed_at": 1794214800000,
    "stale": true,
    "host": {
      "updates_total": 1,
      "updates_security": 1,
      "security_published": true,
      "security_by_level": {
        "critical": 1,
        "important": 1,
        "moderate": 1,
        "low": 1,
        "unknown": 1
      },
      "security_pending_since": 1794214800000,
      "packages_truncated": true
    },
    "release_locked": {
      "current": "example",
      "follows_latest": true,
      "latest": "example",
      "latest_released_on": "example",
      "releases_behind": 1,
      "days_behind": 1
    },
    "at_latest": {
      "status": "example",
      "reason": "example",
      "release": "example",
      "matched_at": 1794214800000,
      "checked_at": 1794214800000,
      "stale": true,
      "updates_total": 1,
      "updates_security": 1,
      "security_by_level": {
        "critical": 1,
        "important": 1,
        "moderate": 1,
        "low": 1,
        "unknown": 1
      },
      "advisory_counts": {
        "critical": 1,
        "important": 1,
        "moderate": 1,
        "low": 1,
        "unknown": 1,
        "total": 1
      },
      "kernel_candidate": "example",
      "security_pending_since": 1794214800000,
      "packages_truncated": true
    },
    "kernel": {
      "running": "example",
      "newest_present": "example",
      "update_available": true
    },
    "reboot": {
      "required": true,
      "since": 1794214800000,
      "source": "example",
      "package_count": 1
    },
    "recheck": {
      "state": "example",
      "available_at": 1794214800000,
      "last": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "status": "example",
        "issued_at": 1794214800000,
        "expires_at": 1794214800000,
        "completed_at": 1794214800000
      }
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's pending OS update packages

GET/v1/servers/{server\_uuid}/os-updates/packages

Lists the packages waiting to be installed on one server, security updates first, with their installed and available versions and their advisories. `scope=host` (the default) is what the host’s own package manager sees inside its locked release; `scope=latest` is what a server locked to an Amazon Linux 2023 release would install at the latest release, each package with every advisory that names it and the CVE ids Amazon lists. `meta` states how many updates are pending in the scope, whether the stored list was cut at 500 packages and, on `latest`, the Amazon Linux 2023 release the list was matched against; every `latest` row comes from Amazon’s core repository, `amazonlinux`. Package names are the host’s attack map, so this needs `security.view`. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `security.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `scope` (string or null): Which list: `host` (the default) is what the host’s own package manager sees inside its locked release, `latest` what a server locked to an Amazon Linux 2023 release would install at the latest release (empty for any other server). Values:`host``latest`(an open set: new values may be added)
- `security_only` (string or null): Only the security updates (`true`, `false`, `1` or `0`). Values:`true``false``1``0`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s pending packages.

Each item of the page:

- `name` (string): The package name.
- `arch` (string): The architecture, such as `x86_64` or `noarch`.
- `current_version` (string): The version on the host now.
- `available_version` (string): The version that would be installed: the host’s candidate, or the latest release’s.
- `repository` (string or null): The repository the package comes from: on `host`, the one the host’s package manager offers it from; on `latest`, always `amazonlinux`, because the latest-release list is read from Amazon’s AL2023 core repository, so no `latest` row comes from a third-party repository.
- `security` (boolean): Whether it is a security update.
- `severity` (string or null): One of `critical`, `important`, `moderate`, `low`, `unknown` for a security update (`unknown` when its advisory carries none of the four); null when it is not a security update.
- `vendor_severity` (string or null): The vendor’s own word for the severity; null when it gave none.
- `advisory` (string or null): The id of the worst advisory that names the package; null when none does.
- `advisories` (array of objects): `latest` only: every advisory that names the package at a version newer than installed and not newer than the available one, worst severity first, then the id descending, at most 16; `cve_ids` are at most 32 CVE ids from Amazon’s metadata and `cve_ids_truncated` says more exist, and `severity` is one of `critical`, `important`, `moderate`, `low`, `unknown`. Never null: it is empty on `host`, and empty when none is known, so a `latest` row with `advisory` set and `advisories` empty was matched before the advisories were kept, and has them after the next hourly match (about an hour for an `aarch64` server, about two for an `x86_64` one).
  - `id` (string): The advisory’s id, such as `ALAS2023-2025-1180`.
  - `severity` (string): One of `critical`, `important`, `moderate`, `low`, `unknown`: the advisory’s severity.
  - `cve_ids` (array of strings): The CVE ids the advisory fixes, at most 32.
  - `cve_ids_truncated` (boolean): Whether the advisory names more than 32 CVE ids.
- `advisories_truncated` (boolean or null): `latest` only: whether more than 16 advisories name the package. Null on `host`.
- `only_at_latest` (boolean or null): `latest` only: true when the host’s own list has no package of this name and architecture (it is only at the latest release); null on `host`, and null when the host’s list is truncated, since a package past its cut would read true.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/os-updates/packages**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/os-updates/packages \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->osUpdatesPackages('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item->name, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.osUpdatesPackages('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.name);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.os_updates_packages('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.name)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "name": "example",
      "arch": "example",
      "current_version": "example",
      "available_version": "example",
      "repository": "example",
      "security": true,
      "severity": "example",
      "vendor_severity": "example",
      "advisory": "example",
      "advisories": [
        {
          "id": "example",
          "severity": "example",
          "cve_ids": [
            "example"
          ],
          "cve_ids_truncated": true
        }
      ],
      "advisories_truncated": true,
      "only_at_latest": true
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1,
  "meta": {
    "scope": "example",
    "updates_total": 1,
    "truncated": true,
    "release": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's ports

GET/v1/servers/{server\_uuid}/ports

Lists the ports the server’s agent reports, the open ones first. Retired ports are included only with `include_retired=true`. `meta` states when the agent last reported a complete port list and whether the cap on charted ports is full. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `include_retired` (string or null): Whether retired ports are listed too (`true`, `false`, `1` or `0`), so “how long was this port open” stays answerable for every port ever seen. Values:`true``false``1``0`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s ports.

Each item of the page:

- `uuid` (string): The UUID of the port.
- `port` (integer): The port number.
- `protocol` (string): One of `tcp`, `udp`.
- `bind_scope` (string): `any`, `loopback` or `specific`; the addresses only for `specific`.
- `addresses` (array of strings): The bound addresses of a `specific` bind; empty for any other (never null: a nullable array is not a type the spec validator reads).
- `process_name` (string or null): The owner’s kernel `comm`, never a command line.
- `is_open` (boolean): Whether the port is listening now.
- `state` (string): `open` or `closed`.
- `opened_at` (integer or null): Epoch milliseconds. When the port was last seen opening; null when not known. An instant: epoch milliseconds, UTC.
- `closed_at` (integer or null): Epoch milliseconds. When the port was last seen closing; null while it is open. An instant: epoch milliseconds, UTC.
- `first_seen_at` (integer or null): Epoch milliseconds. When the agent first reported the port. An instant: epoch milliseconds, UTC.
- `tracked` (boolean): Whether a user asked for this ephemeral port to be tracked.
- `expected` (boolean): Whether the port is marked as expected to be open.
- `charted` (boolean): Whether the port has a series, alarms and a history: not ephemeral, or ephemeral and tracked.
- `health_status` (string): One of `unknown`, `healthy`, `warning`, `critical`.
- `retired_at` (integer or null): Epoch milliseconds. When the port was retired; null while it is not retired. An instant: epoch milliseconds, UTC.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/ports**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/ports \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->ports('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.ports('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.ports('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "port": 1,
      "protocol": "example",
      "bind_scope": "example",
      "addresses": [
        "example"
      ],
      "process_name": "example",
      "is_open": true,
      "state": "example",
      "opened_at": 1794214800000,
      "closed_at": 1794214800000,
      "first_seen_at": 1794214800000,
      "tracked": true,
      "expected": true,
      "charted": true,
      "health_status": "example",
      "retired_at": 1794214800000
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1,
  "meta": {
    "reported_at": 1794214800000,
    "capped": true
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's top processes

GET/v1/servers/{server\_uuid}/processes

Lists the server’s process groups ranked by memory or by CPU, highest first. The agent’s roll-up of every process it did not send is not a row: it is `meta.other`, null when the server has none. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `sort_by` (string or null): What the processes are ranked by: `memory` or `cpu`. Values:`memory``cpu`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s process groups.

Each item of the page:

- `process_name` (string): The executable name.
- `owner` (string): The owner; empty when the agent did not send one.
- `cpu_percent` (number or null): The CPU the group uses, as a percentage.
- `memory_mb` (number or null): The memory the group holds, in MB.
- `process_count` (integer or null): How many processes the group has.
- `open_files_percent` (number or null): The group’s worst process’s open files against its own limit; null where the agent sends none.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/processes**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/processes \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->processes('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item->processName, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.processes('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.process_name);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.processes('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.process_name)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "process_name": "example",
      "owner": "example",
      "cpu_percent": 0,
      "memory_mb": 0,
      "process_count": 1,
      "open_files_percent": 0
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1,
  "meta": {
    "server": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "sampled_at": 1794214800000,
    "other": {
      "cpu_percent": 0,
      "memory_mb": 0,
      "process_count": 1
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (503 Service Unavailable)**

A data store did not answer within the request's 10 seconds; try again shortly (`store_unavailable`).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/store_unavailable/",
  "title": "Store unavailable",
  "status": 503,
  "code": "store_unavailable",
  "detail": "A data store did not answer; try again shortly",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Provision a server

POST/v1/servers/{server\_uuid}/provision

Withdrawn: refused with a 422 `invalid_request` that changes nothing. A server gets a new token by enrolling again with the organisation’s install token. The operation will be removed at the next major release of the SDKs.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Body parameters

- `channel` (string or null): The agent channel the enrolment token is for. Values:`stable``beta`(an open set: new values may be added)

### Returns

`200 OK`:

The server’s enrolment receipt.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/provision**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/provision \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->provision('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.provision('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.provision('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "hostname": "example",
    "enrollment_token": "example",
    "agent_status": "example",
    "agent_channel": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Reactivate a server

POST/v1/servers/{server\_uuid}/reactivate

Brings an archived server back to monitoring. Refuses when the organisation is at its server limit or its payment is blocked, or when the server’s agent is no longer active. Answers the server as `servers.view` does.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The server after it was reactivated.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/reactivate**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/reactivate \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->reactivate('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.reactivate('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.reactivate('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "display_name": "example",
    "server_profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "hostname": "example",
    "ip_address": "example",
    "supplier_identifier": "example",
    "supplier_name": "example",
    "public_ipv4": "example",
    "connection": {
      "type": "example",
      "proxy_host": "example",
      "proxy_port": 1
    },
    "os_type": "example",
    "os_name": "example",
    "os_version": "example",
    "kernel_version": "example",
    "cpu_model": "example",
    "cpu_cores": 1,
    "total_memory_mb": 1,
    "booted_at": 1794214800000,
    "timezone": "example",
    "utc_offset_seconds": 1,
    "in_container": true,
    "health_status": "example",
    "security_health_status": "example",
    "monitoring_health_status": "example",
    "overall_health_status": "example",
    "active": true,
    "archived_at": 1794214800000,
    "notes": "example",
    "agent": {
      "status": "example",
      "version": "example",
      "capabilities": [
        "example"
      ],
      "last_seen_at": 1794214800000,
      "connectivity_state": "example"
    },
    "disks": [
      {
        "mount_point": "example",
        "device": "example",
        "filesystem_type": "example",
        "total_gb": 0,
        "used_gb": 0,
        "free_gb": 0,
        "used_percent": 0,
        "inodes_used_percent": 0
      }
    ],
    "network_interfaces": [
      {
        "interface_name": "example",
        "ipv4_address": "example",
        "ipv6_address": "example",
        "is_up": true
      }
    ],
    "alarm_summary": {
      "critical": 1,
      "warning": 1,
      "ok": 1,
      "inactive": 1,
      "acknowledged": 1
    },
    "alarm_snooze": {
      "until": 1794214800000,
      "source": "example",
      "server": {
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      },
      "profile": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      }
    },
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "group": {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      }
    ],
    "console_url": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (402 Payment Required)**

The organisation's payment gate blocks the action: `payment_required` (no payment method) or `invoice_overdue`. Nothing is billed and nothing is started.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/payment_required/",
  "title": "Payment required",
  "status": 402,
  "code": "payment_required",
  "detail": "A payment method must be set before adding resources for monitoring.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Recheck a server's OS updates

POST/v1/servers/{server\_uuid}/os-updates/recheck

Asks the server’s agent to read its pending updates and its package inventory now, instead of at the next scheduled check, so a patched server’s answer becomes current within minutes. The agent reads what the host’s package manager left; it never runs it. The call returns at once with the recheck’s uuid, and `servers.osUpdates` shows its progress in `recheck.last`: once it is `completed` a report arrived, and the counts are current only when the summary’s `status` is `ok`. It is refused for a Windows server, a container, an agent that needs updating, an inactive server, while a recheck is waiting and when asked again within 10 minutes; read `recheck.state` first to know.

Needs the scope `security.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`202 Accepted`:

The request was accepted; the recheck’s task is returned and the agent reads the host.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/os-updates/recheck**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/os-updates/recheck \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->recheckOsUpdates('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.recheckOsUpdates('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.recheck_os_updates('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (202 Accepted)**

```json
{
  "data": {
    "state": "example",
    "available_at": 1794214800000,
    "last": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "status": "example",
      "issued_at": 1794214800000,
      "expires_at": 1794214800000,
      "completed_at": 1794214800000
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Recheck a server's security posture

POST/v1/servers/{server\_uuid}/security-posture/recheck

Asks the server’s agent to run its security-posture checks again, like the console’s Check now. The check itself runs on the agent, so the call returns at once with the server and the results follow later; it is refused for a container, while a check is pending and when asked again within a few minutes.

Needs the scope `security.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`202 Accepted`:

The request was accepted; the server is returned and the agent runs the check.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/security-posture/recheck**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/security-posture/recheck \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->recheckPosture('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.recheckPosture('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.recheck_posture('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (202 Accepted)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "display_name": "example",
    "server_profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "hostname": "example",
    "ip_address": "example",
    "supplier_identifier": "example",
    "supplier_name": "example",
    "public_ipv4": "example",
    "connection": {
      "type": "example",
      "proxy_host": "example",
      "proxy_port": 1
    },
    "os_type": "example",
    "os_name": "example",
    "os_version": "example",
    "kernel_version": "example",
    "cpu_model": "example",
    "cpu_cores": 1,
    "total_memory_mb": 1,
    "booted_at": 1794214800000,
    "timezone": "example",
    "utc_offset_seconds": 1,
    "in_container": true,
    "health_status": "example",
    "security_health_status": "example",
    "monitoring_health_status": "example",
    "overall_health_status": "example",
    "active": true,
    "archived_at": 1794214800000,
    "notes": "example",
    "agent": {
      "status": "example",
      "version": "example",
      "capabilities": [
        "example"
      ],
      "last_seen_at": 1794214800000,
      "connectivity_state": "example"
    },
    "disks": [
      {
        "mount_point": "example",
        "device": "example",
        "filesystem_type": "example",
        "total_gb": 0,
        "used_gb": 0,
        "free_gb": 0,
        "used_percent": 0,
        "inodes_used_percent": 0
      }
    ],
    "network_interfaces": [
      {
        "interface_name": "example",
        "ipv4_address": "example",
        "ipv6_address": "example",
        "is_up": true
      }
    ],
    "alarm_summary": {
      "critical": 1,
      "warning": 1,
      "ok": 1,
      "inactive": 1,
      "acknowledged": 1
    },
    "alarm_snooze": {
      "until": 1794214800000,
      "source": "example",
      "server": {
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      },
      "profile": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      }
    },
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "group": {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      }
    ],
    "console_url": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Restore a security finding

POST/v1/servers/{server\_uuid}/security-findings/{finding\_uuid}/restore

Lifts the dismissal of a finding so it counts again. Answers the finding after the change.

Needs the scope `security.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `finding_uuid` (string (uuid), required): The UUID of the security finding, which must belong to the server.

### Returns

`200 OK`:

The finding after it was restored.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/security-findings/{finding_uuid}/restore**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/security-findings/01c67242-615a-4f61-a230-4f00d737d619/restore \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->restoreSecurityFinding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.restoreSecurityFinding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619');
```

Python:

```python
client = Client.from_environment()

result = client.servers.restore_security_finding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619')
```

**Response (200 OK)**

```json
{
  "data": {
    "kind": "indicator",
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "title": "example",
    "severity": "example",
    "status": "example",
    "location": {
      "kind": "example",
      "container_uuid": "28bd25cc-08cf-49ee-8f25-fe6365e8085a",
      "image_ref": "example"
    },
    "source": "example",
    "dismissal": {
      "by": "example",
      "at": 1794214800000,
      "reason": "example",
      "review_on": "example",
      "scope": "example"
    },
    "history": [
      {
        "event": "example",
        "occurred_at": 1794214800000,
        "context": {},
        "by": {
          "name": "example"
        }
      }
    ],
    "vulnerability": {},
    "posture": {},
    "indicator": {}
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Revoke a server's agent

POST/v1/servers/{server\_uuid}/revoke

Revokes the agent of a server: its token stops working and it is cut off. Answers the server as `servers.view` does.

Needs the scope `servers.delete`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The server after its agent was revoked.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/revoke**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/revoke \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->revoke('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.revoke('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.revoke('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "display_name": "example",
    "server_profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    },
    "hostname": "example",
    "ip_address": "example",
    "supplier_identifier": "example",
    "supplier_name": "example",
    "public_ipv4": "example",
    "connection": {
      "type": "example",
      "proxy_host": "example",
      "proxy_port": 1
    },
    "os_type": "example",
    "os_name": "example",
    "os_version": "example",
    "kernel_version": "example",
    "cpu_model": "example",
    "cpu_cores": 1,
    "total_memory_mb": 1,
    "booted_at": 1794214800000,
    "timezone": "example",
    "utc_offset_seconds": 1,
    "in_container": true,
    "health_status": "example",
    "security_health_status": "example",
    "monitoring_health_status": "example",
    "overall_health_status": "example",
    "active": true,
    "archived_at": 1794214800000,
    "notes": "example",
    "agent": {
      "status": "example",
      "version": "example",
      "capabilities": [
        "example"
      ],
      "last_seen_at": 1794214800000,
      "connectivity_state": "example"
    },
    "disks": [
      {
        "mount_point": "example",
        "device": "example",
        "filesystem_type": "example",
        "total_gb": 0,
        "used_gb": 0,
        "free_gb": 0,
        "used_percent": 0,
        "inodes_used_percent": 0
      }
    ],
    "network_interfaces": [
      {
        "interface_name": "example",
        "ipv4_address": "example",
        "ipv6_address": "example",
        "is_up": true
      }
    ],
    "alarm_summary": {
      "critical": 1,
      "warning": 1,
      "ok": 1,
      "inactive": 1,
      "acknowledged": 1
    },
    "alarm_snooze": {
      "until": 1794214800000,
      "source": "example",
      "server": {
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      },
      "profile": {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      }
    },
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example",
        "group": {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      }
    ],
    "console_url": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.delete scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Rotate a server's enrolment token

POST/v1/servers/{server\_uuid}/rotate-token

Withdrawn: refused with a 422 `invalid_request` that changes nothing. A server gets a new token by enrolling again with the organisation’s install token. The operation will be removed at the next major release of the SDKs.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Returns

`200 OK`:

The server’s new enrolment receipt.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/servers/{server_uuid}/rotate-token**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/rotate-token \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->rotateToken('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.rotateToken('e0f5add1-ce75-48d4-bb62-1712db369290');
```

Python:

```python
client = Client.from_environment()

result = client.servers.rotate_token('e0f5add1-ce75-48d4-bb62-1712db369290')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "enrollment_token": "example",
    "agent_status": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Get a security finding

GET/v1/servers/{server\_uuid}/security-findings/{finding\_uuid}

Returns one finding of a server, a vulnerability, a posture check or a compromise indicator, with its dismissal, its history and the fields of its kind.

Needs the scope `security.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `finding_uuid` (string (uuid), required): The UUID of the security finding, which must belong to the server.

### Returns

`200 OK`:

The finding.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/security-findings/{finding_uuid}**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/security-findings/01c67242-615a-4f61-a230-4f00d737d619 \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->securityFinding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.securityFinding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619');
```

Python:

```python
client = Client.from_environment()

result = client.servers.security_finding('e0f5add1-ce75-48d4-bb62-1712db369290', '01c67242-615a-4f61-a230-4f00d737d619')
```

**Response (200 OK)**

```json
{
  "data": {
    "kind": "indicator",
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "title": "example",
    "severity": "example",
    "status": "example",
    "location": {
      "kind": "example",
      "container_uuid": "28bd25cc-08cf-49ee-8f25-fe6365e8085a",
      "image_ref": "example"
    },
    "source": "example",
    "dismissal": {
      "by": "example",
      "at": 1794214800000,
      "reason": "example",
      "review_on": "example",
      "scope": "example"
    },
    "history": [
      {
        "event": "example",
        "occurred_at": 1794214800000,
        "context": {},
        "by": {
          "name": "example"
        }
      }
    ],
    "vulnerability": {},
    "posture": {},
    "indicator": {}
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's security findings

GET/v1/servers/{server\_uuid}/security-findings

Lists the findings of one server: its vulnerabilities first, then its posture checks, then its compromise indicators, in every status. Filter by kind, by KEV, by level (`severity`), by status, by vulnerability id or by package; a row is the summary of a finding, and `servers.securityFinding` returns the whole. Each finding says where it was found (`location`: the host or a container) and what was matched (`source`). Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `security.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `kind` (string or null): Only findings of this kind. Values:`vulnerability``posture``indicator`(an open set: new values may be added)
- `kev` (string or null): Only findings that are in the CISA Known Exploited Vulnerabilities catalogue (`true`) or are not (`false`). `true` leaves out posture checks and compromise indicators, which are never in it. Values:`true``false``1``0`(an open set: new values may be added)
- `severity` (array of strings or null): Only findings of these levels, as the list shows them: `critical`, `warning` or `info`. Repeat the parameter for several. A vulnerability’s level follows KEV and the vendor severity: KEV or vendor `critical` is `critical`, vendor `high` or `medium` is `warning`, the rest `info`. A list: repeat the parameter (`severity=critical&severity=warning`) or send one value (`severity=critical`); `severity[]=critical` is accepted too. Values:`critical``warning``info`(an open set: new values may be added)
- `status` (array of strings or null): Only findings with these statuses, as the list shows them: `open`, `dismissed` or `resolved` for a vulnerability or a compromise indicator, `pass`, `fail`, `not_applicable` or `not_measured` for a posture check. Repeat the parameter for several; a status only one kind has leaves the other kinds out. A list: repeat the parameter (`status=open&status=dismissed`) or send one value (`status=open`); `status[]=open` is accepted too. Values:`open``dismissed``resolved``pass``fail``not_applicable``not_measured`(an open set: new values may be added)
- `vulnerability_id` (string or null): Only the vulnerability with this id, for example `CVE-2024-3094`; case does not matter. Leaves out posture checks and compromise indicators.
- `package` (string or null): Only vulnerabilities of this package, by its exact name. Leaves out posture checks and compromise indicators.
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `location` (string or null): Only findings found `host` or in a `container`. `container` leaves out posture checks and compromise indicators, which are always the host’s; it keeps the findings of a container that is no longer on record. Values:`host``container`(an open set: new values may be added)
- `container_uuid` (string (uuid) or null): Only the vulnerability findings of this container of the server; it leaves out the other kinds. A container that is not on this server answers 404 `not_found`.
- `source` (array of strings or null): Only vulnerability findings matched from one of these sources: `os_package`, `runtime` (a language runtime) or `library` (a language dependency); it leaves out the other kinds. A list: repeat the parameter (`source=os_package&source=runtime`) or send one value (`source=os_package`); `source[]=os_package` is accepted too. Values:`os_package``runtime``library`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s security findings.

Each item of the page:

- `kind` (string): One of `vulnerability`, `posture`, `indicator`.
- `uuid` (string): The UUID of the finding.
- `title` (string): The vulnerability id for a vulnerability, the check’s title for a posture check, the indicator’s title for a compromise indicator.
- `package` (null): The package of a vulnerability; null for the other kinds.
- `key` (string): The key of a posture check or of a compromise indicator; null for a vulnerability.
- `severity` (string): The finding’s level as the list shows it: one of `critical`, `warning` or `info`. For a vulnerability, KEV or vendor `critical` is `critical`, vendor `high` or `medium` is `warning`, the rest `info`.
- `status` (string): `open`, `dismissed` or `resolved` for a vulnerability or a compromise indicator; `pass`, `fail`, `not_applicable` or `not_measured` for a posture check.
- `dismissed` (boolean): Whether the finding is dismissed.
- `kev` (boolean): Whether the vulnerability is in the CISA Known Exploited Vulnerabilities catalogue; false for the other kinds.
- `kev_ids` (array of strings): The CVE ids of the vulnerability that are in the CISA Known Exploited Vulnerabilities catalogue, the first 16 stored, in stored order (an ALAS, GHSA or USN finding’s `title` hides them); `[]` when none is, and for the other kinds. The single-finding read has the full list.
- `kev_ids_truncated` (boolean): Whether more than 16 known-exploited CVE ids are stored; false for the other kinds.
- `epss` (number or null): The vulnerability’s EPSS score, from 0 to 1; null when it has none and for the other kinds.
- `fix_state` (string or null): Whether a fix exists: `fixed`, `not_fixed`, `wont_fix` or `unknown` for a vulnerability; null for the other kinds.
- `fixed_version` (string or null): The version that fixes the vulnerability, when there is one; null for the other kinds.
- `location` (object): Where the finding was found.
  - `kind` (string): `host`, or `container` for a vulnerability found in a container.
  - `container_uuid` (string or null): The container’s uuid; null on the host, and when the container is no longer on record.
  - `image_ref` (string or null): The container’s image; null on the host, when not known, or when the container is no longer on record.
- `source` (string or null): What was matched, for a vulnerability: `os_package`, `runtime` (a language runtime) or `library` (a language dependency); null for the other kinds.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/security-findings**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/security-findings \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->securityFindings('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item['uuid'], "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.securityFindings('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.security_findings('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "kind": "posture",
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "title": "example",
      "package": null,
      "key": "example",
      "severity": "example",
      "status": "example",
      "dismissed": true,
      "kev": true,
      "kev_ids": [
        "example"
      ],
      "kev_ids_truncated": true,
      "epss": 0,
      "fix_state": "example",
      "fixed_version": "example",
      "location": {
        "kind": "host",
        "container_uuid": "28bd25cc-08cf-49ee-8f25-fe6365e8085a",
        "image_ref": "example"
      },
      "source": "example"
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Snooze a server's alarms

PUT/v1/servers/{server\_uuid}/alarm-snooze

Holds the alarm notifications of one server for a set time, as the console’s Snooze does. The alarms keep evaluating the whole time: incidents still open, escalate, step down and resolve, and health and the alarm states keep their real values; only the automatic notifications are held. It covers the server’s own alarms and those of its volumes, ports and systemd units, including the `*_reporting_stopped` alarms, so snoozing a server before a reboot keeps it quiet. The server’s database instances, services, domains, log sources and custom metrics are their own resources and are not covered. While a snooze is live, a new or escalated incident whose alarm has a notification policy is held, not sent, and reads `notification_held_at` on the incident. An incident that resolves while the server is snoozed is resolved without a notification, even one that was notified before the snooze started, and an incident whose trigger was held is resolved without one too: the team is not told that an earlier page cleared. A person’s acknowledge or resolve still notifies and clears the hold, snoozed or not. When the snooze ends, by its time or by `DELETE`, each incident still open whose notification was held is notified once at its current severity (the stored message, so it may read as lowered from a higher severity); one already acknowledged or resolved is cleared without a notification. That release is made by a sweep that runs every minute, so it can lag the end by up to a minute. A server is also snoozed while its server profile’s snooze is live (read the server’s `alarm_snooze`): it stays quiet until the later of the two ends, and ending one leaves the other in force. Send `duration` (a whole number, at least 1) and `unit` (`minutes`, `hours` or `days`), counted from now: the total is 1 minute to 30 days, and more is refused with 422. Setting a snooze on a server that already has one replaces its end, so a second call extends or shortens it, and there is one snooze for each. `reason` is optional, plain text, at most 500 characters. A snooze takes effect from the next evaluation pass (up to a minute), so a notification can still go out in the pass that is running when you call, and likewise an end takes effect from the next pass. Needs the `alarms.edit` scope.

Needs the scope `alarms.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Body parameters

- `duration` (integer, required): How long the snooze lasts, a whole number of `unit`s, at least 1. The total is 1 minute to 30 days: at most 43200 `minutes`, 720 `hours` or 30 `days`.
- `unit` (string, required): The unit of `duration`: `minutes`, `hours` or `days`. Values:`minutes``hours``days`(an open set: new values may be added)
- `reason` (string or null): Why the alarms are snoozed, plain text, at most 500 characters; null or left out for none. It is shown to the team with the snooze.

### Returns

`200 OK`:

The server’s snooze after the call: when it ends, which snooze (its own or its profile’s) ends later, its own snooze and its profile’s.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**PUT /v1/servers/{server_uuid}/alarm-snooze**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/alarm-snooze \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "duration": 1,
    "unit": "minutes"
  }'
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->setAlarmSnooze('e0f5add1-ce75-48d4-bb62-1712db369290', ['duration' => 1, 'unit' => 'minutes']);
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.setAlarmSnooze('e0f5add1-ce75-48d4-bb62-1712db369290', { duration: 1, unit: 'minutes' });
```

Python:

```python
client = Client.from_environment()

result = client.servers.set_alarm_snooze('e0f5add1-ce75-48d4-bb62-1712db369290', duration=1, unit='minutes')
```

**Response (200 OK)**

```json
{
  "data": {
    "until": 1794214800000,
    "source": "example",
    "server": {
      "until": 1794214800000,
      "reason": "example",
      "set_at": 1794214800000
    },
    "profile": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example",
      "until": 1794214800000,
      "reason": null,
      "set_at": 1794214800000
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the alarms.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's system services

GET/v1/servers/{server\_uuid}/system-services

Lists the systemd units of a server, by name, with the restarts, memory and CPU the metric store holds for each, and the alarms that are firing on it. Those figures are null where the store has none or does not answer. `search` keeps only the units whose name or description contains the text, in any case. Each unit says how it is activated, whether the agent finds it healthy, whether its alarms are armed, when it last entered `active`, and how it last exited. An alarm names its open incident by `incident_uuid`, the id for `GET /v1/incidents/{incident_uuid}`. `meta` states the init system the agent reported and when it last reported a complete inventory. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `search` (string or null): Text matched, in any case, against a unit’s name and its description: only the units that contain it are listed, and `total` counts them.
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s system services.

Each item of the page:

- `uuid` (string): The UUID of the unit.
- `unit_name` (string): The systemd unit’s name, e.g. `nginx.service`.
- `description` (string or null): The unit’s description; null when it has none.
- `load_state` (string or null): systemd’s `LoadState`.
- `active_state` (string or null): systemd’s `ActiveState`.
- `sub_state` (string or null): systemd’s `SubState`.
- `unit_file_state` (string or null): systemd’s `UnitFileState`.
- `monitored` (boolean): Whether the unit is monitored: only a monitored unit has alarms and store figures.
- `activation` (string): How the unit is started: `daemon`, `oneshot_remain`, `oneshot`, `timer`, `socket`, `path`, `dbus` or `none`.
- `healthy` (boolean): Whether the agent finds the unit healthy: it reads up, or it ended by itself the way its own unit file lists as a success.
- `alarms_armed` (boolean): Whether the unit’s alarms are armed: only a monitored unit the agent found healthy has any.
- `restarts` (integer or null): Restarts in the range; null where the store has none.
- `memory_bytes` (integer or null): Memory in bytes; null where the store has none.
- `cpu_percent` (number or null): The latest CPU as a percentage of one core, two decimals; null where not reported (not running, CPU accounting off, an older agent).
- `alarm_state` (string or null): The worst state among the unit’s firing alarms: `critical` or `warning`; null when none is firing.
- `alarms` (array of objects): The unit’s firing alarms, critical first, then the oldest first.
  - `uuid` (string): The alarm’s uuid.
  - `rule_slug` (string): The slug of the catalogue rule behind the alarm.
  - `name` (string): The alarm’s own name, which tells apart two alarms on one rule.
  - `state` (string): One of `warning`, `critical`.
  - `state_since` (integer or null): Epoch milliseconds: when the open incident was triggered; null when it is not known. An instant: epoch milliseconds, UTC.
  - `acknowledged` (boolean): Whether the open incident has been acknowledged.
  - `incident_uuid` (string or null): The uuid of the open incident: the id to pass to `GET /v1/incidents/{incident_uuid}`; null when it is not known.
- `state_changed_at` (integer or null): Epoch milliseconds. When the unit’s state last changed; null when not known. An instant: epoch milliseconds, UTC.
- `first_seen_at` (integer or null): Epoch milliseconds. When the agent first reported the unit. An instant: epoch milliseconds, UTC.
- `missing_since` (integer or null): Epoch milliseconds. Since when a monitored unit has been missing from the last complete inventory; null while it is present. An instant: epoch milliseconds, UTC.
- `absence_accepted_at` (integer or null): Epoch milliseconds. Since when the owner accepted the unit’s absence; null when none is accepted. An instant: epoch milliseconds, UTC.
- `active_entered_at` (integer or null): Epoch milliseconds. When a monitored systemd unit last entered `active`; null when it has not since it was loaded (how a never-started unit reads), for an unmonitored unit, for a Windows service and for an older agent. An instant: epoch milliseconds, UTC.
- `exit_code` (integer or null): For a systemd unit, systemd’s `ExecMainStatus`: the exit status, or the signal number when `result` is `signal` or `core-dump`; for a Windows service, its last exit code as the agent sends it (Win32 or service-specific); null when not reported.
- `result` (string or null): systemd’s `Result` for a unit that is not active and has run: `success`, `exit-code`, `signal`, `core-dump`, `timeout`, `start-limit-hit`, `oom-kill` and others; null when not reported, and always null for a Windows service.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/system-services**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/system-services \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->systemServices('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.systemServices('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.system_services('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "unit_name": "example",
      "description": "example",
      "load_state": "example",
      "active_state": "example",
      "sub_state": "example",
      "unit_file_state": "example",
      "monitored": true,
      "activation": "example",
      "healthy": true,
      "alarms_armed": true,
      "restarts": 1,
      "memory_bytes": 1,
      "cpu_percent": 0,
      "alarm_state": "example",
      "alarms": [
        {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "rule_slug": "example",
          "name": "example",
          "state": "example",
          "state_since": 1794214800000,
          "acknowledged": true,
          "incident_uuid": "ad1ce9ff-c6d0-475c-8f5f-afef44885f4b"
        }
      ],
      "state_changed_at": 1794214800000,
      "first_seen_at": 1794214800000,
      "missing_since": 1794214800000,
      "absence_accepted_at": 1794214800000,
      "active_entered_at": 1794214800000,
      "exit_code": 1,
      "result": "example"
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1,
  "meta": {
    "service_manager": "example",
    "reported_at": 1794214800000
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Set a server's indicator policy

PUT/v1/servers/{server\_uuid}/indicator-policies/{indicator}

Disables or reconfigures one rule on this server: its state, a severity override and known execution folders, with a reason and a review date. Needs the `security.policy` scope. A body that equals the defaults is refused with 422: clear the policy instead. Writing it again with the same values is idempotent.

Needs the scope `security.policy`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `indicator` (string, required): The rule: `exe_world_writable` or `tmp_executable`. Values:`exe_world_writable``tmp_executable`(an open set: new values may be added)

### Body parameters

- `state` (string or null): `on` or `off`: whether the rule is checked. Null inherits the profile’s. Values:`on``off`(an open set: new values may be added)
- `severity` (string or null): The severity every object of the rule takes, `critical`, `warning` or `info`; null leaves the rule’s own. Never below `warning` in `/dev/shm`. Values:`critical``warning``info`(an open set: new values may be added)
- `known_folders` (array of strings or null): Known execution folders, each an absolute path under `/tmp` or `/var/tmp` (not the bare roots, never under `/dev/shm`), at most 32, each at most 1,024 characters. An executable in one, while its folder is private to its owner, is recorded as Info.
- `reason` (string, required): Why the policy is in force, 1 to 500 characters.
- `review_on` (string (date), required): The day the policy is looked at again, `YYYY-MM-DD`, after today and within 12 months (UTC).

### Returns

`200 OK`:

The policy after the call.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**PUT /v1/servers/{server_uuid}/indicator-policies/{indicator}**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/indicator-policies/exe_world_writable \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "reason": "example",
    "review_on": "2026-11-09"
  }'
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->updateIndicatorPolicy('e0f5add1-ce75-48d4-bb62-1712db369290', 'exe_world_writable', ['reason' => 'example', 'review_on' => '2026-11-09']);
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.updateIndicatorPolicy('e0f5add1-ce75-48d4-bb62-1712db369290', 'exe_world_writable', { reason: 'example', review_on: '2026-11-09' });
```

Python:

```python
client = Client.from_environment()

result = client.servers.update_indicator_policy('e0f5add1-ce75-48d4-bb62-1712db369290', 'exe_world_writable', reason='example', review_on='2026-11-09')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "indicator": "example",
    "scope": "example",
    "state": "example",
    "severity": "example",
    "known_folders": [
      "example"
    ],
    "reason": "example",
    "review_on": "example",
    "review_due": true,
    "updated_at": 1794214800000,
    "updated_by": {
      "type": "example",
      "name": "example"
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the security.policy scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Update a server's port

PUT/v1/servers/{server\_uuid}/ports/{port\_uuid}

Sets whether a port is expected to be open and whether an ephemeral port is tracked; send at least one of the two. Answers the port as `servers.ports` lists it. A port of another server is refused as not found.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `port_uuid` (string (uuid), required): The UUID of the port.

### Body parameters

- `expected` (boolean or null): Whether the port is expected to be open.
- `tracked` (boolean or null): Whether an ephemeral port is tracked.

### Returns

`200 OK`:

The port after the change.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**PUT /v1/servers/{server_uuid}/ports/{port_uuid}**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/ports/8b6329bb-5a52-4292-bc66-7c66c4482d81 \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->updatePort('e0f5add1-ce75-48d4-bb62-1712db369290', '8b6329bb-5a52-4292-bc66-7c66c4482d81');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.updatePort('e0f5add1-ce75-48d4-bb62-1712db369290', '8b6329bb-5a52-4292-bc66-7c66c4482d81');
```

Python:

```python
client = Client.from_environment()

result = client.servers.update_port('e0f5add1-ce75-48d4-bb62-1712db369290', '8b6329bb-5a52-4292-bc66-7c66c4482d81')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "port": 1,
    "protocol": "example",
    "bind_scope": "example",
    "addresses": [
      "example"
    ],
    "process_name": "example",
    "is_open": true,
    "state": "example",
    "opened_at": 1794214800000,
    "closed_at": 1794214800000,
    "first_seen_at": 1794214800000,
    "tracked": true,
    "expected": true,
    "charted": true,
    "health_status": "example",
    "retired_at": 1794214800000
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Update a server's volume

PUT/v1/servers/{server\_uuid}/volumes/{volume\_uuid}

Switches monitoring of a volume on or off, or hands it back to the agent’s own classification with `reset_override`; send one of the two. Answers the volume as `servers.volumes` lists it.

Needs the scope `servers.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.
- `volume_uuid` (string (uuid), required): The UUID of the volume.

### Body parameters

- `monitored` (boolean or null): Whether the volume is monitored.
- `reset_override` (boolean or null): Instruction: hand the volume back to the agent’s own classification.

### Returns

`200 OK`:

The volume after the change.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**PUT /v1/servers/{server_uuid}/volumes/{volume_uuid}**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/volumes/3e780a9c-afb8-4dc3-bb21-51c3d3d5dd2b \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->servers->updateVolume('e0f5add1-ce75-48d4-bb62-1712db369290', '3e780a9c-afb8-4dc3-bb21-51c3d3d5dd2b');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.servers.updateVolume('e0f5add1-ce75-48d4-bb62-1712db369290', '3e780a9c-afb8-4dc3-bb21-51c3d3d5dd2b');
```

Python:

```python
client = Client.from_environment()

result = client.servers.update_volume('e0f5add1-ce75-48d4-bb62-1712db369290', '3e780a9c-afb8-4dc3-bb21-51c3d3d5dd2b')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "mount_point": "example",
    "device": "example",
    "filesystem_type": "example",
    "total_gb": 0,
    "used_bytes": 1,
    "free_bytes": 1,
    "used_percent": 0,
    "inodes_used_percent": 0,
    "read_only": true,
    "classification": "example",
    "monitored": true,
    "health_status": "example",
    "open_incidents": {
      "critical": 1,
      "warning": 1,
      "acknowledged": 1
    },
    "first_seen_at": 1794214800000,
    "forecast": {
      "status": "example",
      "used_bytes": 1,
      "capacity_bytes": 1,
      "growth_bytes_per_day": 1,
      "growth_low": 1,
      "growth_high": 1,
      "projection_30d": 1,
      "projection_90d": 1,
      "projection_180d": 1,
      "projection_365d": 1,
      "days_to_warning": 1,
      "days_to_critical": 1,
      "days_to_full": 1,
      "warning_percent": 0,
      "critical_percent": 0,
      "history_days": 1,
      "fit_window_days": 1,
      "segment_started_on": "example",
      "computed_at": 1794214800000
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a server's volumes

GET/v1/servers/{server\_uuid}/volumes

Lists the server’s current volumes, by mount point, with their usage. Usage figures are null when the metric store has none. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `servers.view`.

### Path parameters

- `server_uuid` (string (uuid), required): The UUID of the server.

### Query parameters

- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the server’s volumes.

Each item of the page:

- `uuid` (string): The UUID of the volume.
- `mount_point` (string): The mount point of the volume.
- `device` (string or null): The block device; null when the agent does not report it.
- `filesystem_type` (string or null): The filesystem type; null when the agent does not report it.
- `total_gb` (number or null): The volume’s size in gigabytes, as the agent reports it.
- `used_bytes` (integer or null): Bytes in use; null when no usage is available.
- `free_bytes` (integer or null): Bytes free; null when no usage is available.
- `used_percent` (number or null): Space in use as a percentage; null when no usage is available.
- `inodes_used_percent` (number or null): Inodes in use as a percentage; null for a filesystem that keeps no inode count or when no usage is available. On XFS and other filesystems that allocate inodes as they need them, the total grows and shrinks with free space, so this percentage can move while `inodes_used` stays flat: read the count.
- `inodes_used` (integer or null): Inodes in use, a count; null for a filesystem that keeps no inode count or when no usage is available.
- `inodes_free` (integer or null): Inodes free, a count; null for a filesystem that keeps no inode count or when no usage is available.
- `read_only` (boolean or null): Null when the agent does not report it.
- `classification` (string): `pending`, `monitored`, or an `excluded_*` reason.
- `monitored` (boolean): Whether the volume is monitored.
- `health_status` (string): One of `unknown`, `healthy`, `warning`, `critical`.
- `open_incidents` (object): Open and acknowledged incidents by severity; `acknowledged` is the subset of those.
  - `critical` (integer): Open incidents at critical severity.
  - `warning` (integer): Open incidents at warning severity.
  - `acknowledged` (integer): Of the open incidents, the acknowledged.
- `first_seen_at` (integer or null): Epoch milliseconds. When the agent first reported the volume. An instant: epoch milliseconds, UTC.
- `forecast` (object or null): The volume’s growth forecast, fitted on its daily peaks of used space with the method of the database growth forecast. Null for a volume that is not monitored, on a server that is archived or inactive, and before the first calculation.
  - `status` (string): One of `ok`, `insufficient_history` (fewer than 7 days of history in the fit) and `not_growing`.
  - `used_bytes` (integer or null): The bytes used today by the fit’s value, not the raw latest reading; null when the volume has no history yet.
  - `capacity_bytes` (integer or null): The volume’s capacity in bytes, used plus free, as the alarm and `used_percent` read it (reserved blocks are not in it); null when no capacity was read, and then every `days_to_*` is null.
  - `growth_bytes_per_day` (integer or null): The growth in bytes a day; null without a fit, and zero or negative when the volume is not growing.
  - `growth_low` (integer or null): The low end of the growth band in bytes a day (the 10th percentile of the pairwise slopes); null without a fit.
  - `growth_high` (integer or null): The high end of the growth band in bytes a day (the 90th percentile of the pairwise slopes); null without a fit.
  - `projection_30d` (integer or null): The fitted bytes used 30 days from now, never below 0; null without a fit.
  - `projection_90d` (integer or null): The fitted bytes used 90 days from now, never below 0; null without a fit.
  - `projection_180d` (integer or null): The fitted bytes used 180 days from now, never below 0; null without a fit.
  - `projection_365d` (integer or null): The fitted bytes used 365 days from now, never below 0; null without a fit.
  - `days_to_warning` (integer or null): Whole days until the volume reaches its warning threshold; 0 when it is already at or past it; null without a fit, a capacity or a growth above 0; at most 3650.
  - `days_to_critical` (integer or null): Whole days until the volume reaches its critical threshold; 0 when it is already at or past it; null without a fit, a capacity or a growth above 0; at most 3650.
  - `days_to_full` (integer or null): Whole days until the volume is full (used reaches its capacity); 0 when it already is; null without a fit, a capacity or a growth above 0; at most 3650, which means more than 10 years.
  - `warning_percent` (number or null): The warning threshold in percent of the capacity that `days_to_warning` was measured with; null when the volume has none.
  - `critical_percent` (number or null): The critical threshold in percent of the capacity that `days_to_critical` was measured with; null when the volume has none.
  - `history_days` (integer): The days of history the fit read, at most 90.
  - `fit_window_days` (integer): The days of the fit’s window: the history after the last clean-up, or the last 30 days when the growth changed.
  - `segment_started_on` (string or null): The day after the last clean-up the fit starts from, as `YYYY-MM-DD` in UTC; null when none was found or without a fit.
  - `computed_at` (integer): Epoch milliseconds. When the forecast was calculated. An instant: epoch milliseconds, UTC.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/servers/{server_uuid}/volumes**

curl:

```bash
curl https://rest.watchtower15.com/v1/servers/e0f5add1-ce75-48d4-bb62-1712db369290/volumes \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->servers->volumes('e0f5add1-ce75-48d4-bb62-1712db369290')->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.servers.volumes('e0f5add1-ce75-48d4-bb62-1712db369290')) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.servers.volumes('e0f5add1-ce75-48d4-bb62-1712db369290'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "mount_point": "example",
      "device": "example",
      "filesystem_type": "example",
      "total_gb": 0,
      "used_bytes": 1,
      "free_bytes": 1,
      "used_percent": 0,
      "inodes_used_percent": 0,
      "inodes_used": 1,
      "inodes_free": 1,
      "read_only": true,
      "classification": "example",
      "monitored": true,
      "health_status": "example",
      "open_incidents": {
        "critical": 1,
        "warning": 1,
        "acknowledged": 1
      },
      "first_seen_at": 1794214800000,
      "forecast": {
        "status": "example",
        "used_bytes": 1,
        "capacity_bytes": 1,
        "growth_bytes_per_day": 1,
        "growth_low": 1,
        "growth_high": 1,
        "projection_30d": 1,
        "projection_90d": 1,
        "projection_180d": 1,
        "projection_365d": 1,
        "days_to_warning": 1,
        "days_to_critical": 1,
        "days_to_full": 1,
        "warning_percent": 0,
        "critical_percent": 0,
        "history_days": 1,
        "fit_window_days": 1,
        "segment_started_on": "example",
        "computed_at": 1794214800000
      }
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the servers.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

Source: https://developer.watchtower15.com/api/reference/servers/
