Docs/Reference

API reference

Last updated·1 min read

Complete reference for the TheNotificationApp API endpoint.

Endpoint

POST https://thenotification.app/api/sendNotification

Headers

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 shown as the headline
body string Yes Notification message shown below the title
link string No URL that opens when the notification is tapped
image string No Image URL displayed in the notification

Example request

curl -X POST https://thenotification.app/api/sendNotification \
  -H "app_key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Deployment complete",
    "body": "main branch deployed successfully",
    "link": "https://yourapp.com",
    "image": "https://yourapp.com/badge.png"
  }'

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:

{
  "success": false,
  "error": "Invalid app_key"
}

429 Too Many Requests — rate limit exceeded

{
  "success": false,
  "error": "Monthly message limit exceeded",
  "limit": 1000,
  "received": 1000
}

For free users the error will read "Lifetime message limit exceeded".

500 Internal Server Error

{
  "success": false,
  "error": "Internal server error"
}