D
DGuardAPI Documentation

Push Notifications

Push notification system to alert users about detected threats in real-time.

Features

Real-time Notifications

Instant delivery

iOS & Android Support

APNs and FCM

Priority by Severity

Critical alerts first

Notification History

Complete tracking

Register Device

POST /notifications/devices

Request Example

{
  "user_id": "usr_123456",
  "device_id": "device_abc123",
  "platform": "ios",
  "push_token": "apns_or_fcm_token_here",
  "app_version": "1.0.0",
  "language": "es"
}

Response Example

{
  "registration_id": "reg_xyz789",
  "device_id": "device_abc123",
  "platform": "ios",
  "status": "active",
  "registered_at": "2025-01-14T19:00:00Z"
}

Send Notification

POST /notifications/send

Request Example

{
  "user_id": "usr_123456",
  "notification": {
    "title": "⚠️ Security Alert",
    "body": "Phishing attempt detected in your email",
    "category": "security_alert",
    "priority": "high",
    "data": {
      "alert_type": "phishing",
      "alert_id": "alert_abc123"
    }
  },
  "options": {
    "send_to_all_devices": true,
    "badge_count": 1,
    "sound": "alert.wav"
  }
}

Notification Categories

security_alert

General security alert

high
phishing_detected

Phishing detected in email/SMS

high
fraud_alert

Fraudulent transaction

critical
darkweb_alert

New leak detected

high
vpn_status

VPN connection status

normal
refund_status

Refund update

normal
system

System notifications

low

Notification History

GET /notifications/history?user_id=usr_123456&limit=50

Query Parameters: user_id, limit (max 100), offset, category, unread_only