notifications

Send batch notifications

Send the same Firebase notification to multiple users. Admin only.

post/api/notifications/send-batch

Request body

user_idsstring[] required

Target user IDs.

titlestring required

Notification title

bodystring required

Notification body

notification_type'chat' | 'booking' | 'payment' | 'subscription' | 'event' | 'general' | 'daily_morning' | 'daily_evening' | 'lunch' | 'journey' | 'corabea_plus' | 'diary_shared' | 'kit_document'

Notification type constants for FCM notifications.

dataobject nullable

Optional FCM data payload (string key-value pairs)

notification_metadataobject nullable

Optional metadata for backend logs (chat_id, appointment_id, etc.)

active_onlyboolean

If true, send only to active FCM tokens

Example request

{
  "active_only": true,
  "body": "Controlla i nuovi contenuti in app",
  "data": {
    "show_in_foreground": "true",
    "type": "general"
  },
  "notification_metadata": {
    "campaign": "crm_bulk_send"
  },
  "notification_type": "general",
  "title": "Promemoria",
  "user_ids": [
    "123e4567-e89b-12d3-a456-426614174000",
    "123e4567-e89b-12d3-a456-426614174001"
  ]
}

Response

Successful Response

total_usersinteger required

Total users requested

processed_usersinteger required

Total users processed

successful_usersinteger required

Users with fully successful delivery

failed_usersinteger required

Users with zero successful devices or at least one failure

success_countinteger required

Total successful device sends across all users

failure_countinteger required

Total failed device sends across all users

total_devicesinteger required

Total targeted devices across all users

Example response

{
  "failed_users": 1,
  "failure_count": 1,
  "processed_users": 2,
  "results": [
    {
      "failure_count": 0,
      "success": true,
      "success_count": 2,
      "total_devices": 2,
      "user_id": "123e4567-e89b-12d3-a456-426614174000"
    },
    {
      "failure_count": 1,
      "success": false,
      "success_count": 1,
      "total_devices": 2,
      "user_id": "123e4567-e89b-12d3-a456-426614174001"
    }
  ],
  "success_count": 3,
  "successful_users": 1,
  "total_devices": 4,
  "total_users": 2
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.