Retrieve subscriber notifications
Retrieve in-app (inbox) notifications for a subscriber by its unique key identifier subscriberId. Supports filtering by tags, read/archived/snoozed/seen state, data attributes, severity, date range, and context keys.
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.subscribers.notifications.list({
subscriberId: "<id>",
offset: 0,
createdGte: 1704067200000,
createdLte: 1735689599999,
});
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
using Novu.Models.Requests;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
SubscribersControllerGetSubscriberNotificationsRequest req = new SubscribersControllerGetSubscriberNotificationsRequest() {
SubscriberId = "<id>",
Offset = 0D,
CreatedGte = 1704067200000D,
CreatedLte = 1735689599999D,
};
var res = await sdk.Subscribers.Notifications.ListAsync(req);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Operations;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$request = new Operations\SubscribersControllerGetSubscriberNotificationsRequest(
subscriberId: '<id>',
offset: 0,
createdGte: 1704067200000,
createdLte: 1735689599999,
);
$response = $sdk->subscribers->notifications->list(
request: $request
);
if ($response->getSubscriberNotificationsResponseDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.subscribers.notifications.list(request={
"subscriber_id": "<id>",
"offset": 0,
"created_gte": 1704067200000,
"created_lte": 1735689599999,
})
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"github.com/novuhq/novu-go/v3/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.Subscribers.Notifications.List(ctx, operations.SubscribersControllerGetSubscriberNotificationsRequest{
SubscriberID: "<id>",
Offset: v3.Pointer[float64](0.0),
CreatedGte: v3.Pointer[float64](1704067200000.0),
CreatedLte: v3.Pointer[float64](1735689599999.0),
})
if err != nil {
log.Fatal(err)
}
if res.GetSubscriberNotificationsResponseDto != nil {
// handle response
}
}curl --request GET \
--url https://api.novu.co/v2/subscribers/{subscriberId}/notifications \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.novu.co/v2/subscribers/{subscriberId}/notifications', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.novu.co/v2/subscribers/{subscriberId}/notifications")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v2/subscribers/{subscriberId}/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"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": {}
}
}
],
"hasMore": true,
"filter": {}
}{
"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
Query Parameters
x <= 100Filter by read/unread state
Filter by archived state
Filter by snoozed state
Filter by seen state
Filter by data attributes (JSON string)
Filter by severity levels
high, medium, low, none Filter notifications created on or after this timestamp (Unix timestamp in milliseconds)
Filter notifications created on or before this timestamp (Unix timestamp in milliseconds)
Context keys for filtering notifications in multi-context scenarios
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.list({
subscriberId: "<id>",
offset: 0,
createdGte: 1704067200000,
createdLte: 1735689599999,
});
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
using Novu.Models.Requests;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
SubscribersControllerGetSubscriberNotificationsRequest req = new SubscribersControllerGetSubscriberNotificationsRequest() {
SubscriberId = "<id>",
Offset = 0D,
CreatedGte = 1704067200000D,
CreatedLte = 1735689599999D,
};
var res = await sdk.Subscribers.Notifications.ListAsync(req);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Operations;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$request = new Operations\SubscribersControllerGetSubscriberNotificationsRequest(
subscriberId: '<id>',
offset: 0,
createdGte: 1704067200000,
createdLte: 1735689599999,
);
$response = $sdk->subscribers->notifications->list(
request: $request
);
if ($response->getSubscriberNotificationsResponseDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.subscribers.notifications.list(request={
"subscriber_id": "<id>",
"offset": 0,
"created_gte": 1704067200000,
"created_lte": 1735689599999,
})
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"github.com/novuhq/novu-go/v3/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.Subscribers.Notifications.List(ctx, operations.SubscribersControllerGetSubscriberNotificationsRequest{
SubscriberID: "<id>",
Offset: v3.Pointer[float64](0.0),
CreatedGte: v3.Pointer[float64](1704067200000.0),
CreatedLte: v3.Pointer[float64](1735689599999.0),
})
if err != nil {
log.Fatal(err)
}
if res.GetSubscriberNotificationsResponseDto != nil {
// handle response
}
}curl --request GET \
--url https://api.novu.co/v2/subscribers/{subscriberId}/notifications \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.novu.co/v2/subscribers/{subscriberId}/notifications', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.novu.co/v2/subscribers/{subscriberId}/notifications")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v2/subscribers/{subscriberId}/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"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": {}
}
}
],
"hasMore": true,
"filter": {}
}{
"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."