Skip to main content

Notifications API

Endpoints for managing notifications and user preferences.

Get Notifications

Retrieve user notifications.
curl -X GET "https://api.usmewe.com/v1/notifications?limit=20" \
  -H "Authorization: Bearer YOUR_TOKEN"

Query Parameters

ParameterTypeDescription
limitnumberResults per page (default: 20)
offsetnumberPagination offset
unreadbooleanFilter unread only
typestringFilter by notification type

Get Unread Count

Get count of unread notifications.
curl -X GET "https://api.usmewe.com/v1/notifications/unread/count" \
  -H "Authorization: Bearer YOUR_TOKEN"

Mark as Read

Mark notifications as read.

Single Notification

curl -X PATCH "https://api.usmewe.com/v1/notifications/{notifId}/read" \
  -H "Authorization: Bearer YOUR_TOKEN"

Mark All Read

curl -X POST "https://api.usmewe.com/v1/notifications/read-all" \
  -H "Authorization: Bearer YOUR_TOKEN"

Delete Notification

Delete a notification.
curl -X DELETE "https://api.usmewe.com/v1/notifications/{notifId}" \
  -H "Authorization: Bearer YOUR_TOKEN"

Notification Types

TypeDescription
loan_createdLoan request created
loan_fundedLoan has been funded
loan_due_reminderPayment due reminder
loan_overdueLoan is overdue
loan_repaidLoan successfully repaid
guardian_requestGuardian invitation received
guardian_acceptedGuardian accepted invitation
withdrawal_requestedSocial Vault withdrawal pending
withdrawal_approval_neededGuardian approval needed
vault_lockedSocial Vault locked (duress)
trust_score_updatedTrust Score changed
level_upUser leveled up
badge_earnedNew badge earned

Notification Preferences

Get Preferences

curl -X GET "https://api.usmewe.com/v1/notifications/preferences" \
  -H "Authorization: Bearer YOUR_TOKEN"

Update Preferences

curl -X PATCH "https://api.usmewe.com/v1/notifications/preferences" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "push": {
      "marketing": false
    },
    "email": {
      "weekly_summary": false
    }
  }'

Register Push Token

Register device for push notifications.
curl -X POST "https://api.usmewe.com/v1/notifications/push/register" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "ExponentPushToken[xxx]",
    "platform": "ios",
    "deviceId": "device_abc123"
  }'

Unregister Push Token

Remove device from push notifications.
curl -X DELETE "https://api.usmewe.com/v1/notifications/push/unregister" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "deviceId": "device_abc123"
  }'

Test Notification

Send a test notification (development only).
curl -X POST "https://api.usmewe.com/v1/notifications/test" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "push"
  }'

Error Responses

CodeErrorDescription
404NOTIFICATION_NOT_FOUNDNotification doesn’t exist
400INVALID_TOKENInvalid push token format
429RATE_LIMITEDToo many requests