Create notifications

POST {{baseUrl}}/notifications

Send a notification to one or multiple users. 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 firstname, customattributes, and more when creating a notification.

The new notification will be shown in the notification inbox of each recipient in real-time. It will also be delivered to each recipient through all channels you have enabled for your MagicBell project.

Request Body

{"notification"=>{"title"=>"<string>", "recipients"=>[{"email"=>"<string>", "external_id"=>"<string>", "matches"=>"<string>", "enim_7"=>-16509666, "eiusmod_f"=>false, "proident_85"=>true}, {"email"=>"<string>", "external_id"=>"<string>", "matches"=>"<string>"}], "content"=>"<string>", "action_url"=>"<uri>", "custom_attributes"=>{"reprehenderit5"=>true}, "category"=>"<string>", "topic"=>"<string>", "overrides"=>{"channels"=>{"in_app"=>{"title"=>"<string>", "content"=>"<string>", "action_url"=>"<string>"}, "email"=>{"title"=>"<string>", "content"=>"<string>", "action_url"=>"<string>"}, "web_push"=>{"title"=>"<string>", "content"=>"<string>", "action_url"=>"<string>"}, "mobile_push"=>{"title"=>"<string>", "content"=>"<string>", "action_url"=>"<string>"}}}}}

HEADERS

KeyDatatypeRequiredDescription
X-MAGICBELL-API-KEYstring(Required) The (public) API key of your MagicBell project.
X-MAGICBELL-API-SECRETstring(Required) The API secret of your MagicBell project.
Content-Typestring
Acceptstring

RESPONSES

status: Created

{&quot;notification&quot;:{&quot;id&quot;:&quot;\u003cstring\u003e&quot;,&quot;title&quot;:&quot;\u003cstring\u003e&quot;,&quot;sent_at&quot;:&quot;\u003cnumber\u003e&quot;,&quot;content&quot;:&quot;\u003cstring\u003e&quot;,&quot;action_url&quot;:&quot;\u003curi\u003e&quot;,&quot;category&quot;:&quot;\u003cstring\u003e&quot;,&quot;topic&quot;:&quot;\u003cstring\u003e&quot;,&quot;custom_attributes&quot;:{&quot;officia34b&quot;:&quot;officia mollit&quot;,&quot;anim3c&quot;:true}}}