/** * @example * { * url: "http://requestb.in/173lyyx1" * } */ export interface CreateWebhookRequest { /** Add authentication on webhook url */ auth?: CreateWebhookRequest.Auth; /** To send batched webhooks */ batched?: boolean; /** Channel of the webhook */ channel?: CreateWebhookRequest.Channel; /** Description of the webhook */ description?: string; /** * Inbound domain of webhook, required in case of event type * `inbound` */ domain?: string; /** * Events triggering the webhook. Required for transactional and * marketing types, optional for inbound type (defaults to * `inboundEmailProcessed`). Possible values for **Transactional** * type webhook: `sent` OR `request`, `delivered`, `hardBounce`, * `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, * `opened`, `uniqueOpened` and `unsubscribed`. Possible values for * **Marketing** type webhook: `spam`, `opened`, `click`, * `hardBounce`, `softBounce`, `unsubscribed`, `listAddition`, * `delivered`, `contactUpdated` & `contactDeleted`. Possible values * for **Inbound** type webhook: `inboundEmailProcessed`. */ events?: CreateWebhookRequest.Events.Item[]; /** Custom headers to be send with webhooks */ headers?: CreateWebhookRequest.Headers.Item[]; /** Type of the webhook */ type?: CreateWebhookRequest.Type; /** URL of the webhook */ url: string; } export declare namespace CreateWebhookRequest { /** * Add authentication on webhook url */ interface Auth { /** Webhook authentication token */ token?: string | undefined; /** Type of authentication */ type?: string | undefined; } /** Channel of the webhook */ const Channel: { readonly Email: "email"; readonly Sms: "sms"; }; type Channel = (typeof Channel)[keyof typeof Channel]; type Events = Events.Item[]; namespace Events { const Item: { readonly Sent: "sent"; readonly HardBounce: "hardBounce"; readonly SoftBounce: "softBounce"; readonly Blocked: "blocked"; readonly Spam: "spam"; readonly Delivered: "delivered"; readonly Request: "request"; readonly Click: "click"; readonly Invalid: "invalid"; readonly Deferred: "deferred"; readonly Opened: "opened"; readonly UniqueOpened: "uniqueOpened"; readonly Unsubscribed: "unsubscribed"; readonly ListAddition: "listAddition"; readonly ContactUpdated: "contactUpdated"; readonly ContactDeleted: "contactDeleted"; readonly InboundEmailProcessed: "inboundEmailProcessed"; readonly Reply: "reply"; }; type Item = (typeof Item)[keyof typeof Item]; } type Headers = Headers.Item[]; namespace Headers { interface Item { /** Header key name */ key?: string | undefined; /** Header value */ value?: string | undefined; } } /** Type of the webhook */ const Type: { readonly Transactional: "transactional"; readonly Marketing: "marketing"; readonly Inbound: "inbound"; }; type Type = (typeof Type)[keyof typeof Type]; }