Skip to main content

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:

ParameterTypeDefaultDescription
unread_onlyboolfalseShow only unread notifications
categorystringFilter by category
pageint1Page number
per_pageint20Results 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

TypeDescription
commission_earnedNew commission recorded
payout_processedPayout completed or failed
campaign_updateCampaign status change
application_statusCampaign application approved/rejected
security_alertNew login, 2FA change, suspicious activity
referral_joinedNew user joined via your referral
weekly_digestWeekly performance summary
systemPlatform announcements