Unsnooze a notification
Unsnooze a specific in-app (inbox) notification by its unique identifier notificationId.
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.subscribers.notifications.unsnooze({
subscriberId: "<id>",
notificationId: "<id>",
});
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Subscribers.Notifications.UnsnoozeAsync(
subscriberId: "<id>",
notificationId: "<id>"
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$response = $sdk->subscribers->notifications->unsnooze(
subscriberId: '<id>',
notificationId: '<id>'
);
if ($response->inboxNotificationDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.subscribers.notifications.unsnooze(subscriber_id="<id>", notification_id="<id>")
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.Subscribers.Notifications.Unsnooze(ctx, "<id>", "<id>", nil, nil)
if err != nil {
log.Fatal(err)
}
if res.InboxNotificationDto != nil {
// handle response
}
}curl --request PATCH \
--url https://api.novu.co/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze \
--header 'Authorization: <api-key>'const options = {method: 'PATCH', headers: {Authorization: '<api-key>'}};
fetch('https://api.novu.co/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.novu.co/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"transactionId": "<string>",
"body": "<string>",
"to": {
"id": "<string>",
"subscriberId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"avatar": "<string>"
},
"isRead": true,
"isSeen": true,
"isArchived": true,
"isSnoozed": true,
"createdAt": "<string>",
"subject": "<string>",
"snoozedUntil": "<string>",
"deliveredAt": [
"<string>"
],
"readAt": "<string>",
"firstSeenAt": "<string>",
"archivedAt": "<string>",
"avatar": "<string>",
"primaryAction": {
"label": "<string>",
"isCompleted": true,
"redirect": {
"url": "<string>"
}
},
"secondaryAction": {
"label": "<string>",
"isCompleted": true,
"redirect": {
"url": "<string>"
}
},
"tags": [
"<string>"
],
"data": {},
"redirect": {
"url": "<string>"
},
"workflow": {
"id": "<string>",
"identifier": "<string>",
"name": "<string>",
"critical": true,
"tags": [
"<string>"
],
"data": {}
}
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"errors": {
"fieldName1": {
"messages": [
"Field is required",
"Must be a valid email address"
],
"value": "invalidEmail"
},
"fieldName2": {
"messages": [
"Must be at least 18 years old"
],
"value": 17
},
"fieldName3": {
"messages": [
"Must be a boolean value"
],
"value": true
},
"fieldName4": {
"messages": [
"Must be a valid object"
],
"value": {
"key": "value"
}
},
"fieldName5": {
"messages": [
"Field is missing"
],
"value": null
},
"fieldName6": {
"messages": [
"Undefined value"
]
}
},
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"API rate limit exceeded"{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"Please wait some time, then try again."Authorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".
Headers
A header for idempotency purposes
Path Parameters
The identifier of the subscriber
The identifier of the notification
Query Parameters
Context keys for filtering
Response
OK
Unique identifier of the notification
Transaction identifier of the notification
Body content of the notification
Subscriber this notification was sent to
Show child attributes
Show child attributes
Whether the notification has been read
Whether the notification has been seen
Whether the notification has been archived
Whether the notification is snoozed
ISO timestamp when the notification was created
Channel type through which the message is sent
in_app, email, sms, chat, push Severity of the workflow
high, medium, low, none Subject of the notification
ISO timestamp when the notification will be unsnoozed
Timestamps when the notification was delivered
ISO timestamp when the notification was read
ISO timestamp when the notification was first seen
ISO timestamp when the notification was archived
Avatar URL for the notification
Primary action button for the notification
Show child attributes
Show child attributes
Secondary action button for the notification
Show child attributes
Show child attributes
Tags associated with the notification
Custom data payload of the notification
Redirect configuration for the notification
Show child attributes
Show child attributes
Workflow associated with the notification
Show child attributes
Show child attributes
Was this page helpful?
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.subscribers.notifications.unsnooze({
subscriberId: "<id>",
notificationId: "<id>",
});
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Subscribers.Notifications.UnsnoozeAsync(
subscriberId: "<id>",
notificationId: "<id>"
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$response = $sdk->subscribers->notifications->unsnooze(
subscriberId: '<id>',
notificationId: '<id>'
);
if ($response->inboxNotificationDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.subscribers.notifications.unsnooze(subscriber_id="<id>", notification_id="<id>")
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.Subscribers.Notifications.Unsnooze(ctx, "<id>", "<id>", nil, nil)
if err != nil {
log.Fatal(err)
}
if res.InboxNotificationDto != nil {
// handle response
}
}curl --request PATCH \
--url https://api.novu.co/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze \
--header 'Authorization: <api-key>'const options = {method: 'PATCH', headers: {Authorization: '<api-key>'}};
fetch('https://api.novu.co/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.novu.co/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"transactionId": "<string>",
"body": "<string>",
"to": {
"id": "<string>",
"subscriberId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"avatar": "<string>"
},
"isRead": true,
"isSeen": true,
"isArchived": true,
"isSnoozed": true,
"createdAt": "<string>",
"subject": "<string>",
"snoozedUntil": "<string>",
"deliveredAt": [
"<string>"
],
"readAt": "<string>",
"firstSeenAt": "<string>",
"archivedAt": "<string>",
"avatar": "<string>",
"primaryAction": {
"label": "<string>",
"isCompleted": true,
"redirect": {
"url": "<string>"
}
},
"secondaryAction": {
"label": "<string>",
"isCompleted": true,
"redirect": {
"url": "<string>"
}
},
"tags": [
"<string>"
],
"data": {},
"redirect": {
"url": "<string>"
},
"workflow": {
"id": "<string>",
"identifier": "<string>",
"name": "<string>",
"critical": true,
"tags": [
"<string>"
],
"data": {}
}
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"errors": {
"fieldName1": {
"messages": [
"Field is required",
"Must be a valid email address"
],
"value": "invalidEmail"
},
"fieldName2": {
"messages": [
"Must be at least 18 years old"
],
"value": 17
},
"fieldName3": {
"messages": [
"Must be a boolean value"
],
"value": true
},
"fieldName4": {
"messages": [
"Must be a valid object"
],
"value": {
"key": "value"
}
},
"fieldName5": {
"messages": [
"Field is missing"
],
"value": null
},
"fieldName6": {
"messages": [
"Undefined value"
]
}
},
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"API rate limit exceeded"{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"Please wait some time, then try again."