# Creating notifications via the API

**URL:** <https://meta.discourse.org/t/creating-notifications-via-the-api/173769>\
**Category:** Development\
**Tags:** notifications, rest-api\
**Created:** [December 17, 2020, 10:55am UTC](https://meta.discourse.org/t/creating-notifications-via-the-api/173769 "2020-12-17T10:55:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)\
**Post date:** [December 17, 2020, 3:23pm UTC](https://meta.discourse.org/t/creating-notifications-via-the-api/173769/5 "2020-12-17T15:23:24Z")

</div>

> [@Mevo](#):
>
> The plugin would receive the information and trigger notifications in Discourse? Notifications can be (more easily) done from a plugin?

I’m planning a similar plugin myself, centering my website non-email notifications around Discourse, which you can then subscribe to via MessageBus and have a central push notification configuration.

What I’m planning is just having a custom endpoint for creating custom notifications, after seeing these snippets I think it’s feasible.

For creating a custom notification:

> <https://github.com/discourse/discourse-code-review/blob/main/lib/discourse_code_review/state/commit_approval.rb#L168-L173>

For customizing how the notification item is displayed on the notification list:  
[https://github.com/discourse/discourse-code-review/blob/master/assets/javascripts/discourse/widgets/code-review-commit-approved-notification-item.js.es6](https://github.com/discourse/discourse-code-review/blob/master/assets/javascripts/discourse/widgets/code-review-commit-approved-notification-item.js.es6)

If there were a core API for creating the notification, I think this notification item widget could be done on a theme component, which would be even simpler.

---

_[View the full topic](https://meta.discourse.org/t/creating-notifications-via-the-api/173769)._
