← Back
API Reference
Send push notifications to the device using your API token. All requests require a Bearer token in the Authorization header.
Base URL
https://your-domain.vercel.app/apiSend Notification
Sends a push notification to the device.
POST/api/notify
Headers
Authorization: Bearer <your_token> Content-Type: application/json
Request Body
{
"title": "string", // required
"body": "string" // required
}Response
// 200 OK
{ "success": true }
// 401 Unauthorized
{ "error": "Invalid token" }
// 403 Forbidden
{ "error": "Token is disabled" }Examples
curl
curl -X POST https://your-domain.vercel.app/api/notify \
-H "Authorization: Bearer <your_token>" \
-H "Content-Type: application/json" \
-d '{"title": "Hello", "body": "World"}'JavaScript
await fetch("https://your-domain.vercel.app/api/notify", {
method: "POST",
headers: {
"Authorization": "Bearer <your_token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
title: "Hello",
body: "World",
}),
});Python
import requests
requests.post(
"https://your-domain.vercel.app/api/notify",
headers={
"Authorization": "Bearer <your_token>",
"Content-Type": "application/json",
},
json={"title": "Hello", "body": "World"},
)Error Codes
| Status | Meaning |
|---|---|
| 200 | Notification sent |
| 400 | Missing title or body |
| 401 | Missing or invalid token |
| 403 | Token is disabled |
| 500 | Failed to send to device |
| 503 | No active devices registered |