Skip to content

Create Message POST

Send a push notification to your devices.

Endpoint

POST https://api.pocketalert.app/v1/messages

Authentication

Required

Include one of these headers in your request:

  • Token: <your-api-key> — Get it from API Keys
  • Authorization: Bearer <jwt-token> — From Login

Request

Headers

HeaderRequiredDescription
Content-Typeapplication/json
TokenYour API key
AuthorizationBearer <jwt-token>

* One of Token or Authorization is required

Body Parameters

ParameterTypeRequiredDescription
titlestringNotification title
messagestringNotification body text
application_idstringApplication TID to categorize the message
device_idstringSpecific 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

FieldTypeDescription
tidstringUnique message identifier
titlestringMessage title
messagestringMessage body
applicationstringApplication name (if specified)
devicestringTarget device name
created_atstringCreation 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

StatusDescription
401Unauthorized — Invalid or missing token
422Validation Error — Missing required fields
429Rate Limited — Too many requests
json
{
  "error": "Validation failed",
  "details": {
    "title": ["The title field is required"]
  }
}

Pocket Alert Documentation