SubscribersController_markActionAsSeen
import { Novu } from "@novu/api";
import { MarkMessageActionAsSeenDtoStatus } from "@novu/api/models/components";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.messages.updateAsSeen({
messageId: "<value>",
type: "<value>",
subscriberId: "<value>",
markMessageActionAsSeenDto: {
status: MarkMessageActionAsSeenDtoStatus.Done,
},
});
// Handle the result
console.log(result)
}
run();{
"_templateId": "<string>",
"_environmentId": "<string>",
"_messageTemplateId": "<string>",
"_organizationId": "<string>",
"_notificationId": "<string>",
"_subscriberId": "<string>",
"createdAt": "<string>",
"content": {
"content": "<string>",
"url": "<string>",
"styles": {}
},
"transactionId": "<string>",
"read": true,
"seen": true,
"cta": {
"data": {
"url": "<string>"
},
"type": "redirect",
"action": {
"buttons": [
{
"content": "<string>",
"resultContent": "<string>"
}
],
"result": {
"payload": {}
}
}
},
"errorId": "<string>",
"errorText": "<string>",
"payload": {},
"overrides": {},
"_id": "<string>",
"subscriber": {
"subscriberId": "<string>",
"_organizationId": "<string>",
"_environmentId": "<string>",
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"_id": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"avatar": "<string>",
"locale": "<string>",
"channels": [
{
"credentials": {
"webhookUrl": "<string>",
"channel": "<string>",
"deviceTokens": [
"<string>"
],
"alertUid": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"state": "<string>",
"externalUrl": "<string>"
},
"_integrationId": "<string>",
"integrationIdentifier": "<string>"
}
],
"isOnline": true,
"lastOnlineAt": "<string>",
"__v": 123
},
"template": {
"name": "<string>",
"description": "<string>",
"active": true,
"draft": true,
"preferenceSettings": {
"email": true,
"sms": true,
"in_app": true,
"chat": true,
"push": true
},
"critical": true,
"tags": [
"<string>"
],
"steps": [
{
"_id": "<string>",
"uuid": "<string>",
"name": "<string>",
"_templateId": "<string>",
"active": true,
"shouldStopOnFail": true,
"template": {},
"filters": [
{
"isNegated": true,
"children": [
{
"field": "<string>",
"value": "<string>"
}
]
}
],
"_parentId": {},
"metadata": {
"amount": 123,
"digestKey": "<string>",
"backoff": true,
"backoffAmount": 123,
"updateMode": true
},
"replyCallback": {},
"variants": {
"_id": "<string>",
"uuid": "<string>",
"name": "<string>",
"_templateId": "<string>",
"active": true,
"shouldStopOnFail": true,
"template": {},
"filters": [
{
"isNegated": true,
"children": [
{
"field": "<string>",
"value": "<string>"
}
]
}
],
"_parentId": {},
"metadata": {
"amount": 123,
"digestKey": "<string>",
"backoff": true,
"backoffAmount": 123,
"updateMode": true
},
"replyCallback": {}
}
}
],
"_organizationId": "<string>",
"_creatorId": "<string>",
"_environmentId": "<string>",
"triggers": [
{
"type": "event",
"identifier": "<string>",
"variables": [
{
"name": "<string>"
}
],
"subscriberVariables": [
{
"name": "<string>"
}
]
}
],
"_notificationGroupId": "<string>",
"deleted": true,
"deletedAt": "<string>",
"deletedBy": "<string>",
"_id": "<string>",
"_parentId": "<string>",
"notificationGroup": {
"name": "<string>",
"_environmentId": "<string>",
"_organizationId": "<string>",
"_id": "<string>",
"_parentId": "<string>"
},
"data": {},
"workflowIntegrationStatus": {}
},
"templateIdentifier": "<string>",
"lastSeenDate": "<string>",
"lastReadDate": "<string>",
"subject": "<string>",
"email": "<string>",
"phone": "<string>",
"directWebhookUrl": "<string>",
"providerId": "<string>",
"deviceTokens": [
"<string>"
],
"title": "<string>",
"_feedId": "<string>"
}Subscribers
Update notification action status
Update in-app (inbox) notification’s action status by its unique key identifier messageId and type field type. type field can be primary or secondary
POST
/
v1
/
subscribers
/
{subscriberId}
/
messages
/
{messageId}
/
actions
/
{type}
SubscribersController_markActionAsSeen
import { Novu } from "@novu/api";
import { MarkMessageActionAsSeenDtoStatus } from "@novu/api/models/components";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.messages.updateAsSeen({
messageId: "<value>",
type: "<value>",
subscriberId: "<value>",
markMessageActionAsSeenDto: {
status: MarkMessageActionAsSeenDtoStatus.Done,
},
});
// Handle the result
console.log(result)
}
run();{
"_templateId": "<string>",
"_environmentId": "<string>",
"_messageTemplateId": "<string>",
"_organizationId": "<string>",
"_notificationId": "<string>",
"_subscriberId": "<string>",
"createdAt": "<string>",
"content": {
"content": "<string>",
"url": "<string>",
"styles": {}
},
"transactionId": "<string>",
"read": true,
"seen": true,
"cta": {
"data": {
"url": "<string>"
},
"type": "redirect",
"action": {
"buttons": [
{
"content": "<string>",
"resultContent": "<string>"
}
],
"result": {
"payload": {}
}
}
},
"errorId": "<string>",
"errorText": "<string>",
"payload": {},
"overrides": {},
"_id": "<string>",
"subscriber": {
"subscriberId": "<string>",
"_organizationId": "<string>",
"_environmentId": "<string>",
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"_id": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"avatar": "<string>",
"locale": "<string>",
"channels": [
{
"credentials": {
"webhookUrl": "<string>",
"channel": "<string>",
"deviceTokens": [
"<string>"
],
"alertUid": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"state": "<string>",
"externalUrl": "<string>"
},
"_integrationId": "<string>",
"integrationIdentifier": "<string>"
}
],
"isOnline": true,
"lastOnlineAt": "<string>",
"__v": 123
},
"template": {
"name": "<string>",
"description": "<string>",
"active": true,
"draft": true,
"preferenceSettings": {
"email": true,
"sms": true,
"in_app": true,
"chat": true,
"push": true
},
"critical": true,
"tags": [
"<string>"
],
"steps": [
{
"_id": "<string>",
"uuid": "<string>",
"name": "<string>",
"_templateId": "<string>",
"active": true,
"shouldStopOnFail": true,
"template": {},
"filters": [
{
"isNegated": true,
"children": [
{
"field": "<string>",
"value": "<string>"
}
]
}
],
"_parentId": {},
"metadata": {
"amount": 123,
"digestKey": "<string>",
"backoff": true,
"backoffAmount": 123,
"updateMode": true
},
"replyCallback": {},
"variants": {
"_id": "<string>",
"uuid": "<string>",
"name": "<string>",
"_templateId": "<string>",
"active": true,
"shouldStopOnFail": true,
"template": {},
"filters": [
{
"isNegated": true,
"children": [
{
"field": "<string>",
"value": "<string>"
}
]
}
],
"_parentId": {},
"metadata": {
"amount": 123,
"digestKey": "<string>",
"backoff": true,
"backoffAmount": 123,
"updateMode": true
},
"replyCallback": {}
}
}
],
"_organizationId": "<string>",
"_creatorId": "<string>",
"_environmentId": "<string>",
"triggers": [
{
"type": "event",
"identifier": "<string>",
"variables": [
{
"name": "<string>"
}
],
"subscriberVariables": [
{
"name": "<string>"
}
]
}
],
"_notificationGroupId": "<string>",
"deleted": true,
"deletedAt": "<string>",
"deletedBy": "<string>",
"_id": "<string>",
"_parentId": "<string>",
"notificationGroup": {
"name": "<string>",
"_environmentId": "<string>",
"_organizationId": "<string>",
"_id": "<string>",
"_parentId": "<string>"
},
"data": {},
"workflowIntegrationStatus": {}
},
"templateIdentifier": "<string>",
"lastSeenDate": "<string>",
"lastReadDate": "<string>",
"subject": "<string>",
"email": "<string>",
"phone": "<string>",
"directWebhookUrl": "<string>",
"providerId": "<string>",
"deviceTokens": [
"<string>"
],
"title": "<string>",
"_feedId": "<string>"
}Enter your API key in the
Authorization field like the example shown below:E.g ApiKey 18d2e625f05d80eAuthorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
Body
application/json
Response
Created
Show child attributes
Show child attributes
Available options:
in_app, email, sms, chat, push Show child attributes
Show child attributes
Available options:
sent, error, warning The payload that was used to send the notification trigger
Provider specific overrides used when triggering the notification
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I