Kunden erstellen

POST /api/customers

Kunden erstellen

POST /api/customers

Erstellt einen neuen Kunden und weist über packageType ein organisationsdefiniertes Paket zu.

Authentifizierung

Dieser Endpoint erfordert Authentifizierung.

BASE_URL="https://uptimeify.io"
TOKEN="wsm_<dein-api-token>"

Anfrage (Request Body)

{
  "name": "Kundenname",
  "email": "kunde@example.com",
  "packageType": "business", // konfigurierter packageType oder Display-Name aus der Paket-Konfiguration der Organisation
  "organizationId": 1, // optional (nur für Global Admins erforderlich)
  "status": "active", // optional, Standard: active
  "customFields": { ... } // optional
}

Hinweise:

  • packageType kann den konfigurierten Paket-Key oder den Display-Namen des Pakets enthalten. Bekannte Alias-Schreibweisen wie aquisition_test werden automatisch normalisiert.
  • Wenn kein konfiguriertes Paket dazu passt, wird der Request mit 400 Bad Request abgelehnt.
  • Für normale Benutzer wird organizationId aus der Session/dem Token abgeleitet und darf nicht überschrieben werden.
  • Für Global Admins muss organizationId explizit angegeben werden.

Response

{
  "success": true,
  "customer": {
    "id": 64,
    "publicId": "6d74c32b-a97c-49b9-be3e-2b5e24bed826",
    "organizationId": 2,
    "name": "Example Customer",
    "email": "example@test.com",
    "notificationPhoneNumber": null,
    "notificationEmail": null,
    "packageId": 7,
    "packageType": "essential",
    "status": "active",
    "allowedCheckCountryCodes": null,
    "cancellationDate": null,
    "cancelledAt": null,
    "customFields": {
      "region": "EU",
      "planOwner": "Operations"
    },
    "monthlyReportsEnabled": true,
    "notificationChannels": null,
    "notificationTargets": null,
    "notificationRules": null,
    "smsUsageCurrentMonth": 0,
    "createdAt": "2026-04-04T12:27:13.415Z",
    "updatedAt": "2026-04-04T12:27:13.415Z"
  }
}