Skip to content

Public Notify API

  • Base URL: https://api.notificator-project.com
  • Resource: / on the public API domain
  • Primary method: POST

Supported methods:

  • POST create and dispatch an external notification
  • GET return endpoint metadata (or OpenAPI with ?format=openapi)
  • OPTIONS CORS preflight

OpenAPI document:

  • GET https://api.notificator-project.com?format=openapi

Provide exactly one API key using any of these headers:

  • Authorization: Bearer wpnotif_...
  • X-API-Key: wpnotif_...
  • X-WPNOTIF-Key: wpnotif_...

Key type policy:

  • Allowed: public_client, internal_service
  • Rejected: wordpress_server

Domain policy:

  • If a key has allowed_domains, request Origin or Referer host must match.
  • Requests without Origin or Referer are accepted for server-to-server traffic.
  • localhost and 127.0.0.1 are always accepted for local testing.

Content types accepted:

  • application/json
  • application/x-www-form-urlencoded
  • text/plain

Minimum payload requirement:

  • A request must include at least one meaningful notification field.
  • Valid examples: title, body, message, category, severity, non-empty payload, or non-empty data.
  • Requests that only include control flags (for example only sendPush) return 400.
FieldTypeRequiredDefaultNotes
titlestringNoExternal NotificationTrimmed to 140 chars.
bodystringNo""Trimmed to 2000 chars.
sourcestringNothird_partyTrimmed to 200 chars.
categorystringNoinfoNormalized to info, task, promo.
severitystringNonullNormalized to info, warning, error, critical or omitted.
sendPushbooleanNotrueControls Expo push send attempt.
sendMqttbooleanNotrueControls MQTT publish step.
strictDeliverybooleanNofalseWhen true, MQTT failures return 502 (fail-fast). When false, MQTT failures are reported as partial success (200).
deviceIdstringNoall active devicesSends MQTT only to one device when provided.
mqttQosnumberNo1Valid values: 0, 1, 2.
payloadobjectNo{}Preferred metadata object merged into downstream data.
dataobjectNo{}Additional metadata object merged into downstream data.

Any additional top-level fields are preserved and merged into internal data.

Incoming payloads are normalized for common webhook formats:

  • subject -> title
  • description or text -> body
  • service -> source
  • JSON string values in payload and data are auto-parsed into objects
  • category and severity resolution precedence: top-level -> payload -> data
Terminal window
curl -X POST "https://api.notificator-project.com" \
-H "Authorization: Bearer wpnotif_YOUR_PUBLIC_CLIENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Build Failed",
"description": "CI pipeline failed on deploy.",
"service": "github_actions",
"severity": "error",
"payload": { "workflow": "deploy.yml", "branch": "main" }
}'
Terminal window
curl -X POST "https://api.notificator-project.com" \
-H "Authorization: Bearer wpnotif_YOUR_PUBLIC_CLIENT_KEY" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "subject=Disk Space Alert" \
--data-urlencode "description=Node reached 92% disk usage" \
--data-urlencode "service=infra_monitor" \
--data-urlencode "payload={\"host\":\"api-1\",\"disk\":92}"
Terminal window
curl -X POST "https://api.notificator-project.com" \
-H "Authorization: Bearer wpnotif_YOUR_PUBLIC_CLIENT_KEY" \
-H "Content-Type: text/plain" \
--data "Payment provider timeout on checkout"

Use this mode when your caller must treat MQTT delivery as mandatory.

Terminal window
curl -X POST "https://api.notificator-project.com" \
-H "Authorization: Bearer wpnotif_YOUR_PUBLIC_CLIENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Queue Backlog High",
"body": "Order queue is above threshold.",
"source": "erp_worker",
"sendMqtt": true,
"strictDelivery": true,
"payload": { "queue": "orders", "pending": 182 }
}'

By default (strictDelivery: false), MQTT publish failures do not fail the whole request. The endpoint returns 200 with ok: true plus MQTT warning fields.

{
"ok": true,
"kind": "external_notification",
"stored": true,
"payloadPreview": {
"type": "external_notification",
"title": "Queue Backlog High",
"body": "Order queue is above threshold.",
"source": "erp_worker",
"category": "task",
"severity": "warning",
"dataKeys": ["queue", "pending", "cluster"]
},
"pushSent": true,
"pushAttempted": 1,
"pushEnabled": true,
"emailEnabled": false,
"mqttPublishedCount": 1,
"mqttFailedCount": 0,
"mqttSkipped": false,
"mqttError": null,
"warnings": [],
"mqttEnabled": true,
"timestamp": "2026-03-29T12:00:00.000Z"
}
{
"ok": true,
"kind": "external_notification",
"stored": true,
"pushSent": true,
"pushAttempted": 1,
"pushEnabled": true,
"mqttPublishedCount": 0,
"mqttFailedCount": 1,
"mqttError": "Publish failed",
"warnings": ["mqtt_publish_failed_partial"],
"mqttEnabled": true,
"timestamp": "2026-03-29T12:00:00.000Z"
}
FieldTypeDescription
okbooleantrue when request was processed.
kindstringAlways external_notification.
storedbooleanWhether encrypted notification was stored.
storeReasonstringIncluded when stored is false.
payloadPreviewobjectSanitized preview of normalized payload.
pushSentbooleanAt least one push token succeeded.
pushAttemptednumberNumber of push tokens attempted.
pushEnabledbooleanReflects request-level sendPush.
emailEnabledbooleanAlways false for this endpoint.
mqttPublishedCountnumberNumber of successful MQTT publishes completed.
mqttFailedCountnumberNumber of MQTT publish failures in the request.
mqttSkippedbooleantrue when no active MQTT targets were available.
mqttSkipReasonstringIncluded when MQTT was skipped.
mqttErrorstringFirst MQTT error message when one or more publishes fail.
warningsstring[]Warning codes for partial-success outcomes (for example mqtt_publish_failed_partial).
mqttEnabledbooleanReflects request-level sendMqtt.
timestampstringServer timestamp in ISO-8601 format.
HTTPExample errorMeaning
400Invalid request bodyBody could not be parsed.
400Request payload is emptyNo meaningful notification fields were provided.
401Authorization requiredNo auth header/key supplied.
401Invalid API keyKey missing, revoked, or unknown.
401API key type not allowed for this endpoint...Key type is not public_client or internal_service.
401Origin is not allowed for this API keyDomain policy denied request.
401Authentication service unavailableBackend key validation service not configured/available.
404Device not found for userProvided deviceId does not belong to key owner.
409Device is inactive or pausedTarget device exists but is not publishable.
502MQTT publish failedReturned only when strictDelivery=true and MQTT publish fails.