Back to Documentation
API Reference
Complete reference for the notification API endpoint including headers, request body, and all possible responses.
Endpoint
POST https://thenotification.app/api/sendNotificationHeaders
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| app_key | Your application API key | Yes |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Notification title |
| body | string | Yes | Notification message |
| link | string | No | URL to open when notification is tapped |
| image | string | No | Image URL to display in notification |
Responses
200 OK - Success
{
"success": true,
"message": "Notification sent to 1 device(s)",
"devices_sent": 1,
"failed_count": 0
}400 Bad Request - Validation Error
{
"success": false,
"error": "Title and body are required"
}
// Other 400 errors:
// - "Title and body must be strings"
// - "Link must be a string"
// - "Image must be a string"
// - "No devices registered for this application"401 Unauthorized - Authentication Error
{
"success": false,
"error": "Missing app_key header"
}
// Or: "Invalid app_key"429 Too Many Requests - Rate Limit Exceeded
{
"success": false,
"error": "Monthly message limit exceeded",
"limit": 100,
"received": 100
}500 Internal Server Error - Server Error
{
"success": false,
"error": "Internal server error"
}