import { NonNullablePaths } from '@wix/sdk-types'; interface Campaign { /** * Campaign ID. * @format GUID */ campaignId?: string; /** Marketing campaign title. If you don't provide the value, the title automatically gets the value of an email subject. */ title?: string | null; /** * URL of the first image after the logo. * @format WEB_URL */ firstImageUrl?: string | null; /** Editor type. */ editorType?: CampaignEditorTypeEnumWithLiterals; /** Campaign status. */ status?: CampaignStatusEnumWithLiterals; /** Campaign visibility status. */ visibilityStatus?: CampaignVisibilityStatusEnumWithLiterals; /** Campaign distribution status. */ distributionStatus?: EnumWithLiterals; /** Publishing data. The field is returned empty if the campaign isn't published. */ publishingData?: PublishingData; /** Date and time when the campaign was created. */ dateCreated?: Date | null; /** Date and time when the campaign was updated. */ dateUpdated?: Date | null; /** * Email subject of the campaign (initially copied from the template). * @maxLength 1000 * @deprecated */ emailSubject?: string; } declare enum CampaignEditorTypeEnum { /** Unknown editor. This value isn't used. */ UNKNOWN = "UNKNOWN", /** Classic web editor. */ WEB = "WEB", /** Classic mobile editor. */ MOBILE = "MOBILE", /** Chat (AI) based web editor. */ MJML = "MJML" } /** @enumType */ type CampaignEditorTypeEnumWithLiterals = CampaignEditorTypeEnum | 'UNKNOWN' | 'WEB' | 'MOBILE' | 'MJML'; declare enum CampaignStatusEnum { /** Unknown campaign. This value isn't used. */ UNKNOWN = "UNKNOWN", /** Campaign is active. */ ACTIVE = "ACTIVE", /** Campaign is archived. */ ARCHIVED = "ARCHIVED", /** Campaign is deleted. */ DELETED = "DELETED" } /** @enumType */ type CampaignStatusEnumWithLiterals = CampaignStatusEnum | 'UNKNOWN' | 'ACTIVE' | 'ARCHIVED' | 'DELETED'; declare enum CampaignVisibilityStatusEnum { /** Unknown status. This value isn't used. */ UNKNOWN = "UNKNOWN", /** Campaign isn't published yet. */ DRAFT = "DRAFT", /** Campaign is published. */ PUBLISHED = "PUBLISHED", /** Campaign is a template. */ TEMPLATE = "TEMPLATE" } /** @enumType */ type CampaignVisibilityStatusEnumWithLiterals = CampaignVisibilityStatusEnum | 'UNKNOWN' | 'DRAFT' | 'PUBLISHED' | 'TEMPLATE'; declare enum Enum { /** Unknown distribution status. */ UNKNOWN = "UNKNOWN", /** Campaign isn't distributed to recipients yet. */ NOT_STARTED = "NOT_STARTED", /** Campaign is scheduled for distribution. */ SCHEDULED = "SCHEDULED", /** Campaign is in screening for malicious content. */ IN_DETECTION = "IN_DETECTION", /** Campaign is in review by the site moderators. */ IN_MODERATION = "IN_MODERATION", /** Several recipients are selected for campaign testing, and campaign is sent out to them. */ SAMPLING = "SAMPLING", /** Campaign is being sent out to all recipients. */ SENDING = "SENDING", /** Campaign is rejected. */ REJECTED = "REJECTED", /** Campaign is terminated after a failed sampling test. */ TERMINATED = "TERMINATED", /** Campaign is fully distributed to all recipients. */ DISTRIBUTED = "DISTRIBUTED", /** Scheduled campaign is paused. */ PAUSED = "PAUSED" } /** @enumType */ type EnumWithLiterals = Enum | 'UNKNOWN' | 'NOT_STARTED' | 'SCHEDULED' | 'IN_DETECTION' | 'IN_MODERATION' | 'SAMPLING' | 'SENDING' | 'REJECTED' | 'TERMINATED' | 'DISTRIBUTED' | 'PAUSED'; interface PublishingData { /** * Landing page URL. * @format WEB_URL */ landingPageUrl?: string; /** Marketing campaign statistics. */ statistics?: CampaignStatistics; /** Marketing campaign publish date. */ datePublished?: Date | null; } interface CampaignStatistics { /** Landing page statistics of a marketing campaign. */ landingPage?: LandingPageStatistics; /** Email distribution statistics of a marketing campaign. */ emailCampaign?: DistributionStatistics; /** Combined statistics of landing page and email distribution. */ total?: TotalStatistics; } interface LandingPageStatistics { /** Number of times when a landing page was loaded or viewed. */ opened?: number; /** Number of times a link was clicked in a landing page. */ clicked?: number; } interface DistributionStatistics { /** Number of delivered emails. */ delivered?: number; /** * Number of recipients who opened an email. * * If the same recipient opened the same email twice, it is counted as a one unique open. */ opened?: number; /** * Number of recipients who clicked a link in the email. * * If the same recipient clicked the same link twice, it is counted as a one unique click. * * If the same recipient clicked different links, it is counted as a one unique click. */ clicked?: number; /** Number of emails that didn't reach the recipient. */ bounced?: number; /** Number of recipients who reported the email as a spam. */ complained?: number; /** Number of emails that weren't sent due to the campaign termination. */ notSent?: number; } interface TotalStatistics { /** Total number of emails sent. */ mailsSent?: number; /** Number of landing page views and opened emails. */ opened?: number; /** Number of landing page and email link clicks. */ clicked?: number; } interface RejectionData { rejectionReasons?: RejectionReasonEnumWithLiterals[]; } declare enum RejectionReasonEnum { UNKNOWN = "UNKNOWN", LOW_ENGAGEMENT = "LOW_ENGAGEMENT", SENDER_DETAILS = "SENDER_DETAILS", SPAM_TRAPS = "SPAM_TRAPS", OTHER = "OTHER", ADULT_SEXUAL_CONTENT = "ADULT_SEXUAL_CONTENT", AFFILIATE_MARKETING = "AFFILIATE_MARKETING", BETTING_OR_GAMBLING = "BETTING_OR_GAMBLING", CREDIT_REPAIR_OR_DEBT_RELIEF = "CREDIT_REPAIR_OR_DEBT_RELIEF", GET_RICH_QUICK_SCHEME = "GET_RICH_QUICK_SCHEME", ILLEGAL_SUBSTANCES_OR_WEAPONS = "ILLEGAL_SUBSTANCES_OR_WEAPONS", MISLEADING_SUBJECT_LINE = "MISLEADING_SUBJECT_LINE", TRADING_OR_CRYPTOCURRENCIES = "TRADING_OR_CRYPTOCURRENCIES", UNSOLICITED_CONTENT = "UNSOLICITED_CONTENT", MAX_AUDIENCE_SIZE_EXCEEDED = "MAX_AUDIENCE_SIZE_EXCEEDED" } /** @enumType */ type RejectionReasonEnumWithLiterals = RejectionReasonEnum | 'UNKNOWN' | 'LOW_ENGAGEMENT' | 'SENDER_DETAILS' | 'SPAM_TRAPS' | 'OTHER' | 'ADULT_SEXUAL_CONTENT' | 'AFFILIATE_MARKETING' | 'BETTING_OR_GAMBLING' | 'CREDIT_REPAIR_OR_DEBT_RELIEF' | 'GET_RICH_QUICK_SCHEME' | 'ILLEGAL_SUBSTANCES_OR_WEAPONS' | 'MISLEADING_SUBJECT_LINE' | 'TRADING_OR_CRYPTOCURRENCIES' | 'UNSOLICITED_CONTENT' | 'MAX_AUDIENCE_SIZE_EXCEEDED'; declare enum CampaignSendingStateEnum { /** Campaign not yet published. */ DRAFT = "DRAFT", /** Campaign is being reviewed. */ REVIEW = "REVIEW", /** Campaign was rejected. */ REJECTED = "REJECTED", /** Campaign is scheduled. */ SCHEDULED = "SCHEDULED", /** Scheduled campaign was paused. */ PAUSED = "PAUSED", /** Campaign is published. */ PUBLISHED = "PUBLISHED", /** Campaign is being send. */ SENDING = "SENDING", /** * Campaign was partially sent. * Happens when too many recipients bounce. */ PARTIALLY_SENT = "PARTIALLY_SENT", /** Campaign was sent. */ SENT = "SENT" } /** @enumType */ type CampaignSendingStateEnumWithLiterals = CampaignSendingStateEnum | 'DRAFT' | 'REVIEW' | 'REJECTED' | 'SCHEDULED' | 'PAUSED' | 'PUBLISHED' | 'SENDING' | 'PARTIALLY_SENT' | 'SENT'; declare enum CampaignTypeEnum { UNKNOWN = "UNKNOWN", /** Email marketing campaign. */ EMAIL_MARKETING = "EMAIL_MARKETING", /** Mobile place invitation email. */ INVITATION = "INVITATION", /** Automation campaign. */ AUTOMATION = "AUTOMATION", /** Triggered email. */ TRIGGERED = "TRIGGERED" } /** @enumType */ type CampaignTypeEnumWithLiterals = CampaignTypeEnum | 'UNKNOWN' | 'EMAIL_MARKETING' | 'INVITATION' | 'AUTOMATION' | 'TRIGGERED'; interface GetPlaceholderKeysRequest { /** * Campaign ID. * @format GUID */ campaignId?: string; } interface GetPlaceholderKeysResponse { /** Keys of placeholders used in the campaign. */ placeholderKeys?: string[]; } interface GetDefaultComponentsRequest { } interface GetDefaultComponentsResponse { footer?: Record | null; logo?: Record | null; follow?: Record | null; } interface GetCampaignRequest { /** * Campaign ID. * @format GUID */ campaignId: string; /** * Whether a returned campaign should include `publishingData.statistics`. * * Default: `false`. */ optionIncludeStatistics?: boolean; } interface GetCampaignResponse { /** Campaign information. */ campaign?: Campaign; } interface ListCampaignsRequest { /** Paging parameters. */ paging?: Paging; /** * Whether to include `publishingData.statistics` in the returned campaign object. * * Default: `false`. */ optionIncludeStatistics?: boolean; /** Campaign status. */ statuses?: CampaignStatusEnumWithLiterals[]; /** Visibility status. */ visibilityStatuses?: CampaignVisibilityStatusEnumWithLiterals[]; } interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } /** Editor type. */ interface CampaignEditorType { value?: CampaignEditorTypeEnumWithLiterals; } interface ListCampaignsResponse { /** Paging parameters. */ paging?: Paging; /** List of campaigns. */ campaigns?: Campaign[]; } interface CountCampaignsRequest { /** Since when should we start counting (optional, default value "1970-01-01T00:00:00.000Z") */ dateFrom?: Date | null; } interface CountCampaignsResponse { /** "drafts" + "scheduled" + "published" (excluding "archived"). */ total?: number; /** Non published (draft) campaigns. */ drafts?: number; /** Campaigns scheduled for publishing in the future. */ scheduled?: number; /** Campaigns published or sent. */ published?: number; /** Campaigns moved to archive (regardless of the status). */ archived?: number; } interface CreateFromTemplateRequest { /** * ID of the template to fork. * @format GUID */ templateId?: string; /** Values to replace template placeholders with (unique for each template). */ variables?: Record; /** Campaign editor type. */ campaignEditorType?: CampaignEditorTypeEnumWithLiterals; } interface CreateFromTemplateResponse { /** Campaign information. */ campaign?: Campaign; } interface CreateUserTemplateRequest { /** * ID of campaign to create template from. * @format GUID */ campaignId?: string; /** * Title of template. * @maxLength 1000 */ title?: string | null; } interface CreateUserTemplateResponse { /** Created user template information. */ campaign?: Campaign; } interface CreateFromUserTemplateRequest { /** * ID of the user template campaign to use. * @format GUID */ campaignId?: string; } interface CreateFromUserTemplateResponse { /** Campaign created from user template. */ campaign?: Campaign; } interface PublishCampaignRequest { /** * Campaign ID * @format GUID */ campaignId: string; /** Email distribution options. Pass this object in the request if you need to distribute your marketing campaign with emails. */ emailDistributionOptions?: EmailDistributionOptions; } interface EmailDistributionOptions { /** * The subject line for the email campaign, which appears in recipients’ inboxes. * @maxLength 1000 */ emailSubject?: string | null; /** Contact label IDs. */ labelIds?: string[]; /** * IDs of contacts to whom to send out the campaign. * @format GUID */ contactIds?: string[]; /** * Filter ids to send campaign to (unsupported). * @format GUID * @deprecated Filter ids to send campaign to (unsupported). * @replacedBy contacts_filter * @targetRemovalDate 2023-10-10 */ filterIds?: string[]; /** Campaign scheduling. You can schedule the campaign no less than 30 minutes until the sending time. [Upgrade your plan](https://support.wix.com/en/article/email-marketing-upgrading-your-email-marketing-plan) to schedule the campaign. */ sendAt?: Date | null; } interface PublishCampaignResponse { /** Publishing info. */ publishingData?: PublishingData; } interface Rejected { /** * ID of the campaign that was rejected. * @format GUID */ campaignId?: string; } interface Published { /** * ID of the campaign that was published. * @format GUID */ campaignId?: string; /** * Campaign landing page URL. * @format WEB_URL * @maxLength 2048 */ landingPageUrl?: string; /** Estimation of recipient list size (optional). */ mailingListSizeEstimate?: number | null; } interface Terminated { /** * ID of the campaign that was terminated. * @format GUID */ campaignId?: string; } interface Distributed { /** * ID of the campaign that was distributed. * @format GUID */ campaignId?: string; } interface EmailActivityUpdated extends EmailActivityUpdatedEventTypeOneOf { /** Recipient clicked on an email. */ click?: Click; /** Recipient opened an email. */ open?: Open; /** * Email soft bounced when sent to a recipient. * * Indicates a temporary issue sending your email. For example, the email server receiving the email is under a heavy load. * For soft bounces, you should wait and try again at a later time. */ softBounce?: SoftBounce; /** * Email hard bounced when sent to a recipient. * * Indicates a permanent error sending your email. For example, the email address does not exist. */ hardBounce?: HardBounce; /** * Campaign ID. * @format GUID */ campaignId?: string; /** * [Contact ID](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-object) of a recipient. * @format GUID */ contactId?: string; /** * Email address of a recipient. * @format EMAIL */ recipientEmailAddress?: string; /** Date and time of the event. */ timestamp?: Date | null; activityType?: ActivityTypeWithLiterals; /** * email metadata * @maxSize 20 */ metadata?: Record; } /** @oneof */ interface EmailActivityUpdatedEventTypeOneOf { /** Recipient clicked on an email. */ click?: Click; /** Recipient opened an email. */ open?: Open; /** * Email soft bounced when sent to a recipient. * * Indicates a temporary issue sending your email. For example, the email server receiving the email is under a heavy load. * For soft bounces, you should wait and try again at a later time. */ softBounce?: SoftBounce; /** * Email hard bounced when sent to a recipient. * * Indicates a permanent error sending your email. For example, the email address does not exist. */ hardBounce?: HardBounce; } /** The type of email activity that triggered the webhook. */ declare enum ActivityType { /** Triggered when an email is delivered to the recipient. */ DELIVERY = "DELIVERY", /** Triggered when the recipient clicks on a URL inside of the email. */ CLICK = "CLICK", /** Triggered when the email is opened by the recipient. */ OPEN = "OPEN", /** Triggered when the email is bounced softly. */ SOFT_BOUNCE = "SOFT_BOUNCE", /** Triggered when the email bounces. */ HARD_BOUNCED = "HARD_BOUNCED" } /** @enumType */ type ActivityTypeWithLiterals = ActivityType | 'DELIVERY' | 'CLICK' | 'OPEN' | 'SOFT_BOUNCE' | 'HARD_BOUNCED'; interface Click { /** URL that was clicked. */ url?: string; /** Browser user agent of the recipient. */ userAgent?: string; } interface Open { /** Browser user agent of the recipient. */ userAgent?: string; } interface SoftBounce { /** Reason the email soft bounced. */ reason?: string; } interface HardBounce { /** Reason the email hard bounced. */ reason?: string; } interface Scheduled { /** * ID of the campaign that was scheduled. * @format GUID */ campaignId?: string; /** The timestamp campaign is scheduled for. */ sendAt?: Date | null; /** Shows if this is a rescheduling of previously scheduled campaign. */ rescheduled?: boolean; } interface SendTestRequest { /** * Campaign ID. * @format GUID */ campaignId: string; /** * Email subject. * @maxLength 1000 */ emailSubject?: string | null; /** * Recipient email address. * @format EMAIL */ toEmailAddress: string; } interface PlaceholderContent extends PlaceholderContentValueOneOf { text?: PlainText; html?: Html; money?: Money; dateTime?: DateTime; map?: Map; array?: _Array; enum?: PlaceholderContentEnum; attachment?: Attachment; integer?: Integer; decimal?: Decimal; localDate?: LocalDate; } /** @oneof */ interface PlaceholderContentValueOneOf { text?: PlainText; html?: Html; money?: Money; dateTime?: DateTime; map?: Map; array?: _Array; enum?: PlaceholderContentEnum; attachment?: Attachment; integer?: Integer; decimal?: Decimal; localDate?: LocalDate; } interface PlainText { text?: string; } interface Html { html?: string; } /** * Money. * Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003. */ interface Money { /** * Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. * @format DECIMAL_VALUE */ value?: string; /** * Currency code. Must be valid ISO 4217 currency code (e.g., USD). * @format CURRENCY */ currency?: string; /** Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. */ formattedValue?: string | null; } interface DateTime { timestamp?: Date | null; /** optional time zone is the full name. example: "Asia/Jerusalem" */ timeZone?: string | null; } interface Map { variables?: Record; } interface _Array { items?: PlaceholderContent[]; } interface PlaceholderContentEnum { value?: string; translation?: string; } interface Attachment { fileName?: string; downloadUrl?: string; } interface Integer { /** min value: -2147483648, max value: 2147483647 */ value?: number; } interface Decimal { /** * when converted from Double, has a limitation of max 16 digits (including fractional part) * highest possible value for precise representation is 9999999999999998 (9999999999999999 is represented as 10000000000000000) * @format DECIMAL_VALUE */ value?: string; } interface LocalDate { /** @format LOCAL_DATE */ value?: string; } interface SendTestResponse { } interface PauseSchedulingRequest { /** * Campaign ID. * @format GUID */ campaignId: string; } interface PauseSchedulingResponse { } interface Paused { /** * ID of the campaign that was paused. * @format GUID */ campaignId?: string; } interface RescheduleRequest { /** * ID of the campaign to reschedule. * @format GUID */ campaignId: string; /** New time for sending out the campaign. */ sendAt: Date | null; } interface RescheduleResponse { } interface ArchiveCampaignRequest { /** * ID of the campaign to archive. * @format GUID */ campaignId?: string; } interface ArchiveCampaignResponse { } /** Sent when status of the campaign is changed from "Active" to "Archived" */ interface Archived { /** * ID of the campaign that was archived. * @format GUID */ campaignId?: string; } interface UnarchiveCampaignRequest { /** * ID of the campaign to unarchive. * @format GUID */ campaignId?: string; } interface UnarchiveCampaignResponse { } /** Sent when status of the campaign is changed from "Archived" to "Active" */ interface Unarchived { /** * ID of the campaign whose status was changed to active. * @format GUID */ campaignId?: string; } interface UpdateTitleRequest { /** * ID of the campaign to change title of. * @format GUID */ campaignId?: string; /** * New title to set. * @maxLength 1000 */ title?: string; } interface UpdateTitleResponse { } interface DeleteCampaignRequest { /** * Campaign ID. * @format GUID */ campaignId: string; } interface DeleteCampaignResponse { } interface ReuseCampaignRequest { /** * ID of the message to be duplicated. * @format GUID */ campaignId: string; } interface ReuseCampaignResponse { /** Campaign information. */ campaign?: Campaign; } interface PreviewCampaignRequest { /** * ID of the campaign to preview. * @format GUID */ campaignId?: string; /** * Preferred language for campaign content (optional). * @format LANGUAGE */ language?: string | null; /** Values to replace campaign placeholders with (unique for each campaign). */ placeholders?: Record; /** Whether to hide the ad (default value "false"). */ forceHideAd?: boolean; /** * When true, unresolved placeholders are removed from the preview. * When false (default), unresolved placeholders remain visible. */ removeMissingPlaceholders?: boolean; } interface PreviewCampaignResponse { /** Preview HTML. */ html?: string; /** * Email subject with resolved dynamic parameters. * @maxLength 1000 */ emailSubject?: string; } interface GetComposerRequest { /** * Campaign ID. * @format GUID */ campaignId?: string; /** * Preferred language for campaign content (optional). * @format LANGUAGE */ language?: string | null; } interface GetComposerResponse { /** Composer. */ composer?: Composer; /** * Campaign subject. * @maxLength 1000 */ emailSubject?: string; /** * Campaign preheader (optional). * @maxLength 1000 */ emailPreheader?: string | null; } interface Composer { /** * Internal data structure for editor/viewer to render the campaign. * @maxLength 10000000 */ composerDataJson?: string; /** Default values of existing placeholders. */ defaultValues?: DefaultValues; } interface DefaultValues { /** @maxSize 500 */ map?: Record; } interface UpdateComposerRequest { /** * Campaign ID. * @format GUID */ campaignId?: string; /** Campaign composer. */ composer?: Composer; /** Campaign editor type (optional, default "WEB"). */ campaignEditorType?: CampaignEditorType; /** * Campaign subject (optional). * @maxLength 1000 */ emailSubject?: string | null; /** * Campaign preheader (optional). * @maxLength 1000 */ emailPreheader?: string | null; } interface UpdateComposerResponse { } interface CreateCampaignRequest { /** Campaign composer. */ composer?: Composer; /** Campaign editor type (optional, default "WEB"). */ campaignEditorType?: CampaignEditorType; /** * Campaign subject (optional). * @maxLength 1000 */ emailSubject?: string | null; /** * Campaign preheader (optional). * @maxLength 1000 */ emailPreheader?: string | null; } interface CreateCampaignResponse { /** Campaign information. */ campaign?: Campaign; } interface ResendToNonOpenersRequest { /** * ID of the campaign to resend. * @format GUID */ campaignId?: string; /** * Subject line to use with the resent copy of campaign. * @maxLength 1000 */ emailSubject?: string | null; } interface ResendToNonOpenersResponse { /** * ID of the newly created and resent campaign. * @format GUID */ campaignId?: string; } interface GetAudienceRequest { /** * Campaign ID. * @format GUID */ campaignId: string; } interface GetAudienceResponse { /** Campaign audience. */ audience?: CampaignAudience; } interface CampaignAudience { /** * IDs of contacts to whom to send the campaign. * @format GUID * @maxSize 100 */ contactIds?: string[]; /** * Labels IDs. * @maxLength 100 * @maxSize 20 */ labelIds?: string[]; /** * Segment IDs. * @format GUID * @maxSize 20 */ segmentIds?: string[]; /** Filter for contacts in JSON format. */ contactsFilter?: Record | null; /** * Contacts plain text search expression (searches in name, phone and email fields). * @minLength 1 * @maxLength 100 */ contactsSearchTerm?: string | null; /** Should "inactive" contacts be excluded or not. */ activeContactsOnly?: boolean; } interface IdentifySenderAddressRequest { /** * Email address to verify. * @format EMAIL * @minLength 6 * @maxLength 254 */ emailAddress: string; } interface IdentifySenderAddressResponse { /** * Actual "from" address that will be used for sending emails. * @format EMAIL * @minLength 6 * @maxLength 254 */ senderAddress?: string; } interface CopyUserTemplateToSiteRequest { /** * ID of the user template to copy. * @format GUID */ campaignId?: string; /** * ID of the target meta site where the user template will be copied. * @format GUID */ targetMetaSiteId?: string; } interface CopyUserTemplateToSiteResponse { /** * ID of the newly created user template in the target meta site. * @format GUID */ campaignId?: string; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } interface EstimateFilterSizeRequest { /** Contacts filter expression. */ filter?: Record | null; /** Should "inactive" contacts be excluded or not (default value "false"). */ activeContactsOnly?: boolean; /** * Contacts plain text search expression (searches in name, phone and email fields). * @minLength 1 * @maxLength 100 */ search?: string | null; } interface EstimateFilterSizeResponse { /** Mailing list size estimation. */ estimation?: number; } interface EstimateAudienceSizeRequest { /** * Contact IDs of a campaign audience. * @format GUID */ contactIds?: string[]; /** Label IDs of a campaign audience. */ labelIds?: string[]; /** Contacts filter expression (json). */ contactsFilter?: Record | null; /** * Contacts plain text search expression (searches in name, phone and email fields). * @minLength 1 * @maxLength 100 */ search?: string | null; /** * Segment ids of a campaign audience. * @format GUID */ segmentIds?: string[]; /** Should "inactive" contacts be excluded or not (default value "false"). */ activeContactsOnly?: boolean; /** * Id of a campaign that is to be resent. * @format GUID */ resendCampaignId?: string | null; /** Should total number of contacts in provided audience be returned or not (default value "false"). */ withTotal?: boolean; } interface EstimateAudienceSizeResponse { /** Audience size (estimated number of emails to be sent). */ estimation?: number; /** Total number of contacts in provided audience (optional). */ total?: number | null; } interface ReconcileContactRequest { /** * Email address of the contact. * @format EMAIL */ emailAddress?: string; } interface ReconcileContactResponse { /** Created or retrieved contact. */ contact?: Contact; } interface Contact { /** * Unique ID of the contact entity. * @format GUID */ _id?: string; /** * Primary email address of the contact. * @format EMAIL */ emailAddress?: string; /** * Full name of the contact (optional). * @maxLength 100 */ fullName?: string | null; /** * Profile picture of the contact (optional). * @format WEB_URL * @maxLength 2048 */ pictureUrl?: string | null; } interface SearchContactsRequest { /** * Text to search contacts by - can search by name or email address. * @maxLength 100 */ searchTerm?: string; /** Should "inactive" contacts be excluded or not (default value "false"). */ activeContactsOnly?: boolean; /** * Page size (default 50, max 1000). * @max 1000 */ pageSize?: number | null; } interface SearchContactsResponse { /** Search results. */ contacts?: Contact[]; } interface GetLabelsRequest { /** Should "inactive" contacts be excluded or not (default value "false"). */ activeContactsOnly?: boolean; } interface GetLabelsResponse { /** Returned labels with contact counts. */ labels?: Label[]; } interface Label { /** * Unique ID of the label entity. * @maxLength 100 */ _id?: string; /** * Name of the label. * @maxLength 100 */ name?: string; /** Amount of contacts assigned to the label. */ contactsCount?: number; } interface SubscribeFromLandingPageRequest { /** * Campaign ID that the subscription is happening from. * @format GUID */ campaignId?: string; /** * Email address that is entered into subscription field. * @format EMAIL */ emailAddress?: string; /** Did UoU explicitly consent to terms of use or not (optional, default value "false") */ consent?: boolean; } interface SubscribeFromLandingPageResponse { /** @format GUID */ contactId?: string; } interface ValidateLinkRequest { /** * URL to validate. * @minLength 1 */ url: string; } interface ValidateLinkResponse { /** Whether the link is valid. */ valid?: boolean; } interface ValidateHtmlLinksRequest { /** * HTML string with links. * @maxLength 1000000 */ html: string; } interface ValidateHtmlLinksResponse { /** Non-valid links. */ blacklistedLinks?: string[]; } interface GetCampaignMappingRequest { /** * rule ID in automations * @format GUID */ automationRuleId?: string; /** * template ID configured for the automation * @format GUID */ templateId?: string; } interface GetCampaignMappingResponse { /** @format GUID */ campaignId?: string; } interface UpsertTranslationRequest { /** * Campaign ID. * @format GUID */ campaignId?: string; /** Composer data. */ composer?: Composer; /** * Translation language (optional, default value "EN"). * @format LANGUAGE */ language?: string | null; /** * For BI event [36:1031] only (optional, default value "n/a"). * @format GUID */ automationRuleId?: string | null; /** Should campaign also be published or not (default value "false"). */ publish?: boolean; /** * Campaign subject (optional). * @maxLength 1000 */ emailSubject?: string | null; /** * Campaign preheader (optional). * @maxLength 1000 */ emailPreheader?: string | null; } interface UpsertTranslationResponse { } interface GetUsedPlaceholderKeysRequest { /** * Campaign ID. * @format GUID */ campaignId?: string; } interface GetUsedPlaceholderKeysResponse { /** * Keys of placeholders used in the automation. * @maxLength 200 * @maxSize 300 */ placeholderKeys?: string[]; } interface LookupCampaignMappingRequest { /** * rule ID in automations * @format GUID */ automationRuleId?: string; /** * template ID configured for the automation * @format GUID */ templateId?: string; } interface LookupCampaignMappingResponse { /** @format GUID */ campaignId?: string | null; } interface UpsertAutomationTranslatorContentRequest { /** * Campaign ID that the content belongs to * @format GUID */ campaignId?: string; /** Automation translator content */ automationTranslatorContent?: AutomationTranslatorContent; } /** Automation Translator Content */ interface AutomationTranslatorContent { /** * AutomationTranslatorContent ID * @minLength 1 * @maxLength 256 * @immutable */ _id?: string; /** * Content that can contain multiple strings. It represents a json file, that is stored on Smartling * @minLength 1 * @maxLength 800000 */ json?: string; } interface UpsertAutomationTranslatorContentResponse { } interface GetAutomationTranslatorContentRequest { /** * Campaign ID * @format GUID */ campaignId?: string; } interface GetAutomationTranslatorContentResponse { /** Automation translator content */ automationTranslatorContent?: AutomationTranslatorContent; } interface SendTestBulkRequest { /** * Campaign ID * @format GUID */ campaignId?: string; /** * Recipient email address * @format EMAIL */ toEmailAddress?: string; /** Values to replace campaign placeholders with (unique for each campaign) */ placeholders?: Record; /** * Sender from name * @maxLength 100 */ fromName?: string | null; /** * Reply-to email address * @format EMAIL */ replyToEmailAddress?: string | null; /** * Preferred language for campaign content (optional). If not provided, a test email for each campaign language is sent * @format LANGUAGE */ language?: string | null; } interface SendTestBulkResponse { } interface ListStatisticsRequest { /** * IDs of the campaigns to retrieve (max 100 campaigns). * @format GUID * @minSize 1 * @maxSize 100 */ campaignIds: string[]; } interface ListStatisticsResponse { /** List of statistics. */ statistics?: CampaignStatisticsContainer[]; } interface CampaignStatisticsContainer { /** * Campaign ID. * @format GUID */ campaignId?: string; /** Landing page statistics. */ landingPage?: LandingPageStatistics; /** Email campaign statistics. */ email?: DistributionStatistics; } interface ListRecipientsRequest { /** * Campaign ID. * @format GUID */ campaignId: string; /** Email activity to filter. */ activity: RecipientsActivityEnumWithLiterals; /** Pagination options. */ paging?: CursorPaging; } declare enum RecipientsActivityEnum { DELIVERED = "DELIVERED", OPENED = "OPENED", CLICKED = "CLICKED", BOUNCED = "BOUNCED", NOT_SENT = "NOT_SENT", SENT = "SENT", NOT_OPENED = "NOT_OPENED" } /** @enumType */ type RecipientsActivityEnumWithLiterals = RecipientsActivityEnum | 'DELIVERED' | 'OPENED' | 'CLICKED' | 'BOUNCED' | 'NOT_SENT' | 'SENT' | 'NOT_OPENED'; interface CursorPaging { /** * Number of items to load. * @max 1000 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get the relevant cursor token * from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 1000 */ cursor?: string | null; } interface ListRecipientsResponse { /** List of recipients. */ recipients?: CampaignRecipientDetails[]; /** Details on the paged set of returned results. */ pagingMetadata?: PagingMetadataV2; } interface CampaignRecipientDetails { /** * Contact ID. * @format GUID */ contactId?: string; /** Date and time of the last activity. */ lastActivityDate?: Date | null; /** * Primary email address of the contact. * @format EMAIL */ emailAddress?: string; /** * Full name of the contact (optional). * @maxLength 100 */ fullName?: string | null; /** Is this contact currently deleted from the site or not. */ contactDeleted?: boolean; } interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } /** @docsIgnore */ type PublishCampaignApplicationErrors = { code?: 'ALREADY_PUBLISHED'; description?: string; data?: Record; } | { code?: 'SCHEDULING_FEATURE_UNAVAILABLE'; description?: string; data?: Record; } | { code?: 'INVALID_SEND_AT'; description?: string; data?: Record; }; interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface CampaignDistributedEnvelope { data: Distributed; metadata: EventMetadata; } /** * Triggered when a campaign is successfully distributed to all recipients. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_campaign_distributed_event * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug campaign_distributed_event */ declare function onCampaignDistributedEvent(handler: (event: CampaignDistributedEnvelope) => void | Promise): void; interface CampaignPausedEnvelope { data: Paused; metadata: EventMetadata; } /** * Triggered when a scheduled campaign is paused. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_campaign_paused_event * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug campaign_paused_event */ declare function onCampaignPausedEvent(handler: (event: CampaignPausedEnvelope) => void | Promise): void; interface CampaignPublishedEnvelope { data: Published; metadata: EventMetadata; } /** * Triggered when a draft campaign is published. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_campaign_published_event * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug campaign_published_event */ declare function onCampaignPublishedEvent(handler: (event: CampaignPublishedEnvelope) => void | Promise): void; interface CampaignRejectedEnvelope { data: Rejected; metadata: EventMetadata; } /** * Triggered when a campaign is identified as abusive and rejected without sending emails to recipients. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_campaign_rejected_event * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug campaign_rejected_event */ declare function onCampaignRejectedEvent(handler: (event: CampaignRejectedEnvelope) => void | Promise): void; interface CampaignScheduledEnvelope { data: Scheduled; metadata: EventMetadata; } /** * Triggered when a campaign is scheduled to be sent out at the specific time. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_campaign_scheduled_event * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug campaign_scheduled_event */ declare function onCampaignScheduledEvent(handler: (event: CampaignScheduledEnvelope) => void | Promise): void; interface CampaignTerminatedEnvelope { data: Terminated; metadata: EventMetadata; } /** * Triggered when the mailing list isn't clean and campaign was terminated. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_campaign_terminated_event * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug campaign_terminated_event */ declare function onCampaignTerminatedEvent(handler: (event: CampaignTerminatedEnvelope) => void | Promise): void; interface CampaignCreatedEnvelope { entity: Campaign; metadata: EventMetadata; } /** * Triggered when a campaign is created. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_created * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug created */ declare function onCampaignCreated(handler: (event: CampaignCreatedEnvelope) => void | Promise): void; interface CampaignDeletedEnvelope { metadata: EventMetadata; } /** * Triggered when a campaign is deleted. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_deleted * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug deleted */ declare function onCampaignDeleted(handler: (event: CampaignDeletedEnvelope) => void | Promise): void; interface CampaignEmailActivityUpdatedEnvelope { data: EmailActivityUpdated; metadata: EventMetadata; } /** * Triggered when an email campaign has a new recipient activity. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Access Verticals by Automations * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionScope Read Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING * @permissionScope Manage Email Marketing * @permissionScopeId SCOPE.DC-PROMOTE.EMAIL-MARKETING * @permissionId Shoutout.Read * @webhook * @eventType wix.email_marketing.v1.campaign_email_activity_updated * @serviceIdentifier wix.emailmarketing.api.v1.CampaignService * @slug email_activity_updated */ declare function onCampaignEmailActivityUpdated(handler: (event: CampaignEmailActivityUpdatedEnvelope) => void | Promise): void; /** * Retrieves information about an email campaign. * @param campaignId - Campaign ID. * @public * @requiredField campaignId * @param options - Options to use when getting a campaign. * @permissionId Shoutout.Manage * @applicableIdentity APP * @returns Campaign information. * @fqn wix.emailmarketing.api.v1.CampaignService.Get */ declare function getCampaign(campaignId: string, options?: GetCampaignOptions): Promise>; interface GetCampaignOptions { /** * Whether a returned campaign should include `publishingData.statistics`. * * Default: `false`. */ optionIncludeStatistics?: boolean; } /** * Retrieves a list of email campaigns. * * Default sorts by `dateUpdated` in `DESC` order. * @public * @param options - Options to use when getting the list of campaigns. * @permissionId Shoutout.Read * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService.List */ declare function listCampaigns(options?: ListCampaignsOptions): Promise>; interface ListCampaignsOptions { /** Paging parameters. */ paging?: Paging; /** * Whether to include `publishingData.statistics` in the returned campaign object. * * Default: `false`. */ optionIncludeStatistics?: boolean; /** Campaign status. */ statuses?: CampaignStatusEnumWithLiterals[]; /** Visibility status. */ visibilityStatuses?: CampaignVisibilityStatusEnumWithLiterals[]; } /** * Publishes and sends a specified campaign. * * If the `email_distribution_options` object isn't passed in the request, the campaign is only published as a landing page. * @param campaignId - Campaign ID * @public * @requiredField campaignId * @param options - Options to use when publishing a campaign. * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService.Publish */ declare function publishCampaign(campaignId: string, options?: PublishCampaignOptions): Promise & { __applicationErrorsType?: PublishCampaignApplicationErrors; }>; interface PublishCampaignOptions { /** Email distribution options. Pass this object in the request if you need to distribute your marketing campaign with emails. */ emailDistributionOptions?: EmailDistributionOptions; } /** * Sends a test email. Call this method to preview your email campaign. * * We strongly recommend calling this method only a few times in a row, as there is a rate limit to prevent abuse of the Send Test method. * @param campaignId - Campaign ID. * @public * @requiredField campaignId * @requiredField options.toEmailAddress * @param options - Options for sending a test email. * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService.SendTest */ declare function sendTest(campaignId: string, options?: NonNullablePaths): Promise; interface SendTestOptions { /** * Email subject. * @maxLength 1000 */ emailSubject?: string | null; /** * Recipient email address. * @format EMAIL */ toEmailAddress: string; } /** * Pauses a scheduled campaign. * @param campaignId - Campaign ID. * @public * @requiredField campaignId * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService.PauseScheduling */ declare function pauseScheduling(campaignId: string): Promise; /** * Changes the sending time for an already scheduled campaign. * @param campaignId - ID of the campaign to reschedule. * @param sendAt - New time for sending out the campaign. * @public * @requiredField campaignId * @requiredField sendAt * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService.Reschedule */ declare function reschedule(campaignId: string, sendAt: Date): Promise; /** * Permanently deletes a campaign. * @param campaignId - Campaign ID. * @public * @requiredField campaignId * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService._delete */ declare function deleteCampaign(campaignId: string): Promise; /** * Creates a copy of an existing campaign. * @param campaignId - ID of the message to be duplicated. * @public * @requiredField campaignId * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService.Reuse */ declare function reuseCampaign(campaignId: string): Promise>; /** * Retrieves the audience of a paused campaign. Use this method to retrieve all selected audience of the paused campaign at once, so they can be passed in bulk when the campaign is published again after being paused. * @param campaignId - Campaign ID. * @public * @requiredField campaignId * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService.GetAudience */ declare function getAudience(campaignId: string): Promise>; /** * Checks if the sender's email address will be used as the "from" address or will it be replaced and to what exactly. * @param emailAddress - Email address to verify. * @public * @requiredField emailAddress * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignService.IdentifySenderAddress */ declare function identifySenderAddress(emailAddress: string): Promise>; /** * Validates any provided link. Call this method when you want to check whether the link complies with the abuse rules and can be used in a campaign. * * If you provide a link as a placeholder, it's returned in a response as valid. * @param url - URL to validate. * @public * @requiredField url * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignValidationService.ValidateLink */ declare function validateLink(url: string): Promise>; /** * Validates links that are inside the provided HTML. This method automatically takes out links from the HTML block and validates them. Call this method when you want to check whether the link complies with the abuse rules and can be used in a campaign. * @param html - HTML string with links. * @public * @requiredField html * @permissionId Shoutout.Manage * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignValidationService.ValidateHtmlLinks */ declare function validateHtmlLinks(html: string): Promise>; /** * Retrieves a list of statistics for up to 100 selected campaigns. * * For each campaign, you receive the total activity count for the campaign's landing page and email. For example, the total * amount of times the landing page was opened, or the total amount of email recipients that clicked a link in an email. * * Call List Campaigns to retrieve additional information for a site's campaigns. * Call List Recipients to retrieve a list of recipients and their activities related to a selected campaign. * @param campaignIds - IDs of the campaigns to retrieve (max 100 campaigns). * @public * @requiredField campaignIds * @permissionId Shoutout.Read * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignStatisticsService.ListStatistics */ declare function listStatistics(campaignIds: string[]): Promise>; /** * Retrieves a list of recipients for a selected campaign based on a specific recipient activity. * * Pages are returned with a maximum of 1,000 recipients per page and defaults to 40 recipients per page. * * Call List Statistics to retrieve a list of activity for selected campaigns. * Call List Campaigns to retrieve additional information for your campaigns. * * If no `activity` is included, this method returns an error. * @param campaignId - Campaign ID. * @param activity - Email activity to filter. * @public * @requiredField activity * @requiredField campaignId * @param options - Options to use when getting the list of recipients. * @permissionId Shoutout.Read * @applicableIdentity APP * @fqn wix.emailmarketing.api.v1.CampaignStatisticsService.ListRecipients */ declare function listRecipients(campaignId: string, activity: RecipientsActivityEnumWithLiterals, options?: ListRecipientsOptions): Promise>; interface ListRecipientsOptions { /** Pagination options. */ paging?: CursorPaging; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, ActivityType, type ActivityTypeWithLiterals, type ArchiveCampaignRequest, type ArchiveCampaignResponse, type Archived, type Attachment, type AutomationTranslatorContent, type BaseEventMetadata, type Campaign, type CampaignAudience, type CampaignCreatedEnvelope, type CampaignDeletedEnvelope, type CampaignDistributedEnvelope, type CampaignEditorType, CampaignEditorTypeEnum, type CampaignEditorTypeEnumWithLiterals, type CampaignEmailActivityUpdatedEnvelope, type CampaignPausedEnvelope, type CampaignPublishedEnvelope, type CampaignRecipientDetails, type CampaignRejectedEnvelope, type CampaignScheduledEnvelope, CampaignSendingStateEnum, type CampaignSendingStateEnumWithLiterals, type CampaignStatistics, type CampaignStatisticsContainer, CampaignStatusEnum, type CampaignStatusEnumWithLiterals, type CampaignTerminatedEnvelope, CampaignTypeEnum, type CampaignTypeEnumWithLiterals, CampaignVisibilityStatusEnum, type CampaignVisibilityStatusEnumWithLiterals, type Click, type Composer, type Contact, type CopyUserTemplateToSiteRequest, type CopyUserTemplateToSiteResponse, type CountCampaignsRequest, type CountCampaignsResponse, type CreateCampaignRequest, type CreateCampaignResponse, type CreateFromTemplateRequest, type CreateFromTemplateResponse, type CreateFromUserTemplateRequest, type CreateFromUserTemplateResponse, type CreateUserTemplateRequest, type CreateUserTemplateResponse, type CursorPaging, type Cursors, type DateTime, type Decimal, type DefaultValues, type DeleteCampaignRequest, type DeleteCampaignResponse, type Distributed, type DistributionStatistics, type DomainEvent, type DomainEventBodyOneOf, type EmailActivityUpdated, type EmailActivityUpdatedEventTypeOneOf, type EmailDistributionOptions, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, Enum, type EnumWithLiterals, type EstimateAudienceSizeRequest, type EstimateAudienceSizeResponse, type EstimateFilterSizeRequest, type EstimateFilterSizeResponse, type EventMetadata, type GetAudienceRequest, type GetAudienceResponse, type GetAutomationTranslatorContentRequest, type GetAutomationTranslatorContentResponse, type GetCampaignMappingRequest, type GetCampaignMappingResponse, type GetCampaignOptions, type GetCampaignRequest, type GetCampaignResponse, type GetComposerRequest, type GetComposerResponse, type GetDefaultComponentsRequest, type GetDefaultComponentsResponse, type GetLabelsRequest, type GetLabelsResponse, type GetPlaceholderKeysRequest, type GetPlaceholderKeysResponse, type GetUsedPlaceholderKeysRequest, type GetUsedPlaceholderKeysResponse, type HardBounce, type Html, type IdentificationData, type IdentificationDataIdOneOf, type IdentifySenderAddressRequest, type IdentifySenderAddressResponse, type Integer, type Label, type LandingPageStatistics, type ListCampaignsOptions, type ListCampaignsRequest, type ListCampaignsResponse, type ListRecipientsOptions, type ListRecipientsRequest, type ListRecipientsResponse, type ListStatisticsRequest, type ListStatisticsResponse, type LocalDate, type LookupCampaignMappingRequest, type LookupCampaignMappingResponse, type Map, type MessageEnvelope, type Money, type Open, type Paging, type PagingMetadataV2, type PauseSchedulingRequest, type PauseSchedulingResponse, type Paused, type PlaceholderContent, type PlaceholderContentEnum, type PlaceholderContentValueOneOf, type PlainText, type PreviewCampaignRequest, type PreviewCampaignResponse, type PublishCampaignApplicationErrors, type PublishCampaignOptions, type PublishCampaignRequest, type PublishCampaignResponse, type Published, type PublishingData, RecipientsActivityEnum, type RecipientsActivityEnumWithLiterals, type ReconcileContactRequest, type ReconcileContactResponse, type Rejected, type RejectionData, RejectionReasonEnum, type RejectionReasonEnumWithLiterals, type RescheduleRequest, type RescheduleResponse, type ResendToNonOpenersRequest, type ResendToNonOpenersResponse, type RestoreInfo, type ReuseCampaignRequest, type ReuseCampaignResponse, type Scheduled, type SearchContactsRequest, type SearchContactsResponse, type SendTestBulkRequest, type SendTestBulkResponse, type SendTestOptions, type SendTestRequest, type SendTestResponse, type SoftBounce, type SubscribeFromLandingPageRequest, type SubscribeFromLandingPageResponse, type Terminated, type TotalStatistics, type UnarchiveCampaignRequest, type UnarchiveCampaignResponse, type Unarchived, type UpdateComposerRequest, type UpdateComposerResponse, type UpdateTitleRequest, type UpdateTitleResponse, type UpsertAutomationTranslatorContentRequest, type UpsertAutomationTranslatorContentResponse, type UpsertTranslationRequest, type UpsertTranslationResponse, type ValidateHtmlLinksRequest, type ValidateHtmlLinksResponse, type ValidateLinkRequest, type ValidateLinkResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type _Array, deleteCampaign, getAudience, getCampaign, identifySenderAddress, listCampaigns, listRecipients, listStatistics, onCampaignCreated, onCampaignDeleted, onCampaignDistributedEvent, onCampaignEmailActivityUpdated, onCampaignPausedEvent, onCampaignPublishedEvent, onCampaignRejectedEvent, onCampaignScheduledEvent, onCampaignTerminatedEvent, pauseScheduling, publishCampaign, reschedule, reuseCampaign, sendTest, validateHtmlLinks, validateLink };