# 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:** 9

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [December 18, 2020, 10:26pm UTC](https://meta.discourse.org/t/creating-notifications-via-the-api/173769/9 "2020-12-18T22:26:57Z")

</div>

Thanks, @renato!

Here’s what I’ve got.

```ruby
Notification.create!(
  notification_type: Notification.types[:custom],
  user_id: 1,
  topic_id: nil,
  post_number: nil,
  high_priority: true,
  data: {
    message: 'pfaffmanager.title',
    display_username: 'pfaffman',
    topic_title: 'my title'
  }.to_json
)

```

I see the notication, but, predictably, (EDIT:) **NOTHING** happens if I click. Also (not obvious to me until I did it), the `message` is a `I18n`, not an arbitrary string. . . ). What I’d like is to be able to put the URL to the model that called it.

---

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