Back to Novu

Message schema

docs/api-reference/messages/message-schema.mdx

3.19.05.2 KB
Original Source

Message

Message is a single notification that is sent to a subscriber. Each channel step in the workflow generates a message.

FieldTypeDescription
idstringUnique identifier for the message
templateIdstringTemplate ID associated with the message
environmentIdstringEnvironment ID where the message is sent
messageTemplateIdstringMessage template ID
organizationIdstringOrganization ID associated with the message
notificationIdstringNotification ID associated with the message
subscriberIdstringSubscriber ID associated with the message
subscriberSubscriberResponseDtoSubscriber details, if available
templateWorkflowResponseWorkflow template associated with the message
templateIdentifierstringIdentifier for the message template
createdAtstringCreation date of the message
deliveredAtstring[]Array of delivery dates for the message, if the message has multiple delivery dates, for example after being snoozed
lastSeenDatestringLast seen date of the message, if available
lastReadDatestringLast read date of the message, if available
contentstring | EmailBlock[]Content of the message, can be an email block or a string
transactionIdstringTransaction ID associated with the message
subjectstringSubject of the message, if applicable
channelChannelTypeEnumChannel type through which the message is sent
readbooleanIndicates if the message has been read
seenbooleanIndicates if the message has been seen
snoozedUntilstringDate when the message will be unsnoozed
emailstringEmail address associated with the message, if applicable
phonestringPhone number associated with the message, if applicable
directWebhookUrlstringDirect webhook URL for the message, if applicable
providerIdstringProvider ID associated with the message, if applicable
deviceTokensstring[]Device tokens associated with the message, if applicable
titlestringTitle of the message, if applicable
ctaMessageCTATypeCall to action associated with the message
feedIdstringFeed ID associated with the message, if applicable
statusMessageStatusEnumStatus of the message
errorIdstringError ID if the message has an error
errorTextstringError text if the message has an error
payloadRecord<string, unknown>The payload that was used to send the notification trigger
overridesRecord<string, unknown>Provider specific overrides used when triggering the notification
contextKeysstring[]Context (single or multi) in which the message was sent

ChannelTypeEnum

typescript
ChannelTypeEnum {
  IN_APP = "in_app",
  EMAIL = "email",
  SMS = "sms",
  CHAT = "chat",
  PUSH = "push"
}

Workflow

Workflow is a collection of steps that are executed in order to send a notification.

FieldTypeDescription
idstring
namestring
descriptionstring
activeboolean
draftboolean
preferenceSettingsSubscriberPreferenceChannels
criticalboolean
tagsstring[]
stepsNotificationStepDto[]
organizationIdstring
creatorIdstring
environmentIdstring
triggersNotificationTrigger[]
notificationGroupIdstring
parentIdstring
deletedboolean
deletedAtstring
deletedBystring
notificationGroupNotificationGroup
dataWorkflowResponseData
workflowIntegrationStatusWorkflowIntegrationStatus

Actor

Actor is the user who is skipped from sending the notification when workflow is triggered to a topic.

Actor can be a string (subscriber ID) or a SubscriberPayloadDto object with the following fields:

FieldTypeDescription
subscriberIdstringUnique identifier of the subscriber
firstNamestring | nullFirst name of the subscriber
lastNamestring | nullLast name of the subscriber
emailstring | nullEmail address of the subscriber
phonestring | nullPhone number of the subscriber
avatarstring | nullAvatar URL or identifier
localestring | nullLocale of the subscriber
timezonestring | nullTimezone of the subscriber
dataRecord<string, unknown> | nullAdditional custom data associated with the subscriber

MessageCTA

MessageCTA is a call to action that is displayed in the Inbox message. It can be used to redirect the user to a specific URL when the message is clicked.

FieldTypeDescription
typeredirectType of call to action
dataMessageCTADataData associated with the call to action
actionMessageActionAction associated with the call to action