---
title: "ICMP Monitor erstellen"
description: "Erstellt einen neuen ICMP Monitor."
---

`POST /api/icmp-monitors`

## Authentifizierung

Erfordert eine gültige Session.

- Header: `Authorization: Bearer <token>`

## Request Body

```json
{
  "customerId": "6764e84f-f02a-43e6-a46d-cecaec556723",
  "name": "Ping Gateway",
  "hostname": "claas.sh",
  "status": "active",
  "checkInterval": 5,
  "timeoutSeconds": 10,
  "icmpConfig": {
    "packetSize": 56,
    "count": 4
  }
}
```

### Felder

- `customerId` (number | string, required)
  - Akzeptiert die interne numerische Kunden-ID oder die Customer-`publicId`-UUID.
- `name` (string, required)
- `hostname` (string, required)
  - Muss nur Hostname oder IP sein (kein Protokoll wie `https://`, kein Pfad wie `/ping`).
- `status` (string, optional)
  - Erlaubt: `active`, `maintenance`, `disabled`, `paused`, `inactive`
  - Hinweis: `paused` / `inactive` werden zu `disabled` normalisiert.
- `checkInterval` (number, optional)
- `timeoutSeconds` (number, optional)
- `icmpConfig` (object, optional)
  - Wird als `config` JSON am Monitor gespeichert.

### `icmpConfig` (vom Worker unterstützte Keys)

- `packetSize` (number)
  - Default: `56`
- `count` (number)
  - Default: `3`

## cURL

```bash
curl -X POST "https://YOUR_DOMAIN/api/icmp-monitors" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "6764e84f-f02a-43e6-a46d-cecaec556723",
    "name": "Ping Gateway",
    "hostname": "claas.sh",
    "status": "active",
    "checkInterval": 5,
    "timeoutSeconds": 10,
    "icmpConfig": { "packetSize": 56, "count": 4 }
  }'
```

## Response

```json
{
  "id": 123,
  "organizationId": 1,
  "customerId": 2,
  "name": "Ping Gateway",
  "hostname": "claas.sh",
  "port": null,
  "status": "active",
  "checkInterval": 5,
  "timeoutSeconds": 10,
  "allowedCheckCountryCodes": null,
  "notificationPhoneNumber": null,
  "notificationEmail": null,
  "lastCheckedAt": null,
  "createdAt": "2026-02-26T12:00:00.000Z",
  "updatedAt": "2026-02-26T12:00:00.000Z",
  "config": {
    "packetSize": 56,
    "count": 4
  },
  "icmpConfig": {
    "packetSize": 56,
    "count": 4
  }
}
```

## Fehler

- `400 Invalid Customer identifier`
- `400` Ungültiger Hostname oder ungültiger Request Body
- `401` Unauthorized
- `403` Forbidden (z. B. `readonly` oder global supporter)
- `404` Kunde nicht gefunden

