Broadcasts
A broadcast is a precursor to a notification. When you specify multiple recipients, MagicBell creates a notification for each recipient and delivers it to them based on their preferences.
The broadcast object
Attributes
Create broadcastsreal-time
Create a broadcast to send notifications to upto a 1,000 recipients - users or topic subscribers. You can identify users by their email address or by an external_id.
You don't have to import your users into MagicBell. If a user does not exist we'll create it automatically.
You can send user attributes like first_name, custom_attributes, and more when creating a broadcast.
A new notification will be shown in the inbox of each recipient in real-time. It will also be delivered to each recipient through all channels you have enabled for your project.
HTTP headers
Request body
List broadcasts
List all broadcasts. Broadcasts are sorted in descending order by the sent_at timestamp.
HTTP headers
Query parameters
Fetch a broadcast by its ID
Fetch a broadcast by its ID.
HTTP headers
Path parameters
Fetch notifications by broadcast id.
Fetch the notifications for a broadcast.
HTTP headers
Path parameters
Query parameters
The notification object
Attributes
Fetch notifications for a user
Fetch a user's notifications. Notifications are sorted in descending order by the sent_at timestamp.
HTTP headers
Query parameters
Fetch notification by ID
Fetch a user's notification by its ID.
HTTP headers
Path parameters
Delete a notificationreal-time
Delete a user's notification by its ID. The notification is deleted immediately and removed from the user's notification inbox in real-time.
HTTP headers
Path parameters
Mark a notification as readreal-time
Mark a user notification as read. The notification will be automatically marked as seen, too.
The new state will be reflected in the user's notification inbox in real-time.
HTTP headers
Path parameters
Mark a notification as unreadreal-time
Mark a user notification as unread. The new state will be reflected in the user's notification inbox in real-time.
HTTP headers
Path parameters
Archive a notificationreal-time
Mark a user notification as archived.
HTTP headers
Path parameters
Unarchive a notificationreal-time
Mark a user notification as unarchived.
HTTP headers
Path parameters
Mark all notifications as readreal-time
Mark all notifications of a user as read. When you call this endpoint, the notification inboxes of this user will be updated in real-time.
HTTP headers
Query parameters
Mark all notifications as seenreal-time
Mark all notifications of a user as seen. When you call this endpoint, the notification inboxes of this user will be updated in real-time.
HTTP headers
Query parameters
The user object
Attributes
Create a user
Create a user. Please note that you must provide the user's email or the external id so MagicBell can uniquely identify the user.
The external id, if provided, must be unique to the user.
HTTP headers
Request body
Fetch users
Fetches users for the project identified by the auth keys. Supports filtering, ordering, and pagination.
HTTP headers
Query parameters
last_seen_at
timestamp. Please send it in RFC3339 formatlast_seen_at
timestamp. Please send it in RFC3339 formatlast_notified_at
timestamp. Please send it in RFC3339 formatlast_notified_at
timestamp. Please send it in RFC3339 formatcreated_at,DESC
Update a user
Update a user's data. If you identify users by their email addresses, you need to update the MagicBell data, so this user can still access their notifications.
HTTP headers
Path parameters
email:theusersemail@example.com
or external_id:theusersexternalid
as the user id.Request body
Get user by ID
Fetch a user by id, for the project identified by the auth keys.
HTTP headers
Path parameters
Delete a user
Immediately deletes a user.
HTTP headers
Path parameters
email:theusersemail@example.com
or external_id:theusersexternalid
as the user id.Fetch notifications by user id.
Fetch the notifications and deliveries for a user.
HTTP headers
Path parameters
Query parameters
Update a user identified by email
Update a user's data. If you identify users by their email addresses, you need to update the MagicBell data, so this user can still access their notifications.
HTTP headers
Path parameters
Request body
Delete a user identified by email
Immediately deletes a user.
HTTP headers
Path parameters
Update a user identified by external ID
Update a user's data. If you identify users by their email addresses, you need to update the MagicBell data, so this user can still access their notifications.
HTTP headers
Path parameters
Request body
Delete a user identified by external ID
Immediately deletes a user.
HTTP headers
Path parameters
Fetch user's push subscriptions
Fetch a user's push subscriptions. Returns a paginated list of web and mobile push subscriptions for all platforms.
HTTP headers
Path parameters
Query parameters
The push subscription object
Attributes
Register a device token for a user
Register a device token for push notifications.
Please keep in mind that mobile push notifications will be delivered to this device only if the channel is configured and enabled.
HTTP headers
Request body
List user's device tokens
Returns the list of device tokens registered for push notifications.
HTTP headers
Delete user's device token
Deletes the registered device token to remove the mobile push subscription.
HTTP headers
Path parameters
The notification preference object
Attributes
Update user notification preferences
Update a user's notification preferences. These preferences will be applied only to channels you enabled for your project.
HTTP headers
Request body
Fetch user notification preferences
Fetch a user's notification preferences. If a user does not disable a channel explicitly, we would send notifications through that channel as long as your project is enabled.
HTTP headers
Create a topic subscription
Set a user's subscription status to subscribed for a particular topic (and optional categories). If the user previously unsubscribed, the user will be resubscribed.
HTTP headers
Request body
Fetch user's topic subscriptions
Fetch a user's topic subscriptions.
HTTP headers
Unsubscribe from a topic
Unusbscribe a user from a particular topic (and optional categories).
HTTP headers
Path parameters
Request body
Show a topic subscription
Show a user's subscription status for a particular topic and categories.
HTTP headers
Path parameters
Delete topic subscription(s)
HTTP headers
Path parameters
Request body
Create a import
Enqueues an import - currently only supported for users. Amongst other things, the users import allows associating slack channels (if you have already setup the oauth apps).
HTTP headers
Request body
Get the status of an import
Query the status of the import for a summary of imported records and failures for each record that could not be imported successfully.
HTTP headers
Path parameters
The metric object
Attributes
Get notification metrics
Query the metrics of broadcasts and their recipients.
HTTP headers
Path parameters
Get notification metrics grouped by category
Query the metrics of broadcasts and their recipients, grouped by category.
HTTP headers
Path parameters
Get notification metrics grouped by topic
Query the metrics of broadcasts and their recipients, grouped by topic.