Notifications API
Configure how and when you receive notifications across email, push, and WhatsApp channels.
Get Notification Preferences
curl https://api.affilync.com/api/notifications/preferences \
-H "Authorization: Bearer YOUR_TOKEN"
Response (200):
{
"data": {
"email_enabled": true,
"push_enabled": true,
"whatsapp_enabled": false,
"categories": {
"commission_earned": { "email": true, "push": true, "whatsapp": false },
"payout_processed": { "email": true, "push": true, "whatsapp": false },
"campaign_update": { "email": true, "push": false, "whatsapp": false },
"security_alert": { "email": true, "push": true, "whatsapp": true },
"weekly_digest": { "email": true, "push": false, "whatsapp": false },
"marketing": { "email": false, "push": false, "whatsapp": false }
}
}
}
Update Notification Preferences
curl -X PUT https://api.affilync.com/api/notifications/preferences \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"whatsapp_enabled": true,
"categories": {
"commission_earned": { "whatsapp": true },
"marketing": { "email": false }
}
}'
List Notifications
curl "https://api.affilync.com/api/notifications?unread_only=true&page=1" \
-H "Authorization: Bearer YOUR_TOKEN"
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
unread_only | bool | false | Show only unread notifications |
category | string | — | Filter by category |
page | int | 1 | Page number |
per_page | int | 20 | Results per page |
Response (200):
{
"data": [
{
"id": "notif_abc123",
"type": "commission_earned",
"title": "Commission Earned",
"message": "You earned $25.00 from Spring Sale campaign",
"read": false,
"data": {
"commission_id": "comm_abc123",
"amount": "25.00",
"campaign_name": "Spring Sale"
},
"created_at": "2026-03-24T10:15:00Z"
}
],
"meta": {
"page": 1,
"total": 47,
"unread_count": 5
}
}
Mark as Read
curl -X PATCH https://api.affilync.com/api/notifications/notif_abc123/read \
-H "Authorization: Bearer YOUR_TOKEN"
Mark All as Read
curl -X POST https://api.affilync.com/api/notifications/read-all \
-H "Authorization: Bearer YOUR_TOKEN"
Unread Count
Lightweight endpoint for badge counts.
curl https://api.affilync.com/api/notifications/count \
-H "Authorization: Bearer YOUR_TOKEN"
Response (200):
{
"data": { "unread": 5, "total": 47 }
}
Notification Types
| Type | Description |
|---|---|
commission_earned | New commission recorded |
payout_processed | Payout completed or failed |
campaign_update | Campaign status change |
application_status | Campaign application approved/rejected |
security_alert | New login, 2FA change, suspicious activity |
referral_joined | New user joined via your referral |
weekly_digest | Weekly performance summary |
system | Platform announcements |