Skip to content

Notifications API

The Notifications API lets you list, read, and manage in-app notifications. It also provides endpoints for checking delivery channel health, linking your Telegram account, and managing push subscriptions.

Real-time notification delivery is available via WebSocket (notification.new event).

All endpoints require either a JWT token or an API key (gf_...) in the Authorization header.

MethodPathDescription
GET/api/v1/notificationsList notifications (paginated)
GET/api/v1/notifications/:idGet single notification
POST/api/v1/notifications/:id/readMark as read
POST/api/v1/notifications/read-allMark all as read
GET/api/v1/notifications/unread-countUnread count
POST/api/v1/notifications/telegram/generate-codeGenerate Telegram link code
GET/api/v1/notifications/telegram/statusTelegram link status
DELETE/api/v1/notifications/telegram/unlinkUnlink Telegram
POST/api/v1/notifications/push/subscribeRegister push subscription
DELETE/api/v1/notifications/push/unsubscribeRemove push subscription
{
"id": "notif_01JXYZ...",
"eventType": "budget_alert",
"title": "Budget 80% consumed",
"message": "Campaign 'FB US iOS' has used 80% of its daily budget.",
"channel": "inapp",
"status": "delivered",
"readAt": null,
"createdAt": "2025-01-15T10:30:00Z",
"payload": { "campaignId": "camp_abc123", "budgetPct": 80 }
}
TypeDescription
budget_alertCampaign budget threshold reached
conversion_alertConversion rate anomaly detected
performance_alertTraffic or CTR performance change
campaign_statusCampaign paused, started, or ended
billing_alertBalance low, payment failed
security_alertSuspicious login or API key usage
system_updatePlatform maintenance or new features
weekly_reportWeekly performance summary
Terminal window
curl "https://devcore.getghostflow.io/api/v1/notifications?page=1&perPage=20&eventType=budget_alert" \
-H "Authorization: Bearer gf_your_api_key"

Query Parameters:

ParamTypeDefaultDescription
pageinteger1Page number
perPageinteger50Items per page (max 100)
eventTypestringFilter by event type
statusstringFilter: unread, read, delivered
channelstringFilter by channel
sincestringISO 8601 datetime, return only newer
Terminal window
curl https://devcore.getghostflow.io/api/v1/notifications/unread-count \
-H "Authorization: Bearer gf_your_api_key"
{ "count": 5 }
Terminal window
curl -X POST https://devcore.getghostflow.io/api/v1/notifications/read-all \
-H "Authorization: Bearer gf_your_api_key"
Terminal window
# Step 1: Generate a linking code
curl -X POST https://devcore.getghostflow.io/api/v1/notifications/telegram/generate-code \
-H "Authorization: Bearer gf_your_api_key"
{
"code": "GF-A1B2C3",
"expiresInSeconds": 300,
"botUsername": "GhostFlowBot"
}

Send the code to @GhostFlowBot on Telegram within 5 minutes to complete linking.

Subscribe to real-time notifications via the shared WebSocket connection:

{
"type": "notification.new",
"payload": {
"messageId": "msg_01ABC...",
"data": {
"notificationId": "notif_01JXYZ...",
"eventType": "conversion_alert",
"title": "Conversion spike detected",
"message": "Campaign 'TikTok EU' conversions up 150% in last hour.",
"payload": null,
"timestamp": 1736937000000
}
}
}
EndpointLimit
GET (list, count)60 req/min
POST (mark read)30 req/min
DELETE20 req/min
Telegram generate-code5 req/min