mailchannels-sdk 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/mailchannels-js/SKILL.md +91 -0
- package/.agents/skills/mailchannels-js/resources/attachments.md +113 -0
- package/.agents/skills/mailchannels-js/resources/clients-and-transport.md +98 -0
- package/.agents/skills/mailchannels-js/resources/custom-headers.md +64 -0
- package/.agents/skills/mailchannels-js/resources/custom-tracking-domains.md +83 -0
- package/.agents/skills/mailchannels-js/resources/dkim.md +148 -0
- package/.agents/skills/mailchannels-js/resources/domain-checks.md +100 -0
- package/.agents/skills/mailchannels-js/resources/error-handling.md +143 -0
- package/.agents/skills/mailchannels-js/resources/metrics-and-usage.md +114 -0
- package/.agents/skills/mailchannels-js/resources/overview.md +91 -0
- package/.agents/skills/mailchannels-js/resources/sending.md +221 -0
- package/.agents/skills/mailchannels-js/resources/sub-accounts.md +129 -0
- package/.agents/skills/mailchannels-js/resources/suppressions.md +91 -0
- package/.agents/skills/mailchannels-js/resources/templates.md +97 -0
- package/.agents/skills/mailchannels-js/resources/testing.md +95 -0
- package/.agents/skills/mailchannels-js/resources/unsubscribe.md +73 -0
- package/.agents/skills/mailchannels-js/resources/webhooks.md +174 -0
- package/README.md +70 -4
- package/dist/_chunks/simulator.mjs +111 -23
- package/dist/mailchannels.d.mts +853 -561
- package/dist/mailchannels.mjs +861 -457
- package/package.json +10 -9
package/dist/mailchannels.d.mts
CHANGED
|
@@ -62,6 +62,11 @@ interface ErrorResponse {
|
|
|
62
62
|
* This field is intended for diagnostic use only and should not be relied upon.
|
|
63
63
|
*/
|
|
64
64
|
type: ErrorType;
|
|
65
|
+
/**
|
|
66
|
+
* An object containing the response, if available.
|
|
67
|
+
* This field may be `null` if no response is available or if the error is not related to an HTTP request or if the response is not a JSON object.
|
|
68
|
+
*/
|
|
69
|
+
response: Record<string, unknown> | null;
|
|
65
70
|
}
|
|
66
71
|
interface SuccessResponse {
|
|
67
72
|
/**
|
|
@@ -129,6 +134,12 @@ interface EmailsSendTracking {
|
|
|
129
134
|
* Track when a recipient clicks a link in your email.
|
|
130
135
|
*/
|
|
131
136
|
click?: {
|
|
137
|
+
/**
|
|
138
|
+
* The name of a configured active click tracking domain.
|
|
139
|
+
* When specified, click tracking links will use this domain instead of the default MailChannels domain.
|
|
140
|
+
* The domain must be registered in your account and have an active status.
|
|
141
|
+
*/
|
|
142
|
+
customDomainName?: string;
|
|
132
143
|
/**
|
|
133
144
|
* @default false
|
|
134
145
|
*/
|
|
@@ -138,6 +149,12 @@ interface EmailsSendTracking {
|
|
|
138
149
|
* Track when a recipient opens your email. Please note that some email clients may not support open tracking.
|
|
139
150
|
*/
|
|
140
151
|
open?: {
|
|
152
|
+
/**
|
|
153
|
+
* The name of a configured active open tracking domain.
|
|
154
|
+
* When specified, the open tracking pixel will use this domain instead of the default MailChannels domain.
|
|
155
|
+
* The domain must be registered in your account and have an active status.
|
|
156
|
+
*/
|
|
157
|
+
customDomainName?: string;
|
|
141
158
|
/**
|
|
142
159
|
* @default false
|
|
143
160
|
*/
|
|
@@ -360,10 +377,21 @@ interface EmailsSendOptionsBase {
|
|
|
360
377
|
/**
|
|
361
378
|
* Mark these messages as transactional or non-transactional. In order for a message to be marked as non-transactional, it must have exactly one recipient per personalization, and it must be DKIM signed. 400 Bad Request will be returned if there are more than one recipient in any personalization for non-transactional messages. If a message is marked as non-transactional, it changes the sending process as follows:
|
|
362
379
|
*
|
|
363
|
-
* List-Unsubscribe headers will be added.
|
|
380
|
+
* List-Unsubscribe and List-Unsubscribe-Post headers will be added, unless you supply your own List-Unsubscribe header, in which case yours is used and neither is added.
|
|
364
381
|
* @default true
|
|
365
382
|
*/
|
|
366
383
|
transactional?: boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Settings to customize the unsubscribe experience for the message.
|
|
386
|
+
*/
|
|
387
|
+
unsubscribe?: {
|
|
388
|
+
/**
|
|
389
|
+
* The name of a configured active unsubscribe tracking domain.
|
|
390
|
+
* When specified, unsubscribe links will use this domain instead of the default MailChannels domain.
|
|
391
|
+
* The domain must be registered in your account and have an active status.
|
|
392
|
+
*/
|
|
393
|
+
customDomainName?: string;
|
|
394
|
+
};
|
|
367
395
|
}
|
|
368
396
|
type EmailsSendTargetOptions = {
|
|
369
397
|
personalizations: (Omit<EmailsSendPersonalization, "template"> & {
|
|
@@ -474,6 +502,7 @@ type EmailsQueueResponse = DataResponse<{
|
|
|
474
502
|
*/
|
|
475
503
|
requestId: string;
|
|
476
504
|
}>;
|
|
505
|
+
/** @deprecated Use `EmailsQueueResponse` instead. */
|
|
477
506
|
type EmailsSendAsyncResponse = EmailsQueueResponse;
|
|
478
507
|
declare class Emails {
|
|
479
508
|
protected mailchannels: MailChannelsClient;
|
|
@@ -584,98 +613,6 @@ interface DomainsDkimKey {
|
|
|
584
613
|
statusModifiedAt?: string;
|
|
585
614
|
}
|
|
586
615
|
type DomainsDkimCreateResponse = DataResponse<DomainsDkimKey>;
|
|
587
|
-
interface DomainsCheck {
|
|
588
|
-
/**
|
|
589
|
-
* Domain used for DKIM signing.
|
|
590
|
-
*/
|
|
591
|
-
domain?: string;
|
|
592
|
-
/**
|
|
593
|
-
* DKIM private key encoded in Base64.
|
|
594
|
-
*/
|
|
595
|
-
privateKey?: string;
|
|
596
|
-
/**
|
|
597
|
-
* DKIM selector in the domain DNS records.
|
|
598
|
-
*/
|
|
599
|
-
selector?: string;
|
|
600
|
-
}
|
|
601
|
-
interface DomainsCheckOptions {
|
|
602
|
-
/**
|
|
603
|
-
* Each item may include DKIM `domain`, `selector` and `privateKey`. Up to 10 items are allowed. The absence or presence of these fields affects how DKIM settings are validated:
|
|
604
|
-
* 1. If `domain`, `selector`, and `privateKey` are all present, verify using the provided domain, selector, and key.
|
|
605
|
-
* 2. If `domain` and `selector` are present, use the stored private key for the given domain and selector.
|
|
606
|
-
* 3. If only `domain` is present, use all stored keys for the given domain.
|
|
607
|
-
* 4. If none are present, use all stored keys for the `domain` provided in the domain field of the request.
|
|
608
|
-
* 5. If `privateKey` is present, `selector` must be present.
|
|
609
|
-
* 6. If `selector` is present and `domain` is not, the domain will be taken from the domain field of the request.
|
|
610
|
-
*/
|
|
611
|
-
dkim?: DomainsCheck[] | DomainsCheck;
|
|
612
|
-
/**
|
|
613
|
-
* Used exclusively for [Domain Lockdown](https://support.mailchannels.com/hc/en-us/articles/16918954360845-Secure-your-domain-name-against-spoofing-with-Domain-Lockdown) verification. If you're not using senderid to associate your domain with your account, you can disregard this field. The corresponding value is included in the `X-MailChannels-SenderId` header of emails sent via MailChannels.
|
|
614
|
-
*/
|
|
615
|
-
senderId?: string;
|
|
616
|
-
}
|
|
617
|
-
type DomainsCheckVerdict = "passed" | "failed" | "soft failed" | "temporary error" | "permanent error" | "neutral" | "none" | "unknown";
|
|
618
|
-
type DomainsCheckResponse = DataResponse<{
|
|
619
|
-
dkim: {
|
|
620
|
-
domain: string;
|
|
621
|
-
/**
|
|
622
|
-
* The human readable status of the DKIM key used for verification.
|
|
623
|
-
*/
|
|
624
|
-
keyStatus?: DomainsDkimKey["status"] | "provided";
|
|
625
|
-
selector: string;
|
|
626
|
-
/**
|
|
627
|
-
* A human-readable explanation of DKIM check.
|
|
628
|
-
*/
|
|
629
|
-
reason?: string;
|
|
630
|
-
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
631
|
-
}[];
|
|
632
|
-
domainLockdown: {
|
|
633
|
-
/**
|
|
634
|
-
* A human-readable explanation of Domain Lockdown check.
|
|
635
|
-
*/
|
|
636
|
-
reason?: string;
|
|
637
|
-
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
638
|
-
};
|
|
639
|
-
/**
|
|
640
|
-
* These results are here to help avoid [SDNF](https://support.mailchannels.com/hc/en-us/articles/203155500-550-5-2-1-SDNF-Sender-Domain-Not-Found) (Sender Domain Not Found) blocks. For messages not to get blocked by SDNF, we require either an MX or A record to exist for the sender domain.
|
|
641
|
-
*/
|
|
642
|
-
senderDomain: {
|
|
643
|
-
a: {
|
|
644
|
-
/**
|
|
645
|
-
* A human-readable explanation of A record check.
|
|
646
|
-
*/
|
|
647
|
-
reason?: string;
|
|
648
|
-
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
649
|
-
};
|
|
650
|
-
mx: {
|
|
651
|
-
/**
|
|
652
|
-
* A human-readable explanation of MX record check.
|
|
653
|
-
*/
|
|
654
|
-
reason?: string;
|
|
655
|
-
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
656
|
-
};
|
|
657
|
-
/**
|
|
658
|
-
* Overall verdict. Passed if either A or MX record check passed.
|
|
659
|
-
*/
|
|
660
|
-
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
661
|
-
};
|
|
662
|
-
spf: {
|
|
663
|
-
/**
|
|
664
|
-
* A human-readable explanation of SPF check.
|
|
665
|
-
*/
|
|
666
|
-
reason?: string;
|
|
667
|
-
/**
|
|
668
|
-
* The SPF record that was used for the check.
|
|
669
|
-
*/
|
|
670
|
-
spfRecord?: string;
|
|
671
|
-
/**
|
|
672
|
-
* Error message if the SPF record lookup failed.
|
|
673
|
-
*/
|
|
674
|
-
spfRecordError?: string;
|
|
675
|
-
verdict: DomainsCheckVerdict;
|
|
676
|
-
};
|
|
677
|
-
references?: string[];
|
|
678
|
-
}>;
|
|
679
616
|
interface DomainsDkimListOptions {
|
|
680
617
|
/**
|
|
681
618
|
* Selector to filter keys by. Must be a maximum of 63 characters.
|
|
@@ -728,29 +665,6 @@ type DomainsDkimRotateResponse = DataResponse<{
|
|
|
728
665
|
new: DomainsDkimKey;
|
|
729
666
|
rotated: DomainsDkimKey;
|
|
730
667
|
}>;
|
|
731
|
-
declare class Domains {
|
|
732
|
-
protected mailchannels: MailChannelsClient;
|
|
733
|
-
readonly dkim: DomainsDkim;
|
|
734
|
-
constructor(mailchannels: MailChannelsClient);
|
|
735
|
-
/**
|
|
736
|
-
* Validates a domain's email authentication setup by retrieving its DKIM, SPF, and Domain Lockdown status. This endpoint checks whether the domain is properly configured for secure email delivery.
|
|
737
|
-
* @param domain - Domain used for sending emails. If `dkim` settings are not provided, or `dkim` settings are provided with no `domain`, the stored dkim settings for this domain will be used.
|
|
738
|
-
* @param options - The domain options to check.
|
|
739
|
-
* @example
|
|
740
|
-
* ```ts
|
|
741
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
742
|
-
* const { data, error } = await mailchannels.domains.check('example.com', {
|
|
743
|
-
* dkim: [{
|
|
744
|
-
* domain: 'example.com',
|
|
745
|
-
* privateKey: 'your-private-key',
|
|
746
|
-
* selector: 'mailchannels'
|
|
747
|
-
* }],
|
|
748
|
-
* senderId: 'sender-id'
|
|
749
|
-
* })
|
|
750
|
-
* ```
|
|
751
|
-
*/
|
|
752
|
-
check(domain: string, options?: DomainsCheckOptions): Promise<DomainsCheckResponse>;
|
|
753
|
-
}
|
|
754
668
|
declare class DomainsDkim {
|
|
755
669
|
private mailchannels;
|
|
756
670
|
constructor(mailchannels: MailChannelsClient);
|
|
@@ -811,161 +725,442 @@ declare class DomainsDkim {
|
|
|
811
725
|
*/
|
|
812
726
|
rotate(domain: string, selector: string, options: DomainsDkimRotateOptions): Promise<DomainsDkimRotateResponse>;
|
|
813
727
|
}
|
|
814
|
-
type
|
|
728
|
+
type DomainsCustomTrackingScope = "click" | "open" | "unsubscribe";
|
|
729
|
+
interface DomainsCustomTrackingDomain {
|
|
815
730
|
/**
|
|
816
|
-
*
|
|
731
|
+
* The label for this custom tracking domain.
|
|
817
732
|
*/
|
|
818
|
-
|
|
819
|
-
}[]>;
|
|
820
|
-
type WebhooksSigningKeyResponse = DataResponse<{
|
|
733
|
+
name: string;
|
|
821
734
|
/**
|
|
822
|
-
* The
|
|
735
|
+
* The registered domain hostname.
|
|
823
736
|
*/
|
|
824
|
-
|
|
737
|
+
hostname: string;
|
|
825
738
|
/**
|
|
826
|
-
* The
|
|
739
|
+
* The event type this domain handles.
|
|
827
740
|
*/
|
|
828
|
-
|
|
829
|
-
}>;
|
|
830
|
-
type WebhooksValidateResponse = DataResponse<{
|
|
741
|
+
scope: DomainsCustomTrackingScope;
|
|
831
742
|
/**
|
|
832
|
-
*
|
|
743
|
+
* Current status of the custom tracking domain.
|
|
833
744
|
*/
|
|
834
|
-
|
|
745
|
+
status: "active" | "disabled";
|
|
835
746
|
/**
|
|
836
|
-
*
|
|
747
|
+
* ISO 8601 timestamp when the domain was registered.
|
|
837
748
|
*/
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
*/
|
|
842
|
-
result: "passed" | "failed";
|
|
843
|
-
/**
|
|
844
|
-
* The webhook that was validated.
|
|
845
|
-
*/
|
|
846
|
-
webhook: string;
|
|
847
|
-
/**
|
|
848
|
-
* The HTTP response returned by the webhook, including status code and response body. A null value indicates no response was received. Possible reasons include timeouts, connection failures, or other network-related issues.
|
|
849
|
-
*/
|
|
850
|
-
response: {
|
|
851
|
-
/**
|
|
852
|
-
* Response body from webhook. Returns an error if unprocessable or too large.
|
|
853
|
-
*/
|
|
854
|
-
body?: string;
|
|
855
|
-
/**
|
|
856
|
-
* HTTP status code returned by the webhook.
|
|
857
|
-
*/
|
|
858
|
-
status: number;
|
|
859
|
-
} | null;
|
|
860
|
-
}[];
|
|
861
|
-
}>;
|
|
862
|
-
type WebhookEventType = "processed" | "delivered" | "open" | "click" | "hard-bounced" | "soft-bounced" | "dropped" | "complained" | "unsubscribed" | "test";
|
|
863
|
-
interface WebhookEventBase<T extends WebhookEventType> {
|
|
749
|
+
createdAt: string;
|
|
750
|
+
}
|
|
751
|
+
interface DomainsCustomTrackingDnsSetupRequired {
|
|
864
752
|
/**
|
|
865
|
-
*
|
|
753
|
+
* UUID v4 nonce; also the TXT record value to set. Present only when TXT ownership verification is pending.
|
|
754
|
+
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
866
755
|
*/
|
|
867
|
-
|
|
756
|
+
token?: string;
|
|
868
757
|
/**
|
|
869
|
-
*
|
|
870
|
-
*
|
|
758
|
+
* Fully-qualified DNS TXT record name to add. Present only when TXT ownership verification is pending.
|
|
759
|
+
* @example "_mailchannels-verify.click.example.com"
|
|
871
760
|
*/
|
|
872
|
-
|
|
761
|
+
txtRecordName?: string;
|
|
873
762
|
/**
|
|
874
|
-
*
|
|
763
|
+
* Value for the DNS TXT record (same as token). Present only when TXT ownership verification is pending.
|
|
764
|
+
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
875
765
|
*/
|
|
876
|
-
|
|
766
|
+
txtRecordValue?: string;
|
|
877
767
|
/**
|
|
878
|
-
*
|
|
768
|
+
* Human-readable guidance for the DNS records that must be in place before retrying.
|
|
879
769
|
*/
|
|
880
|
-
|
|
770
|
+
instructions?: string;
|
|
771
|
+
}
|
|
772
|
+
type DomainsCustomTrackingWithDnsSetupRequired<T extends 202 | 201 | 200 | undefined = undefined> = T extends undefined ? DomainsCustomTrackingDomain & {
|
|
773
|
+
dnsSetupRequired: false;
|
|
774
|
+
} | DomainsCustomTrackingDnsSetupRequired & {
|
|
775
|
+
dnsSetupRequired: true;
|
|
776
|
+
} : T extends 202 ? DomainsCustomTrackingDnsSetupRequired & {
|
|
777
|
+
dnsSetupRequired: true;
|
|
778
|
+
} : DomainsCustomTrackingDomain & {
|
|
779
|
+
dnsSetupRequired: false;
|
|
780
|
+
};
|
|
781
|
+
type DomainsCustomTrackingCreateResponse = DataResponse<DomainsCustomTrackingWithDnsSetupRequired>;
|
|
782
|
+
interface DomainsCustomTrackingListOptions {
|
|
881
783
|
/**
|
|
882
|
-
*
|
|
784
|
+
* Filter by custom tracking domain label.
|
|
883
785
|
*/
|
|
884
|
-
|
|
786
|
+
name?: string;
|
|
885
787
|
/**
|
|
886
|
-
*
|
|
788
|
+
* Filter by status.
|
|
887
789
|
*/
|
|
888
|
-
|
|
790
|
+
status?: "active" | "disabled";
|
|
889
791
|
/**
|
|
890
|
-
*
|
|
792
|
+
* Filter by scope.
|
|
891
793
|
*/
|
|
892
|
-
|
|
794
|
+
scope?: DomainsCustomTrackingScope;
|
|
893
795
|
/**
|
|
894
|
-
* The
|
|
796
|
+
* The maximum number of domains to return. Possible values are `1` to `1000`.
|
|
797
|
+
* @default 100
|
|
895
798
|
*/
|
|
896
|
-
|
|
897
|
-
}
|
|
898
|
-
interface WebhookEventProcessed extends WebhookEventBase<"processed"> {}
|
|
899
|
-
interface WebhookEventDelivered extends WebhookEventBase<"delivered"> {}
|
|
900
|
-
interface WebhookEventWithTracking {
|
|
799
|
+
limit?: number;
|
|
901
800
|
/**
|
|
902
|
-
* The
|
|
801
|
+
* The number of domains to skip before returning results. The default is `0`.
|
|
802
|
+
* @default 0
|
|
903
803
|
*/
|
|
904
|
-
|
|
804
|
+
offset?: number;
|
|
805
|
+
}
|
|
806
|
+
type DomainsCustomTrackingListResponse = DataResponse<{
|
|
905
807
|
/**
|
|
906
|
-
*
|
|
808
|
+
* List of custom tracking domains matching the filter criteria.
|
|
907
809
|
*/
|
|
908
|
-
|
|
909
|
-
}
|
|
910
|
-
interface WebhookEventOpen extends WebhookEventBase<"open">, WebhookEventWithTracking {}
|
|
911
|
-
interface WebhookEventClick extends WebhookEventBase<"click">, WebhookEventWithTracking {
|
|
810
|
+
customTrackingDomains: DomainsCustomTrackingDomain[];
|
|
912
811
|
/**
|
|
913
|
-
*
|
|
812
|
+
* Total number of custom tracking domains.
|
|
914
813
|
*/
|
|
915
|
-
|
|
916
|
-
}
|
|
917
|
-
interface
|
|
814
|
+
total: number;
|
|
815
|
+
}>;
|
|
816
|
+
interface DomainsCustomTrackingUpdateOptions {
|
|
918
817
|
/**
|
|
919
|
-
*
|
|
818
|
+
* New label for this custom tracking domain. Maximum length is `64` characters. Must match the pattern `^[a-z0-9-]+$`.
|
|
920
819
|
*/
|
|
921
|
-
|
|
820
|
+
name?: string;
|
|
922
821
|
/**
|
|
923
|
-
*
|
|
822
|
+
* New status. Re-activation requires DNS verification — add the TXT record and CNAME record described in the response body, then retry.
|
|
924
823
|
*/
|
|
925
|
-
|
|
824
|
+
status?: "active" | "disabled";
|
|
926
825
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
interface WebhookEventTest extends Omit<WebhookEventBase<"test">, "recipients" | "campaignId"> {}
|
|
933
|
-
type WebhookEvent = WebhookEventProcessed | WebhookEventDelivered | WebhookEventOpen | WebhookEventClick | WebhookEventHardBounced | WebhookEventSoftBounced | WebhookEventDropped | WebhookEventComplained | WebhookEventUnsubscribed | WebhookEventTest;
|
|
934
|
-
interface WebhooksVerifyOptions {
|
|
826
|
+
type DomainsCustomTrackingUpdateResponse = DataResponse<DomainsCustomTrackingWithDnsSetupRequired>;
|
|
827
|
+
declare class DomainsCustomTracking {
|
|
828
|
+
private mailchannels;
|
|
829
|
+
private static readonly SCOPE_VALUES;
|
|
830
|
+
constructor(mailchannels: MailChannelsClient);
|
|
935
831
|
/**
|
|
936
|
-
*
|
|
832
|
+
* Retrieve all custom tracking domains registered under your account.
|
|
833
|
+
* Optional filters include domain name, status, scope, limit and offset.
|
|
834
|
+
* @param options - Optional filter options.
|
|
835
|
+
* @example
|
|
836
|
+
* ```ts
|
|
837
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
838
|
+
* const { data, error } = await mailchannels.domains.customTracking.list({
|
|
839
|
+
* status: 'active'
|
|
840
|
+
* })
|
|
841
|
+
* ```
|
|
937
842
|
*/
|
|
938
|
-
|
|
843
|
+
list(options?: DomainsCustomTrackingListOptions): Promise<DomainsCustomTrackingListResponse>;
|
|
939
844
|
/**
|
|
940
|
-
*
|
|
845
|
+
* Register a custom branded domain for click tracking, open tracking, or unsubscribe handling. By default, MailChannels uses shared domains for these links. Using a custom domain improves brand consistency by replacing shared domains with your own (e.g., `click.example.com`). Once registered, select the domain at send time using its `name`.
|
|
846
|
+
*
|
|
847
|
+
* Before registration completes, two DNS records must be in place:
|
|
848
|
+
* 1. A TXT record at `_mailchannels-verify.<hostname>` containing the verification token (returned when DNS setup is required).
|
|
849
|
+
* 2. A CNAME record at `<hostname>` pointing to `links.mailchannels.net`.
|
|
850
|
+
* @param name - A unique label used to select this domain at message send time. Maximum length is `64` characters. Must match the pattern `^[a-z0-9-]+$`.
|
|
851
|
+
* @param hostname - The hostname to register as a custom tracking domain (e.g., `click.example.com`).
|
|
852
|
+
* @param scope - The event type this domain handles.
|
|
853
|
+
* @example
|
|
854
|
+
* ```ts
|
|
855
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
856
|
+
* const { data, error } = await mailchannels.domains.customTracking.create(
|
|
857
|
+
* 'clickdemo',
|
|
858
|
+
* 'click.example.com',
|
|
859
|
+
* 'click'
|
|
860
|
+
* )
|
|
861
|
+
* ```
|
|
941
862
|
*/
|
|
942
|
-
|
|
943
|
-
"content-digest": string;
|
|
944
|
-
"signature": string;
|
|
945
|
-
"signature-input": string;
|
|
946
|
-
};
|
|
863
|
+
create(name: string, hostname: string, scope: DomainsCustomTrackingScope): Promise<DomainsCustomTrackingCreateResponse>;
|
|
947
864
|
/**
|
|
948
|
-
*
|
|
865
|
+
* Update an existing custom tracking domain by its hostname and scope. Supports updating the custom tracking domain's name or toggling its active status.
|
|
866
|
+
* @param hostname - The hostname of the custom tracking domain to update.
|
|
867
|
+
* @param scope - The scope of the custom tracking domain to update.
|
|
868
|
+
* @param options - The options for updating the custom tracking domain.
|
|
869
|
+
* @example
|
|
870
|
+
* ```ts
|
|
871
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
872
|
+
* const { data, error } = await mailchannels.domains.customTracking.update('click.example.com', 'click', {
|
|
873
|
+
* name: 'newclickname',
|
|
874
|
+
* status: 'active'
|
|
875
|
+
* })
|
|
876
|
+
* ```
|
|
949
877
|
*/
|
|
950
|
-
|
|
878
|
+
update(hostname: string, scope: DomainsCustomTrackingScope, options: DomainsCustomTrackingUpdateOptions): Promise<DomainsCustomTrackingUpdateResponse>;
|
|
951
879
|
/**
|
|
952
|
-
*
|
|
953
|
-
*
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
880
|
+
* Permanently delete an existing custom tracking domain for the given hostname and scope. The domain can be re-registered if needed.
|
|
881
|
+
*
|
|
882
|
+
* WARNING: Any tracking links or unsubscribe URLs in previously sent emails using this domain will stop working immediately.
|
|
883
|
+
* @param hostname - The hostname of the custom tracking domain to delete.
|
|
884
|
+
* @param scope - The scope of the custom tracking domain to delete.
|
|
885
|
+
* @example
|
|
886
|
+
* ```ts
|
|
887
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
888
|
+
* const { success, error } = await mailchannels.domains.customTracking.delete('click.example.com', 'click')
|
|
889
|
+
* ```
|
|
890
|
+
*/
|
|
891
|
+
delete(hostname: string, scope: DomainsCustomTrackingScope): Promise<SuccessResponse>;
|
|
892
|
+
}
|
|
893
|
+
interface DomainsCheck {
|
|
894
|
+
/**
|
|
895
|
+
* Domain used for DKIM signing.
|
|
896
|
+
*/
|
|
897
|
+
domain?: string;
|
|
898
|
+
/**
|
|
899
|
+
* DKIM private key encoded in Base64.
|
|
900
|
+
*/
|
|
901
|
+
privateKey?: string;
|
|
902
|
+
/**
|
|
903
|
+
* DKIM selector in the domain DNS records.
|
|
904
|
+
*/
|
|
905
|
+
selector?: string;
|
|
906
|
+
}
|
|
907
|
+
interface DomainsCheckOptions {
|
|
908
|
+
/**
|
|
909
|
+
* Each item may include DKIM `domain`, `selector` and `privateKey`. Up to 10 items are allowed. The absence or presence of these fields affects how DKIM settings are validated:
|
|
910
|
+
* 1. If `domain`, `selector`, and `privateKey` are all present, verify using the provided domain, selector, and key.
|
|
911
|
+
* 2. If `domain` and `selector` are present, use the stored private key for the given domain and selector.
|
|
912
|
+
* 3. If only `domain` is present, use all stored keys for the given domain.
|
|
913
|
+
* 4. If none are present, use all stored keys for the `domain` provided in the domain field of the request.
|
|
914
|
+
* 5. If `privateKey` is present, `selector` must be present.
|
|
915
|
+
* 6. If `selector` is present and `domain` is not, the domain will be taken from the domain field of the request.
|
|
916
|
+
*/
|
|
917
|
+
dkim?: DomainsCheck[] | DomainsCheck;
|
|
918
|
+
/**
|
|
919
|
+
* Used exclusively for [Domain Lockdown](https://support.mailchannels.com/hc/en-us/articles/16918954360845-Secure-your-domain-name-against-spoofing-with-Domain-Lockdown) verification. If you're not using senderid to associate your domain with your account, you can disregard this field. The corresponding value is included in the `X-MailChannels-SenderId` header of emails sent via MailChannels.
|
|
920
|
+
*/
|
|
921
|
+
senderId?: string;
|
|
922
|
+
}
|
|
923
|
+
type DomainsCheckVerdict = "passed" | "failed" | "soft failed" | "temporary error" | "permanent error" | "neutral" | "none" | "unknown";
|
|
924
|
+
type DomainsCheckResponse = DataResponse<{
|
|
925
|
+
dkim: {
|
|
926
|
+
domain: string;
|
|
927
|
+
/**
|
|
928
|
+
* The human readable status of the DKIM key used for verification.
|
|
929
|
+
*/
|
|
930
|
+
keyStatus?: DomainsDkimKey["status"] | "provided";
|
|
931
|
+
selector: string;
|
|
932
|
+
/**
|
|
933
|
+
* A human-readable explanation of DKIM check.
|
|
934
|
+
*/
|
|
935
|
+
reason?: string;
|
|
936
|
+
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
937
|
+
}[];
|
|
938
|
+
domainLockdown: {
|
|
939
|
+
/**
|
|
940
|
+
* A human-readable explanation of Domain Lockdown check.
|
|
941
|
+
*/
|
|
942
|
+
reason?: string;
|
|
943
|
+
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
944
|
+
};
|
|
945
|
+
/**
|
|
946
|
+
* These results are here to help avoid [SDNF](https://support.mailchannels.com/hc/en-us/articles/203155500-550-5-2-1-SDNF-Sender-Domain-Not-Found) (Sender Domain Not Found) blocks. For messages not to get blocked by SDNF, we require either an MX or A record to exist for the sender domain.
|
|
947
|
+
*/
|
|
948
|
+
senderDomain: {
|
|
949
|
+
a: {
|
|
950
|
+
/**
|
|
951
|
+
* A human-readable explanation of A record check.
|
|
952
|
+
*/
|
|
953
|
+
reason?: string;
|
|
954
|
+
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
955
|
+
};
|
|
956
|
+
mx: {
|
|
957
|
+
/**
|
|
958
|
+
* A human-readable explanation of MX record check.
|
|
959
|
+
*/
|
|
960
|
+
reason?: string;
|
|
961
|
+
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
962
|
+
};
|
|
963
|
+
/**
|
|
964
|
+
* Overall verdict. Passed if either A or MX record check passed.
|
|
965
|
+
*/
|
|
966
|
+
verdict: Extract<DomainsCheckVerdict, "passed" | "failed">;
|
|
967
|
+
};
|
|
968
|
+
spf: {
|
|
969
|
+
/**
|
|
970
|
+
* A human-readable explanation of SPF check.
|
|
971
|
+
*/
|
|
972
|
+
reason?: string;
|
|
973
|
+
/**
|
|
974
|
+
* The SPF record that was used for the check.
|
|
975
|
+
*/
|
|
976
|
+
spfRecord?: string;
|
|
977
|
+
/**
|
|
978
|
+
* Error message if the SPF record lookup failed.
|
|
979
|
+
*/
|
|
980
|
+
spfRecordError?: string;
|
|
981
|
+
verdict: DomainsCheckVerdict;
|
|
982
|
+
};
|
|
983
|
+
references?: string[];
|
|
984
|
+
}>;
|
|
985
|
+
declare class Domains {
|
|
986
|
+
protected mailchannels: MailChannelsClient;
|
|
987
|
+
readonly dkim: DomainsDkim;
|
|
988
|
+
readonly customTracking: DomainsCustomTracking;
|
|
989
|
+
constructor(mailchannels: MailChannelsClient);
|
|
990
|
+
/**
|
|
991
|
+
* Validates a domain's email authentication setup by retrieving its DKIM, SPF, and Domain Lockdown status. This endpoint checks whether the domain is properly configured for secure email delivery.
|
|
992
|
+
* @param domain - Domain used for sending emails. If `dkim` settings are not provided, or `dkim` settings are provided with no `domain`, the stored dkim settings for this domain will be used.
|
|
993
|
+
* @param options - The domain options to check.
|
|
994
|
+
* @example
|
|
995
|
+
* ```ts
|
|
996
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
997
|
+
* const { data, error } = await mailchannels.domains.check('example.com', {
|
|
998
|
+
* dkim: [{
|
|
999
|
+
* domain: 'example.com',
|
|
1000
|
+
* privateKey: 'your-private-key',
|
|
1001
|
+
* selector: 'mailchannels'
|
|
1002
|
+
* }],
|
|
1003
|
+
* senderId: 'sender-id'
|
|
1004
|
+
* })
|
|
1005
|
+
* ```
|
|
1006
|
+
*/
|
|
1007
|
+
check(domain: string, options?: DomainsCheckOptions): Promise<DomainsCheckResponse>;
|
|
1008
|
+
}
|
|
1009
|
+
type WebhooksListResponse = DataResponse<{
|
|
1010
|
+
/**
|
|
1011
|
+
* A customer's webhook that events will be sent to
|
|
1012
|
+
*/
|
|
1013
|
+
webhook: string;
|
|
1014
|
+
}[]>;
|
|
1015
|
+
type WebhooksSigningKeyResponse = DataResponse<{
|
|
1016
|
+
/**
|
|
1017
|
+
* The ID of the key.
|
|
1018
|
+
*/
|
|
1019
|
+
id: string;
|
|
1020
|
+
/**
|
|
1021
|
+
* The public key used to verify webhook signatures.
|
|
1022
|
+
*/
|
|
1023
|
+
key: string;
|
|
1024
|
+
}>;
|
|
1025
|
+
type WebhooksValidateResponse = DataResponse<{
|
|
1026
|
+
/**
|
|
1027
|
+
* Indicates whether all webhook validations passed.
|
|
1028
|
+
*/
|
|
1029
|
+
allPassed: boolean;
|
|
1030
|
+
/**
|
|
1031
|
+
* Detailed results for each tested webhook, including whether it returned a 2xx status code, along with its response status code and body.
|
|
1032
|
+
*/
|
|
1033
|
+
results: {
|
|
1034
|
+
/**
|
|
1035
|
+
* Indicates whether the webhook responded with a 2xx HTTP status code.
|
|
1036
|
+
*/
|
|
1037
|
+
result: "passed" | "failed";
|
|
1038
|
+
/**
|
|
1039
|
+
* The webhook that was validated.
|
|
1040
|
+
*/
|
|
1041
|
+
webhook: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* The HTTP response returned by the webhook, including status code and response body. A null value indicates no response was received. Possible reasons include timeouts, connection failures, or other network-related issues.
|
|
1044
|
+
*/
|
|
1045
|
+
response: {
|
|
1046
|
+
/**
|
|
1047
|
+
* Response body from webhook. Returns an error if unprocessable or too large.
|
|
1048
|
+
*/
|
|
1049
|
+
body?: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* HTTP status code returned by the webhook.
|
|
1052
|
+
*/
|
|
1053
|
+
status: number;
|
|
1054
|
+
} | null;
|
|
1055
|
+
}[];
|
|
1056
|
+
}>;
|
|
1057
|
+
type WebhookEventType = "processed" | "delivered" | "open" | "click" | "hard-bounced" | "soft-bounced" | "dropped" | "complained" | "unsubscribed" | "test";
|
|
1058
|
+
interface WebhookEventBase<T extends WebhookEventType> {
|
|
1059
|
+
/**
|
|
1060
|
+
* The sender's email address
|
|
1061
|
+
*/
|
|
1062
|
+
email?: string;
|
|
1063
|
+
/**
|
|
1064
|
+
* The MailChannels account ID that generated the webhook.
|
|
1065
|
+
* If the message was sent by a sub-account, this field contains the sub-account handle.
|
|
1066
|
+
*/
|
|
1067
|
+
customerHandle: string;
|
|
1068
|
+
/**
|
|
1069
|
+
* The Unix timestamp (in seconds) when the event occurred; the timezone is always UTC
|
|
1070
|
+
*/
|
|
1071
|
+
timestamp: number;
|
|
1072
|
+
/**
|
|
1073
|
+
* The Message-Id of the message that generated the event
|
|
1074
|
+
*/
|
|
1075
|
+
smtpId?: string;
|
|
1076
|
+
/**
|
|
1077
|
+
* The type of event that occurred
|
|
1078
|
+
*/
|
|
1079
|
+
event: T;
|
|
1080
|
+
/**
|
|
1081
|
+
* A unique identifier generated to track the original HTTP request
|
|
1082
|
+
*/
|
|
1083
|
+
requestId?: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* The campaign identifier for the message that generated the event
|
|
1086
|
+
*/
|
|
1087
|
+
campaignId?: string;
|
|
1088
|
+
/**
|
|
1089
|
+
* The recipients of the message
|
|
1090
|
+
*/
|
|
1091
|
+
recipients?: string[];
|
|
1092
|
+
}
|
|
1093
|
+
interface WebhookEventProcessed extends WebhookEventBase<"processed"> {}
|
|
1094
|
+
interface WebhookEventDelivered extends WebhookEventBase<"delivered"> {}
|
|
1095
|
+
interface WebhookEventWithTracking {
|
|
1096
|
+
/**
|
|
1097
|
+
* The User-Agent header given when the recipient opened the message
|
|
1098
|
+
*/
|
|
1099
|
+
userAgent?: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* The IP address of the host that made the HTTP request
|
|
1102
|
+
*/
|
|
1103
|
+
ip?: string;
|
|
1104
|
+
}
|
|
1105
|
+
interface WebhookEventOpen extends WebhookEventBase<"open">, WebhookEventWithTracking {}
|
|
1106
|
+
interface WebhookEventClick extends WebhookEventBase<"click">, WebhookEventWithTracking {
|
|
1107
|
+
/**
|
|
1108
|
+
* The URL that was clicked by the recipient
|
|
1109
|
+
*/
|
|
1110
|
+
url?: string;
|
|
1111
|
+
}
|
|
1112
|
+
interface WebhookEventWithStatus {
|
|
1113
|
+
/**
|
|
1114
|
+
* The SMTP status code that caused the bounce
|
|
1115
|
+
*/
|
|
1116
|
+
status?: string;
|
|
1117
|
+
/**
|
|
1118
|
+
* A human-readable explanation of why the message hard-bounced
|
|
1119
|
+
*/
|
|
1120
|
+
reason?: string;
|
|
1121
|
+
}
|
|
1122
|
+
interface WebhookEventHardBounced extends WebhookEventBase<"hard-bounced">, WebhookEventWithStatus {}
|
|
1123
|
+
interface WebhookEventSoftBounced extends WebhookEventBase<"soft-bounced">, WebhookEventWithStatus {}
|
|
1124
|
+
interface WebhookEventDropped extends WebhookEventBase<"dropped">, WebhookEventWithStatus {}
|
|
1125
|
+
interface WebhookEventComplained extends WebhookEventBase<"complained"> {}
|
|
1126
|
+
interface WebhookEventUnsubscribed extends WebhookEventBase<"unsubscribed"> {}
|
|
1127
|
+
interface WebhookEventTest extends Omit<WebhookEventBase<"test">, "recipients" | "campaignId"> {}
|
|
1128
|
+
type WebhookEvent = WebhookEventProcessed | WebhookEventDelivered | WebhookEventOpen | WebhookEventClick | WebhookEventHardBounced | WebhookEventSoftBounced | WebhookEventDropped | WebhookEventComplained | WebhookEventUnsubscribed | WebhookEventTest;
|
|
1129
|
+
interface WebhooksVerifyOptions {
|
|
1130
|
+
/**
|
|
1131
|
+
* The raw body of the incoming webhook request as a string. This should be the exact payload received from the webhook, without any modifications or parsing, to ensure accurate signature verification.
|
|
1132
|
+
*/
|
|
1133
|
+
payload: string;
|
|
1134
|
+
/**
|
|
1135
|
+
* The headers of the incoming webhook request as a record of key-value pairs. These headers should include `content-digest`, `signature`, and `signature-input` required for validating the authenticity of the webhook request.
|
|
1136
|
+
*/
|
|
1137
|
+
headers: Record<string, string> | {
|
|
1138
|
+
"content-digest": string;
|
|
1139
|
+
"signature": string;
|
|
1140
|
+
"signature-input": string;
|
|
1141
|
+
};
|
|
1142
|
+
/**
|
|
1143
|
+
* The public key used to verify the webhook signature. If not provided, the SDK will attempt to retrieve the appropriate public key based on the `keyId` specified in the `signature-input` header.
|
|
1144
|
+
*/
|
|
1145
|
+
publicKey?: string;
|
|
1146
|
+
/**
|
|
1147
|
+
* Whether to cache signing keys fetched from the API by their `keyId`. Defaults to `true`.
|
|
1148
|
+
* @default true
|
|
1149
|
+
*/
|
|
1150
|
+
cache?: boolean;
|
|
1151
|
+
}
|
|
1152
|
+
type WebhooksVerifyResponse = DataResponse<WebhookEvent[]>;
|
|
958
1153
|
type WebhooksBatchStatus = "1xx" | "2xx" | "3xx" | "4xx" | "5xx" | "no_response";
|
|
959
1154
|
type WebhooksBatchResponseStatus = "1xx_response" | "2xx_response" | "3xx_response" | "4xx_response" | "5xx_response" | "no_response";
|
|
960
1155
|
interface WebhooksBatchesOptions {
|
|
961
1156
|
/**
|
|
962
|
-
* Inclusive lower bound (UTC) for filtering webhook batches by creation time. Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ
|
|
1157
|
+
* Inclusive lower bound (UTC) for filtering webhook batches by creation time. Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` or a `Date` object.
|
|
963
1158
|
*/
|
|
964
|
-
createdAfter?: string;
|
|
1159
|
+
createdAfter?: string | Date;
|
|
965
1160
|
/**
|
|
966
|
-
* Exclusive upper bound (UTC) for filtering webhook batches by creation time. Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ
|
|
1161
|
+
* Exclusive upper bound (UTC) for filtering webhook batches by creation time. Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` or a `Date` object.
|
|
967
1162
|
*/
|
|
968
|
-
createdBefore?: string;
|
|
1163
|
+
createdBefore?: string | Date;
|
|
969
1164
|
/**
|
|
970
1165
|
* Filters webhook batches by webhook response status category. If not provided, batches with all categories are returned.
|
|
971
1166
|
*/
|
|
@@ -1145,7 +1340,7 @@ declare class Webhooks {
|
|
|
1145
1340
|
*/
|
|
1146
1341
|
resendBatch(batchId: number): Promise<WebhooksResendBatchResponse>;
|
|
1147
1342
|
}
|
|
1148
|
-
interface
|
|
1343
|
+
interface SubAccount {
|
|
1149
1344
|
/**
|
|
1150
1345
|
* The name of the company associated with the sub-account.
|
|
1151
1346
|
*/
|
|
@@ -1159,7 +1354,9 @@ interface SubAccountsAccount {
|
|
|
1159
1354
|
*/
|
|
1160
1355
|
handle: string;
|
|
1161
1356
|
}
|
|
1162
|
-
type SubAccountsCreateResponse = DataResponse<
|
|
1357
|
+
type SubAccountsCreateResponse = DataResponse<SubAccount>;
|
|
1358
|
+
/** @deprecated Use `SubAccount` instead. */
|
|
1359
|
+
type SubAccountsAccount = SubAccount;
|
|
1163
1360
|
interface SubAccountsListOptions {
|
|
1164
1361
|
/**
|
|
1165
1362
|
* Possible values are `1` to `1000`.
|
|
@@ -1172,229 +1369,81 @@ interface SubAccountsListOptions {
|
|
|
1172
1369
|
*/
|
|
1173
1370
|
offset?: number;
|
|
1174
1371
|
}
|
|
1175
|
-
type SubAccountsListResponse = DataResponse<
|
|
1372
|
+
type SubAccountsListResponse = DataResponse<SubAccount[]>;
|
|
1176
1373
|
interface SubAccountsApiKey {
|
|
1177
1374
|
/**
|
|
1178
|
-
* The API key ID for the sub-account.
|
|
1179
|
-
*/
|
|
1180
|
-
id: number;
|
|
1181
|
-
/**
|
|
1182
|
-
* API key for the sub-account.
|
|
1183
|
-
*/
|
|
1184
|
-
key: string;
|
|
1185
|
-
}
|
|
1186
|
-
type SubAccountsCreateApiKeyResponse = DataResponse<SubAccountsApiKey>;
|
|
1187
|
-
interface SubAccountsListApiKeyOptions {
|
|
1188
|
-
/**
|
|
1189
|
-
* The maximum number of API keys included in the response. Possible values are `1` to `1000`.
|
|
1190
|
-
* @default 100
|
|
1191
|
-
*/
|
|
1192
|
-
limit?: number;
|
|
1193
|
-
/**
|
|
1194
|
-
* Offset into the list of API keys to return.
|
|
1195
|
-
* @default 0
|
|
1196
|
-
*/
|
|
1197
|
-
offset?: number;
|
|
1198
|
-
}
|
|
1199
|
-
type SubAccountsListApiKeyResponse = DataResponse<SubAccountsApiKey[]>;
|
|
1200
|
-
interface SubAccountsSmtpPassword {
|
|
1201
|
-
/**
|
|
1202
|
-
* Whether the SMTP password is enabled.
|
|
1203
|
-
*/
|
|
1204
|
-
enabled: boolean;
|
|
1205
|
-
/**
|
|
1206
|
-
* The SMTP password ID for the sub-account.
|
|
1207
|
-
*/
|
|
1208
|
-
id: number;
|
|
1209
|
-
/**
|
|
1210
|
-
* SMTP password for the sub-account.
|
|
1211
|
-
*/
|
|
1212
|
-
smtpPassword: string;
|
|
1213
|
-
}
|
|
1214
|
-
type SubAccountsCreateSmtpPasswordResponse = DataResponse<SubAccountsSmtpPassword>;
|
|
1215
|
-
type SubAccountsListSmtpPasswordResponse = DataResponse<SubAccountsSmtpPassword[]>;
|
|
1216
|
-
interface SubAccountsLimit {
|
|
1217
|
-
sends: number;
|
|
1218
|
-
}
|
|
1219
|
-
type SubAccountsLimitResponse = DataResponse<SubAccountsLimit>;
|
|
1220
|
-
interface SubAccountsUsage {
|
|
1221
|
-
/**
|
|
1222
|
-
* The end date of the current billing period (ISO 8601 format).
|
|
1223
|
-
* @example "2025-04-11"
|
|
1224
|
-
*/
|
|
1225
|
-
endDate?: string;
|
|
1226
|
-
/**
|
|
1227
|
-
* The start date of the current billing period (ISO 8601 format).
|
|
1228
|
-
* @example "2025-03-12"
|
|
1229
|
-
*/
|
|
1230
|
-
startDate?: string;
|
|
1231
|
-
/**
|
|
1232
|
-
* The total usage for the current billing period.
|
|
1233
|
-
*/
|
|
1234
|
-
total: number;
|
|
1235
|
-
}
|
|
1236
|
-
type SubAccountsUsageResponse = DataResponse<SubAccountsUsage>;
|
|
1237
|
-
declare class SubAccounts {
|
|
1238
|
-
protected mailchannels: MailChannelsClient;
|
|
1239
|
-
private static readonly COMPANY_PATTERN;
|
|
1240
|
-
private static readonly HANDLE_PATTERN;
|
|
1241
|
-
constructor(mailchannels: MailChannelsClient);
|
|
1242
|
-
/**
|
|
1243
|
-
* Creates a new sub-account under the parent account. Each sub-account must have a unique handle composed solely of lowercase alphanumeric characters. If no handle is provided, a random handle will be generated. Note that Sub-accounts are only available to parent accounts on 100K and higher plans.
|
|
1244
|
-
* @param companyName - The name of the company associated with the sub-account. This name is used for display purposes only and does not affect the functionality of the sub-account. The length must be between 3 and 128 characters.
|
|
1245
|
-
* @param handle - A unique name for the sub-account to be created. The length must be between 3 and 128 characters, and it may contain only lowercase letters and numbers. If not provided, a random handle will be generated.
|
|
1246
|
-
* @example
|
|
1247
|
-
* ```ts
|
|
1248
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1249
|
-
* const { data, error } = await mailchannels.subAccounts.create('My Company', 'validhandle123')
|
|
1250
|
-
* ```
|
|
1251
|
-
*/
|
|
1252
|
-
create(companyName: string, handle?: string): Promise<SubAccountsCreateResponse>;
|
|
1253
|
-
/**
|
|
1254
|
-
* Retrieves all sub-accounts associated with the parent account. The response is paginated with a default limit of 1000 sub-accounts per page and an offset of 0.
|
|
1255
|
-
* @param options - The options to filter the list of sub-accounts.
|
|
1256
|
-
* @example
|
|
1257
|
-
* ```ts
|
|
1258
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1259
|
-
* const { data, error } = await mailchannels.subAccounts.list()
|
|
1260
|
-
* ```
|
|
1261
|
-
*/
|
|
1262
|
-
list(options?: SubAccountsListOptions): Promise<SubAccountsListResponse>;
|
|
1263
|
-
/**
|
|
1264
|
-
* Deletes the sub-account identified by its handle.
|
|
1265
|
-
* @param handle - Handle of sub-account to be deleted.
|
|
1266
|
-
* @example
|
|
1267
|
-
* ```ts
|
|
1268
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1269
|
-
* const { success, error } = await mailchannels.subAccounts.delete('validhandle123')
|
|
1270
|
-
* ```
|
|
1271
|
-
*/
|
|
1272
|
-
delete(handle: string): Promise<SuccessResponse>;
|
|
1273
|
-
/**
|
|
1274
|
-
* Suspends the sub-account identified by its handle. This action disables the account, preventing it from sending any emails until it is reactivated.
|
|
1275
|
-
* @param handle - Handle of sub-account to be suspended.
|
|
1276
|
-
* @example
|
|
1277
|
-
* ```ts
|
|
1278
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1279
|
-
* const { success, error } = await mailchannels.subAccounts.suspend('validhandle123')
|
|
1280
|
-
* ```
|
|
1281
|
-
*/
|
|
1282
|
-
suspend(handle: string): Promise<SuccessResponse>;
|
|
1283
|
-
/**
|
|
1284
|
-
* Activates a suspended sub-account identified by its handle, restoring its ability to send emails.
|
|
1285
|
-
* @param handle - Handle of sub-account to be activated.
|
|
1286
|
-
* @example
|
|
1287
|
-
* ```ts
|
|
1288
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1289
|
-
* const { success, error } = await mailchannels.subAccounts.activate('validhandle123')
|
|
1290
|
-
* ```
|
|
1291
|
-
*/
|
|
1292
|
-
activate(handle: string): Promise<SuccessResponse>;
|
|
1293
|
-
/**
|
|
1294
|
-
* Creates a new API key for the specified sub-account.
|
|
1295
|
-
* @param handle - Handle of the sub-account to create API key for.
|
|
1296
|
-
* @example
|
|
1297
|
-
* ```ts
|
|
1298
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1299
|
-
* const { data, error } = await mailchannels.subAccounts.createApiKey('validhandle123')
|
|
1300
|
-
* ```
|
|
1375
|
+
* The API key ID for the sub-account.
|
|
1301
1376
|
*/
|
|
1302
|
-
|
|
1377
|
+
id: number;
|
|
1303
1378
|
/**
|
|
1304
|
-
*
|
|
1305
|
-
* @param handle - Handle of the sub-account to retrieve the API key for.
|
|
1306
|
-
* @param options - The options to filter the list of API keys.
|
|
1307
|
-
* @example
|
|
1308
|
-
* ```ts
|
|
1309
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1310
|
-
* const { data, error } = await mailchannels.subAccounts.listApiKeys('validhandle123')
|
|
1311
|
-
* ```
|
|
1379
|
+
* API key for the sub-account.
|
|
1312
1380
|
*/
|
|
1313
|
-
|
|
1381
|
+
key: string;
|
|
1382
|
+
}
|
|
1383
|
+
type SubAccountsApiKeysCreateResponse = DataResponse<SubAccountsApiKey>;
|
|
1384
|
+
interface SubAccountsApiKeysListOptions {
|
|
1314
1385
|
/**
|
|
1315
|
-
*
|
|
1316
|
-
* @
|
|
1317
|
-
* @param id - The ID of the API key to delete.
|
|
1318
|
-
* @example
|
|
1319
|
-
* ```ts
|
|
1320
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1321
|
-
* const { success, error } = await mailchannels.subAccounts.deleteApiKey('validhandle123', 1)
|
|
1322
|
-
* ```
|
|
1386
|
+
* The maximum number of API keys included in the response. Possible values are `1` to `1000`.
|
|
1387
|
+
* @default 100
|
|
1323
1388
|
*/
|
|
1324
|
-
|
|
1389
|
+
limit?: number;
|
|
1325
1390
|
/**
|
|
1326
|
-
*
|
|
1327
|
-
* @
|
|
1328
|
-
* @example
|
|
1329
|
-
* ```ts
|
|
1330
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1331
|
-
* const { data, error } = await mailchannels.subAccounts.createSmtpPassword('validhandle123')
|
|
1332
|
-
* ```
|
|
1391
|
+
* Offset into the list of API keys to return.
|
|
1392
|
+
* @default 0
|
|
1333
1393
|
*/
|
|
1334
|
-
|
|
1394
|
+
offset?: number;
|
|
1395
|
+
}
|
|
1396
|
+
type SubAccountsApiKeysListResponse = DataResponse<SubAccountsApiKey[]>;
|
|
1397
|
+
/** @deprecated Use `SubAccountsApiKeysCreateResponse` instead. */
|
|
1398
|
+
type SubAccountsCreateApiKeyResponse = SubAccountsApiKeysCreateResponse;
|
|
1399
|
+
/** @deprecated Use `SubAccountsApiKeysListOptions` instead. */
|
|
1400
|
+
type SubAccountsListApiKeyOptions = SubAccountsApiKeysListOptions;
|
|
1401
|
+
/** @deprecated Use `SubAccountsApiKeysListResponse` instead. */
|
|
1402
|
+
type SubAccountsListApiKeyResponse = SubAccountsApiKeysListResponse;
|
|
1403
|
+
interface SubAccountsSmtpPassword {
|
|
1335
1404
|
/**
|
|
1336
|
-
*
|
|
1337
|
-
* @param handle - Handle of the sub-account to retrieve the SMTP password for.
|
|
1338
|
-
* @example
|
|
1339
|
-
* ```ts
|
|
1340
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1341
|
-
* const { data, error } = await mailchannels.subAccounts.listSmtpPasswords('validhandle123')
|
|
1342
|
-
* ```
|
|
1405
|
+
* Whether the SMTP password is enabled.
|
|
1343
1406
|
*/
|
|
1344
|
-
|
|
1407
|
+
enabled: boolean;
|
|
1345
1408
|
/**
|
|
1346
|
-
*
|
|
1347
|
-
* @param handle - Handle of the sub-account for which the SMTP password should be deleted.
|
|
1348
|
-
* @param id - The ID of the SMTP password to delete.
|
|
1349
|
-
* @example
|
|
1350
|
-
* ```ts
|
|
1351
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1352
|
-
* const { success, error } = await mailchannels.subAccounts.deleteSmtpPassword('validhandle123', 1)
|
|
1353
|
-
* ```
|
|
1409
|
+
* The SMTP password ID for the sub-account.
|
|
1354
1410
|
*/
|
|
1355
|
-
|
|
1411
|
+
id: number;
|
|
1356
1412
|
/**
|
|
1357
|
-
*
|
|
1358
|
-
* @param handle - Handle of the sub-account to retrieve the limit for.
|
|
1359
|
-
* @example
|
|
1360
|
-
* ```ts
|
|
1361
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1362
|
-
* const { data, error } = await mailchannels.subAccounts.getLimit('validhandle123')
|
|
1363
|
-
* ```
|
|
1413
|
+
* SMTP password for the sub-account.
|
|
1364
1414
|
*/
|
|
1365
|
-
|
|
1415
|
+
smtpPassword: string;
|
|
1416
|
+
}
|
|
1417
|
+
type SubAccountsSmtpPasswordsCreateResponse = DataResponse<SubAccountsSmtpPassword>;
|
|
1418
|
+
type SubAccountsSmtpPasswordsListResponse = DataResponse<SubAccountsSmtpPassword[]>;
|
|
1419
|
+
/** @deprecated Use `SubAccountsSmtpPasswordsCreateResponse` instead. */
|
|
1420
|
+
type SubAccountsCreateSmtpPasswordResponse = SubAccountsSmtpPasswordsCreateResponse;
|
|
1421
|
+
/** @deprecated Use `SubAccountsSmtpPasswordsListResponse` instead. */
|
|
1422
|
+
type SubAccountsListSmtpPasswordResponse = SubAccountsSmtpPasswordsListResponse;
|
|
1423
|
+
interface SubAccountsLimit {
|
|
1424
|
+
sends: number;
|
|
1425
|
+
}
|
|
1426
|
+
interface SubAccountsLimitsSetOptions extends SubAccountsLimit {}
|
|
1427
|
+
type SubAccountsLimitsGetResponse = DataResponse<SubAccountsLimit>;
|
|
1428
|
+
/** @deprecated Use `SubAccountsLimitsGetResponse` instead. */
|
|
1429
|
+
type SubAccountsLimitResponse = SubAccountsLimitsGetResponse;
|
|
1430
|
+
interface SubAccountsUsage {
|
|
1366
1431
|
/**
|
|
1367
|
-
*
|
|
1368
|
-
* @
|
|
1369
|
-
* @param limit - The limits to set for the sub-account. The minimum allowed sends is `0`
|
|
1370
|
-
* @example
|
|
1371
|
-
* ```ts
|
|
1372
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1373
|
-
* const { success, error } = await mailchannels.subAccounts.setLimit('validhandle123', { sends: 1000 })
|
|
1374
|
-
* ```
|
|
1432
|
+
* The end date of the current billing period (ISO 8601 format).
|
|
1433
|
+
* @example "2025-04-11"
|
|
1375
1434
|
*/
|
|
1376
|
-
|
|
1435
|
+
endDate?: string;
|
|
1377
1436
|
/**
|
|
1378
|
-
*
|
|
1379
|
-
* @
|
|
1380
|
-
* @example
|
|
1381
|
-
* ```ts
|
|
1382
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1383
|
-
* const { success, error } = await mailchannels.subAccounts.deleteLimit('validhandle123')
|
|
1384
|
-
* ```
|
|
1437
|
+
* The start date of the current billing period (ISO 8601 format).
|
|
1438
|
+
* @example "2025-03-12"
|
|
1385
1439
|
*/
|
|
1386
|
-
|
|
1440
|
+
startDate?: string;
|
|
1387
1441
|
/**
|
|
1388
|
-
*
|
|
1389
|
-
* @param handle - Handle of the sub-account to query usage stats for.
|
|
1390
|
-
* @example
|
|
1391
|
-
* ```ts
|
|
1392
|
-
* const mailchannels = new MailChannels('your-api-key')
|
|
1393
|
-
* const { data, error } = await mailchannels.subAccounts.getUsage('validhandle123')
|
|
1394
|
-
* ```
|
|
1442
|
+
* The total usage for the current billing period.
|
|
1395
1443
|
*/
|
|
1396
|
-
|
|
1444
|
+
total: number;
|
|
1397
1445
|
}
|
|
1446
|
+
type SubAccountsUsageResponse = DataResponse<SubAccountsUsage>;
|
|
1398
1447
|
interface MetricsEngagement {
|
|
1399
1448
|
/**
|
|
1400
1449
|
* A series of metrics aggregations bucketed by time interval (e.g. hour, day).
|
|
@@ -1404,25 +1453,74 @@ interface MetricsEngagement {
|
|
|
1404
1453
|
clickTrackingDelivered: MetricsBucket[];
|
|
1405
1454
|
open: MetricsBucket[];
|
|
1406
1455
|
openTrackingDelivered: MetricsBucket[];
|
|
1456
|
+
uniqueClick?: MetricsBucket[];
|
|
1457
|
+
uniqueClickTrackingDelivered?: MetricsBucket[];
|
|
1458
|
+
uniqueOpen?: MetricsBucket[];
|
|
1459
|
+
uniqueOpenTrackingDelivered?: MetricsBucket[];
|
|
1407
1460
|
};
|
|
1461
|
+
/**
|
|
1462
|
+
* Count of click events by recipients.
|
|
1463
|
+
*/
|
|
1408
1464
|
click: number;
|
|
1465
|
+
/**
|
|
1466
|
+
* Count of recipients of delivered messages with HTML content that contains tracked click URLs, where click tracking is enabled in the send request.
|
|
1467
|
+
*/
|
|
1409
1468
|
clickTrackingDelivered: number;
|
|
1469
|
+
/**
|
|
1470
|
+
* The end of the time range for retrieving message engagement metrics (exclusive).
|
|
1471
|
+
*/
|
|
1410
1472
|
endTime: string;
|
|
1473
|
+
/**
|
|
1474
|
+
* Count of open events by recipients.
|
|
1475
|
+
*/
|
|
1411
1476
|
open: number;
|
|
1477
|
+
/**
|
|
1478
|
+
* Count of recipients of delivered messages with HTML content where open tracking was enabled in the send request.
|
|
1479
|
+
*/
|
|
1412
1480
|
openTrackingDelivered: number;
|
|
1481
|
+
/**
|
|
1482
|
+
* The beginning of the time range for retrieving message engagement metrics (inclusive).
|
|
1483
|
+
*/
|
|
1413
1484
|
startTime: string;
|
|
1485
|
+
/**
|
|
1486
|
+
* Count of distinct messages that had at least one click event.
|
|
1487
|
+
* Unlike `click`, each message is counted at most once regardless of how many links were clicked or how many times.
|
|
1488
|
+
* Use this to compute click rates without exceeding 100%.
|
|
1489
|
+
*/
|
|
1490
|
+
uniqueClick?: number;
|
|
1491
|
+
/**
|
|
1492
|
+
* Count of distinct messages delivered with click tracking enabled (message-level, not recipient-level).
|
|
1493
|
+
* Use as the denominator when computing unique click rates.
|
|
1494
|
+
*/
|
|
1495
|
+
uniqueClickTrackingDelivered?: number;
|
|
1496
|
+
/**
|
|
1497
|
+
* Count of distinct messages that had at least one open event.
|
|
1498
|
+
* Unlike `open`, each message is counted at most once regardless of how many times its tracking pixel was fired.
|
|
1499
|
+
* Use this to compute open rates without exceeding 100%.
|
|
1500
|
+
*/
|
|
1501
|
+
uniqueOpen?: number;
|
|
1502
|
+
/**
|
|
1503
|
+
* Count of distinct messages delivered with open tracking enabled (message-level, not recipient-level).
|
|
1504
|
+
* Use as the denominator when computing unique open rates.
|
|
1505
|
+
*/
|
|
1506
|
+
uniqueOpenTrackingDelivered?: number;
|
|
1414
1507
|
}
|
|
1415
1508
|
type MetricsEngagementResponse = DataResponse<MetricsEngagement>;
|
|
1416
1509
|
interface MetricsPerformance {
|
|
1417
1510
|
/**
|
|
1418
|
-
* Count of messages bounced during the specified time range.
|
|
1511
|
+
* Count of messages hard-bounced during the specified time range.
|
|
1419
1512
|
*/
|
|
1420
1513
|
bounced: number;
|
|
1514
|
+
/**
|
|
1515
|
+
* Count of messages complained during the specified time range.
|
|
1516
|
+
*/
|
|
1517
|
+
complained: number;
|
|
1421
1518
|
/**
|
|
1422
1519
|
* A series of metrics aggregations bucketed by time interval (e.g. hour, day).
|
|
1423
1520
|
*/
|
|
1424
1521
|
buckets: {
|
|
1425
1522
|
bounced: MetricsBucket[];
|
|
1523
|
+
complained: MetricsBucket[];
|
|
1426
1524
|
delivered: MetricsBucket[];
|
|
1427
1525
|
processed: MetricsBucket[];
|
|
1428
1526
|
};
|
|
@@ -1494,108 +1592,369 @@ interface MetricsVolume {
|
|
|
1494
1592
|
/**
|
|
1495
1593
|
* Count of messages processed during the specified time range.
|
|
1496
1594
|
*/
|
|
1497
|
-
processed: number;
|
|
1595
|
+
processed: number;
|
|
1596
|
+
/**
|
|
1597
|
+
* The beginning of the time range for retrieving message volume metrics (inclusive).
|
|
1598
|
+
*/
|
|
1599
|
+
startTime: string;
|
|
1600
|
+
}
|
|
1601
|
+
type MetricsVolumeResponse = DataResponse<MetricsVolume>;
|
|
1602
|
+
type MetricsUsageResponse = DataResponse<{
|
|
1603
|
+
/**
|
|
1604
|
+
* The end date of the current billing period (ISO 8601 format).
|
|
1605
|
+
* @example "2025-04-11"
|
|
1606
|
+
*/
|
|
1607
|
+
endDate?: string;
|
|
1608
|
+
/**
|
|
1609
|
+
* The start date of the current billing period (ISO 8601 format).
|
|
1610
|
+
* @example "2025-03-12"
|
|
1611
|
+
*/
|
|
1612
|
+
startDate?: string;
|
|
1613
|
+
/**
|
|
1614
|
+
* The total usage for the current billing period.
|
|
1615
|
+
*/
|
|
1616
|
+
total: number;
|
|
1617
|
+
}>;
|
|
1618
|
+
type MetricsSendersType = "sub-accounts" | "campaigns";
|
|
1619
|
+
interface MetricsSendersOptions {
|
|
1620
|
+
/**
|
|
1621
|
+
* The beginning of the time range for retrieving top senders metrics (inclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` or a `Date` object. Defaults to one month ago if not provided.
|
|
1622
|
+
* @example "2025-11-02T03:13:35.761763554Z"
|
|
1623
|
+
*/
|
|
1624
|
+
startTime?: string | Date;
|
|
1625
|
+
/**
|
|
1626
|
+
* The end of the time range for retrieving top senders metrics (exclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` or a `Date` object. Defaults to the current time if not provided.
|
|
1627
|
+
* @example "2025-12-02T03:13:35.761763554Z"
|
|
1628
|
+
*/
|
|
1629
|
+
endTime?: string | Date;
|
|
1630
|
+
/**
|
|
1631
|
+
* The maximum number of senders to return. Possible values are 1 to 1000.
|
|
1632
|
+
* @default 10
|
|
1633
|
+
*/
|
|
1634
|
+
limit?: number;
|
|
1635
|
+
/**
|
|
1636
|
+
* The number of senders to skip before returning results.
|
|
1637
|
+
* @default 0
|
|
1638
|
+
*/
|
|
1639
|
+
offset?: number;
|
|
1640
|
+
/**
|
|
1641
|
+
* The order in which to sort the results, based on total messages (processed + dropped).
|
|
1642
|
+
* @default "desc"
|
|
1643
|
+
*/
|
|
1644
|
+
sortOrder?: "asc" | "desc";
|
|
1645
|
+
}
|
|
1646
|
+
interface MetricsSenders {
|
|
1647
|
+
endTime: string;
|
|
1648
|
+
limit: number;
|
|
1649
|
+
offset: number;
|
|
1650
|
+
senders: {
|
|
1651
|
+
bounced: number;
|
|
1652
|
+
delivered: number;
|
|
1653
|
+
dropped: number;
|
|
1654
|
+
/**
|
|
1655
|
+
* Maximum character length: 255
|
|
1656
|
+
*/
|
|
1657
|
+
name: string;
|
|
1658
|
+
processed: number;
|
|
1659
|
+
}[];
|
|
1660
|
+
startTime: string;
|
|
1661
|
+
/**
|
|
1662
|
+
* The total number of senders in this category that sent messages in the given time range.
|
|
1663
|
+
*/
|
|
1664
|
+
total: number;
|
|
1665
|
+
}
|
|
1666
|
+
type MetricsSendersResponse = DataResponse<MetricsSenders>;
|
|
1667
|
+
interface MetricsBucket {
|
|
1668
|
+
/**
|
|
1669
|
+
* The number of events or occurrences aggregated within this time period.
|
|
1670
|
+
*/
|
|
1671
|
+
count: number;
|
|
1672
|
+
/**
|
|
1673
|
+
* The starting date and time of the time period this bucket represents.
|
|
1674
|
+
*/
|
|
1675
|
+
periodStart: string;
|
|
1676
|
+
}
|
|
1677
|
+
interface MetricsOptions {
|
|
1678
|
+
/**
|
|
1679
|
+
* The beginning of the time range for retrieving message metrics (inclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` or a `Date` object. Defaults to one month ago if not provided.
|
|
1680
|
+
* @example "2025-05-26"
|
|
1681
|
+
*/
|
|
1682
|
+
startTime?: string | Date;
|
|
1683
|
+
/**
|
|
1684
|
+
* The end of the time range for retrieving message metrics (exclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` or a `Date` object. Defaults to the current time if not provided.
|
|
1685
|
+
* @example "2025-05-31T15:16:17Z"
|
|
1686
|
+
*/
|
|
1687
|
+
endTime?: string | Date;
|
|
1688
|
+
/**
|
|
1689
|
+
* The ID of the campaign to filter metrics by. If not provided, metrics for all campaigns will be returned.
|
|
1690
|
+
*/
|
|
1691
|
+
campaignId?: string;
|
|
1692
|
+
/**
|
|
1693
|
+
* The interval for aggregating metrics data.
|
|
1694
|
+
* @default "day"
|
|
1695
|
+
*/
|
|
1696
|
+
interval?: "hour" | "day" | "week" | "month";
|
|
1697
|
+
}
|
|
1698
|
+
type SuppressionsTypes = "transactional" | "non-transactional";
|
|
1699
|
+
interface SuppressionsCreateOptions {
|
|
1700
|
+
/**
|
|
1701
|
+
* If true, the parent account creates suppression entries for all associated sub-accounts. This field is only applicable to parent accounts. Sub-accounts cannot create entries for other sub-accounts.
|
|
1702
|
+
* @default false
|
|
1703
|
+
*/
|
|
1704
|
+
addToSubAccounts?: boolean;
|
|
1705
|
+
/**
|
|
1706
|
+
* The total number of suppression entries to create, for the parent and/or its sub-accounts, must not exceed `1000`.
|
|
1707
|
+
*/
|
|
1708
|
+
entries: {
|
|
1709
|
+
/**
|
|
1710
|
+
* Must be less than `1024` characters.
|
|
1711
|
+
*/
|
|
1712
|
+
notes?: string;
|
|
1713
|
+
/**
|
|
1714
|
+
* The email address to suppress. Must be a valid email address format and less than `255` characters.
|
|
1715
|
+
*/
|
|
1716
|
+
recipient: string;
|
|
1717
|
+
/**
|
|
1718
|
+
* An array of types of suppression to apply to the recipient.
|
|
1719
|
+
* @default ["non-transactional"]
|
|
1720
|
+
*/
|
|
1721
|
+
types?: SuppressionsTypes[];
|
|
1722
|
+
}[];
|
|
1723
|
+
}
|
|
1724
|
+
type SuppressionsSource = "api" | "unsubscribe_link" | "list_unsubscribe" | "hard_bounce" | "spam_complaint" | "all";
|
|
1725
|
+
interface SuppressionsListOptions {
|
|
1726
|
+
/**
|
|
1727
|
+
* The email address of the suppression entry to search for. If provided, the search will return the suppression entry associated with this recipient. If not provided, the search will return all suppression entries for the account.
|
|
1728
|
+
*/
|
|
1729
|
+
recipient?: string;
|
|
1730
|
+
/**
|
|
1731
|
+
* The source of the suppression entries to filter by. If not provided, suppression entries from all sources will be returned.
|
|
1732
|
+
*/
|
|
1733
|
+
source?: Exclude<SuppressionsSource, "all">;
|
|
1734
|
+
/**
|
|
1735
|
+
* The date and/or time before which the suppression entries were created. Format: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` or a `Date` object.
|
|
1736
|
+
*/
|
|
1737
|
+
createdBefore?: string | Date;
|
|
1738
|
+
/**
|
|
1739
|
+
* The date and/or time after which the suppression entries were created. Format: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` or a `Date` object.
|
|
1740
|
+
*/
|
|
1741
|
+
createdAfter?: string | Date;
|
|
1742
|
+
/**
|
|
1743
|
+
* The maximum number of suppression entries to return. Must be between `1` and `1000`.
|
|
1744
|
+
* @default 1000
|
|
1745
|
+
*/
|
|
1746
|
+
limit?: number;
|
|
1747
|
+
/**
|
|
1748
|
+
* The number of suppression entries to skip before returning results.
|
|
1749
|
+
* @default 0
|
|
1750
|
+
*/
|
|
1751
|
+
offset?: number;
|
|
1752
|
+
}
|
|
1753
|
+
interface SuppressionsListEntry {
|
|
1754
|
+
createdAt: string;
|
|
1755
|
+
notes?: string;
|
|
1498
1756
|
/**
|
|
1499
|
-
* The
|
|
1757
|
+
* The email address that is suppressed.
|
|
1500
1758
|
*/
|
|
1501
|
-
|
|
1759
|
+
recipient: string;
|
|
1760
|
+
sender?: string;
|
|
1761
|
+
source: SuppressionsSource;
|
|
1762
|
+
types: SuppressionsTypes[];
|
|
1502
1763
|
}
|
|
1503
|
-
type
|
|
1504
|
-
|
|
1764
|
+
type SuppressionsListResponse = DataResponse<SuppressionsListEntry[]>;
|
|
1765
|
+
declare class SubAccountsApiKeys {
|
|
1766
|
+
private mailchannels;
|
|
1767
|
+
constructor(mailchannels: MailChannelsClient);
|
|
1505
1768
|
/**
|
|
1506
|
-
*
|
|
1507
|
-
* @
|
|
1769
|
+
* Creates a new API key for the specified sub-account.
|
|
1770
|
+
* @param handle - Handle of the sub-account to create API key for.
|
|
1771
|
+
* @example
|
|
1772
|
+
* ```ts
|
|
1773
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1774
|
+
* const { data, error } = await mailchannels.subAccounts.apiKeys.create('validhandle123')
|
|
1775
|
+
* ```
|
|
1508
1776
|
*/
|
|
1509
|
-
|
|
1777
|
+
create(handle: string): Promise<SubAccountsApiKeysCreateResponse>;
|
|
1510
1778
|
/**
|
|
1511
|
-
*
|
|
1512
|
-
* @
|
|
1779
|
+
* Retrieves details of all API keys associated with the specified sub-account. For security reasons, the full API key is not returned; only the key ID and a partially redacted version are provided.
|
|
1780
|
+
* @param handle - Handle of the sub-account to retrieve the API key for.
|
|
1781
|
+
* @param options - The options to filter the list of API keys.
|
|
1782
|
+
* @example
|
|
1783
|
+
* ```ts
|
|
1784
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1785
|
+
* const { data, error } = await mailchannels.subAccounts.apiKeys.list('validhandle123')
|
|
1786
|
+
* ```
|
|
1513
1787
|
*/
|
|
1514
|
-
|
|
1788
|
+
list(handle: string, options?: SubAccountsApiKeysListOptions): Promise<SubAccountsApiKeysListResponse>;
|
|
1515
1789
|
/**
|
|
1516
|
-
*
|
|
1790
|
+
* Deletes the API key identified by its ID for the specified sub-account.
|
|
1791
|
+
* @param handle - Handle of the sub-account for which the API key should be deleted.
|
|
1792
|
+
* @param id - The ID of the API key to delete.
|
|
1793
|
+
* @example
|
|
1794
|
+
* ```ts
|
|
1795
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1796
|
+
* const { success, error } = await mailchannels.subAccounts.apiKeys.delete('validhandle123', 1)
|
|
1797
|
+
* ```
|
|
1517
1798
|
*/
|
|
1518
|
-
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1799
|
+
delete(handle: string, id: number): Promise<SuccessResponse>;
|
|
1800
|
+
}
|
|
1801
|
+
declare class SubAccountsSmtpPasswords {
|
|
1802
|
+
private mailchannels;
|
|
1803
|
+
constructor(mailchannels: MailChannelsClient);
|
|
1522
1804
|
/**
|
|
1523
|
-
*
|
|
1524
|
-
* @
|
|
1805
|
+
* Creates a new SMTP password for the specified sub-account.
|
|
1806
|
+
* @param handle - Handle of the sub-account to create SMTP password for.
|
|
1807
|
+
* @example
|
|
1808
|
+
* ```ts
|
|
1809
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1810
|
+
* const { data, error } = await mailchannels.subAccounts.smtpPasswords.create('validhandle123')
|
|
1811
|
+
* ```
|
|
1525
1812
|
*/
|
|
1526
|
-
|
|
1813
|
+
create(handle: string): Promise<SubAccountsSmtpPasswordsCreateResponse>;
|
|
1527
1814
|
/**
|
|
1528
|
-
*
|
|
1529
|
-
* @
|
|
1815
|
+
* Retrieves details of all SMTP passwords associated with the specified sub-account. For security, the full SMTP password is not returned; only the password ID and a partially redacted version are provided.
|
|
1816
|
+
* @param handle - Handle of the sub-account to retrieve the SMTP password for.
|
|
1817
|
+
* @example
|
|
1818
|
+
* ```ts
|
|
1819
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1820
|
+
* const { data, error } = await mailchannels.subAccounts.smtpPasswords.list('validhandle123')
|
|
1821
|
+
* ```
|
|
1530
1822
|
*/
|
|
1531
|
-
|
|
1823
|
+
list(handle: string): Promise<SubAccountsSmtpPasswordsListResponse>;
|
|
1532
1824
|
/**
|
|
1533
|
-
*
|
|
1534
|
-
* @
|
|
1825
|
+
* Deletes the SMTP password identified by its ID for the specified sub-account.
|
|
1826
|
+
* @param handle - Handle of the sub-account for which the SMTP password should be deleted.
|
|
1827
|
+
* @param id - The ID of the SMTP password to delete.
|
|
1828
|
+
* @example
|
|
1829
|
+
* ```ts
|
|
1830
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1831
|
+
* const { success, error } = await mailchannels.subAccounts.smtpPasswords.delete('validhandle123', 1)
|
|
1832
|
+
* ```
|
|
1535
1833
|
*/
|
|
1536
|
-
|
|
1834
|
+
delete(handle: string, id: number): Promise<SuccessResponse>;
|
|
1835
|
+
}
|
|
1836
|
+
declare class SubAccountsLimits {
|
|
1837
|
+
private mailchannels;
|
|
1838
|
+
constructor(mailchannels: MailChannelsClient);
|
|
1537
1839
|
/**
|
|
1538
|
-
*
|
|
1539
|
-
* @
|
|
1840
|
+
* Retrieves the limit of a specified sub-account. A value of `-1` indicates that the sub-account inherits the parent account's limit, allowing the sub-account to utilize any remaining capacity within the parent account's allocation.
|
|
1841
|
+
* @param handle - Handle of the sub-account to retrieve the limit for.
|
|
1842
|
+
* @example
|
|
1843
|
+
* ```ts
|
|
1844
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1845
|
+
* const { data, error } = await mailchannels.subAccounts.limits.get('validhandle123')
|
|
1846
|
+
* ```
|
|
1540
1847
|
*/
|
|
1541
|
-
|
|
1848
|
+
get(handle: string): Promise<SubAccountsLimitsGetResponse>;
|
|
1542
1849
|
/**
|
|
1543
|
-
*
|
|
1544
|
-
* @
|
|
1850
|
+
* Sets the limit for the specified sub-account.
|
|
1851
|
+
* @param handle - Handle of the sub-account to set limit for.
|
|
1852
|
+
* @param options - The limits to set for the sub-account. The minimum allowed sends is `0`
|
|
1853
|
+
* @example
|
|
1854
|
+
* ```ts
|
|
1855
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1856
|
+
* const { success, error } = await mailchannels.subAccounts.limits.set('validhandle123', { sends: 1000 })
|
|
1857
|
+
* ```
|
|
1545
1858
|
*/
|
|
1546
|
-
|
|
1547
|
-
}
|
|
1548
|
-
interface MetricsSenders {
|
|
1549
|
-
endTime: string;
|
|
1550
|
-
limit: number;
|
|
1551
|
-
offset: number;
|
|
1552
|
-
senders: {
|
|
1553
|
-
bounced: number;
|
|
1554
|
-
delivered: number;
|
|
1555
|
-
dropped: number;
|
|
1556
|
-
/**
|
|
1557
|
-
* Maximum character length: 255
|
|
1558
|
-
*/
|
|
1559
|
-
name: string;
|
|
1560
|
-
processed: number;
|
|
1561
|
-
}[];
|
|
1562
|
-
startTime: string;
|
|
1859
|
+
set(handle: string, options: SubAccountsLimitsSetOptions): Promise<SuccessResponse>;
|
|
1563
1860
|
/**
|
|
1564
|
-
*
|
|
1861
|
+
* Deletes the limit for the specified sub-account. After a successful deletion, the specified sub-account will be limited to the parent account's limit.
|
|
1862
|
+
* @param handle - Handle of the sub-account to delete limit for.
|
|
1863
|
+
* @example
|
|
1864
|
+
* ```ts
|
|
1865
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1866
|
+
* const { success, error } = await mailchannels.subAccounts.limits.delete('validhandle123')
|
|
1867
|
+
* ```
|
|
1565
1868
|
*/
|
|
1566
|
-
|
|
1869
|
+
delete(handle: string): Promise<SuccessResponse>;
|
|
1567
1870
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1871
|
+
declare class SubAccounts {
|
|
1872
|
+
protected mailchannels: MailChannelsClient;
|
|
1873
|
+
private static readonly COMPANY_PATTERN;
|
|
1874
|
+
private static readonly HANDLE_PATTERN;
|
|
1875
|
+
readonly apiKeys: SubAccountsApiKeys;
|
|
1876
|
+
readonly smtpPasswords: SubAccountsSmtpPasswords;
|
|
1877
|
+
readonly limits: SubAccountsLimits;
|
|
1878
|
+
constructor(mailchannels: MailChannelsClient);
|
|
1570
1879
|
/**
|
|
1571
|
-
*
|
|
1880
|
+
* Creates a new sub-account under the parent account. Each sub-account must have a unique handle composed solely of lowercase alphanumeric characters. If no handle is provided, a random handle will be generated. Note that Sub-accounts are only available to parent accounts on 100K and higher plans.
|
|
1881
|
+
* @param companyName - The name of the company associated with the sub-account. This name is used for display purposes only and does not affect the functionality of the sub-account. The length must be between 3 and 128 characters.
|
|
1882
|
+
* @param handle - A unique name for the sub-account to be created. The length must be between 3 and 128 characters, and it may contain only lowercase letters and numbers. If not provided, a random handle will be generated.
|
|
1883
|
+
* @example
|
|
1884
|
+
* ```ts
|
|
1885
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1886
|
+
* const { data, error } = await mailchannels.subAccounts.create('My Company', 'validhandle123')
|
|
1887
|
+
* ```
|
|
1572
1888
|
*/
|
|
1573
|
-
|
|
1889
|
+
create(companyName: string, handle?: string): Promise<SubAccountsCreateResponse>;
|
|
1574
1890
|
/**
|
|
1575
|
-
* The
|
|
1891
|
+
* Retrieves all sub-accounts associated with the parent account. The response is paginated with a default limit of 1000 sub-accounts per page and an offset of 0.
|
|
1892
|
+
* @param options - The options to filter the list of sub-accounts.
|
|
1893
|
+
* @example
|
|
1894
|
+
* ```ts
|
|
1895
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1896
|
+
* const { data, error } = await mailchannels.subAccounts.list()
|
|
1897
|
+
* ```
|
|
1576
1898
|
*/
|
|
1577
|
-
|
|
1578
|
-
}
|
|
1579
|
-
interface MetricsOptions {
|
|
1899
|
+
list(options?: SubAccountsListOptions): Promise<SubAccountsListResponse>;
|
|
1580
1900
|
/**
|
|
1581
|
-
*
|
|
1582
|
-
* @
|
|
1901
|
+
* Deletes the sub-account identified by its handle.
|
|
1902
|
+
* @param handle - Handle of sub-account to be deleted.
|
|
1903
|
+
* @example
|
|
1904
|
+
* ```ts
|
|
1905
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1906
|
+
* const { success, error } = await mailchannels.subAccounts.delete('validhandle123')
|
|
1907
|
+
* ```
|
|
1583
1908
|
*/
|
|
1584
|
-
|
|
1909
|
+
delete(handle: string): Promise<SuccessResponse>;
|
|
1585
1910
|
/**
|
|
1586
|
-
*
|
|
1587
|
-
* @
|
|
1911
|
+
* Suspends the sub-account identified by its handle. This action disables the account, preventing it from sending any emails until it is reactivated.
|
|
1912
|
+
* @param handle - Handle of sub-account to be suspended.
|
|
1913
|
+
* @example
|
|
1914
|
+
* ```ts
|
|
1915
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1916
|
+
* const { success, error } = await mailchannels.subAccounts.suspend('validhandle123')
|
|
1917
|
+
* ```
|
|
1588
1918
|
*/
|
|
1589
|
-
|
|
1919
|
+
suspend(handle: string): Promise<SuccessResponse>;
|
|
1590
1920
|
/**
|
|
1591
|
-
*
|
|
1921
|
+
* Activates a suspended sub-account identified by its handle, restoring its ability to send emails.
|
|
1922
|
+
* @param handle - Handle of sub-account to be activated.
|
|
1923
|
+
* @example
|
|
1924
|
+
* ```ts
|
|
1925
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1926
|
+
* const { success, error } = await mailchannels.subAccounts.activate('validhandle123')
|
|
1927
|
+
* ```
|
|
1592
1928
|
*/
|
|
1593
|
-
|
|
1929
|
+
activate(handle: string): Promise<SuccessResponse>;
|
|
1594
1930
|
/**
|
|
1595
|
-
*
|
|
1596
|
-
* @
|
|
1931
|
+
* Retrieves usage statistics for the specified sub-account during the current billing period.
|
|
1932
|
+
* @param handle - Handle of the sub-account to query usage stats for.
|
|
1933
|
+
* @example
|
|
1934
|
+
* ```ts
|
|
1935
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1936
|
+
* const { data, error } = await mailchannels.subAccounts.getUsage('validhandle123')
|
|
1937
|
+
* ```
|
|
1597
1938
|
*/
|
|
1598
|
-
|
|
1939
|
+
getUsage(handle: string): Promise<SubAccountsUsageResponse>;
|
|
1940
|
+
/** @deprecated Use `apiKeys.create` instead. */
|
|
1941
|
+
createApiKey(...args: Parameters<SubAccountsApiKeys["create"]>): Promise<SubAccountsApiKeysCreateResponse>;
|
|
1942
|
+
/** @deprecated Use `apiKeys.list` instead. */
|
|
1943
|
+
listApiKeys(...args: Parameters<SubAccountsApiKeys["list"]>): Promise<SubAccountsApiKeysListResponse>;
|
|
1944
|
+
/** @deprecated Use `apiKeys.delete` instead. */
|
|
1945
|
+
deleteApiKey(...args: Parameters<SubAccountsApiKeys["delete"]>): Promise<SuccessResponse>;
|
|
1946
|
+
/** @deprecated Use `smtpPasswords.create` instead. */
|
|
1947
|
+
createSmtpPassword(...args: Parameters<SubAccountsSmtpPasswords["create"]>): Promise<SubAccountsSmtpPasswordsCreateResponse>;
|
|
1948
|
+
/** @deprecated Use `smtpPasswords.list` instead. */
|
|
1949
|
+
listSmtpPasswords(...args: Parameters<SubAccountsSmtpPasswords["list"]>): Promise<SubAccountsSmtpPasswordsListResponse>;
|
|
1950
|
+
/** @deprecated Use `smtpPasswords.delete` instead. */
|
|
1951
|
+
deleteSmtpPassword(...args: Parameters<SubAccountsSmtpPasswords["delete"]>): Promise<SuccessResponse>;
|
|
1952
|
+
/** @deprecated Use `limits.set` instead. */
|
|
1953
|
+
setLimit(...args: Parameters<SubAccountsLimits["set"]>): Promise<SuccessResponse>;
|
|
1954
|
+
/** @deprecated Use `limits.get` instead. */
|
|
1955
|
+
getLimit(...args: Parameters<SubAccountsLimits["get"]>): Promise<SubAccountsLimitsGetResponse>;
|
|
1956
|
+
/** @deprecated Use `limits.delete` instead. */
|
|
1957
|
+
deleteLimit(...args: Parameters<SubAccountsLimits["delete"]>): Promise<SuccessResponse>;
|
|
1599
1958
|
}
|
|
1600
1959
|
declare class Metrics {
|
|
1601
1960
|
protected mailchannels: MailChannelsClient;
|
|
@@ -1611,7 +1970,7 @@ declare class Metrics {
|
|
|
1611
1970
|
*/
|
|
1612
1971
|
engagement(options?: MetricsOptions): Promise<MetricsEngagementResponse>;
|
|
1613
1972
|
/**
|
|
1614
|
-
* Retrieve performance metrics for messages sent from your account, including counts of processed, delivered, hard-bounced events. Supports optional filters for time range, and campaign ID.
|
|
1973
|
+
* Retrieve performance metrics for messages sent from your account, including counts of processed, delivered, hard-bounced, and complained events. Supports optional filters for time range, and campaign ID.
|
|
1615
1974
|
* @param options - Options to filter and customize the performance metrics retrieval.
|
|
1616
1975
|
* @example
|
|
1617
1976
|
* ```ts
|
|
@@ -1661,73 +2020,6 @@ declare class Metrics {
|
|
|
1661
2020
|
*/
|
|
1662
2021
|
senders(type: MetricsSendersType, options?: MetricsSendersOptions): Promise<MetricsSendersResponse>;
|
|
1663
2022
|
}
|
|
1664
|
-
type SuppressionsTypes = "transactional" | "non-transactional";
|
|
1665
|
-
interface SuppressionsCreateOptions {
|
|
1666
|
-
/**
|
|
1667
|
-
* If true, the parent account creates suppression entries for all associated sub-accounts. This field is only applicable to parent accounts. Sub-accounts cannot create entries for other sub-accounts.
|
|
1668
|
-
* @default false
|
|
1669
|
-
*/
|
|
1670
|
-
addToSubAccounts?: boolean;
|
|
1671
|
-
/**
|
|
1672
|
-
* The total number of suppression entries to create, for the parent and/or its sub-accounts, must not exceed `1000`.
|
|
1673
|
-
*/
|
|
1674
|
-
entries: {
|
|
1675
|
-
/**
|
|
1676
|
-
* Must be less than `1024` characters.
|
|
1677
|
-
*/
|
|
1678
|
-
notes?: string;
|
|
1679
|
-
/**
|
|
1680
|
-
* The email address to suppress. Must be a valid email address format and less than `255` characters.
|
|
1681
|
-
*/
|
|
1682
|
-
recipient: string;
|
|
1683
|
-
/**
|
|
1684
|
-
* An array of types of suppression to apply to the recipient.
|
|
1685
|
-
* @default ["non-transactional"]
|
|
1686
|
-
*/
|
|
1687
|
-
types?: SuppressionsTypes[];
|
|
1688
|
-
}[];
|
|
1689
|
-
}
|
|
1690
|
-
type SuppressionsSource = "api" | "unsubscribe_link" | "list_unsubscribe" | "hard_bounce" | "spam_complaint" | "all";
|
|
1691
|
-
interface SuppressionsListOptions {
|
|
1692
|
-
/**
|
|
1693
|
-
* The email address of the suppression entry to search for. If provided, the search will return the suppression entry associated with this recipient. If not provided, the search will return all suppression entries for the account.
|
|
1694
|
-
*/
|
|
1695
|
-
recipient?: string;
|
|
1696
|
-
/**
|
|
1697
|
-
* The source of the suppression entries to filter by. If not provided, suppression entries from all sources will be returned.
|
|
1698
|
-
*/
|
|
1699
|
-
source?: Exclude<SuppressionsSource, "all">;
|
|
1700
|
-
/**
|
|
1701
|
-
* The date and/or time before which the suppression entries were created. Format: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`.
|
|
1702
|
-
*/
|
|
1703
|
-
createdBefore?: string;
|
|
1704
|
-
/**
|
|
1705
|
-
* The date and/or time after which the suppression entries were created. Format: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`.
|
|
1706
|
-
*/
|
|
1707
|
-
createdAfter?: string;
|
|
1708
|
-
/**
|
|
1709
|
-
* The maximum number of suppression entries to return. Must be between `1` and `1000`.
|
|
1710
|
-
* @default 1000
|
|
1711
|
-
*/
|
|
1712
|
-
limit?: number;
|
|
1713
|
-
/**
|
|
1714
|
-
* The number of suppression entries to skip before returning results.
|
|
1715
|
-
* @default 0
|
|
1716
|
-
*/
|
|
1717
|
-
offset?: number;
|
|
1718
|
-
}
|
|
1719
|
-
interface SuppressionsListEntry {
|
|
1720
|
-
createdAt: string;
|
|
1721
|
-
notes?: string;
|
|
1722
|
-
/**
|
|
1723
|
-
* The email address that is suppressed.
|
|
1724
|
-
*/
|
|
1725
|
-
recipient: string;
|
|
1726
|
-
sender?: string;
|
|
1727
|
-
source: SuppressionsSource;
|
|
1728
|
-
types: SuppressionsTypes[];
|
|
1729
|
-
}
|
|
1730
|
-
type SuppressionsListResponse = DataResponse<SuppressionsListEntry[]>;
|
|
1731
2023
|
declare class Suppressions {
|
|
1732
2024
|
protected mailchannels: MailChannelsClient;
|
|
1733
2025
|
constructor(mailchannels: MailChannelsClient);
|
|
@@ -1778,4 +2070,4 @@ declare class MailChannels extends MailChannelsClient {
|
|
|
1778
2070
|
readonly suppressions: Suppressions;
|
|
1779
2071
|
constructor(key: string, options?: MailChannelsClientOptions);
|
|
1780
2072
|
}
|
|
1781
|
-
export { Attachment, type DataResponse, Domains, type DomainsCheckOptions, type DomainsCheckResponse, type DomainsCheckVerdict, type DomainsDkimCreateOptions, type DomainsDkimCreateResponse, type DomainsDkimKey, type DomainsDkimKeyStatus, type DomainsDkimListOptions, type DomainsDkimListResponse, type DomainsDkimRotateOptions, type DomainsDkimRotateResponse, type DomainsDkimUpdateStatusOptions, Emails, type EmailsQueueResponse, type EmailsSendAsyncResponse, type EmailsSendAttachment, type EmailsSendContent, type EmailsSendDkim, type EmailsSendOptions, type EmailsSendPersonalization, type EmailsSendRecipient, type EmailsSendRecipientInput, type EmailsSendResponse, type EmailsSendTemplate, type EmailsSendTemplateType, type EmailsSendTemplateValue, type EmailsSendTracking, type ErrorResponse, type ErrorType, MailChannels, MailChannelsClient, type MailChannelsClientOptions, Metrics, type MetricsBucket, type MetricsEngagement, type MetricsEngagementResponse, type MetricsOptions, type MetricsPerformance, type MetricsPerformanceResponse, type MetricsRecipientBehaviour, type MetricsRecipientBehaviourResponse, type MetricsSenders, type MetricsSendersOptions, type MetricsSendersResponse, type MetricsSendersType, type MetricsUsageResponse, type MetricsVolume, type MetricsVolumeResponse, SubAccounts, type SubAccountsAccount, type SubAccountsApiKey, type SubAccountsCreateApiKeyResponse, type SubAccountsCreateResponse, type SubAccountsCreateSmtpPasswordResponse, type SubAccountsLimit, type SubAccountsLimitResponse, type SubAccountsListApiKeyOptions, type SubAccountsListApiKeyResponse, type SubAccountsListOptions, type SubAccountsListResponse, type SubAccountsListSmtpPasswordResponse, type SubAccountsSmtpPassword, type SubAccountsUsage, type SubAccountsUsageResponse, type SuccessResponse, Suppressions, type SuppressionsCreateOptions, type SuppressionsListEntry, type SuppressionsListOptions, type SuppressionsListResponse, type SuppressionsSource, type SuppressionsTypes, type WebhookEvent, type WebhookEventClick, type WebhookEventComplained, type WebhookEventDelivered, type WebhookEventDropped, type WebhookEventHardBounced, type WebhookEventOpen, type WebhookEventProcessed, type WebhookEventSoftBounced, type WebhookEventTest, type WebhookEventType, type WebhookEventUnsubscribed, Webhooks, type WebhooksBatch, type WebhooksBatchResponseStatus, type WebhooksBatchStatus, type WebhooksBatchesOptions, type WebhooksBatchesResponse, type WebhooksListResponse, type WebhooksResendBatch, type WebhooksResendBatchResponse, type WebhooksSigningKeyResponse, type WebhooksValidateResponse, type WebhooksVerifyOptions, type WebhooksVerifyResponse };
|
|
2073
|
+
export { Attachment, type DataResponse, Domains, type DomainsCheckOptions, type DomainsCheckResponse, type DomainsCheckVerdict, type DomainsCustomTrackingCreateResponse, type DomainsCustomTrackingDnsSetupRequired, type DomainsCustomTrackingDomain, type DomainsCustomTrackingListOptions, type DomainsCustomTrackingListResponse, type DomainsCustomTrackingScope, type DomainsCustomTrackingUpdateOptions, type DomainsCustomTrackingUpdateResponse, type DomainsCustomTrackingWithDnsSetupRequired, type DomainsDkimCreateOptions, type DomainsDkimCreateResponse, type DomainsDkimKey, type DomainsDkimKeyStatus, type DomainsDkimListOptions, type DomainsDkimListResponse, type DomainsDkimRotateOptions, type DomainsDkimRotateResponse, type DomainsDkimUpdateStatusOptions, Emails, type EmailsQueueResponse, type EmailsSendAsyncResponse, type EmailsSendAttachment, type EmailsSendContent, type EmailsSendDkim, type EmailsSendOptions, type EmailsSendPersonalization, type EmailsSendRecipient, type EmailsSendRecipientInput, type EmailsSendResponse, type EmailsSendTemplate, type EmailsSendTemplateType, type EmailsSendTemplateValue, type EmailsSendTracking, type ErrorResponse, type ErrorType, MailChannels, MailChannelsClient, type MailChannelsClientOptions, Metrics, type MetricsBucket, type MetricsEngagement, type MetricsEngagementResponse, type MetricsOptions, type MetricsPerformance, type MetricsPerformanceResponse, type MetricsRecipientBehaviour, type MetricsRecipientBehaviourResponse, type MetricsSenders, type MetricsSendersOptions, type MetricsSendersResponse, type MetricsSendersType, type MetricsUsageResponse, type MetricsVolume, type MetricsVolumeResponse, type SubAccount, SubAccounts, type SubAccountsAccount, type SubAccountsApiKey, type SubAccountsApiKeysCreateResponse, type SubAccountsApiKeysListOptions, type SubAccountsApiKeysListResponse, type SubAccountsCreateApiKeyResponse, type SubAccountsCreateResponse, type SubAccountsCreateSmtpPasswordResponse, type SubAccountsLimit, type SubAccountsLimitResponse, type SubAccountsLimitsGetResponse, type SubAccountsLimitsSetOptions, type SubAccountsListApiKeyOptions, type SubAccountsListApiKeyResponse, type SubAccountsListOptions, type SubAccountsListResponse, type SubAccountsListSmtpPasswordResponse, type SubAccountsSmtpPassword, type SubAccountsSmtpPasswordsCreateResponse, type SubAccountsSmtpPasswordsListResponse, type SubAccountsUsage, type SubAccountsUsageResponse, type SuccessResponse, Suppressions, type SuppressionsCreateOptions, type SuppressionsListEntry, type SuppressionsListOptions, type SuppressionsListResponse, type SuppressionsSource, type SuppressionsTypes, type WebhookEvent, type WebhookEventClick, type WebhookEventComplained, type WebhookEventDelivered, type WebhookEventDropped, type WebhookEventHardBounced, type WebhookEventOpen, type WebhookEventProcessed, type WebhookEventSoftBounced, type WebhookEventTest, type WebhookEventType, type WebhookEventUnsubscribed, Webhooks, type WebhooksBatch, type WebhooksBatchResponseStatus, type WebhooksBatchStatus, type WebhooksBatchesOptions, type WebhooksBatchesResponse, type WebhooksListResponse, type WebhooksResendBatch, type WebhooksResendBatchResponse, type WebhooksSigningKeyResponse, type WebhooksValidateResponse, type WebhooksVerifyOptions, type WebhooksVerifyResponse };
|