Back to Novu

Topic schema

docs/api-reference/topics/topic-schema.mdx

3.19.03.5 KB
Original Source

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.

FieldTypeDescription
idstringThe identifier of the topic
keystringThe unique key of the topic
namestringThe name of the topic
createdAtstringThe date the topic was created
updatedAtstringThe 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.

FieldTypeDescription
idstringThe internal ID generated by Novu for the subscription. Use this when referencing the subscription by its database ID.
identifierstringThe user-supplied key provided when creating the subscription. Use this to look up or manage a specific subscription within a topic.
createdAtstringThe date and time the subscription was created
topicTopicResponseDtoTopic information
subscriberSubscriberDtoSubscriber information
contextKeysstring[]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.

FieldTypeDescription
idstringThe 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.
firstNamestringThe first name of the subscriber.
lastNamestringThe last name of the subscriber.
emailstringThe email address of the subscriber.
phonestringThe phone number of the subscriber.
avatarstringThe URL of the subscriber's avatar image.
localestringThe locale setting of the subscriber, indicating their preferred language or region.
channelsChannelSettingsDto[]An array of channel settings associated with the subscriber.
topicsstring[]An array of topics that the subscriber is subscribed to.
isOnlinebooleanIndicates whether the subscriber is currently online.
lastOnlineAtstringThe timestamp indicating when the subscriber was last online, in ISO 8601 format.
vnumberThe version of the subscriber document.
dataRecord<string, unknown>Additional custom data for the subscriber
timezonestringTimezone of the subscriber
subscriberIdstringThe identifier used to create this subscriber, which typically corresponds to the user ID in your system.
organizationIdstringThe unique identifier of the organization to which the subscriber belongs.
environmentIdstringThe unique identifier of the environment associated with this subscriber.
deletedbooleanIndicates whether the subscriber has been deleted.
createdAtstringThe timestamp indicating when the subscriber was created, in ISO 8601 format.
updatedAtstringThe timestamp indicating when the subscriber was last updated, in ISO 8601 format.