# Server profiles

Reusable server profiles: the checks and thresholds a group of servers share.

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

**Endpoints**

- `POST/v1/server-profiles`
- `PUT/v1/server-profiles/{server_profile_uuid}`
- `GET/v1/server-profiles/{server_profile_uuid}`
- `GET/v1/server-profiles`
- `DELETE/v1/server-profiles/{server_profile_uuid}`
- `GET/v1/server-profiles/{server_profile_uuid}/alarm-templates`
- `DELETE/v1/server-profiles/{server_profile_uuid}/indicator-policies/{indicator}`
- `POST/v1/server-profiles/{server_profile_uuid}/alarm-templates`
- `DELETE/v1/server-profiles/{server_profile_uuid}/alarm-templates/{template_uuid}`
- `POST/v1/server-profiles/{server_profile_uuid}/duplicate`
- `DELETE/v1/server-profiles/{server_profile_uuid}/alarm-snooze`
- `GET/v1/server-profiles/{server_profile_uuid}/indicator-policies`
- `POST/v1/server-profiles/{server_profile_uuid}/alarm-templates/preview-propagation`
- `POST/v1/server-profiles/{server_profile_uuid}/alarm-templates/propagate`
- `PUT/v1/server-profiles/{server_profile_uuid}/alarm-snooze`
- `PUT/v1/server-profiles/{server_profile_uuid}/alarm-templates/{template_uuid}`
- `PUT/v1/server-profiles/{server_profile_uuid}/indicator-policies/{indicator}`

## The Server profile object

### Attributes

- `uuid` (string): The profile’s uuid.
- `name` (string): The profile’s name.
- `slug` (string): Fixed at creation: the value of an install command’s `--profile=`.
- `description` (string or null): The profile’s description; null when it has none.
- `profile_type` (string): The profile’s type: `default` for the organisation’s default profile, otherwise `custom`.
- `os` (string): The profile’s operating system, fixed at creation: one of `linux`, `windows`.
- `logging_disabled` (boolean): Whether the agent collects no logs.
- `telemetry_disabled` (boolean): Whether the agent collects no telemetry.
- `telemetry_capture_all` (boolean): Whether every telemetry option is collected.
- `servers_count` (integer): How many servers use the profile.
- `telemetry_options` (array of strings): The telemetry options collected when `telemetry_capture_all` is false: any of `cpu`, `memory`, `swap`, `disk`, `disk_io`, `network`, `load`, `processes` and `systemd`.
- `log_files` (array of objects): The log files the agent collects.
  - `uuid` (string): The log file entry’s uuid.
  - `source_type` (string): What is collected: `file` for a log file, `journald` for the systemd journal, `windows_event_log` for a Windows Event Log channel.
  - `path` (string or null): The path of the log file, which may be a pattern; null for `journald`.
  - `format` (string or null): How the backend parses the file’s lines at ingest into status, method, path and duration: `nginx_combined`, `wt15_timed` or `wt15_relay`; null when it is not parsed.
  - `channel` (string or null): For a `windows_event_log` entry, the Event Log channel; null for the other types.
  - `min_level` (string or null): For a `windows_event_log` entry, the least severe level collected: `critical`, `error`, `warning` or `information`; null for the other types.
  - `event_ids` (array of integers): For a `windows_event_log` entry, the event ids collected, empty for every event at or above `min_level`; empty for the other types.
- `log_folders` (array of objects): The log folders the agent collects.
  - `uuid` (string): The log folder entry’s uuid.
  - `path` (string): The absolute path of the folder, read literally.
  - `match_mode` (string or null): Which files in the folder are collected: `all` for every file, `regex` for those matching `pattern`; null when not set.
  - `pattern` (string or null): The regular expression for `regex` mode; null otherwise.
  - `extensions` (array of strings): The file extensions that apply to the folder’s files; may be empty.
- `tags` (array of objects): The tags the profile gives its servers.
  - `uuid` (string): The tag’s uuid.
  - `name` (string): The tag’s name.
