Notifications API
Comprehensive notification management system with user preferences, smart filtering, and push notification delivery
System Overview
User Preferences
Granular control over notification types with master toggle
Smart Delivery
Intelligent filtering respects user preferences before sending
Always Logged
All notifications saved to database regardless of delivery
Notification Settings API
Manage user notification preferences with catch-all update functionality
Base Endpoint
https://api.wecompleteapp.com/api/users/user/{userId}/notification-settingsGETRetrieve Current Settings
Request:
curl -X GET https://api.wecompleteapp.com/api/users/user/USER_ID/notification-settings \
-H "Content-Type: application/json"Response:
{
"success": true,
"settings": {
"pauseAll": false,
"dailyReminders": true,
"moodUpdates": true,
"habitsReminder": true,
"eventsNotification": true,
"gamesNotification": true,
"partnerActivity": true,
"systemUpdates": true
}
}PUT/PATCHUpdate Settings (Catch-All)
Request:
curl -X PUT https://api.wecompleteapp.com/api/users/user/USER_ID/notification-settings \
-H "Content-Type: application/json" \
-d '{
"moodUpdates": false,
"habitsReminder": true,
"eventsNotification": false
}'Response:
{
"success": true,
"settings": {
"pauseAll": false,
"dailyReminders": true,
"moodUpdates": false,
"habitsReminder": true,
"eventsNotification": false,
"gamesNotification": true,
"partnerActivity": true,
"systemUpdates": true
},
"message": "Notification settings updated successfully"
}PAUSEMaster Toggle - Pause All Notifications
Request:
curl -X PUT https://api.wecompleteapp.com/api/users/user/USER_ID/notification-settings \
-H "Content-Type: application/json" \
-d '{
"pauseAll": true
}'Note: Setting pauseAll to true automatically disables all other notification types
Available Notification Settings
Complete list of notification preferences users can control
| Setting Key | Type | Description | Default |
|---|---|---|---|
pauseAll | boolean | Master toggle for all notifications - when true, disables all other notifications | false |
dailyReminders | boolean | Daily tips, questions, and mood tracking reminders | true |
moodUpdates | boolean | Partner mood notifications and updates | true |
habitsReminder | boolean | Habit tracking reminders and check-ins | true |
eventsNotification | boolean | Event reminders and calendar notifications | true |
gamesNotification | boolean | Game invitations and activity notifications | true |
partnerActivity | boolean | General partner activity notifications (notes, memories, etc.) | true |
systemUpdates | boolean | App updates, announcements, and system notifications | true |
Smart Notification Bridge
Intelligent notification system that respects user preferences while ensuring important notifications are logged
How It Works
Request Received
Notification request with category
Check Preferences
Query user notification settings
Always Save
Store notification in database
Smart Delivery
Send push if user opted in
Usage Example
Request:
curl -X POST https://api.wecompleteapp.com/api/users/user/USER_ID/send-test-notification \
-H "Content-Type: application/json" \
-d '{
"title": "Partner Mood Update",
"message": "Your partner just shared they are feeling happy!",
"category": "moodUpdates"
}'Response (User Opted In):
{
"success": true,
"message": "Notification sent successfully",
"notificationType": "moodUpdates",
"userOptedIn": true,
"saved": true,
"sent": 2,
"total": 2,
"action": "saved_and_sent"
}Response (User Opted Out):
{
"success": true,
"message": "Notification saved but not sent (user opted out)",
"notificationType": "moodUpdates",
"userOptedOut": true,
"saved": true,
"sent": 0,
"total": 2,
"action": "saved_only"
}Category to Setting Mapping
| Notification Category | Maps to Setting | Description |
|---|---|---|
mood, moodUpdates | moodUpdates | Partner mood notifications |
habits, habitsReminder | habitsReminder | Habit tracking reminders |
events, eventsNotification | eventsNotification | Event reminders |
games, gamesNotification | gamesNotification | Game notifications |
questions, dailyReminders | dailyReminders | Daily tips and questions |
notes, partnerActivity | partnerActivity | Partner activity |
systemUpdates | systemUpdates | System updates |
Frontend Integration
Ready-to-use JavaScript class for managing notification settings
JavaScript Implementation
class NotificationSettingsManager {
constructor(userId) {
this.userId = userId;
this.baseUrl = `https://api.wecompleteapp.com/api/users/user/${userId}/notification-settings`;
}
// Get current settings
async getSettings() {
const response = await fetch(this.baseUrl);
return await response.json();
}
// Update specific setting
async updateSetting(settingName, value) {
const response = await fetch(this.baseUrl, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ [settingName]: value })
});
return await response.json();
}
// Toggle pause all
async togglePauseAll(pause) {
const response = await fetch(this.baseUrl, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ pauseAll: pause })
});
return await response.json();
}
}
// Usage
const settings = new NotificationSettingsManager('user_123');
await settings.updateSetting('moodUpdates', false);Key Features
Catch-All Updates
Update any combination of settings in a single request
Master Toggle
pauseAll setting overrides all other preferences
Smart Filtering
Automatic preference checking before push delivery
Always Logged
All notifications saved regardless of delivery preference
Category Mapping
Automatic mapping from notification types to user settings
Default Enabled
All notifications enabled by default for better engagement
Need help implementing notifications? Check out our iOS Push Notifications documentation or contact support.