Retrieve an event
Retrieve an event by its unique key identifier notificationId. Here notificationId is of mongodbId type. This API returns the event details - execution logs, status, actual notification (message) generated by each workflow step.
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.notifications.retrieve("<id>");
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Notifications.RetrieveAsync(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->notifications->get(
notificationId: '<id>'
);
if ($response->activityNotificationResponseDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.notifications.retrieve(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.Notifications.Retrieve(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.ActivityNotificationResponseDto != nil {
// handle response
}
}curl --request GET \
--url https://api.novu.co/v1/notifications/{notificationId} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.novu.co/v1/notifications/{notificationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.novu.co/v1/notifications/{notificationId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v1/notifications/{notificationId}")
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{
"_environmentId": "<string>",
"_organizationId": "<string>",
"_subscriberId": "<string>",
"transactionId": "<string>",
"_id": "<string>",
"_templateId": "<string>",
"_digestedNotificationId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"channels": [],
"subscriber": {
"subscriberId": "<string>",
"_id": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>"
},
"template": {
"name": "<string>",
"triggers": [
{
"type": "event",
"identifier": "<string>",
"variables": [
{
"name": "<string>"
}
],
"subscriberVariables": [
{
"name": "<string>"
}
]
}
],
"_id": "<string>"
},
"jobs": [
{
"_id": "<string>",
"executionDetails": [
{
"_id": "<string>",
"detail": "<string>",
"isRetry": true,
"isTest": true,
"createdAt": "<string>",
"raw": "<string>"
}
],
"step": {
"_id": "<string>",
"active": true,
"filters": [
{
"isNegated": true,
"children": [
{
"field": "<string>",
"value": "<string>"
}
]
}
],
"_templateId": "<string>",
"replyCallback": {},
"controlVariables": {},
"metadata": {},
"issues": {},
"template": {},
"variants": "<array>",
"name": "<string>",
"_parentId": "<string>"
},
"status": "<string>",
"digest": {
"digestKey": "<string>",
"amount": 123,
"events": [
{}
],
"backoff": true,
"backoffAmount": 123,
"updateMode": true,
"timed": {
"atTime": "<string>",
"weekDays": [],
"monthDays": [
123
],
"cronExpression": "<string>",
"untilDate": "<string>"
}
},
"overrides": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"payload": {},
"updatedAt": "<string>",
"scheduleExtensionsCount": 123
}
],
"payload": {},
"tags": [
"<string>"
],
"controls": {},
"to": {},
"topics": [
{
"_topicId": "<string>",
"topicKey": "<string>"
}
],
"critical": true,
"contextKeys": [
"<string>"
]
}{
"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
Response
OK
Environment ID of the notification
Organization ID of the notification
Subscriber ID of the notification
Transaction ID of the notification
Unique identifier of the notification
Template ID of the notification
Digested Notification ID
Creation time of the notification
Last updated time of the notification
Type of the step
in_app, email, sms, chat, push, digest, trigger, delay, throttle, custom, http_request Subscriber of the notification
Show child attributes
Show child attributes
Template of the notification
Show child attributes
Show child attributes
Jobs of the notification
Show child attributes
Show child attributes
Payload of the notification
Tags associated with the notification
Controls associated with the notification
To field for subscriber definition
Topics of the notification
Show child attributes
Show child attributes
Severity of the workflow
high, medium, low, none Criticality of the notification
Context (single or multi) in which the notification was sent
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.notifications.retrieve("<id>");
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Notifications.RetrieveAsync(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->notifications->get(
notificationId: '<id>'
);
if ($response->activityNotificationResponseDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.notifications.retrieve(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.Notifications.Retrieve(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.ActivityNotificationResponseDto != nil {
// handle response
}
}curl --request GET \
--url https://api.novu.co/v1/notifications/{notificationId} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.novu.co/v1/notifications/{notificationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.novu.co/v1/notifications/{notificationId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v1/notifications/{notificationId}")
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{
"_environmentId": "<string>",
"_organizationId": "<string>",
"_subscriberId": "<string>",
"transactionId": "<string>",
"_id": "<string>",
"_templateId": "<string>",
"_digestedNotificationId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"channels": [],
"subscriber": {
"subscriberId": "<string>",
"_id": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>"
},
"template": {
"name": "<string>",
"triggers": [
{
"type": "event",
"identifier": "<string>",
"variables": [
{
"name": "<string>"
}
],
"subscriberVariables": [
{
"name": "<string>"
}
]
}
],
"_id": "<string>"
},
"jobs": [
{
"_id": "<string>",
"executionDetails": [
{
"_id": "<string>",
"detail": "<string>",
"isRetry": true,
"isTest": true,
"createdAt": "<string>",
"raw": "<string>"
}
],
"step": {
"_id": "<string>",
"active": true,
"filters": [
{
"isNegated": true,
"children": [
{
"field": "<string>",
"value": "<string>"
}
]
}
],
"_templateId": "<string>",
"replyCallback": {},
"controlVariables": {},
"metadata": {},
"issues": {},
"template": {},
"variants": "<array>",
"name": "<string>",
"_parentId": "<string>"
},
"status": "<string>",
"digest": {
"digestKey": "<string>",
"amount": 123,
"events": [
{}
],
"backoff": true,
"backoffAmount": 123,
"updateMode": true,
"timed": {
"atTime": "<string>",
"weekDays": [],
"monthDays": [
123
],
"cronExpression": "<string>",
"untilDate": "<string>"
}
},
"overrides": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"payload": {},
"updatedAt": "<string>",
"scheduleExtensionsCount": 123
}
],
"payload": {},
"tags": [
"<string>"
],
"controls": {},
"to": {},
"topics": [
{
"_topicId": "<string>",
"topicKey": "<string>"
}
],
"critical": true,
"contextKeys": [
"<string>"
]
}{
"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."