DTO
This module is used to gather all Data Transfer Object definitions in the Novu SDK.
All definitions of format returned by the Novu API are here, which help us to instantiate and document them for developer purpose (instead of getting raw dict without any hint about what is in it).
- class novu.dto.ActivityGraphStatesDto(_id: str, count: int, templates: List[str], channels: List[Channel])
Definition of an activity graph states in Novu.
- class novu.dto.ActivityNotificationDto(_environment_id: str, _organization_id: str, transaction_id: str, created_at: str | None = None, channels: str | None = None, subscriber: DtoDescriptor[ActivityNotificationSubscriberResponseDTO] | None = None, template: DtoDescriptor[ActivityNotificationTemplateResponseDto] | None = None, jobs: DtoDescriptor[ActivityNotificationJobResponseDto] | None = None, _id: str | None = None)
Definition of the notification
- jobs: DtoDescriptor[ActivityNotificationJobResponseDto] | None = None
The jobs of the notification
- subscriber: DtoDescriptor[ActivityNotificationSubscriberResponseDTO] | None = None
The subscriber of the notification
- template: DtoDescriptor[ActivityNotificationTemplateResponseDto] | None = None
The template of the notification
- class novu.dto.ActivityNotificationExecutionDetailResponseDto(_id: str, _job_id: str, status: str, detail: str, is_retry: bool, is_test: bool, provider_id: dict, source: str, raw: str | None = None)
Definition of the execution of the notification
- class novu.dto.ActivityNotificationJobResponseDto(_id: str, provider_id: dict, status: str, step: DtoIterableDescriptor[ActivityNotificationStepResponseDto] = None, type: DtoDescriptor[ActivityNotificationTriggerResponseDto] = None, execution_details: DtoIterableDescriptor[ActivityNotificationExecutionDetailResponseDto] = None, digest: dict | None = None, payload: dict | None = None)
Definition of the job that executed the notification
- execution_details: DtoIterableDescriptor[ActivityNotificationExecutionDetailResponseDto] = None
The execution details of the job
- step: DtoIterableDescriptor[ActivityNotificationStepResponseDto] = None
The step of the job
- class novu.dto.ActivityNotificationStepResponseDto(_id: str, active: bool, filters: dict, template: dict | None = None)
Definition for the Notification for the Step Dto
- class novu.dto.ActivityNotificationSubscriberResponseDTO(_id: str, email: str | None = None, first_name: str | None = None, last_name: str | None = None, phone: str | None = None)
Definition of the specific response for an activity notification subscriber request.
- class novu.dto.ActivityNotificationTemplateResponseDto(name: str, triggers: DtoIterableDescriptor[ActivityNotificationTriggerResponseDto] = None, _id: str | None = None)
Definition of the template used to send the notification
- triggers: DtoIterableDescriptor[ActivityNotificationTriggerResponseDto] = None
The triggers for the template
- class novu.dto.ActivityNotificationTriggerResponseDto(type: str, identifier: str, variables: List[dict], subscriber_variables: List[dict] | None = None)
Definition of the triggers for the notifications
- class novu.dto.BlueprintDto(name: str, description: str, _id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, _notification_group_id: str | None = None, _creator_id: str | None = None, created_at: str | None = None, updated_at: str | None = None, deleted: bool | None = None, deleted_at: str | None = None, deleted_by: str | None = None, critical: bool | None = None, _parent_id: str | None = None, active: bool | None = None, blueprint_id: str | None = None, draft: bool | None = None, is_blueprint: bool | None = None, notification_group: object | None = None, preference_settings: object | None = None, steps: List[object] | None = None, tags: List[str] | None = None, triggers: List[object] | None = None)
Blueprint definition.
- class novu.dto.BulkResultSubscriberDto(created: DtoIterableDescriptor[SubscriberDto] = None, updated: DtoIterableDescriptor[SubscriberDto] = None, failed: DtoIterableDescriptor[SubscriberDto] = None)
Definition of paginated subscribers
- created: DtoIterableDescriptor[SubscriberDto] = None
List of subscribers that were created during the operation.
- failed: DtoIterableDescriptor[SubscriberDto] = None
List of subscribers whose creation (or update) failed.
- updated: DtoIterableDescriptor[SubscriberDto] = None
List of subscribers that were updated during the operation.
- class novu.dto.ChangeDetailDto(op: str | None = None, path: List[str] | None = None, val: Any | None = None)
Definition of a change detail
- class novu.dto.ChangeDto(_id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, _entity_id: str | None = None, _parent_id: str | None = None, enabled: bool | None = None, type: ChangeKind | None = None, change: DtoIterableDescriptor[ChangeDetailDto] = None, created_at: str | None = None, updated_at: str | None = None)
Definition of a change
- change: DtoIterableDescriptor[ChangeDetailDto] = None
Details about a change
- type: ChangeKind | None = None
Kind of change applied.
- class novu.dto.EnvironmentApiKeyDto(key: str, _user_id: str, _id: str | None = None)
Definition of an environment’s api-key
- class novu.dto.EnvironmentDto(id: str | None = None, _id: str | None = None, name: str | None = None, identifier: str | None = None, _organization_id: str | None = None, widget: DtoDescriptor[EnvironmentWidgetDto] = None, api_keys: DtoIterableDescriptor[EnvironmentApiKeyDto] = None, created_at: str | None = None, updated_at: str | None = None)
Definition of an environment
- api_keys: DtoIterableDescriptor[EnvironmentApiKeyDto] = None
List of API Keys related to the environment
- widget: DtoDescriptor[EnvironmentWidgetDto] = None
Environment’s widget settings
- class novu.dto.EnvironmentWidgetDto(notification_center_encryption: bool)
Definition of an environment’s widget
- class novu.dto.EventDto(acknowledged: bool, status: EventStatus, transaction_id: str)
Definition of an event
- status: EventStatus
Status for trigger.
- class novu.dto.ExecutionDetailDto(_id: str | None = None, _job_id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, _notification_id: str | None = None, _notification_template_id: str | None = None, _subscriber_id: str | None = None, _message_id: str | None = None, provider_id: str | None = None, transaction_id: str | None = None, channel: ChannelExtended | None = None, detail: str | None = None, source: ExecutionSource | None = None, status: ExecutionStatus | None = None, is_test: bool | None = None, is_retry: bool | None = None, raw: str | None = None, created_at: str | None = None, updated_at: str | None = None)
Definition of an execution detail
- _notification_template_id: str | None = None
Notification template ID in Novu internal storage system
- channel: ChannelExtended | None = None
Channel used to the execution (or logical step like digest or trigger)
- source: ExecutionSource | None = None
Source of the execution
- status: ExecutionStatus | None = None
Status of the execution
- class novu.dto.FeedDto(name: str, identifier: str | None = None, _id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, deleted: bool | None = None, created_at: str | None = None, updated_at: str | None = None, id: str | None = None)
Definition of a feed
- class novu.dto.FieldFilterPartDto(field: str, value: str, operator: FieldFilterPartOperator, on: FieldFilterPartOn, webhook_url: str | None = None, time_operator: FieldFilterPartTimeOperator | None = None)
Definition of a field filter part
- on: FieldFilterPartOn
On value of the field filter part
- operator: FieldFilterPartOperator
Operator of the field filter part
- time_operator: FieldFilterPartTimeOperator | None = None
Time operator, only set if the
onis set toFieldFilterPartOn.IS_ONLINE_IN_LAST
- class novu.dto.GroupedBlueprintDto(category: str, general: DtoIterableDescriptor[BlueprintDto] = None, popular: DtoIterableDescriptor[BlueprintDto] = None)
Grouped blueprint definition.
- general: DtoIterableDescriptor[BlueprintDto] = None
List of general blueprints in the category.
- popular: DtoIterableDescriptor[BlueprintDto] = None
List of popular blueprints in the category.
- class novu.dto.IntegrationChannelUsageDto(count: int | None, limit: int | None)
Definition of an integration usage (scoped to a channel)
- class novu.dto.IntegrationDto(provider_id: SmsProviderIdEnum | PushProviderIdEnum | ChatProviderIdEnum | EmailProviderIdEnum | InAppProviderIdEnum, channel: Channel, active: bool, credentials: Dict[CredentialsKeyEnum, str | bool] | None = None, _id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, created_at: str | None = None, updated_at: str | None = None, deleted_at: str | None = None, deleted_by: str | None = None, deleted: bool | None = None)
Definition of an integration
- camel_case_fields: ClassVar[List[str] | None] = ['provider_id', 'channel', 'credentials', 'active']
List of fields to define in the dict during
to_camel_case().If this list is not defined, we have taken all the fields from the data class.
- provider_id: SmsProviderIdEnum | PushProviderIdEnum | ChatProviderIdEnum | EmailProviderIdEnum | InAppProviderIdEnum
Provider ID, which is one of predefined available enum
- class novu.dto.LayoutDto(name: str, description: str, content: str, is_default: bool, variables: DtoIterableDescriptor[LayoutVariableDto] = None, _id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, _creator_id: str | None = None, content_type: str | None = None, channel: Channel | None = None, created_at: str | None = None, updated_at: str | None = None, is_deleted: bool | None = None)
Layout definition
- camel_case_fields: ClassVar[List[str] | None] = ['name', 'description', 'content', 'variables', 'is_default']
List of fields to define in the dict during
to_camel_case().If this list is not defined, we have taken all the fields from the data class.
- variables: DtoIterableDescriptor[LayoutVariableDto] = None
List of variables used in the layout
- class novu.dto.LayoutVariableDto(name: str, type: TemplateVariableTypeEnum, _id: str | None = None, required: bool = False, default_value: str | None = None)
Layout variable definition
- type: TemplateVariableTypeEnum
Layout variable type
- class novu.dto.MessageDto(identifier: str | None = None, _id: str | None = None, _template_id: str | None = None, _environment_id: str | None = None, _message_template_id: str | None = None, _organization_id: str | None = None, _subscriber_id: str | None = None, _job_id: str | None = None, template_identifier: str | None = None, email: str | None = None, subject: str | None = None, cta: dict | None = None, channel: Channel | None = None, content: str | None = None, provider_id: SmsProviderIdEnum | PushProviderIdEnum | ChatProviderIdEnum | EmailProviderIdEnum | InAppProviderIdEnum | None = None, device_tokens: List[dict] | None = None, seen: bool | None = None, read: bool | None = None, status: str | None = None, transaction_id: str | None = None, payload: dict | None = None, created_at: str | None = None, updated_at: str | None = None, deleted: bool | None = None, last_read_date: str | None = None, last_seen_date: str | None = None)
Definition of an event
- device_tokens: List[dict] | None = None
A list of device tokens used on the provider to send message
- provider_id: SmsProviderIdEnum | PushProviderIdEnum | ChatProviderIdEnum | EmailProviderIdEnum | InAppProviderIdEnum | None = None
Provider ID used for the message
- class novu.dto.NotificationGroupDto(name: str, _id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, _parent_id: str | None = None, created_at: str | None = None, updated_at: str | None = None)
Definition of a notification group
- class novu.dto.NotificationStepDto(_id: str | None = None, _template_id: str | None = None, _parent_id: str | None = None, active: bool | None = None, should_stop_on_fail: bool | None = None, template: dict | None = None, filters: DtoIterableDescriptor[StepFilterDto] = None, metadata: NotificationStepMetadataDto | None = None, replay_callback: dict | None = None)
Definition of a notification step
- _parent_id: str | None = None
Notification Step ID in Novu internal storage system (parent of this step)
- filters: DtoIterableDescriptor[StepFilterDto] = None
Filters of this template
- metadata: NotificationStepMetadataDto | None = None
Metadata of this notification step
- class novu.dto.NotificationStepMetadataDto(type: NotificationStepMetadataType, amount: int | None = None, unit: NotificationStepMetadataUnit | None = None, digest_key: str | None = None, delay_path: str | None = None, backoff_unit: NotificationStepMetadataUnit | None = None, update_mode: bool | None = None)
Definition of metadata for a notification step
- backoff_unit: NotificationStepMetadataUnit | None = None
The backoff unit of the notification step metadata
- delay_path: str | None = None
Payload path will determine the path in payload for the scheduled date.
That path must be included in your payload on trigger execution and must be a date in strict ISO format.
- digest_key: str | None = None
If specified, the digest engine will group the events based on the digestKey and subscriberId, otherwise the digest engine will group the events based only on the subscriberId.
The digest key might come useful when you want a particular subscriber to get events grouped on a custom field. For example when an actor likes the user’s post, you might want to digest based on the post_id key.
- type: NotificationStepMetadataType
Define the kind of metadata (regular, backoff or scheduled)
- unit: NotificationStepMetadataUnit | None = None
The unit of the notification step metadata
- class novu.dto.NotificationTemplateDto(name: str, description: str | None = None, tags: List[str] | None = None, steps: DtoIterableDescriptor[NotificationStepDto] = None, active: bool | None = None, critical: bool | None = None, draft: bool | None = None, preference_settings: DtoDescriptor[SubscriberPreferenceChannelDto] | None = None, triggers: DtoIterableDescriptor[NotificationTriggerDto] = None, _id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, _notification_group_id: str | None = None, _parent_id: str | None = None, _creator_id: str | None = None, notification_group: DtoDescriptor[NotificationGroupDto] | None = None, created_at: str | None = None, updated_at: str | None = None, deleted_at: str | None = None, deleted: bool | None = None)
Definition of a notification template
- notification_group: DtoDescriptor[NotificationGroupDto] | None = None
Notification group linked to the notification template
- preference_settings: DtoDescriptor[SubscriberPreferenceChannelDto] | None = None
Preference settings of the notification template
- steps: DtoIterableDescriptor[NotificationStepDto] = None
Steps of the template, which describe a step of your notification flow
- triggers: DtoIterableDescriptor[NotificationTriggerDto] = None
Usable triggers to launch this notification template
- class novu.dto.NotificationTemplateFormDto(name: str, notification_group_id: str, description: str | None = None, tags: List[str] | None = None, steps: DtoIterableDescriptor[NotificationStepDto] = None, active: bool | None = None, critical: bool | None = None, draft: bool | None = None, preference_settings: DtoDescriptor[SubscriberPreferenceChannelDto] | None = None)
Definition of a notification template form (create / update)
- preference_settings: DtoDescriptor[SubscriberPreferenceChannelDto] | None = None
Preference settings of the notification template
- steps: DtoIterableDescriptor[NotificationStepDto] = None
Steps of the template, which describe a step of your notification flow
- class novu.dto.NotificationTriggerDto(type: str, identifier: str, variables: DtoIterableDescriptor[NotificationTriggerVariableDto] = None, subscriber_variables: DtoIterableDescriptor[NotificationTriggerVariableDto] = None)
Definition of a trigger for a notification template
- subscriber_variables: DtoIterableDescriptor[NotificationTriggerVariableDto] = None
Subscriber’s variables of a notification trigger
- variables: DtoIterableDescriptor[NotificationTriggerVariableDto] = None
Variables of a notification trigger
- class novu.dto.NotificationTriggerVariableDto(name: str)
Definition of a trigger’s variable for notification template
- class novu.dto.PaginatedActivityNotificationDto(page: int = 0, has_more: bool = False, page_size: int = 0, data: DtoIterableDescriptor[ActivityNotificationDto] = None)
Definition of paginated subscribers
- data: DtoIterableDescriptor[ActivityNotificationDto] = None
Data
- class novu.dto.PaginatedChangeDto(page: int = 0, total_count: int = 0, page_size: int = 0, data: DtoIterableDescriptor[ChangeDto] = None)
Definition of paginated changes
- class novu.dto.PaginatedLayoutDto(page: int = 0, total_count: int = 0, page_size: int = 0, data: DtoIterableDescriptor[LayoutDto] = None)
Paginated layout definition
- class novu.dto.PaginatedMessageDto(page: int = 0, total_count: int = 0, page_size: int = 0, data: DtoIterableDescriptor[MessageDto] = None)
Paginated message definition
- data: DtoIterableDescriptor[MessageDto] = None
Data
- class novu.dto.PaginatedNotificationGroupDto(page: int = 0, total_count: int = 0, page_size: int = 0, data: DtoIterableDescriptor[NotificationGroupDto] = None)
Definition of paginated notification groups
- data: DtoIterableDescriptor[NotificationGroupDto] = None
Data
- class novu.dto.PaginatedNotificationTemplateDto(page: int = 0, total_count: int = 0, page_size: int = 0, data: DtoIterableDescriptor[NotificationTemplateDto] = None)
Definition of paginated subscribers
- data: DtoIterableDescriptor[NotificationTemplateDto] = None
Data
- class novu.dto.PaginatedSubscriberDto(page: int = 0, total_count: int = 0, page_size: int = 0, data: DtoIterableDescriptor[SubscriberDto] = None)
Definition of paginated subscribers
- data: DtoIterableDescriptor[SubscriberDto] = None
Data
- class novu.dto.PaginatedTenantDto(page: int = 0, has_more: bool = False, page_size: int = 0, data: DtoIterableDescriptor[TenantDto] = None)
Paginated topic definition
- class novu.dto.PaginatedTopicDto(page: int = 0, total_count: int = 0, page_size: int = 0, data: DtoIterableDescriptor[TopicDto] = None)
Paginated topic definition
- class novu.dto.StepFilterDto(is_negated: bool | None = None, type: StepFilterType | None = None, value: StepFilterValue | None = None, children: DtoIterableDescriptor[FieldFilterPartDto] = None)
Definition of a step filter
- children: DtoIterableDescriptor[FieldFilterPartDto] = None
Step filter’s children
- type: StepFilterType | None = None
Step filter’s type
- value: StepFilterValue | None = None
Step filter’s value
- class novu.dto.SubscriberChannelSettingsCredentialsDto(webhook_url: str | None = None, channel: str | None = None, device_tokens: List[str] | None = None)
Credentials payload for the specified provider.
- class novu.dto.SubscriberChannelSettingsDto(provider_id: SmsProviderIdEnum | PushProviderIdEnum | ChatProviderIdEnum | EmailProviderIdEnum | InAppProviderIdEnum, _integration_id: str, credentials: DtoDescriptor[SubscriberChannelSettingsCredentialsDto] = None, integration_identifier: str | None = None)
Definition of channel settings for subscriber.
- credentials: DtoDescriptor[SubscriberChannelSettingsCredentialsDto] = None
Credentials of this channel
- provider_id: SmsProviderIdEnum | PushProviderIdEnum | ChatProviderIdEnum | EmailProviderIdEnum | InAppProviderIdEnum
The provider identifier for the credentials
- class novu.dto.SubscriberDto(subscriber_id: str, email: str | None = None, first_name: str | None = None, last_name: str | None = None, phone: str | None = None, avatar: str | None = None, locale: str | None = None, _id: str | None = None, _environment_id: str | None = None, _organization_id: str | None = None, channels: DtoIterableDescriptor[SubscriberChannelSettingsDto] = None, deleted: bool | None = None, created_at: str | None = None, updated_at: str | None = None, is_online: bool | None = None, last_online_at: str | None = None)
Definition of subscriber
- camel_case_fields: ClassVar[List[str] | None] = ['subscriber_id', 'email', 'first_name', 'last_name', 'phone', 'avatar', 'locale', 'channels']
List of fields to define in the dict during
to_camel_case().If this list is not defined, we have taken all the fields from the data class.
- channels: DtoIterableDescriptor[SubscriberChannelSettingsDto] = None
Subscriber provider specific credentials
- class novu.dto.SubscriberPreferenceChannelDto(email: bool | None = True, sms: bool | None = True, in_app: bool | None = True, chat: bool | None = True, push: bool | None = True)
Definition of a channel activation state in subscriber’s preference
- class novu.dto.SubscriberPreferenceDto(preference: DtoDescriptor[SubscriberPreferencePreferenceDto] = None, template: DtoDescriptor[SubscriberPreferenceTemplateDto] = None)
Definition of subscriber’s preference
- preference: DtoDescriptor[SubscriberPreferencePreferenceDto] = None
Sub-struct in Novu for preference / global activation state
- template: DtoDescriptor[SubscriberPreferenceTemplateDto] = None
The identifiers of the template linked to the preferences and its criticality
- class novu.dto.SubscriberPreferencePreferenceDto(enabled: bool, channels: DtoDescriptor[SubscriberPreferenceChannelDto] = None)
Definition of subscriber’s preference sub-struct
- channels: DtoDescriptor[SubscriberPreferenceChannelDto] = None
The activation states of the different channels
- class novu.dto.SubscriberPreferenceTemplateDto(_id: str | None = None, name: str | None = None, critical: bool | None = None)
Definition of a template in subscriber’s preference
- class novu.dto.TenantDto(identifier: str, name: str, data: dict | None = None, _id: str | None = None, _environment_id: str | None = None, created_at: str | None = None, updated_at: str | None = None)
Tenant definition
- class novu.dto.TopicDto(key: str, name: str | None = None, _id: str | None = None, _organization_id: str | None = None, _environment_id: str | None = None, subscribers: List[str] | None = None)
Topic definition