https://api.notifyaim.com/api/v1/
All endpoints require HTTPS.
Registers a device/browser to receive push notifications.
POST /register-subscription
{ "vapidKey": "YOUR_VAPID_KEY", // Your API Key "endpoint": "https://fcm.googleapis.com/fcm/send/abcd1234", // Device endpoint "public_key": "sub.toJSON().keys.p256dh", // VAPID public key "auth_token": "sub.toJSON().keys.auth", // VAPID auth token "topics": ["news", "offers"], // Array of topics to subscribe to "user_id": "optional_user_identifier", // Optional user ID for personalization "group_id": "vip_customers", // Optional group ID for segmentation "locale": "en-US", // Optional locale for language preferences "preferences": { promotions: true, // User preferences for notifications alerts: true, // Enable/disable alerts system: true, // System notifications marketing: false // Marketing notifications }, }
{ "status": "success", // Registration status "user_id": "notify_aim_1234" // Unique user ID for the device }
Subscribes a registered device to a topic for targeted notifications.
POST /update-subscription-topics
{ "api_key": "YOUR_API_KEY", // Your API Key "endpoint": "https://fcm.googleapis.com/fcm/send/abcd1234", // Device endpoint "topics": "[offers, news]", // Comma-separated list of topics to subscribe to }
{ "status": "success", "topic": "offers", "message": "Subscribed to topic successfully", }
All errors follow the structure:
{ "status": "error", "message": "Description of the error" }
Common HTTP Status Codes
curl --location 'https://api.notifyaim.com/api/v1/notification/send' \ --header 'Content-Type: application/json' \ --data '{ "vapid_private": "YOUR_vapid_private_KEY", "title": "Sale Alert", "body": "50% OFF Today!", "url": "https://example.com", "icon": "https://example.com/icon.png", "webhook": "https://example.com/webhook", "topic": "offers" }'