> ## Documentation Index
> Fetch the complete documentation index at: https://docs.novu.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Message schema

> Reference the Novu message schema used in API requests and responses. Review fields, data types, and object structure for this resource.

### Message

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

| Field                | Type                      | Description                                                                                                          |
| -------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `id`                 | `string`                  | Unique identifier for the message                                                                                    |
| `templateId`         | `string`                  | Template ID associated with the message                                                                              |
| `environmentId`      | `string`                  | Environment ID where the message is sent                                                                             |
| `messageTemplateId`  | `string`                  | Message template ID                                                                                                  |
| `organizationId`     | `string`                  | Organization ID associated with the message                                                                          |
| `notificationId`     | `string`                  | Notification ID associated with the message                                                                          |
| `subscriberId`       | `string`                  | Subscriber ID associated with the message                                                                            |
| `subscriber`         | `SubscriberResponseDto`   | Subscriber details, if available                                                                                     |
| `template`           | `WorkflowResponse`        | Workflow template associated with the message                                                                        |
| `templateIdentifier` | `string`                  | Identifier for the message template                                                                                  |
| `createdAt`          | `string`                  | Creation date of the message                                                                                         |
| `deliveredAt`        | `string[]`                | Array of delivery dates for the message, if the message has multiple delivery dates, for example after being snoozed |
| `lastSeenDate`       | `string`                  | Last seen date of the message, if available                                                                          |
| `lastReadDate`       | `string`                  | Last read date of the message, if available                                                                          |
| `content`            | `string \| EmailBlock[]`  | Content of the message, can be an email block or a string                                                            |
| `transactionId`      | `string`                  | Transaction ID associated with the message                                                                           |
| `subject`            | `string`                  | Subject of the message, if applicable                                                                                |
| `channel`            | `ChannelTypeEnum`         | Channel type through which the message is sent                                                                       |
| `read`               | `boolean`                 | Indicates if the message has been read                                                                               |
| `seen`               | `boolean`                 | Indicates if the message has been seen                                                                               |
| `snoozedUntil`       | `string`                  | Date when the message will be unsnoozed                                                                              |
| `email`              | `string`                  | Email address associated with the message, if applicable                                                             |
| `phone`              | `string`                  | Phone number associated with the message, if applicable                                                              |
| `directWebhookUrl`   | `string`                  | Direct webhook URL for the message, if applicable                                                                    |
| `providerId`         | `string`                  | Provider ID associated with the message, if applicable                                                               |
| `deviceTokens`       | `string[]`                | Device tokens associated with the message, if applicable                                                             |
| `title`              | `string`                  | Title of the message, if applicable                                                                                  |
| `cta`                | `MessageCTAType`          | Call to action associated with the message                                                                           |
| `feedId`             | `string`                  | Feed ID associated with the message, if applicable                                                                   |
| `status`             | `MessageStatusEnum`       | Status of the message                                                                                                |
| `errorId`            | `string`                  | Error ID if the message has an error                                                                                 |
| `errorText`          | `string`                  | Error text if the message has an error                                                                               |
| `payload`            | `Record<string, unknown>` | The payload that was used to send the notification trigger                                                           |
| `overrides`          | `Record<string, unknown>` | Provider specific overrides used when triggering the notification                                                    |
| `contextKeys`        | `string[]`                | Context (single or multi) in which the message was sent                                                              |

### ChannelTypeEnum

```typescript theme={null}
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.

| Field                       | Type                           | Description |
| --------------------------- | ------------------------------ | ----------- |
| `id`                        | `string`                       |             |
| `name`                      | `string`                       |             |
| `description`               | `string`                       |             |
| `active`                    | `boolean`                      |             |
| `draft`                     | `boolean`                      |             |
| `preferenceSettings`        | `SubscriberPreferenceChannels` |             |
| `critical`                  | `boolean`                      |             |
| `tags`                      | `string[]`                     |             |
| `steps`                     | `NotificationStepDto[]`        |             |
| `organizationId`            | `string`                       |             |
| `creatorId`                 | `string`                       |             |
| `environmentId`             | `string`                       |             |
| `triggers`                  | `NotificationTrigger[]`        |             |
| `notificationGroupId`       | `string`                       |             |
| `parentId`                  | `string`                       |             |
| `deleted`                   | `boolean`                      |             |
| `deletedAt`                 | `string`                       |             |
| `deletedBy`                 | `string`                       |             |
| `notificationGroup`         | `NotificationGroup`            |             |
| `data`                      | `WorkflowResponseData`         |             |
| `workflowIntegrationStatus` | `WorkflowIntegrationStatus`    |             |

### Actor

Actor is the user who is skipped from sending the notification when workflow is triggered to a [topic](/platform/concepts/topics).

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

| Field          | Type                              | Description                                           |
| -------------- | --------------------------------- | ----------------------------------------------------- |
| `subscriberId` | `string`                          | Unique identifier of the subscriber                   |
| `firstName`    | `string \| null`                  | First name of the subscriber                          |
| `lastName`     | `string \| null`                  | Last name of the subscriber                           |
| `email`        | `string \| null`                  | Email address of the subscriber                       |
| `phone`        | `string \| null`                  | Phone number of the subscriber                        |
| `avatar`       | `string \| null`                  | Avatar URL or identifier                              |
| `locale`       | `string \| null`                  | Locale of the subscriber                              |
| `timezone`     | `string \| null`                  | Timezone of the subscriber                            |
| `data`         | `Record<string, unknown> \| null` | Additional custom data associated with the subscriber |

### MessageCTA

MessageCTA is a call to action that is displayed in the [Inbox](/platform/inbox) message. It can be used to redirect the user to a specific URL when the message is clicked.

| Field    | Type             | Description                               |
| -------- | ---------------- | ----------------------------------------- |
| `type`   | `redirect`       | Type of call to action                    |
| `data`   | `MessageCTAData` | Data associated with the call to action   |
| `action` | `MessageAction`  | Action associated with the call to action |