- `alarm_snooze` (object or null): The profile’s own alarm snooze, which holds the alarm notifications of every server using the profile; null when none is live. See `PUT /v1/server-profiles/{server_profile_uuid}/alarm-snooze`.
  - `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.
- `server_led_tagging` (boolean): Whether servers of this profile take tags from the profile’s own tag groups.
- `server_led_tag_filter_mode` (string or null): One of `include`, `exclude`; null when server-led tagging is off.
- `server_led_tag_groups` (array of objects): The tag groups of the filter.
  - `uuid` (string): The tag group’s uuid.
  - `name` (string): The tag group’s name.

**The Server profile object**

```json
{
  "uuid": "75666699-b77d-4631-b576-041e8102a55b",
  "name": "example",
  "slug": "example",
  "description": "example",
  "profile_type": "example",
  "os": "example",
  "logging_disabled": true,
  "telemetry_disabled": true,
  "telemetry_capture_all": true,
  "servers_count": 1,
  "telemetry_options": [
    "example"
  ],
  "log_files": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "source_type": "example",
      "path": "example",
      "format": "example",
      "channel": "example",
      "min_level": "example",
      "event_ids": [
        1
      ]
    }
  ],
  "log_folders": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "path": "example",
      "match_mode": "example",
      "pattern": "example",
      "extensions": [
        "example"
      ]
    }
  ],
  "tags": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    }
  ],
  "alarm_snooze": {
    "until": 1794214800000,
    "reason": "example",
    "set_at": 1794214800000
  },
  "server_led_tagging": true,
  "server_led_tag_filter_mode": "example",
  "server_led_tag_groups": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example"
    }
  ]
}
```

## Create a server profile

POST/v1/server-profiles

Creates a custom server profile, for Linux servers or, with `os` `windows`, for Windows servers. The name must be unique in the organisation. The managed intervals and spool settings cannot be set, and a request that names one is refused. Unsent fields take the console’s defaults.

Needs the scope `server_profiles.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`.

### Body parameters

- `name` (string, required): The profile’s name, unique in the organisation.
- `description` (string or null): A description of the profile, at most 1000 characters.
- `logging_disabled` (boolean or null): Whether the agent collects no logs.
- `telemetry_disabled` (boolean or null): Whether the agent collects no telemetry.
- `telemetry_capture_all` (boolean or null): Whether every telemetry option is collected.
- `interval_telemetry` (string): Managed by WatchTower15: refused, never ignored.
- `interval_sysinfo` (string): Managed by WatchTower15: refused, never ignored.
- `limit_process_series` (string): Managed by WatchTower15: refused, never ignored.
- `spool_horizon_hours` (string): Managed by WatchTower15: refused, never ignored.
- `spool_metrics_cap_mb` (string): Managed by WatchTower15: refused, never ignored.
- `spool_logs_cap_mb` (string): Managed by WatchTower15: refused, never ignored.
- `spool_database_cap_mb` (string): Managed by WatchTower15: refused, never ignored.
- `spool_min_free_disk_percent` (string): Managed by WatchTower15: refused, never ignored.
- `spool_min_free_disk_mb` (string): Managed by WatchTower15: refused, never ignored.
- `telemetry_options` (array of strings or null): When `telemetry_capture_all` is false, at least one option. Values:`cpu``memory``swap``disk``disk_io``network``load``processes``systemd`(an open set: new values may be added)
- `log_files` (array of objects or null): The log files and journals the agent collects.
  - `source_type` (string): What to collect: `file` for a log file, `journald` for the systemd journal (a Linux profile only), `windows_event_log` for a Windows Event Log channel (a Windows profile only). Values:`file``journald``windows_event_log`(an open set: new values may be added)
  - `path` (string or null): The path of the log file, which may be a pattern; required when `source_type` is `file`.
  - `format` (string or null): How the backend reads an access log file’s lines at ingest: `nginx_combined`, `wt15_timed` (nginx’s combined format and the request time) or `wt15_relay` (a reverse proxy’s format with the upstream status); only for a `file` entry, null for none. A save that leaves it out keeps the entry’s current value; an explicit null clears it. Values:`nginx_combined``wt15_timed``wt15_relay`(an open set: new values may be added)
  - `channel` (string or null): For a `windows_event_log` entry, the channel: `System`, `Application`, `Microsoft-Windows-PowerShell/Operational`; 1 to 255 characters, unique in the profile ignoring case. Required for that type and refused on the others.
  - `min_level` (string or null): For a `windows_event_log` entry, the least severe level collected: `critical`, `error`, `warning` or `information`. Required for that type and refused on the others. Values:`critical``error``warning``information`(an open set: new values may be added)
  - `event_ids` (array of integers or null): For a `windows_event_log` entry, the event ids collected: up to 50 unique ids from 0 to 65535; left out or empty, every event at or above `min_level`. Refused on the other types.
- `os` (string or null): The profile’s operating system, `linux` or `windows`, fixed at creation; left out, `linux`. Values:`linux``windows`(an open set: new values may be added)
- `log_folders` (array of objects or null): The log folders the agent collects.
  - `path` (string): The absolute path of the folder, read literally: it may not contain `*`, `?` or `[`.
  - `match_mode` (string or null): Which files in the folder are collected: `all` for every file, `regex` for those matching `pattern`. Values:`all``regex`(an open set: new values may be added)
  - `pattern` (string or null): The regular expression for `regex` mode; required when `match_mode` is `regex`.
  - `extensions` (array of strings or null): The file extensions that apply to the folder’s files.
- `tag_uuids` (array of strings or null): The uuids of the tags the profile gives its servers.
- `server_led_tagging` (boolean or null): Whether servers of this profile take tags from the profile’s own tag groups.
- `server_led_tag_filter_mode` (string or null): Whether the tag groups in `server_led_tag_group_uuids` are included or excluded: `include` or `exclude`; required when `server_led_tagging` is true. Values:`include``exclude`(an open set: new values may be added)
- `server_led_tag_group_uuids` (array of strings or null): The uuids of the tag groups the profile’s tagging draws from.

### Returns

`201 Created`:

The new server profile.

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/server-profiles**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/server-profiles \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "name": "example"
  }'
```

PHP:

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

$serverProfile = $wt15->serverProfiles->create(['name' => 'example']);
```

Node.js:

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

const result = await wt15.serverProfiles.create({ name: 'example' });
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.create(name='example')
```

**Response (201 Created)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "slug": "example",
    "description": "example",
    "profile_type": "example",
    "os": "example",
    "logging_disabled": true,
    "telemetry_disabled": true,
    "telemetry_capture_all": true,
    "servers_count": 1,
    "telemetry_options": [
      "example"
    ],
    "log_files": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "source_type": "example",
        "path": "example",
        "format": "example",
        "channel": "example",
        "min_level": "example",
        "event_ids": [
          1
        ]
      }
    ],
    "log_folders": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "path": "example",
        "match_mode": "example",
        "pattern": "example",
        "extensions": [
          "example"
        ]
      }
    ],
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example"
      }
    ],
    "alarm_snooze": {
      "until": 1794214800000,
      "reason": "example",
      "set_at": 1794214800000
    },
    "server_led_tagging": true,
    "server_led_tag_filter_mode": "example",
    "server_led_tag_groups": [
      {
        "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 server_profiles.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 profile

PUT/v1/server-profiles/{server\_profile\_uuid}

Updates a server profile; only the fields sent change. `profile_type: default` promotes this profile to be the default, and a default profile is never demoted directly. `sync_tags` applies the profile’s tags to its servers now, as `sync_tags_mode` says. The managed intervals and spool settings cannot be set.

Needs the scope `server_profiles.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_profile_uuid` (string (uuid), required): The uuid of the server profile.

### Body parameters

- `name` (string, required): The profile’s name, unique in the organisation.
- `profile_type` (string or null): `default` promotes this profile; a default profile is never demoted directly, promote another instead. Values:`default``custom`(an open set: new values may be added)
- `description` (string or null): A description of the profile, at most 1000 characters.
- `logging_disabled` (boolean or null): Whether the agent collects no logs.
- `telemetry_disabled` (boolean or null): Whether the agent collects no telemetry.
- `telemetry_capture_all` (boolean or null): Whether every telemetry option is collected.
- `interval_telemetry` (string): Managed by WatchTower15: refused, never ignored.
- `interval_sysinfo` (string): Managed by WatchTower15: refused, never ignored.
- `limit_process_series` (string): Managed by WatchTower15: refused, never ignored.
- `spool_horizon_hours` (string): Managed by WatchTower15: refused, never ignored.
- `spool_metrics_cap_mb` (string): Managed by WatchTower15: refused, never ignored.
- `spool_logs_cap_mb` (string): Managed by WatchTower15: refused, never ignored.
- `spool_database_cap_mb` (string): Managed by WatchTower15: refused, never ignored.
- `spool_min_free_disk_percent` (string): Managed by WatchTower15: refused, never ignored.
- `spool_min_free_disk_mb` (string): Managed by WatchTower15: refused, never ignored.
- `telemetry_options` (array of strings or null): When `telemetry_capture_all` is false, at least one option. Values:`cpu``memory``swap``disk``disk_io``network``load``processes``systemd`(an open set: new values may be added)
- `log_files` (array of objects or null): The log files and journals the agent collects.
  - `source_type` (string): What to collect: `file` for a log file, `journald` for the systemd journal (a Linux profile only), `windows_event_log` for a Windows Event Log channel (a Windows profile only). Values:`file``journald``windows_event_log`(an open set: new values may be added)
  - `path` (string or null): The path of the log file, which may be a pattern; required when `source_type` is `file`.
  - `format` (string or null): How the backend reads an access log file’s lines at ingest: `nginx_combined`, `wt15_timed` (nginx’s combined format and the request time) or `wt15_relay` (a reverse proxy’s format with the upstream status); only for a `file` entry, null for none. A save that leaves it out keeps the entry’s current value; an explicit null clears it. Values:`nginx_combined``wt15_timed``wt15_relay`(an open set: new values may be added)
  - `channel` (string or null): For a `windows_event_log` entry, the channel: `System`, `Application`, `Microsoft-Windows-PowerShell/Operational`; 1 to 255 characters, unique in the profile ignoring case. Required for that type and refused on the others.
  - `min_level` (string or null): For a `windows_event_log` entry, the least severe level collected: `critical`, `error`, `warning` or `information`. Required for that type and refused on the others. Values:`critical``error``warning``information`(an open set: new values may be added)
  - `event_ids` (array of integers or null): For a `windows_event_log` entry, the event ids collected: up to 50 unique ids from 0 to 65535; left out or empty, every event at or above `min_level`. Refused on the other types.
- `os` (string): Refused: a profile’s operating system is set when it is created.
- `log_folders` (array of objects or null): The log folders the agent collects.
  - `path` (string): The absolute path of the folder, read literally: it may not contain `*`, `?` or `[`.
  - `match_mode` (string or null): Which files in the folder are collected: `all` for every file, `regex` for those matching `pattern`. Values:`all``regex`(an open set: new values may be added)
  - `pattern` (string or null): The regular expression for `regex` mode; required when `match_mode` is `regex`.
  - `extensions` (array of strings or null): The file extensions that apply to the folder’s files.
- `tag_uuids` (array of strings or null): The uuids of the tags the profile gives its servers.
- `server_led_tagging` (boolean or null): Whether servers of this profile take tags from the profile’s own tag groups.
- `server_led_tag_filter_mode` (string or null): Whether the tag groups in `server_led_tag_group_uuids` are included or excluded: `include` or `exclude`; required when `server_led_tagging` is true. Values:`include``exclude`(an open set: new values may be added)
- `server_led_tag_group_uuids` (array of strings or null): The uuids of the tag groups the profile’s tagging draws from.
- `sync_tags` (boolean or null): Instruction: apply the profile’s tags to its servers now.
- `sync_tags_mode` (string or null): `additive` keeps a server’s other tags; `exclusive` replaces them. Values:`additive``exclusive`(an open set: new values may be added)

### Returns

`200 OK`:

The server profile 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/server-profiles/{server_profile_uuid}**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2 \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "name": "example"
  }'
```

PHP:

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

$serverProfile = $wt15->serverProfiles->update('148211c4-6c60-4f6a-82ab-fe575324ffb2', ['name' => 'example']);
```

Node.js:

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

const result = await wt15.serverProfiles.update('148211c4-6c60-4f6a-82ab-fe575324ffb2', { name: 'example' });
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.update('148211c4-6c60-4f6a-82ab-fe575324ffb2', name='example')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "slug": "example",
    "description": "example",
    "profile_type": "example",
    "os": "example",
    "logging_disabled": true,
    "telemetry_disabled": true,
    "telemetry_capture_all": true,
    "servers_count": 1,
    "telemetry_options": [
      "example"
    ],
    "log_files": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "source_type": "example",
        "path": "example",
        "format": "example",
        "channel": "example",
        "min_level": "example",
        "event_ids": [
          1
        ]
      }
    ],
    "log_folders": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "path": "example",
        "match_mode": "example",
        "pattern": "example",
        "extensions": [
          "example"
        ]
      }
    ],
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example"
      }
    ],
    "alarm_snooze": {
      "until": 1794214800000,
      "reason": "example",
      "set_at": 1794214800000
    },
    "server_led_tagging": true,
    "server_led_tag_filter_mode": "example",
    "server_led_tag_groups": [
      {
        "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 server_profiles.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 profile

GET/v1/server-profiles/{server\_profile\_uuid}

Returns one server profile with its telemetry options, log files, log folders, tags and tag filter. The managed intervals and spool settings are not part of the public profile, and neither are its alarm templates: read and change those with `/v1/server-profiles/{server_profile_uuid}/alarm-templates`.

Needs the scope `server_profiles.view`.

### Path parameters

- `server_profile_uuid` (string (uuid), required): The uuid of the server profile.

### Returns

`200 OK`:

The server profile.

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/server-profiles/{server_profile_uuid}**

curl:

```bash
curl https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2 \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

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

$serverProfile = $wt15->serverProfiles->view('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Node.js:

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

const result = await wt15.serverProfiles.view('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.view('148211c4-6c60-4f6a-82ab-fe575324ffb2')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "slug": "example",
    "description": "example",
    "profile_type": "example",
    "os": "example",
    "logging_disabled": true,
    "telemetry_disabled": true,
    "telemetry_capture_all": true,
    "servers_count": 1,
    "telemetry_options": [
      "example"
    ],
    "log_files": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "source_type": "example",
        "path": "example",
        "format": "example",
        "channel": "example",
        "min_level": "example",
        "event_ids": [
          1
        ]
      }
    ],
    "log_folders": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "path": "example",
        "match_mode": "example",
        "pattern": "example",
        "extensions": [
          "example"
        ]
      }
    ],
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example"
      }
    ],
    "alarm_snooze": {
      "until": 1794214800000,
      "reason": "example",
      "set_at": 1794214800000
    },
    "server_led_tagging": true,
    "server_led_tag_filter_mode": "example",
    "server_led_tag_groups": [
      {
        "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 server_profiles.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 server profiles

GET/v1/server-profiles

Lists the organisation’s server profiles, the default profiles first (Linux, then Windows); `os` keeps one operating system’s. Each row carries the profile’s settings and counts; read a profile for its log files, log folders and tag filter. 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 `server_profiles.view`.

### 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)
- `os` (string or null): Only the profiles of one operating system: `linux` or `windows`. Values:`linux``windows`(an open set: new values may be added)
- `per_page` (integer or null): How many profiles to return in one page, from 1 to 100.
- `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 server profiles.

Each item of the page:

- `uuid` (string): The profile’s uuid.
- `name` (string): The profile’s name.
- `slug` (string): Fixed at creation: the value of an install command’s `--profile=`.
- `description` (string or null): The profile’s description; null when it has none.
- `profile_type` (string): The profile’s type: `default` for the organisation’s default profile, otherwise `custom`.
- `os` (string): The profile’s operating system, fixed at creation: one of `linux`, `windows`.
- `logging_disabled` (boolean): Whether the agent collects no logs.
- `telemetry_disabled` (boolean): Whether the agent collects no telemetry.
- `telemetry_capture_all` (boolean): Whether every telemetry option is collected.
- `telemetry_options_count` (integer): How many telemetry options are selected.
- `servers_count` (integer): How many servers use the profile.
- `alarm_snooze` (object or null): The profile’s own alarm snooze, which holds the alarm notifications of its servers; null when none is live.
  - `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 profile gives its servers.
  - `uuid` (string): The tag’s uuid.
  - `name` (string): The tag’s name.

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/server-profiles**

curl:

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

PHP:

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

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

Node.js:

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

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

Python:

```python
client = Client.from_environment()

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

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example",
      "slug": "example",
      "description": "example",
      "profile_type": "example",
      "os": "example",
      "logging_disabled": true,
      "telemetry_disabled": true,
      "telemetry_capture_all": true,
      "telemetry_options_count": 1,
      "servers_count": 1,
      "alarm_snooze": {
        "until": 1794214800000,
        "reason": "example",
        "set_at": 1794214800000
      },
      "tags": [
        {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "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 server_profiles.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 profile

DELETE/v1/server-profiles/{server\_profile\_uuid}

Deletes a server profile. The default profile and a profile that servers use cannot be deleted and are refused with 422.

Needs the scope `server_profiles.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_profile_uuid` (string (uuid), required): The uuid of the server profile.

### Returns

`204 No Content`:

The server profile was deleted; 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/server-profiles/{server_profile_uuid}**

curl:

```bash
curl -X DELETE https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2 \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

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

$wt15->serverProfiles->delete('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Node.js:

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

await wt15.serverProfiles.delete('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Python:

```python
client = Client.from_environment()

client.server_profiles.delete('148211c4-6c60-4f6a-82ab-fe575324ffb2')
```

**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 server_profiles.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 profile's alarm templates

GET/v1/server-profiles/{server\_profile\_uuid}/alarm-templates

Lists the alarm templates of a server profile: the alarms every server on the profile gets, with each template’s thresholds, the policies it notifies, how many servers’ alarms still follow it and how many were edited by hand. A template whose rule has been retired is not listed. 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 `server_profiles.view`.

### Path parameters

- `server_profile_uuid` (string (uuid), required): The UUID of the server profile in the path.

### 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 profile’s alarm templates.

Each item of the page:

- `uuid` (string): The template’s uuid.
- `name` (string): The template’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`.
- `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 template’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 template sets none.
- `warning_threshold` (number or null): The template’s own value, else the rule’s default.
- `critical_threshold` (number or null): The template’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 template has none.
- `critical_window_minutes` (integer or null): The window, in minutes, the critical threshold is judged over; null when the template has none.
- `warning_consecutive_failures_count` (integer): Consecutive evaluations before a warning: the template’s own count, else the rule’s default.
- `critical_consecutive_failures_count` (integer): Consecutive evaluations before a critical: the template’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 template’s alarms are switched on.
- `notify_on_acknowledge` (boolean): Whether acknowledging an incident of the template’s alarms notifies: the template’s own flag, else the catalogue’s.
- `notify_on_resolve` (boolean): Whether resolving an incident of the template’s alarms notifies: the template’s own flag, else the catalogue’s.
- `alarm_policies` (array of objects): The policies the template’s alarms notify. 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`.
- `inherited_count` (integer): How many servers’ alarms still follow this template: a propagation with `apply_to_all` changes them.
- `overridden_count` (integer): How many servers’ alarms were edited by hand and no longer follow this template: a propagation leaves them alone.

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/server-profiles/{server_profile_uuid}/alarm-templates**

curl:

```bash
curl https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/alarm-templates \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

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

foreach ($wt15->serverProfiles->alarmTemplates('148211c4-6c60-4f6a-82ab-fe575324ffb2')->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

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

for await (const item of wt15.serverProfiles.alarmTemplates('148211c4-6c60-4f6a-82ab-fe575324ffb2')) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.server_profiles.alarm_templates('148211c4-6c60-4f6a-82ab-fe575324ffb2'):
    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,
      "alarm_policies": [
        {
          "uuid": "75666699-b77d-4631-b576-041e8102a55b",
          "name": "example"
        }
      ],
      "inherited_count": 1,
      "overridden_count": 1
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1,
  "meta": {
    "profile": {
      "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 server_profiles.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"
}
```

## Clear a server profile's indicator policy

DELETE/v1/server-profiles/{server\_profile\_uuid}/indicator-policies/{indicator}

Removes the policy of one rule on this server profile, so the rule reads its defaults. 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_profile_uuid` (string (uuid), required): The UUID of the server profile.
- `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/server-profiles/{server_profile_uuid}/indicator-policies/{indicator}**

curl:

```bash
curl -X DELETE https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/indicator-policies/exe_world_writable \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

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

$wt15->serverProfiles->clearIndicatorPolicy('148211c4-6c60-4f6a-82ab-fe575324ffb2', 'exe_world_writable');
```

Node.js:

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

await wt15.serverProfiles.clearIndicatorPolicy('148211c4-6c60-4f6a-82ab-fe575324ffb2', 'exe_world_writable');
```

Python:

```python
client = Client.from_environment()

client.server_profiles.clear_indicator_policy('148211c4-6c60-4f6a-82ab-fe575324ffb2', '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"
}
```

## Create an alarm template on a server profile

POST/v1/server-profiles/{server\_profile\_uuid}/alarm-templates

Adds an alarm template to a server profile, from a server rule of the catalogue named by `rule_slug` (read `GET /v1/alarm-rules?entity_type=server`). Servers already on the profile are not changed by this call: the new template’s alarm is later added to each server of the profile that lacks it (add only, never changing an existing alarm), with no time you can rely on. To change or remove alarms on the profile’s servers now, edit or delete templates, then `preview-propagation` and `propagate`. `active` and `alarm_policy_uuids` cannot be null; an empty `alarm_policy_uuids` means no policies.

Needs the scope `server_profiles.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_profile_uuid` (string (uuid), required): The UUID of the server profile in the path.

### Body parameters

- `rule_slug` (string, required): The slug of the catalogue rule the template is based on, from `GET /v1/alarm-rules?entity_type=server`; required. A server profile holds server rules only, so a slug of another entity type is refused.
- `name` (string or null): The template’s own name, up to 255 characters. Left out, the template takes its rule’s name.
- `aggregation` (string or null): How the readings in a window are combined before the comparison: `sum`, `count`, `avg`, `min`, `max` or `last`. Left out, the rule’s default applies. Values:`sum``count``avg``min``max``last`(an open set: new values may be added)
- `comparison_operator` (string or null): How a reading is compared with the thresholds: `lt`, `lte`, `gt`, `gte` or `eq`. Left out, the rule’s default applies. Values:`lt``lte``gt``gte``eq`(an open set: new values may be added)
- `warning_threshold` (number or null): The warning threshold, a number; negatives and fractions are allowed. Left out, the rule’s default applies.
- `critical_threshold` (number or null): The critical threshold, a number; negatives and fractions are allowed. Left out, the rule’s default applies.
- `warning_window_minutes` (integer or null): The window, in minutes, the warning threshold is judged over, from 1 to 43200 (30 days). Left out, the rule’s default applies.
- `critical_window_minutes` (integer or null): The window, in minutes, the critical threshold is judged over, from 1 to 43200 (30 days). Left out, the rule’s default applies.
- `warning_consecutive_failures_count` (integer or null): Consecutive evaluations before a warning, from 1 to 100. Left out, the rule’s default applies.
- `critical_consecutive_failures_count` (integer or null): Consecutive evaluations before a critical, from 1 to 100. Left out, the rule’s default applies.
- `active` (boolean): Whether the template’s alarms start switched on; `true` when left out. `null` is refused.
- `notify_on_acknowledge` (boolean or null): Whether acknowledging an incident of the template’s alarms notifies. Left out, the catalogue rule’s flag applies.
- `notify_on_resolve` (boolean or null): Whether resolving an incident of the template’s alarms notifies. Left out, the catalogue rule’s flag applies.
- `alarm_policy_uuids` (array of strings): The alarm policies the template’s alarms notify; an empty list or none means no policies, and `null` is refused. Each uuid is a policy of this organisation.

### Returns

`201 Created`:

The created alarm template.

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/server-profiles/{server_profile_uuid}/alarm-templates**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/alarm-templates \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "rule_slug": "example"
  }'
```

PHP:

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

$result = $wt15->serverProfiles->createAlarmTemplate('148211c4-6c60-4f6a-82ab-fe575324ffb2', ['rule_slug' => 'example']);
```

Node.js:

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

const result = await wt15.serverProfiles.createAlarmTemplate('148211c4-6c60-4f6a-82ab-fe575324ffb2', { rule_slug: 'example' });
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.create_alarm_template('148211c4-6c60-4f6a-82ab-fe575324ffb2', rule_slug='example')
```

**Response (201 Created)**

```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,
    "alarm_policies": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example"
      }
    ],
    "inherited_count": 1,
    "overridden_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 server_profiles.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"
}
```

## Delete an alarm template of a server profile

DELETE/v1/server-profiles/{server\_profile\_uuid}/alarm-templates/{template\_uuid}

Deletes an alarm template. The alarms it created on the profile’s servers are not removed by this call: they stay, each now the server’s own alarm, until a `propagate` with `apply_to_all: true` removes the alarms whose template is gone. A template of another profile answers 404.

Needs the scope `server_profiles.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_profile_uuid` (string (uuid), required): The UUID of the server profile in the path.
- `template_uuid` (string (uuid), required): The UUID of the alarm template in the path; it must be a template of this profile.

### Returns

`204 No Content`:

Nothing: the answer is 204.

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/server-profiles/{server_profile_uuid}/alarm-templates/{template_uuid}**

curl:

```bash
curl -X DELETE https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/alarm-templates/46eee30f-ed07-43f5-b058-4aa79ef78727 \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

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

$wt15->serverProfiles->deleteAlarmTemplate('148211c4-6c60-4f6a-82ab-fe575324ffb2', '46eee30f-ed07-43f5-b058-4aa79ef78727');
```

Node.js:

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

await wt15.serverProfiles.deleteAlarmTemplate('148211c4-6c60-4f6a-82ab-fe575324ffb2', '46eee30f-ed07-43f5-b058-4aa79ef78727');
```

Python:

```python
client = Client.from_environment()

client.server_profiles.delete_alarm_template('148211c4-6c60-4f6a-82ab-fe575324ffb2', '46eee30f-ed07-43f5-b058-4aa79ef78727')
```

**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 server_profiles.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"
}
```

## Duplicate a server profile

POST/v1/server-profiles/{server\_profile\_uuid}/duplicate

Creates a copy of a server profile, with its alarm templates and their policy links, as the console’s duplicate does. The copy is a custom profile. A profile that has indicator policies is copied with them, and duplicating it needs the `security.policy` scope too; without it the call is refused with 403.

Needs the scope `server_profiles.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_profile_uuid` (string (uuid), required): The uuid of the server profile.

### Returns

`201 Created`:

The new copy of the server profile.

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/server-profiles/{server_profile_uuid}/duplicate**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/duplicate \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

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

$result = $wt15->serverProfiles->duplicate('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Node.js:

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

const result = await wt15.serverProfiles.duplicate('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.duplicate('148211c4-6c60-4f6a-82ab-fe575324ffb2')
```

**Response (201 Created)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example",
    "slug": "example",
    "description": "example",
    "profile_type": "example",
    "os": "example",
    "logging_disabled": true,
    "telemetry_disabled": true,
    "telemetry_capture_all": true,
    "servers_count": 1,
    "telemetry_options": [
      "example"
    ],
    "log_files": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "source_type": "example",
        "path": "example",
        "format": "example",
        "channel": "example",
        "min_level": "example",
        "event_ids": [
          1
        ]
      }
    ],
    "log_folders": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "path": "example",
        "match_mode": "example",
        "pattern": "example",
        "extensions": [
          "example"
        ]
      }
    ],
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example"
      }
    ],
    "alarm_snooze": {
      "until": 1794214800000,
      "reason": "example",
      "set_at": 1794214800000
    },
    "server_led_tagging": true,
    "server_led_tag_filter_mode": "example",
    "server_led_tag_groups": [
      {
        "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 server_profiles.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 profile's alarm snooze

DELETE/v1/server-profiles/{server\_profile\_uuid}/alarm-snooze

Ends the profile’s alarm snooze early, so held notifications of its servers are released by the next sweep (up to a minute), unless a server’s own snooze still holds them, as described for `PUT`. The call is safe to repeat: it answers 204 also when the profile had no live snooze, since the end state is what you asked for. 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_profile_uuid` (string (uuid), required): The UUID of the server profile.

### 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/server-profiles/{server_profile_uuid}/alarm-snooze**

curl:

```bash
curl -X DELETE https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/alarm-snooze \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

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

$wt15->serverProfiles->endAlarmSnooze('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Node.js:

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

await wt15.serverProfiles.endAlarmSnooze('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Python:

```python
client = Client.from_environment()

client.server_profiles.end_alarm_snooze('148211c4-6c60-4f6a-82ab-fe575324ffb2')
```

**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"
}
```

## Read a server profile's indicator policies

GET/v1/server-profiles/{server\_profile\_uuid}/indicator-policies

Reads the policy of the two temporary-execution rules (`exe_world_writable`, `tmp_executable`) of this server profile.

Needs the scope `security.view`.

### Path parameters

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

### 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/server-profiles/{server_profile_uuid}/indicator-policies**

curl:

```bash
curl https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/indicator-policies \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

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

$result = $wt15->serverProfiles->indicatorPolicies('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Node.js:

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

const result = await wt15.serverProfiles.indicatorPolicies('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.indicator_policies('148211c4-6c60-4f6a-82ab-fe575324ffb2')
```

**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"
}
```

## Preview propagating a profile's alarm templates

POST/v1/server-profiles/{server\_profile\_uuid}/alarm-templates/preview-propagation

A dry run of `propagate`: for each template, how many servers would get a new alarm, how many alarms would change and how many are kept because they were edited by hand or deleted on that server, and, for alarms whose template is gone, how many would be removed and how many open incidents that would resolve. It writes nothing. Read it before `propagate` with `apply_to_all: true`.

Needs the scope `server_profiles.view`.

### 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_profile_uuid` (string (uuid), required): The UUID of the server profile in the path.

### Returns

`200 OK`:

What a propagation would 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.

**POST /v1/server-profiles/{server_profile_uuid}/alarm-templates/preview-propagation**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/alarm-templates/preview-propagation \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

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

$result = $wt15->serverProfiles->previewAlarmTemplatePropagation('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Node.js:

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

const result = await wt15.serverProfiles.previewAlarmTemplatePropagation('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.preview_alarm_template_propagation('148211c4-6c60-4f6a-82ab-fe575324ffb2')
```

**Response (200 OK)**

```json
{
  "data": {
    "resource_count": 1,
    "template_count": 1,
    "changes": [
      {
        "operation": "example",
        "name": "example",
        "rule_slug": "example",
        "servers_added": 1,
        "servers_updated": 1,
        "servers_kept_overridden": 1,
        "servers_kept_detached": 1
      }
    ],
    "removals": [
      {
        "operation": "example",
        "name": "example",
        "rule_slug": "example",
        "servers_removed": 1,
        "servers_kept_overridden": 1,
        "open_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 server_profiles.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; `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"
}
```

## Propagate a profile's alarm templates to its servers

POST/v1/server-profiles/{server\_profile\_uuid}/alarm-templates/propagate

Applies the profile’s alarm templates to the servers on it. With `apply_to_all` false or left out, it only adds the alarms servers are missing and changes nothing else. With `apply_to_all: true` it also applies the templates’ values to the alarms that follow them and removes, on every server of the profile, the alarms whose template is gone, resolving their open incidents; alarms edited by hand and alarms deleted on a server are kept. Run `preview-propagation` first: removing an alarm stops monitoring what it watched, with no other symptom.

Needs the scope `server_profiles.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_profile_uuid` (string (uuid), required): The UUID of the server profile in the path.

### Body parameters

- `apply_to_all` (boolean or null): `false` (the default) only adds the alarms servers are missing and changes nothing else. `true` also applies the templates’ values to the alarms that follow them and removes, on every server of the profile, the alarms whose template is gone; alarms edited by hand and alarms deleted on a server are kept.

### Returns

`200 OK`:

How many alarms were added, updated, removed and kept.

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/server-profiles/{server_profile_uuid}/alarm-templates/propagate**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/alarm-templates/propagate \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

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

$result = $wt15->serverProfiles->propagateAlarmTemplates('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Node.js:

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

const result = await wt15.serverProfiles.propagateAlarmTemplates('148211c4-6c60-4f6a-82ab-fe575324ffb2');
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.propagate_alarm_templates('148211c4-6c60-4f6a-82ab-fe575324ffb2')
```

**Response (200 OK)**

```json
{
  "data": {
    "resource_count": 1,
    "apply_to_all": true,
    "added": 1,
    "updated": 1,
    "removed": 1,
    "kept_overridden": 1,
    "kept_detached": 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 server_profiles.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"
}
```

## Snooze a server profile's alarms

PUT/v1/server-profiles/{server\_profile\_uuid}/alarm-snooze

Holds the alarm notifications of every server of one server profile 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 every server that uses the profile at the moment a notification would be sent, read live: a server that joins the profile while it is snoozed is snoozed, and one that leaves it is not. For each server it covers the server’s own alarms and those of its volumes, ports and systemd units, including the `*_reporting_stopped` alarms. A 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 snoozed while either its own snooze or its profile’s is live, and stays quiet until the later of the two ends: ending the profile’s snooze leaves a server’s own 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 profile 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_profile_uuid` (string (uuid), required): The UUID of the server profile.

### 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 profile’s own snooze after the call: when it ends, its reason and when it was set.

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/server-profiles/{server_profile_uuid}/alarm-snooze**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/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->serverProfiles->setAlarmSnooze('148211c4-6c60-4f6a-82ab-fe575324ffb2', ['duration' => 1, 'unit' => 'minutes']);
```

Node.js:

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

const result = await wt15.serverProfiles.setAlarmSnooze('148211c4-6c60-4f6a-82ab-fe575324ffb2', { duration: 1, unit: 'minutes' });
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.set_alarm_snooze('148211c4-6c60-4f6a-82ab-fe575324ffb2', duration=1, unit='minutes')
```

**Response (200 OK)**

```json
{
  "data": {
    "until": 1794214800000,
    "reason": "example",
    "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"
}
```

## Update an alarm template of a server profile

PUT/v1/server-profiles/{server\_profile\_uuid}/alarm-templates/{template\_uuid}

Changes the fields sent; what is not sent keeps its value. A `null` returns a threshold, window, consecutive count, `aggregation` or `comparison_operator` to the catalogue rule’s default, `name` to the rule’s name and a notify flag to the catalogue’s; `active` and `alarm_policy_uuids` cannot be null, and `alarm_policy_uuids: []` clears the policies. This changes no server’s alarm by itself: run `preview-propagation` and then `propagate` with `apply_to_all: true` to apply the new values to the alarms that follow the template. A template of another profile answers 404.

Needs the scope `server_profiles.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_profile_uuid` (string (uuid), required): The UUID of the server profile in the path.
- `template_uuid` (string (uuid), required): The UUID of the alarm template in the path; it must be a template of this profile.

### Body parameters

- `name` (string or null): The template’s own name, up to 255 characters. Send `null` to return it to the catalogue rule’s name.
- `aggregation` (string or null): How the readings in a window are combined before the comparison: `sum`, `count`, `avg`, `min`, `max` or `last`. Send `null` to return it to the rule’s default. Values:`sum``count``avg``min``max``last`(an open set: new values may be added)
- `comparison_operator` (string or null): How a reading is compared with the thresholds: `lt`, `lte`, `gt`, `gte` or `eq`. Send `null` to return it to the rule’s default. Values:`lt``lte``gt``gte``eq`(an open set: new values may be added)
- `warning_threshold` (number or null): The warning threshold, a number; negatives and fractions are allowed. Send `null` to return it to the rule’s default.
- `critical_threshold` (number or null): The critical threshold, a number; negatives and fractions are allowed. Send `null` to return it to the rule’s default.
- `warning_window_minutes` (integer or null): The window, in minutes, the warning threshold is judged over, from 1 to 43200 (30 days). Send `null` to return it to the rule’s default.
- `critical_window_minutes` (integer or null): The window, in minutes, the critical threshold is judged over, from 1 to 43200 (30 days). Send `null` to return it to the rule’s default.
- `warning_consecutive_failures_count` (integer or null): Consecutive evaluations before a warning, from 1 to 100. Send `null` to return it to the rule’s default.
- `critical_consecutive_failures_count` (integer or null): Consecutive evaluations before a critical, from 1 to 100. Send `null` to return it to the rule’s default.
- `active` (boolean): Whether the template’s alarms are switched on. `null` is refused: a propagation with `apply_to_all` would switch that alarm off on every server of the profile that has not overridden it.
- `notify_on_acknowledge` (boolean or null): Whether acknowledging an incident of the template’s alarms notifies. Send `null` to return it to the catalogue rule’s flag.
- `notify_on_resolve` (boolean or null): Whether resolving an incident of the template’s alarms notifies. Send `null` to return it to the catalogue rule’s flag.
- `alarm_policy_uuids` (array of strings): The alarm policies the template’s alarms notify, a full replacement of the saved ones; `[]` detaches every policy and `null` is refused. Each uuid is a policy of this organisation.

### Returns

`200 OK`:

The alarm template 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/server-profiles/{server_profile_uuid}/alarm-templates/{template_uuid}**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/alarm-templates/46eee30f-ed07-43f5-b058-4aa79ef78727 \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

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

$result = $wt15->serverProfiles->updateAlarmTemplate('148211c4-6c60-4f6a-82ab-fe575324ffb2', '46eee30f-ed07-43f5-b058-4aa79ef78727');
```

Node.js:

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

const result = await wt15.serverProfiles.updateAlarmTemplate('148211c4-6c60-4f6a-82ab-fe575324ffb2', '46eee30f-ed07-43f5-b058-4aa79ef78727');
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.update_alarm_template('148211c4-6c60-4f6a-82ab-fe575324ffb2', '46eee30f-ed07-43f5-b058-4aa79ef78727')
```

**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,
    "alarm_policies": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example"
      }
    ],
    "inherited_count": 1,
    "overridden_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 server_profiles.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"
}
```

## Set a server profile's indicator policy

PUT/v1/server-profiles/{server\_profile\_uuid}/indicator-policies/{indicator}

Disables or reconfigures one rule on this server profile: 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_profile_uuid` (string (uuid), required): The UUID of the server profile.
- `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, required): `on` or `off`: whether the rule is checked. Required: `on` or `off`. 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/server-profiles/{server_profile_uuid}/indicator-policies/{indicator}**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/server-profiles/148211c4-6c60-4f6a-82ab-fe575324ffb2/indicator-policies/exe_world_writable \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "state": "on",
    "reason": "example",
    "review_on": "2026-11-09"
  }'
```

PHP:

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

$result = $wt15->serverProfiles->updateIndicatorPolicy('148211c4-6c60-4f6a-82ab-fe575324ffb2', 'exe_world_writable', ['state' => 'on', 'reason' => 'example', 'review_on' => '2026-11-09']);
```

Node.js:

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

const result = await wt15.serverProfiles.updateIndicatorPolicy('148211c4-6c60-4f6a-82ab-fe575324ffb2', 'exe_world_writable', { state: 'on', reason: 'example', review_on: '2026-11-09' });
```

Python:

```python
client = Client.from_environment()

result = client.server_profiles.update_indicator_policy('148211c4-6c60-4f6a-82ab-fe575324ffb2', 'exe_world_writable', state='on', 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"
}
```

Source: https://developer.watchtower15.com/api/reference/server-profiles/
