Notifications
Notifications are a powerful way to keep users informed, engaged, and up-to-date. They help share important updates, deliver timely messages, and alert users to key events in a clear and effective manner. Whether it’s letting users know about a system update, announcing a new feature, or sending a personalized message, notifications ensure the right information reaches the right people at the right time.
By integrating notifications, you create a more dynamic and responsive experience, ensuring users feel connected and informed. They can be used to drive engagement, prompt action, or simply keep users in the loop, making them an essential part of any modern application (e.g. Onify Helix).
API Documentation
This describes the endpoints available for managing notifications via API. These endpoints can be used to create, retrieve, update, and delete notifications, both individually and in bulk.
Table of Contents
My Notifications
List My Notifications
Endpoint: GET /my/notifications
Description: Retrieve a list of notifications for the authenticated user.
Headers:
Authorization
(required): Bearer token.
Query Parameters:
term
(string, default:*
): Search term.status
(array[string], optional): Filter by notification status.type
(array[string], optional): Filter by notification type.tag
(array[string], optional): Filter by tags.sort
(array[string], default:["timestamp"]
): Sort criteria.sortby
(string, enum:["asc", "desc"]
, default:desc
): Sort order.startfrom
(integer, default:0
, max:10000
): Pagination offset.pagesize
(integer, default:10
): Number of results per page.metaonly
(boolean, default:false
): Return metadata only.
cURL Example:
curl -X GET "http://0.0.0.0:8181/api/v2/my/notifications?term=*&pagesize=10" \
-H "Authorization: Bearer YOUR_TOKEN"
Bulk Update My Notifications
Endpoint: PUT /my/notifications
Description: Bulk update notifications for the authenticated user.
Headers:
Authorization
(required): Bearer token.
Request Body: (array of objects)
id
(string, required): Notification ID.status
(string, required): New status for the notification.
cURL Example:
curl -X PUT "http://0.0.0.0:8181/api/v2/my/notifications" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '[{"id": "notif123", "status": "read"}]'
Admin Notifications
List Notifications
Endpoint: GET /admin/notifications
Description: List all notifications with administrative access.
Headers:
Authorization
(required): Bearer token.
Query Parameters:
query
(string, optional): Search query.startfrom
(integer, default:0
, max:10000
): Pagination offset.pagesize
(integer, optional): Number of results per page.sort
(array[string], optional): Sort criteria.metaonly
(boolean, default:false
): Return metadata only.includebpmn
(boolean, default:true
): Include BPMN data.
cURL Example:
curl -X GET "http://0.0.0.0:8181/api/v2/admin/notifications?pagesize=20" \
-H "Authorization: Bearer YOUR_TOKEN"
Create or Update Notification
Endpoint: POST /admin/notifications
Description: Create or update a notification.
Headers:
Authorization
(required): Bearer token.
Query Parameters:
refresh
(boolean, optional): Refresh index after operation.
Request Body: (object)
user
(string, required): User ID.title
(string, required): Notification title.message
(string, required): Notification message.status
(string, default:new
): Notification status.tag
(array[string], optional): Tags for the notification.type
(string, optional): Notification type.action
(object, optional): Action associated with the notification.name
(string, optional): Action name.url
(string, required): Action URL.target
(string, enum:["_self", "_blank", "_modal"]
, optional): Action target.
cURL Example:
curl -X POST "http://0.0.0.0:8181/api/v2/admin/notifications" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"user": "user123",
"title": "Important Update",
"message": "System maintenance scheduled.",
"status": "new",
"action": {"url": "http://example.com/details"}
}'
Update Notification by ID
Endpoint: PUT /admin/notifications/{id}
Description: Update a specific notification by its ID.
Headers:
Authorization
(required): Bearer token.
Path Parameters:
id
(string, required): Notification ID.
Request Body: (object)
title
(string, optional): Updated notification title.message
(string, optional): Updated notification message.status
(string, optional): Updated notification status.tag
(array[string], optional): Updated tags for the notification.type
(string, optional): Updated notification type.action
(object, optional): Updated action associated with the notification.name
(string, optional): Action name.url
(string, optional): Action URL.target
(string, enum:["_self", "_blank", "_modal"]
, optional): Action target.
cURL Example:
curl -X PUT "http://0.0.0.0:8181/api/v2/admin/notifications/notif123" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Notification Title",
"message": "This is the updated message.",
"status": "read"
}'
Bulk Update Notifications
Endpoint: PUT /admin/bulk/notifications
Description: Bulk update multiple notifications.
Headers:
Authorization
(required): Bearer token.
Request Body: (array of objects)
id
(string, required): Notification ID.status
(string, required): New status for the notification.
cURL Example:
curl -X PUT "http://0.0.0.0:8181/api/v2/admin/bulk/notifications" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '[{"id": "notif001", "status": "archived"}]'
Delete Notifications by Query
Endpoint: DELETE /admin/notifications
Description: Delete notifications matching a query.
Headers:
Authorization
(required): Bearer token.
Query Parameters:
query
(string, required): Query string to match notifications.max_docs
(integer, optional): Maximum number of documents to delete.sort
(array[string], optional): Sort criteria.refresh
(boolean, optional): Refresh index after operation.
cURL Example:
curl -X DELETE "http://0.0.0.0:8181/api/v2/admin/notifications?query=status:new" \
-H "Authorization: Bearer YOUR_TOKEN"
Delete Notification by ID
Endpoint: DELETE /admin/notifications/{id}
Description: Delete a specific notification by its ID.
Headers:
Authorization
(required): Bearer token.
Path Parameters:
id
(string, required): Notification ID.
cURL Example:
curl -X DELETE "http://0.0.0.0:8181/api/v2/admin/notifications/notif123" \
-H "Authorization: Bearer YOUR_TOKEN"
Updated 12 days ago