API Reference
Push Notifications API Reference
API reference for registering subscribers and sending Web Push or in-app notifications through DNZ Notifications.
Authentication
- Create an API key from the DNZ Notifications dashboard.
- Send the key using the X-API-Key header.
- Keep server keys private. Browser registration should use a client-safe key only when your workspace is configured for that flow.
POST
/v1/subscribers/registerRegister a browser or mobile subscriber under a stable recipientId.
Request example
{
"recipientId": "user_123",
"platform": "web",
"deviceTransport": "web_push",
"webPush": {
"endpoint": "https://push.service.example/subscription-id",
"keys": {
"p256dh": "base64-public-key",
"auth": "base64-auth-secret"
}
},
"metadata": {
"plan": "pro"
}
}Response example
{
"subscriberId": "0b967f0e-3d6f-4ca1-b21d-49d2f50f67f4",
"deviceId": "a7ab4b19-b41f-4db3-a9ae-a7c1ff9d92ef",
"message": "registered"
}Error codes
- 400 validation error
- 401 invalid API key
- 409 subscription already registered to another subscriber
POST
/v1/sendQueue a push or in-app notification for a registered recipient.
Request example
{
"recipientId": "user_123",
"channel": "push",
"title": "Order shipped",
"body": "Your order #DNZ-1042 is on the way.",
"data": {
"orderId": "DNZ-1042",
"url": "/orders/DNZ-1042"
}
}Response example
{
"notificationId": "7dc39d6b-7d37-4db1-bb47-6b09eafccf25",
"status": "queued"
}Error codes
- 400 title and body required when templateId is not provided
- 401 invalid API key
- 404 template not found
Rate limits
- Rate limits should be enforced by workspace policy and infrastructure configuration.
- The API is queue-based: successful requests return 202 and continue processing asynchronously.
