POST /api/notifications/send
Send a personalized notification using a template. Supports realtime delivery to a single user or batch delivery to up to 10,000 targets.
Headers
Your CometChat App ID.
Your CometChat API Key.
Request body
Template configuration for the notification.
The template key (slug). Provide either
key or id.The template ID. Provide either
key or id.Key-value pairs matching the template’s
variableSchema. All declared variables must be supplied.Optional push notification payload overrides.
Array of user IDs to receive the notification. Realtime mode allows 1 target; batch mode allows up to 10,000.
Delivery mode. One of
realtime or batch.Optional notification title for tracking and display.
Optional tag for categorizing and filtering notifications.
Example request
Example response
Response fields
Unique identifier for the sent notification.
The template key used for this notification.
Array of channel types the notification was delivered through.
The delivery mode used (
realtime or batch).The notification title.
The notification tag.
Origin of the send request (e.g.,
api).ISO 8601 timestamp of when the notification was created.
Error codes
| Code | Description |
|---|---|
ERR_BAD_REQUEST | Invalid request body or missing required fields |
ERR_TEMPLATE_NOT_APPROVED | Template is not in approved status |
ERR_INVALID_VARIABLES | Missing or invalid variables for the template schema |
ERR_TARGET_LIMIT_EXCEEDED | Too many targets for the selected mode |
ERR_INVALID_MODE | Mode must be realtime or batch |