Create Message POST
Send a push notification to your devices.
Endpoint
POST https://api.pocketalert.app/v1/messagesAuthentication
Required
Include one of these headers in your request:
Request
Headers
| Header | Required | Description |
|---|---|---|
Content-Type | ✅ | application/json |
Token | ✅ | Your API key |
Authorization | ✅ | Bearer <jwt-token> |
* One of Token or Authorization is required
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | ✅ | Notification title |
message | string | ✅ | Notification body text |
application_id | string | ❌ | Application TID to categorize the message |
device_id | string | ❌ | Specific device TID, omit for all devices |
Example Request
bash
curl -X POST "https://api.pocketalert.app/v1/messages" \
-H "Token: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"title": "Server Alert",
"message": "CPU usage exceeded 90%",
"application_id": "qm47b9pzxzxg"
}'javascript
const response = await fetch('https://api.pocketalert.app/v1/messages', {
method: 'POST',
headers: {
'Token': 'your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Server Alert',
message: 'CPU usage exceeded 90%',
application_id: 'qm47b9pzxzxg'
})
});
const data = await response.json();
console.log(data);python
import requests
response = requests.post(
'https://api.pocketalert.app/v1/messages',
headers={
'Token': 'your-api-key',
'Content-Type': 'application/json'
},
json={
'title': 'Server Alert',
'message': 'CPU usage exceeded 90%',
'application_id': 'qm47b9pzxzxg'
}
)
print(response.json())php
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->post('https://api.pocketalert.app/v1/messages', [
'title' => 'Server Alert',
'message' => 'CPU usage exceeded 90%',
'application_id' => 'qm47b9pzxzxg',
]);
return $response->json();Response
Success Response
201 Created
Message created successfully
| Field | Type | Description |
|---|---|---|
tid | string | Unique message identifier |
title | string | Message title |
message | string | Message body |
application | string | Application name (if specified) |
device | string | Target device name |
created_at | string | Creation timestamp |
json
{
"tid": "jb4xw9elz28g",
"title": "Server Alert",
"message": "CPU usage exceeded 90%",
"application": "Monitoring",
"device": "iPhone",
"created_at": "18.01.2026 15:35:35"
}Error Responses
| Status | Description |
|---|---|
401 | Unauthorized — Invalid or missing token |
422 | Validation Error — Missing required fields |
429 | Rate Limited — Too many requests |
json
{
"error": "Validation failed",
"details": {
"title": ["The title field is required"]
}
}