notifications

Send batch notifications

Changed on

Send the same push notification to multiple users. Admin, coordinator, developer, clinical director, or social media manager. The send is recorded in the CRM notification history (GET /notification-campaigns).

post/api/notifications/send-batch

Request

  • Base URL: https://api.corabea.it (the document declares no server; this is the origin it was published from)
  • URL: https://api.corabea.it/api/notifications/send-batch
  • Auth: HTTP bearer

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' | 'operator_chat' | 'support_ticket' | 'mini_equipe' | 'bia_request' | 'clinical_document' | 'community'

Notification type constants for push notifications.

dataobject nullable

Optional push 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 push 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