> ## 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.

# Topic schema

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

### Topic

Topic is a collection of subscribers that share a common interest. Subscriber can subscribe to multiple topics. When a subscriber is subscribed to a topic, they will receive notifications generated by workflows triggered to that topic.

| Field       | Type     | Description                         |
| ----------- | -------- | ----------------------------------- |
| `id`        | `string` | The identifier of the topic         |
| `key`       | `string` | The unique key of the topic         |
| `name`      | `string` | The name of the topic               |
| `createdAt` | `string` | The date the topic was created      |
| `updatedAt` | `string` | The date the topic was last updated |

### TopicSubscription

TopicSubscription is a relationship between a subscriber and a topic. It is used to track which subscribers are subscribed to which topics and when they subscribed. `createdAt` is the date and time the subscription was created.

| Field         | Type               | Description                                                                                                                          |
| ------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `id`          | `string`           | The internal ID generated by Novu for the subscription. Use this when referencing the subscription by its database ID.               |
| `identifier`  | `string`           | The user-supplied key provided when creating the subscription. Use this to look up or manage a specific subscription within a topic. |
| `createdAt`   | `string`           | The date and time the subscription was created                                                                                       |
| `topic`       | `TopicResponseDto` | Topic information                                                                                                                    |
| `subscriber`  | `SubscriberDto`    | Subscriber information                                                                                                               |
| `contextKeys` | `string[]`         | Context keys that scope this subscription (e.g., tenant:org-a, project:proj-123)                                                     |

### Subscriber

Subscriber is a user who can receive notifications. Read more about subscribers on [subscribers concept page](/platform/concepts/subscribers).

| Field            | Type                      | Description                                                                                                                                                         |
| ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`             | `string`                  | The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier. |
| `firstName`      | `string`                  | The first name of the subscriber.                                                                                                                                   |
| `lastName`       | `string`                  | The last name of the subscriber.                                                                                                                                    |
| `email`          | `string`                  | The email address of the subscriber.                                                                                                                                |
| `phone`          | `string`                  | The phone number of the subscriber.                                                                                                                                 |
| `avatar`         | `string`                  | The URL of the subscriber's avatar image.                                                                                                                           |
| `locale`         | `string`                  | The locale setting of the subscriber, indicating their preferred language or region.                                                                                |
| `channels`       | `ChannelSettingsDto[]`    | An array of channel settings associated with the subscriber.                                                                                                        |
| `topics`         | `string[]`                | An array of topics that the subscriber is subscribed to.                                                                                                            |
| `isOnline`       | `boolean`                 | Indicates whether the subscriber is currently online.                                                                                                               |
| `lastOnlineAt`   | `string`                  | The timestamp indicating when the subscriber was last online, in ISO 8601 format.                                                                                   |
| `v`              | `number`                  | The version of the subscriber document.                                                                                                                             |
| `data`           | `Record<string, unknown>` | Additional custom data for the subscriber                                                                                                                           |
| `timezone`       | `string`                  | Timezone of the subscriber                                                                                                                                          |
| `subscriberId`   | `string`                  | The identifier used to create this subscriber, which typically corresponds to the user ID in your system.                                                           |
| `organizationId` | `string`                  | The unique identifier of the organization to which the subscriber belongs.                                                                                          |
| `environmentId`  | `string`                  | The unique identifier of the environment associated with this subscriber.                                                                                           |
| `deleted`        | `boolean`                 | Indicates whether the subscriber has been deleted.                                                                                                                  |
| `createdAt`      | `string`                  | The timestamp indicating when the subscriber was created, in ISO 8601 format.                                                                                       |
| `updatedAt`      | `string`                  | The timestamp indicating when the subscriber was last updated, in ISO 8601 format.                                                                                  |
