Delete Bulk messages. Sort messages
Hello! Have 2 questions:
1. Can I delete Bulk messages via API? Didn't find it in docs but we need it. Or maybe some endpoint for delete all messages
2. Unread messages always in top when use /notifications endpoint but we need sort by time, can I change sorting field?
Thank you in advance
3 Replies
Hi @Sasha Trityak, I'm an AI assistant for Novu. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Ask Inkeep with any follow-up questions.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Messages
* Subscribers removal
* Get notifications
* API Overview
-----------------------------
Answer
1. Currently, the official Novu documentation does not provide a direct method for bulk-deleting messages via the API. The documentation mentions deleting a single message by its messageId (1) , but there's no mention of a bulk delete feature. However, there is a feature request for an API to bulk-delete notifications based on content within their payload (2) , indicating interest in such functionality but it's not yet implemented.
2. Regarding the sorting of messages, the official documentation does not provide details on customizing the sort order of notifications fetched via the
/notifications
endpoint (3) . The default behavior you're experiencing (unread messages at the top) appears to be by design, with no documented method for altering the sort order to prioritize by time instead.
For the latest updates or changes, it's recommended to check the Novu documentation or their GitHub repository, as new features and improvements are continuously being developed.@Sasha Trityak
1. currently, bulk delete or delete all messages endpoint is not available. One way is to call delete one message api multiple times