@messagebird/sdk 0.16.0 → 0.21.2
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/dist/index.d.mts +610 -470
- package/dist/index.mjs +413 -251
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -36,10 +36,27 @@ interface CoreDefaults {
|
|
|
36
36
|
timeout: number;
|
|
37
37
|
/** Max retry attempts. */
|
|
38
38
|
maxRetries: number;
|
|
39
|
+
/**
|
|
40
|
+
* Extra credentials some operations require on top of the API key, keyed by the
|
|
41
|
+
* security scheme that names them. A generated method names the schemes its
|
|
42
|
+
* operation declares; the core resolves them, so a credential reaches only
|
|
43
|
+
* those operations and never an unrelated request.
|
|
44
|
+
*/
|
|
45
|
+
credentials?: Record<string, {
|
|
46
|
+
header: string;
|
|
47
|
+
value?: string;
|
|
48
|
+
how: string;
|
|
49
|
+
}>;
|
|
39
50
|
}
|
|
40
51
|
declare class BirdHTTPClient {
|
|
41
52
|
private readonly defaults;
|
|
42
53
|
constructor(defaults: CoreDefaults);
|
|
54
|
+
/**
|
|
55
|
+
* Resolve the credential headers an operation's security schemes require.
|
|
56
|
+
* Throws before the request when one is unconfigured, so a caller gets a named
|
|
57
|
+
* error instead of a 401.
|
|
58
|
+
*/
|
|
59
|
+
credentialHeaders(schemes: string[] | undefined, override?: Record<string, string>): Record<string, string>;
|
|
43
60
|
/**
|
|
44
61
|
* Run a generated hey-api SDK call through the request lifecycle.
|
|
45
62
|
*
|
|
@@ -206,6 +223,12 @@ declare class BirdRateLimitError extends BirdAPIError {
|
|
|
206
223
|
//#region src/core/result.d.ts
|
|
207
224
|
/** Per-request overrides accepted by every resource method. */
|
|
208
225
|
interface RequestOptions {
|
|
226
|
+
/**
|
|
227
|
+
* Per-call override for the extra credentials an operation requires, keyed by
|
|
228
|
+
* security scheme (`{ RealtimeKey: "…", RealtimeSecret: "…" }`). Overrides the
|
|
229
|
+
* client config for this call, so one client can address several apps.
|
|
230
|
+
*/
|
|
231
|
+
credentials?: Record<string, string>;
|
|
209
232
|
/** Idempotency key; auto-generated for mutations if omitted, reused on retry. */
|
|
210
233
|
idempotencyKey?: string;
|
|
211
234
|
/** Caller cancellation. Rejects with the native `AbortError`. */
|
|
@@ -323,11 +346,11 @@ type EventWhatsAppBase = {
|
|
|
323
346
|
*/
|
|
324
347
|
direction: "outbound" | "inbound";
|
|
325
348
|
/**
|
|
326
|
-
* Sender of the message. On outbound messages, the business number it was sent from.
|
|
349
|
+
* Sender of the message. On outbound messages, the business number it was sent from; on inbound, the WhatsApp contact.
|
|
327
350
|
*/
|
|
328
351
|
from: WhatsAppAddress;
|
|
329
352
|
/**
|
|
330
|
-
* Recipient of the message. On outbound messages, the WhatsApp contact.
|
|
353
|
+
* Recipient of the message. On outbound messages, the WhatsApp contact; on inbound, the business number.
|
|
331
354
|
*/
|
|
332
355
|
to: WhatsAppAddress;
|
|
333
356
|
/**
|
|
@@ -370,12 +393,12 @@ type EventWhatsAppRejectedData = EventWhatsAppBase & {
|
|
|
370
393
|
* Failure reason, uniform whether the failure happened internally or was reported by the WhatsApp network. `insufficient_balance`: the workspace could not afford the send. `price_not_found`: no price was configured for this destination/template combination. `internal_error`: an unexpected Bird-side failure. `undeliverable`: the recipient could not be reached (for example not on WhatsApp, or the number is invalid). `service_window_expired`: the 24-hour customer care window has closed and a free-form message cannot be sent; send a template instead. `rate_limited`: the send was throttled. `recipient_suppressed`: the recipient is on the workspace's suppression list; the message was rejected before sending. Open enum: new codes may be added over time, so treat any unrecognized value as a future code rather than an error.
|
|
371
394
|
*
|
|
372
395
|
*/
|
|
373
|
-
type WhatsAppErrorCode = string;
|
|
396
|
+
type WhatsAppErrorCode$1 = "insufficient_balance" | "price_not_found" | "internal_error" | "undeliverable" | "service_window_expired" | "rate_limited" | "recipient_suppressed" | (string & {});
|
|
374
397
|
/**
|
|
375
398
|
* Failure detail for a message that could not be delivered or was rejected.
|
|
376
399
|
*/
|
|
377
400
|
type WhatsAppError = {
|
|
378
|
-
code: WhatsAppErrorCode;
|
|
401
|
+
code: WhatsAppErrorCode$1;
|
|
379
402
|
/**
|
|
380
403
|
* Human-readable explanation of the failure.
|
|
381
404
|
*/
|
|
@@ -390,7 +413,7 @@ type WhatsAppError = {
|
|
|
390
413
|
readonly occurred_at: string;
|
|
391
414
|
} | null;
|
|
392
415
|
/**
|
|
393
|
-
* Bird rejected the message before sending it to WhatsApp (the recipient is on the workspace suppression list).
|
|
416
|
+
* Bird rejected the message before sending it to WhatsApp (the recipient is on the workspace suppression list, the wallet had insufficient balance, or the destination is unpriced). It was not sent and not charged.
|
|
394
417
|
*/
|
|
395
418
|
type EventWhatsAppRejected = {
|
|
396
419
|
/**
|
|
@@ -510,11 +533,11 @@ type EventVoiceBase = {
|
|
|
510
533
|
/**
|
|
511
534
|
* Calling party number in E.164 format.
|
|
512
535
|
*/
|
|
513
|
-
|
|
536
|
+
from: string;
|
|
514
537
|
/**
|
|
515
538
|
* Called party number in E.164 format.
|
|
516
539
|
*/
|
|
517
|
-
|
|
540
|
+
to: string;
|
|
518
541
|
};
|
|
519
542
|
/**
|
|
520
543
|
* A call was initiated — Bird received the INVITE and began routing it.
|
|
@@ -600,7 +623,7 @@ type EventVerifyVerificationVerifiedData = EventVerifyBase & {
|
|
|
600
623
|
/**
|
|
601
624
|
* The channel whose passcode the recipient confirmed, the channel that converted. Null when the verification was resolved without attributing a channel.
|
|
602
625
|
*/
|
|
603
|
-
channel: VerificationChannel | null;
|
|
626
|
+
channel: VerificationChannel$1 | null;
|
|
604
627
|
/**
|
|
605
628
|
* Time the verification was verified.
|
|
606
629
|
*/
|
|
@@ -609,7 +632,7 @@ type EventVerifyVerificationVerifiedData = EventVerifyBase & {
|
|
|
609
632
|
/**
|
|
610
633
|
* The channel a passcode is delivered over. Open enum — new channels may be added over time, so treat any unrecognized value as a future channel rather than an error.
|
|
611
634
|
*/
|
|
612
|
-
type VerificationChannel = string;
|
|
635
|
+
type VerificationChannel$1 = "email" | "sms" | "whatsapp" | (string & {});
|
|
613
636
|
/**
|
|
614
637
|
* The recipient to verify. Provide an `email_address`, a `phone_number`, or both; at least one is required. The addresses also identify the verification: a check must supply exactly the set used on the create call, so a verification created with both addresses is not found by either one alone.
|
|
615
638
|
*
|
|
@@ -670,7 +693,7 @@ type EventVerifyVerificationCreatedData = EventVerifyBase & {
|
|
|
670
693
|
/**
|
|
671
694
|
* The first channel of the verification's resolved channel plan.
|
|
672
695
|
*/
|
|
673
|
-
channel: VerificationChannel;
|
|
696
|
+
channel: VerificationChannel$1;
|
|
674
697
|
/**
|
|
675
698
|
* The verification's state at creation, always `pending`. Open enum for forward compatibility.
|
|
676
699
|
*/
|
|
@@ -695,9 +718,9 @@ type EventVerifyVerificationCreated = {
|
|
|
695
718
|
data: EventVerifyVerificationCreatedData;
|
|
696
719
|
};
|
|
697
720
|
/**
|
|
698
|
-
* Why a passcode send did not deliver. Open enum — new reasons may be added over time, so treat any unrecognized value as a future reason rather than an error. Emitted reasons are `carrier_rejected` (SMS), `hard_bounce` (email, permanent bounce), `soft_bounce` (email, transient bounce such as a full mailbox), `undelivered` (a generic delivery failure),
|
|
721
|
+
* Why a passcode send did not deliver. Open enum — new reasons may be added over time, so treat any unrecognized value as a future reason rather than an error. Emitted reasons are `carrier_rejected` (SMS), `hard_bounce` (email, permanent bounce), `soft_bounce` (email, transient bounce such as a full mailbox), `undelivered` (a generic delivery failure), `channel_unavailable` (the channel could not be used and the verification failed over), and `channel_disabled` (Bird has temporarily stopped sending over that channel, so the verification moved on to the next one).
|
|
699
722
|
*/
|
|
700
|
-
type VerificationAttemptFailureReason = string;
|
|
723
|
+
type VerificationAttemptFailureReason$1 = "carrier_rejected" | "hard_bounce" | "soft_bounce" | "undelivered" | "channel_unavailable" | "channel_disabled" | (string & {});
|
|
701
724
|
/**
|
|
702
725
|
* Payload of the verify.attempt.undelivered event.
|
|
703
726
|
*/
|
|
@@ -705,7 +728,7 @@ type EventVerifyAttemptUndeliveredData = EventVerifyBase & {
|
|
|
705
728
|
/**
|
|
706
729
|
* The channel this attempt was sent on.
|
|
707
730
|
*/
|
|
708
|
-
channel: VerificationChannel;
|
|
731
|
+
channel: VerificationChannel$1;
|
|
709
732
|
/**
|
|
710
733
|
* The single address this attempt was dispatched to, an E.164 phone number or an email address.
|
|
711
734
|
*/
|
|
@@ -713,7 +736,7 @@ type EventVerifyAttemptUndeliveredData = EventVerifyBase & {
|
|
|
713
736
|
/**
|
|
714
737
|
* Why the attempt failed to reach the recipient.
|
|
715
738
|
*/
|
|
716
|
-
reason: VerificationAttemptFailureReason;
|
|
739
|
+
reason: VerificationAttemptFailureReason$1;
|
|
717
740
|
/**
|
|
718
741
|
* Diagnostic text describing the failure, for display only. Null when none was reported.
|
|
719
742
|
*/
|
|
@@ -744,7 +767,7 @@ type EventVerifyAttemptSentData = EventVerifyBase & {
|
|
|
744
767
|
/**
|
|
745
768
|
* The channel this attempt was sent on.
|
|
746
769
|
*/
|
|
747
|
-
channel: VerificationChannel;
|
|
770
|
+
channel: VerificationChannel$1;
|
|
748
771
|
/**
|
|
749
772
|
* The single address this attempt was dispatched to, an E.164 phone number or an email address.
|
|
750
773
|
*/
|
|
@@ -779,7 +802,7 @@ type EventVerifyAttemptDeliveredData = EventVerifyBase & {
|
|
|
779
802
|
/**
|
|
780
803
|
* The channel this attempt was sent on.
|
|
781
804
|
*/
|
|
782
|
-
channel: VerificationChannel;
|
|
805
|
+
channel: VerificationChannel$1;
|
|
783
806
|
/**
|
|
784
807
|
* The single address this attempt was dispatched to, an E.164 phone number or an email address.
|
|
785
808
|
*/
|
|
@@ -891,110 +914,6 @@ type EventSmsUndelivered = {
|
|
|
891
914
|
timestamp: string;
|
|
892
915
|
data: EventSmsUndeliveredData;
|
|
893
916
|
};
|
|
894
|
-
/**
|
|
895
|
-
* Payload of the sms.tfn_verification.submitted event.
|
|
896
|
-
*/
|
|
897
|
-
type EventSmsTfnVerificationSubmittedData = EventSmsTfnVerificationBase;
|
|
898
|
-
type SmsSenderId = string;
|
|
899
|
-
type TfnVerificationId = string;
|
|
900
|
-
/**
|
|
901
|
-
* Identity fields shared by every toll-free verification event payload.
|
|
902
|
-
*/
|
|
903
|
-
type EventSmsTfnVerificationBase = {
|
|
904
|
-
/**
|
|
905
|
-
* ID of the toll-free verification.
|
|
906
|
-
*/
|
|
907
|
-
verification_id: TfnVerificationId;
|
|
908
|
-
/**
|
|
909
|
-
* ID of the workspace that owns the verification.
|
|
910
|
-
*/
|
|
911
|
-
workspace_id: WorkspaceId;
|
|
912
|
-
/**
|
|
913
|
-
* Lifecycle state of the verification at the time of the event.
|
|
914
|
-
*/
|
|
915
|
-
status: string;
|
|
916
|
-
/**
|
|
917
|
-
* ID of the toll-free number the verification licenses.
|
|
918
|
-
*/
|
|
919
|
-
sender_id: SmsSenderId;
|
|
920
|
-
};
|
|
921
|
-
/**
|
|
922
|
-
* A toll-free number verification was submitted to the carrier for review.
|
|
923
|
-
*/
|
|
924
|
-
type EventSmsTfnVerificationSubmitted = {
|
|
925
|
-
/**
|
|
926
|
-
* Event type.
|
|
927
|
-
*/
|
|
928
|
-
type: "sms.tfn_verification.submitted";
|
|
929
|
-
/**
|
|
930
|
-
* Time the verification was submitted.
|
|
931
|
-
*/
|
|
932
|
-
timestamp: string;
|
|
933
|
-
data: EventSmsTfnVerificationSubmittedData;
|
|
934
|
-
};
|
|
935
|
-
/**
|
|
936
|
-
* Payload of the sms.tfn_verification.rejected event.
|
|
937
|
-
*/
|
|
938
|
-
type EventSmsTfnVerificationRejectedData = EventSmsTfnVerificationBase & {
|
|
939
|
-
/**
|
|
940
|
-
* Human-readable reasons the carrier gave for the rejection.
|
|
941
|
-
*/
|
|
942
|
-
denial_reasons: Array<string>;
|
|
943
|
-
/**
|
|
944
|
-
* Whether the verification may be corrected and resubmitted within the resubmission window.
|
|
945
|
-
*/
|
|
946
|
-
resubmit_allowed: boolean;
|
|
947
|
-
};
|
|
948
|
-
/**
|
|
949
|
-
* The carrier rejected a toll-free number verification; the number cannot send until an accepted verification is approved.
|
|
950
|
-
*/
|
|
951
|
-
type EventSmsTfnVerificationRejected = {
|
|
952
|
-
/**
|
|
953
|
-
* Event type.
|
|
954
|
-
*/
|
|
955
|
-
type: "sms.tfn_verification.rejected";
|
|
956
|
-
/**
|
|
957
|
-
* Time the rejection was recorded.
|
|
958
|
-
*/
|
|
959
|
-
timestamp: string;
|
|
960
|
-
data: EventSmsTfnVerificationRejectedData;
|
|
961
|
-
};
|
|
962
|
-
/**
|
|
963
|
-
* Payload of the sms.tfn_verification.info_requested event.
|
|
964
|
-
*/
|
|
965
|
-
type EventSmsTfnVerificationInfoRequestedData = EventSmsTfnVerificationBase;
|
|
966
|
-
/**
|
|
967
|
-
* The carrier requested more information before deciding a toll-free number verification.
|
|
968
|
-
*/
|
|
969
|
-
type EventSmsTfnVerificationInfoRequested = {
|
|
970
|
-
/**
|
|
971
|
-
* Event type.
|
|
972
|
-
*/
|
|
973
|
-
type: "sms.tfn_verification.info_requested";
|
|
974
|
-
/**
|
|
975
|
-
* Time the information request was recorded.
|
|
976
|
-
*/
|
|
977
|
-
timestamp: string;
|
|
978
|
-
data: EventSmsTfnVerificationInfoRequestedData;
|
|
979
|
-
};
|
|
980
|
-
/**
|
|
981
|
-
* Payload of the sms.tfn_verification.approved event.
|
|
982
|
-
*/
|
|
983
|
-
type EventSmsTfnVerificationApprovedData = EventSmsTfnVerificationBase;
|
|
984
|
-
/**
|
|
985
|
-
* The carrier approved a toll-free number verification; the number can now send in its licensed countries.
|
|
986
|
-
*/
|
|
987
|
-
type EventSmsTfnVerificationApproved = {
|
|
988
|
-
/**
|
|
989
|
-
* Event type.
|
|
990
|
-
*/
|
|
991
|
-
type: "sms.tfn_verification.approved";
|
|
992
|
-
/**
|
|
993
|
-
* Time the approval was recorded.
|
|
994
|
-
*/
|
|
995
|
-
timestamp: string;
|
|
996
|
-
data: EventSmsTfnVerificationApprovedData;
|
|
997
|
-
};
|
|
998
917
|
/**
|
|
999
918
|
* Payload of the sms.sent event.
|
|
1000
919
|
*/
|
|
@@ -2034,14 +1953,6 @@ type WebhookEvent = ({
|
|
|
2034
1953
|
} & EventSmsRejected) | ({
|
|
2035
1954
|
type: "sms.sent";
|
|
2036
1955
|
} & EventSmsSent) | ({
|
|
2037
|
-
type: "sms.tfn_verification.approved";
|
|
2038
|
-
} & EventSmsTfnVerificationApproved) | ({
|
|
2039
|
-
type: "sms.tfn_verification.info_requested";
|
|
2040
|
-
} & EventSmsTfnVerificationInfoRequested) | ({
|
|
2041
|
-
type: "sms.tfn_verification.rejected";
|
|
2042
|
-
} & EventSmsTfnVerificationRejected) | ({
|
|
2043
|
-
type: "sms.tfn_verification.submitted";
|
|
2044
|
-
} & EventSmsTfnVerificationSubmitted) | ({
|
|
2045
1956
|
type: "sms.undelivered";
|
|
2046
1957
|
} & EventSmsUndelivered) | ({
|
|
2047
1958
|
type: "verify.attempt.delivered";
|
|
@@ -2879,7 +2790,7 @@ type MailboxUpdate = {
|
|
|
2879
2790
|
*/
|
|
2880
2791
|
receive_policy?: "open" | "replies_only" | "allowlist" | "drop";
|
|
2881
2792
|
/**
|
|
2882
|
-
* How long the mailbox remembers message metadata and extracted text. Lowering the tier deletes memory older than the new horizon and requires `confirm=true` when messages older than the new horizon would be deleted. Only `30d` is available today;
|
|
2793
|
+
* How long the mailbox remembers message metadata and extracted text. Lowering the tier deletes memory older than the new horizon and requires `confirm=true` when messages older than the new horizon would be deleted. Only `30d` is available today; additional tiers are planned.
|
|
2883
2794
|
*/
|
|
2884
2795
|
retention_tier?: "30d";
|
|
2885
2796
|
/**
|
|
@@ -2914,7 +2825,7 @@ type MailboxCreate = {
|
|
|
2914
2825
|
*/
|
|
2915
2826
|
receive_policy?: "open" | "replies_only" | "allowlist" | "drop";
|
|
2916
2827
|
/**
|
|
2917
|
-
* How long the mailbox remembers message metadata and extracted text. Original rendered source is always available for 30 days regardless of tier. Only `30d` is available today;
|
|
2828
|
+
* How long the mailbox remembers message metadata and extracted text. Original rendered source is always available for 30 days regardless of tier. Only `30d` is available today; additional tiers are planned.
|
|
2918
2829
|
*/
|
|
2919
2830
|
retention_tier?: "30d";
|
|
2920
2831
|
/**
|
|
@@ -3070,7 +2981,7 @@ type DomainDkimConfig = {
|
|
|
3070
2981
|
mode?: "txt" | "delegated";
|
|
3071
2982
|
};
|
|
3072
2983
|
/**
|
|
3073
|
-
* Tracking domain configuration for branded open and click tracking URLs. Provide only the name part; Bird adds the sending domain automatically.
|
|
2984
|
+
* Tracking domain configuration for branded open and click tracking URLs. Provide only the name part; Bird adds the sending domain automatically. A domain created with no tracking configuration defaults to the name `links`. Tracked links are served over HTTPS once the tracking record verifies.
|
|
3074
2985
|
*
|
|
3075
2986
|
*/
|
|
3076
2987
|
type DomainTrackingConfig = {
|
|
@@ -3347,44 +3258,6 @@ type EmailStatsByBroadcastResponse = {
|
|
|
3347
3258
|
*/
|
|
3348
3259
|
readonly total: number;
|
|
3349
3260
|
};
|
|
3350
|
-
/**
|
|
3351
|
-
* One point in a breakdown row's trend series: the headline delivery and engagement rates for that row's dimension value over a single day or hour. Returned only when `include_trend=true`; the bucket grain (day or hour) follows the `trend_grain` parameter. Counts and rates are approximate at scale.
|
|
3352
|
-
*
|
|
3353
|
-
*/
|
|
3354
|
-
type EmailStatsSeriesPoint = {
|
|
3355
|
-
/**
|
|
3356
|
-
* The day (YYYY-MM-DD) or hour (ISO 8601, on the hour) this point covers, matching the requested `trend_grain`.
|
|
3357
|
-
*/
|
|
3358
|
-
readonly bucket: string;
|
|
3359
|
-
/**
|
|
3360
|
-
* Delivered recipients in this bucket.
|
|
3361
|
-
*/
|
|
3362
|
-
readonly delivered: number;
|
|
3363
|
-
/**
|
|
3364
|
-
* Bounced recipients in this bucket.
|
|
3365
|
-
*/
|
|
3366
|
-
readonly bounced: number;
|
|
3367
|
-
/**
|
|
3368
|
-
* Delivery rate for this bucket, as a fraction. Null when nothing was delivered or bounced.
|
|
3369
|
-
*/
|
|
3370
|
-
readonly delivery_rate: number | null;
|
|
3371
|
-
/**
|
|
3372
|
-
* Bounce rate for this bucket, as a fraction. Null when nothing was delivered or bounced.
|
|
3373
|
-
*/
|
|
3374
|
-
readonly bounce_rate: number | null;
|
|
3375
|
-
/**
|
|
3376
|
-
* Complaint rate for this bucket, as a fraction; event-time attribution can push it above 1 when complaints outrun the bucket's deliveries. Null when nothing was delivered in the bucket. On a sending-IP row complaints are not attributed to the IP, so this reads 0 in buckets that had deliveries and null in buckets that had none.
|
|
3377
|
-
*/
|
|
3378
|
-
readonly complaint_rate: number | null;
|
|
3379
|
-
/**
|
|
3380
|
-
* Open rate for this bucket, as a fraction; event-time attribution can push it above 1 when opens outrun the bucket's deliveries. Null when nothing was delivered in the bucket. On a sending-IP row engagement is not attributed to the IP, so this reads 0 in buckets that had deliveries and null in buckets that had none.
|
|
3381
|
-
*/
|
|
3382
|
-
readonly open_rate: number | null;
|
|
3383
|
-
/**
|
|
3384
|
-
* Click rate for this bucket, as a fraction; event-time attribution can push it above 1 when clicks outrun the bucket's deliveries. Null when nothing was delivered in the bucket. On a sending-IP row engagement is not attributed to the IP, so this reads 0 in buckets that had deliveries and null in buckets that had none.
|
|
3385
|
-
*/
|
|
3386
|
-
readonly click_rate: number | null;
|
|
3387
|
-
};
|
|
3388
3261
|
/**
|
|
3389
3262
|
* Aggregate delivery, engagement, and latency stats for the messages of a single broadcast over the requested period.
|
|
3390
3263
|
*/
|
|
@@ -3396,10 +3269,6 @@ type EmailBroadcastStatsPoint = {
|
|
|
3396
3269
|
readonly delivery: EmailDeliveryStats;
|
|
3397
3270
|
readonly engagement: EmailEngagementStats;
|
|
3398
3271
|
readonly latency: EmailLatencyStats;
|
|
3399
|
-
/**
|
|
3400
|
-
* Per-bucket rate series for this broadcast over the window. Never returned today, because `include_trend` is not available for the broadcast breakdown (supplying it returns 422).
|
|
3401
|
-
*/
|
|
3402
|
-
readonly trend?: Array<EmailStatsSeriesPoint>;
|
|
3403
3272
|
};
|
|
3404
3273
|
/**
|
|
3405
3274
|
* The date range the server actually computed against. Echoed back so clients can render the period without tracking it themselves and so cached responses can be keyed by what was queried.
|
|
@@ -3645,6 +3514,44 @@ type EmailStatsByTemplateResponse = {
|
|
|
3645
3514
|
*/
|
|
3646
3515
|
readonly total: number;
|
|
3647
3516
|
};
|
|
3517
|
+
/**
|
|
3518
|
+
* One point in a breakdown row's trend series: the headline delivery and engagement rates for that row's dimension value over a single day or hour. Returned only when `include_trend=true`; the bucket grain (day or hour) follows the `trend_grain` parameter. Counts and rates are approximate at scale.
|
|
3519
|
+
*
|
|
3520
|
+
*/
|
|
3521
|
+
type EmailStatsSeriesPoint = {
|
|
3522
|
+
/**
|
|
3523
|
+
* The day (YYYY-MM-DD) or hour (ISO 8601, on the hour) this point covers, matching the requested `trend_grain`.
|
|
3524
|
+
*/
|
|
3525
|
+
readonly bucket: string;
|
|
3526
|
+
/**
|
|
3527
|
+
* Delivered recipients in this bucket.
|
|
3528
|
+
*/
|
|
3529
|
+
readonly delivered: number;
|
|
3530
|
+
/**
|
|
3531
|
+
* Bounced recipients in this bucket.
|
|
3532
|
+
*/
|
|
3533
|
+
readonly bounced: number;
|
|
3534
|
+
/**
|
|
3535
|
+
* Delivery rate for this bucket, as a fraction. Null when nothing was delivered or bounced.
|
|
3536
|
+
*/
|
|
3537
|
+
readonly delivery_rate: number | null;
|
|
3538
|
+
/**
|
|
3539
|
+
* Bounce rate for this bucket, as a fraction. Null when nothing was delivered or bounced.
|
|
3540
|
+
*/
|
|
3541
|
+
readonly bounce_rate: number | null;
|
|
3542
|
+
/**
|
|
3543
|
+
* Complaint rate for this bucket, as a fraction; event-time attribution can push it above 1 when complaints outrun the bucket's deliveries. Null when nothing was delivered in the bucket. On a sending-IP row complaints are not attributed to the IP, so this reads 0 in buckets that had deliveries and null in buckets that had none.
|
|
3544
|
+
*/
|
|
3545
|
+
readonly complaint_rate: number | null;
|
|
3546
|
+
/**
|
|
3547
|
+
* Open rate for this bucket, as a fraction; event-time attribution can push it above 1 when opens outrun the bucket's deliveries. Null when nothing was delivered in the bucket. On a sending-IP row engagement is not attributed to the IP, so this reads 0 in buckets that had deliveries and null in buckets that had none.
|
|
3548
|
+
*/
|
|
3549
|
+
readonly open_rate: number | null;
|
|
3550
|
+
/**
|
|
3551
|
+
* Click rate for this bucket, as a fraction; event-time attribution can push it above 1 when clicks outrun the bucket's deliveries. Null when nothing was delivered in the bucket. On a sending-IP row engagement is not attributed to the IP, so this reads 0 in buckets that had deliveries and null in buckets that had none.
|
|
3552
|
+
*/
|
|
3553
|
+
readonly click_rate: number | null;
|
|
3554
|
+
};
|
|
3648
3555
|
type EmailTemplateId = string;
|
|
3649
3556
|
/**
|
|
3650
3557
|
* Aggregate delivery, engagement, and latency stats for the messages sent with a single template over the requested period.
|
|
@@ -4060,7 +3967,7 @@ type EmailStatsComparisonDelta = {
|
|
|
4060
3967
|
readonly unsubscribe_rate_pp: number | null;
|
|
4061
3968
|
};
|
|
4062
3969
|
/**
|
|
4063
|
-
* The same statistics for the equal-length, inclusive period ending the day immediately before the requested start, together with the change between the two periods. Present only when `compare=previous_period` is requested.
|
|
3970
|
+
* The same statistics for the equal-length, inclusive period ending the day immediately before the requested start, together with the change between the two periods. Present only when `compare=previous_period` is requested. The change is already computed, so a percentage difference needs no second request.
|
|
4064
3971
|
*
|
|
4065
3972
|
*/
|
|
4066
3973
|
type EmailStatsComparison = {
|
|
@@ -4178,7 +4085,7 @@ type WhatsAppEvent = {
|
|
|
4178
4085
|
*/
|
|
4179
4086
|
readonly id: WhatsAppEventId;
|
|
4180
4087
|
/**
|
|
4181
|
-
* Lifecycle event type. `whatsapp.accepted`: Bird accepted the request. `whatsapp.sent`: handed to the WhatsApp network. `whatsapp.delivered`: delivery confirmed to the recipient's device. `whatsapp.read`: the recipient opened the message (this does not change the message `status`, which never becomes `read`). `whatsapp.failed`: terminal permanent failure. Open enum: new event types may be added over time, so treat any unrecognized value as a future event rather than an error.
|
|
4088
|
+
* Lifecycle event type. `whatsapp.accepted`: Bird accepted the request. `whatsapp.sent`: handed to the WhatsApp network. `whatsapp.delivered`: delivery confirmed to the recipient's device. `whatsapp.read`: the recipient opened the message (this does not change the message `status`, which never becomes `read`). `whatsapp.failed`: terminal permanent failure. `whatsapp.rejected`: Bird refused the message before sending it, so it was never charged. `whatsapp.received`: an inbound message arrived from the contact. Open enum: new event types may be added over time, so treat any unrecognized value as a future event rather than an error.
|
|
4182
4089
|
*
|
|
4183
4090
|
*/
|
|
4184
4091
|
readonly type: string;
|
|
@@ -4187,18 +4094,22 @@ type WhatsAppEvent = {
|
|
|
4187
4094
|
*/
|
|
4188
4095
|
readonly occurred_at: string;
|
|
4189
4096
|
/**
|
|
4190
|
-
* Failure detail. Present only on `whatsapp.failed` events.
|
|
4097
|
+
* Failure detail. Present only on `whatsapp.failed` and `whatsapp.rejected` events.
|
|
4191
4098
|
*/
|
|
4192
4099
|
error?: WhatsAppError;
|
|
4193
4100
|
};
|
|
4101
|
+
/**
|
|
4102
|
+
* A WhatsApp message to send. Carry exactly one kind of content: a request with none returns a `422` `WhatsAppContentRequired`, and one carrying more than one returns a `422` `WhatsAppContentAmbiguous`. The schema does not express that constraint, because which combinations are available depends on the content types your workspace can send.
|
|
4103
|
+
*
|
|
4104
|
+
*/
|
|
4194
4105
|
type WhatsAppMessageSendRequest = {
|
|
4195
4106
|
/**
|
|
4196
|
-
* The message recipient
|
|
4107
|
+
* The message recipient: a phone number in E.164 format (for example `+31612345678`), or the recipient's business-scoped user ID (for example `US.13491208655302741918`), which addresses a WhatsApp user whose phone number you do not have. A value that is neither returns a `422` `WhatsAppInvalidRecipient`. One-time-passcode templates require a phone number and return a `422` `WhatsAppRecipientNotSupportedForTemplate` when sent to a business-scoped user ID.
|
|
4197
4108
|
*
|
|
4198
4109
|
*/
|
|
4199
4110
|
to: string;
|
|
4200
4111
|
/**
|
|
4201
|
-
* The template to send. Bird selects the sender number from the template's category, so
|
|
4112
|
+
* The template to send. For a Bird-managed template, Bird selects the sender number from the template's category, so `from` must be omitted. A template is the only content deliverable outside a customer service window.
|
|
4202
4113
|
*
|
|
4203
4114
|
*/
|
|
4204
4115
|
template?: WhatsAppTemplateSend;
|
|
@@ -4219,18 +4130,19 @@ type WhatsAppMessageSendRequest = {
|
|
|
4219
4130
|
* The kind of value a template parameter accepts. `text` (the only kind today) is a plain string substituted into the placeholder. Open enum: more kinds may be added over time.
|
|
4220
4131
|
*
|
|
4221
4132
|
*/
|
|
4222
|
-
type WhatsAppTemplateParameterType = string;
|
|
4133
|
+
type WhatsAppTemplateParameterType$1 = "text" | (string & {});
|
|
4223
4134
|
type WhatsAppMessageTemplateComponentParameter = {
|
|
4224
4135
|
/**
|
|
4225
4136
|
* The kind of value this parameter carries. `text` is the only kind today.
|
|
4226
4137
|
*/
|
|
4227
|
-
type: WhatsAppTemplateParameterType;
|
|
4138
|
+
type: WhatsAppTemplateParameterType$1;
|
|
4228
4139
|
/**
|
|
4229
4140
|
* The value substituted into the placeholder, as a plain string.
|
|
4230
4141
|
*/
|
|
4231
4142
|
text: string;
|
|
4232
4143
|
/**
|
|
4233
|
-
*
|
|
4144
|
+
* Required when the template declares named parameters: the placeholder this value fills (for example `first_name`), matching exactly one of the names the template declares. Name every parameter in that case; order does not matter once names are supplied. Omit this field for a positional template, which takes its values in `{{n}}` order instead. Sending the wrong set of names, or leaving one out that the template requires, returns a `422` `WhatsAppTemplateParameterMismatch`.
|
|
4145
|
+
*
|
|
4234
4146
|
*/
|
|
4235
4147
|
name?: string;
|
|
4236
4148
|
};
|
|
@@ -4241,32 +4153,37 @@ type WhatsAppMessageTemplateComponent = {
|
|
|
4241
4153
|
*/
|
|
4242
4154
|
type: string;
|
|
4243
4155
|
/**
|
|
4244
|
-
* The values that fill this part's placeholders
|
|
4156
|
+
* The values that fill this part's placeholders. A positional template takes them in `{{n}}` placeholder order; a template with named parameters requires each parameter's `name` to match one the template declares, and order then carries no meaning.
|
|
4245
4157
|
*
|
|
4246
4158
|
*/
|
|
4247
4159
|
parameters?: Array<WhatsAppMessageTemplateComponentParameter>;
|
|
4248
4160
|
};
|
|
4249
4161
|
/**
|
|
4250
|
-
*
|
|
4162
|
+
* A language tag in BCP-47 form, for example `en` or `pt-BR`.
|
|
4251
4163
|
*/
|
|
4252
|
-
type
|
|
4164
|
+
type LanguageTag = string;
|
|
4253
4165
|
/**
|
|
4254
4166
|
* A template's slug: its permanent, workspace-unique handle and API address. Lowercase letters, numbers, hyphens, and underscores. Fixed at creation, so anything that references it never breaks; the display name is the label to change freely.
|
|
4255
4167
|
*
|
|
4256
4168
|
*/
|
|
4257
4169
|
type TemplateSlug = string;
|
|
4258
|
-
type
|
|
4170
|
+
type WhatsAppTemplateId = string;
|
|
4171
|
+
type WhatsAppTemplateSend = unknown & {
|
|
4172
|
+
/**
|
|
4173
|
+
* The template to send, by its id.
|
|
4174
|
+
*/
|
|
4175
|
+
id?: WhatsAppTemplateId;
|
|
4259
4176
|
/**
|
|
4260
4177
|
* The template to send, by its slug (for example `bird_otp`).
|
|
4261
4178
|
*/
|
|
4262
|
-
slug
|
|
4179
|
+
slug?: TemplateSlug;
|
|
4263
4180
|
/**
|
|
4264
|
-
*
|
|
4181
|
+
* Which of the template's languages to send, as a BCP-47 tag (for example `en` or `pt-BR`). Meta's underscore form (`pt_BR`) is accepted and normalized; the accepted message echoes the canonical BCP-47 form. May be omitted when the template has a single language; when it is stocked in several, omitting the language returns a `422` that names the available tags.
|
|
4265
4182
|
*
|
|
4266
4183
|
*/
|
|
4267
|
-
language?:
|
|
4184
|
+
language?: LanguageTag;
|
|
4268
4185
|
/**
|
|
4269
|
-
* The values that fill the template's placeholders: one entry per content block that has placeholders, each carrying its `parameters
|
|
4186
|
+
* The values that fill the template's placeholders: one entry per content block that has placeholders, each carrying its `parameters`. A positional template takes its parameters in `{{n}}` order; a template with named parameters requires each parameter's `name` to match one the template declares. Either way, sending parameters that do not match what the template declares returns a `422` `WhatsAppTemplateParameterMismatch`.
|
|
4270
4187
|
*
|
|
4271
4188
|
*/
|
|
4272
4189
|
components?: Array<WhatsAppMessageTemplateComponent>;
|
|
@@ -4286,7 +4203,7 @@ type Money = {
|
|
|
4286
4203
|
currency_code: CurrencyCode;
|
|
4287
4204
|
};
|
|
4288
4205
|
/**
|
|
4289
|
-
* Delivery status. `accepted` (the initial status of an outbound send) means Bird accepted the request and it is queued for sending. `sent` means it was handed to the WhatsApp network. `delivered` is confirmed delivery to the recipient's device. `failed` is a terminal permanent failure. `rejected` means the recipient is on the workspace's suppression list
|
|
4206
|
+
* Delivery status. `accepted` (the initial status of an outbound send) means Bird accepted the request and it is queued for sending. `sent` means it was handed to the WhatsApp network. `delivered` is confirmed delivery to the recipient's device. `failed` is a terminal permanent failure. `rejected` means Bird refused the message before sending it to WhatsApp, because the recipient is on the workspace's suppression list, the wallet had insufficient balance, or the destination is unpriced. A rejected message was not sent and not charged. There is no `read` status: a read receipt is reported as `read_at` and a `whatsapp.read` event, not a status value. The remaining values are reserved and not returned today: `scheduled` (queued to send at a future time), `canceled` (a scheduled message canceled before sending), and `received` (a message a contact sent you).
|
|
4290
4207
|
*
|
|
4291
4208
|
*/
|
|
4292
4209
|
type WhatsAppMessageStatus = "scheduled" | "accepted" | "sent" | "delivered" | "failed" | "rejected" | "canceled" | "received";
|
|
@@ -4294,7 +4211,7 @@ type WhatsAppMessageStatus = "scheduled" | "accepted" | "sent" | "delivered" | "
|
|
|
4294
4211
|
* Meta's content classification for a template. `authentication` templates deliver one-time passcodes, `utility` templates deliver transaction-triggered updates (receipts, order status), and `marketing` templates carry promotional content. The category drives which sender number Bird selects and how the send is priced. Open enum: Meta may add new categories over time, so treat any unrecognized value as a future category rather than an error.
|
|
4295
4212
|
*
|
|
4296
4213
|
*/
|
|
4297
|
-
type WhatsAppTemplateCategory = string;
|
|
4214
|
+
type WhatsAppTemplateCategory$1 = "authentication" | "utility" | "marketing" | (string & {});
|
|
4298
4215
|
/**
|
|
4299
4216
|
* The template a message was sent from. On reads `slug`, `language`, `category`, and `components` are always present; `components` is an empty array for an authentication template (the filled-in values, for example a verification code, are never returned).
|
|
4300
4217
|
*
|
|
@@ -4307,11 +4224,11 @@ type WhatsAppMessageTemplate = {
|
|
|
4307
4224
|
/**
|
|
4308
4225
|
* Content classification applied to messages sent from this template.
|
|
4309
4226
|
*/
|
|
4310
|
-
readonly category: WhatsAppTemplateCategory;
|
|
4227
|
+
readonly category: WhatsAppTemplateCategory$1;
|
|
4311
4228
|
/**
|
|
4312
|
-
* The
|
|
4229
|
+
* The canonical BCP-47 tag of the template variant that was sent.
|
|
4313
4230
|
*/
|
|
4314
|
-
readonly language:
|
|
4231
|
+
readonly language: LanguageTag;
|
|
4315
4232
|
/**
|
|
4316
4233
|
* The values that filled the template's placeholders. Empty for an authentication template, whose content is never returned.
|
|
4317
4234
|
*
|
|
@@ -4389,12 +4306,12 @@ type VerificationCheckResult = {
|
|
|
4389
4306
|
readonly attempts_remaining?: number | null;
|
|
4390
4307
|
};
|
|
4391
4308
|
type VerificationChannelEntry = {
|
|
4392
|
-
channel: VerificationChannel;
|
|
4309
|
+
channel: VerificationChannel$1;
|
|
4393
4310
|
};
|
|
4394
4311
|
/**
|
|
4395
4312
|
* Why a verification session reached its final state without succeeding: `attempts_exhausted` (too many incorrect passcodes) or `ttl_elapsed` (the time window elapsed before a correct passcode). Open enum — new reasons may be added over time, so treat any unrecognized value as a future reason rather than an error.
|
|
4396
4313
|
*/
|
|
4397
|
-
type VerificationTerminalReason = string;
|
|
4314
|
+
type VerificationTerminalReason$1 = "attempts_exhausted" | "ttl_elapsed" | (string & {});
|
|
4398
4315
|
type Verification = {
|
|
4399
4316
|
readonly id: VerificationId;
|
|
4400
4317
|
/**
|
|
@@ -4404,7 +4321,7 @@ type Verification = {
|
|
|
4404
4321
|
/**
|
|
4405
4322
|
* Why the verification reached its final state, or null while `pending` and once `verified`. See the enum for the values it can take.
|
|
4406
4323
|
*/
|
|
4407
|
-
readonly reason?: VerificationTerminalReason | null;
|
|
4324
|
+
readonly reason?: VerificationTerminalReason$1 | null;
|
|
4408
4325
|
readonly to: VerificationTo;
|
|
4409
4326
|
/**
|
|
4410
4327
|
* The channels this verification uses to deliver the passcode, in attempt order: the first entry is tried first and later entries are fallbacks. An email recipient is verified over email; a phone recipient is verified over SMS.
|
|
@@ -4457,7 +4374,7 @@ type VerificationOptions = {
|
|
|
4457
4374
|
/**
|
|
4458
4375
|
* Reorder or narrow the delivery channels for this request. List channel names in the order to try them; a channel you omit is not used for this request, and a channel not already enabled for the recipient is ignored. A list that leaves no usable channel fails the request with `422`. Omit the field to use the configured order.
|
|
4459
4376
|
*/
|
|
4460
|
-
channels?: Array<VerificationChannel>;
|
|
4377
|
+
channels?: Array<VerificationChannel$1>;
|
|
4461
4378
|
};
|
|
4462
4379
|
/**
|
|
4463
4380
|
* Bucket grain for a stats trend series.
|
|
@@ -4493,6 +4410,11 @@ type TemplateVariable = {
|
|
|
4493
4410
|
* A human-readable description of the accepted values.
|
|
4494
4411
|
*/
|
|
4495
4412
|
readonly constraint: string;
|
|
4413
|
+
/**
|
|
4414
|
+
* Whether this slot's value is redacted before it reaches storage. A sensitive slot's rendered value never appears in message content read back through the API: a stand-in placeholder is stored instead.
|
|
4415
|
+
*
|
|
4416
|
+
*/
|
|
4417
|
+
readonly sensitive?: boolean;
|
|
4496
4418
|
};
|
|
4497
4419
|
/**
|
|
4498
4420
|
* Content classification. Tells Bird and carriers why you're sending; per-country compliance rules (opt-out policy, quiet hours) key on it as they roll out.
|
|
@@ -4666,7 +4588,7 @@ type SmsMessage = {
|
|
|
4666
4588
|
*/
|
|
4667
4589
|
from: string;
|
|
4668
4590
|
/**
|
|
4669
|
-
* The message body as sent. For a template send, this is the rendered text after parameter substitution.
|
|
4591
|
+
* The message body as sent. For a template send, this is the rendered text after parameter substitution. When `category` is `authentication` (a message carrying a one-time code), this is `**REDACTED**`: the code still reaches the recipient, Bird just does not persist it for later reads.
|
|
4670
4592
|
*
|
|
4671
4593
|
*/
|
|
4672
4594
|
text: string;
|
|
@@ -4736,10 +4658,10 @@ type SmsTemplateSend = unknown & {
|
|
|
4736
4658
|
*/
|
|
4737
4659
|
name?: TemplateName;
|
|
4738
4660
|
/**
|
|
4739
|
-
*
|
|
4661
|
+
* Which of the template's localized bodies to send, as a BCP-47 tag. Falls back to the closest available language, then English, when the exact tag is not stocked. Omit for English.
|
|
4740
4662
|
*
|
|
4741
4663
|
*/
|
|
4742
|
-
language?:
|
|
4664
|
+
language?: LanguageTag;
|
|
4743
4665
|
/**
|
|
4744
4666
|
* Values for the template's variables, keyed by variable name. The accepted keys and their formats are fixed per template (the template's `variables` on the templates endpoint). A missing required variable, an undeclared key, a value that does not match its variable's format, or a serialized payload over 16 KB each return a `422`.
|
|
4745
4667
|
*
|
|
@@ -4867,20 +4789,19 @@ type AudienceRef = {
|
|
|
4867
4789
|
*/
|
|
4868
4790
|
name: string;
|
|
4869
4791
|
};
|
|
4870
|
-
/**
|
|
4871
|
-
* A channel a contact can be reached on. Open enum: `email` is present when the contact has an email address; more values (`sms`, `whatsapp`, `voice`) are added as contacts gain identifiers for other channels. Treat any unrecognized value as a future channel rather than an error. Slugs match `ChannelSlug`.
|
|
4872
|
-
*
|
|
4873
|
-
*/
|
|
4874
|
-
type ContactChannel = string;
|
|
4875
4792
|
type Contact = {
|
|
4876
4793
|
/**
|
|
4877
4794
|
* ID of the contact (`con_`-prefixed), accepted by every operation that takes a `contact_id`.
|
|
4878
4795
|
*/
|
|
4879
4796
|
readonly id: ContactId;
|
|
4880
4797
|
/**
|
|
4881
|
-
* The contact's email address, stored trimmed and lowercased. Unique within the workspace.
|
|
4798
|
+
* The contact's email address, in its stored form, trimmed and lowercased before uniqueness is checked. Unique within the workspace. Null when the contact has no email address.
|
|
4882
4799
|
*/
|
|
4883
|
-
email: string;
|
|
4800
|
+
email: string | null;
|
|
4801
|
+
/**
|
|
4802
|
+
* The contact's phone number in normalized international form (a leading `+` and four to 15 digits), which may differ from the form it was supplied in. Bird normalizes formatting but does not verify the number against numbering-plan metadata. Unique within the workspace. Carriers recycle disconnected numbers, so a long-stored number can come to belong to someone else; `external_id` is the durable key for your own records. Null when the contact has no phone number.
|
|
4803
|
+
*/
|
|
4804
|
+
phone: string | null;
|
|
4884
4805
|
/**
|
|
4885
4806
|
* The contact's first name. Available in broadcast templates as the `contact.first_name` variable.
|
|
4886
4807
|
*/
|
|
@@ -4894,17 +4815,12 @@ type Contact = {
|
|
|
4894
4815
|
*/
|
|
4895
4816
|
external_id?: string | null;
|
|
4896
4817
|
/**
|
|
4897
|
-
* Custom property values for this contact, available as template variables in broadcasts. Each key is a property created via the contact properties API, and each value is a string, number, or
|
|
4818
|
+
* Custom property values for this contact, available as template variables in broadcasts. Each key is a property created via the contact properties API, and each value is a string, number, boolean, or RFC 3339 datetime matching the property's declared type (strings up to 500 characters). Total size is capped at 2 KB serialized. Values stored under a property that was later archived remain readable here.
|
|
4898
4819
|
*
|
|
4899
4820
|
*/
|
|
4900
4821
|
data?: {
|
|
4901
4822
|
[key: string]: unknown;
|
|
4902
4823
|
};
|
|
4903
|
-
/**
|
|
4904
|
-
* Channels this contact can be reached on, derived from the identifiers it has. A contact with an email address includes `email`. More values are added as a contact gains identifiers for other channels.
|
|
4905
|
-
*
|
|
4906
|
-
*/
|
|
4907
|
-
readonly channels?: Array<ContactChannel>;
|
|
4908
4824
|
} & Timestamps;
|
|
4909
4825
|
type AudienceMember = {
|
|
4910
4826
|
contact: Contact;
|
|
@@ -4944,7 +4860,7 @@ type AudienceCreateRequest = {
|
|
|
4944
4860
|
};
|
|
4945
4861
|
type ContactPropertyUpdateRequest = {
|
|
4946
4862
|
/**
|
|
4947
|
-
* Default used when a contact has no value for this property and the template does not supply an inline fallback. A string, number, or
|
|
4863
|
+
* Default used when a contact has no value for this property and the template does not supply an inline fallback. A string, number, boolean, or RFC 3339 datetime matching the declared type (strings up to 500 characters); a value of another type returns a validation error. Set to null to remove the fallback.
|
|
4948
4864
|
*/
|
|
4949
4865
|
fallback_value?: unknown;
|
|
4950
4866
|
};
|
|
@@ -4955,14 +4871,17 @@ type ContactPropertyCreateRequest = {
|
|
|
4955
4871
|
key: string;
|
|
4956
4872
|
type: ContactPropertyType;
|
|
4957
4873
|
/**
|
|
4958
|
-
* Default used when a contact has no value for this property and the template does not supply an inline fallback. A string, number, or
|
|
4874
|
+
* Default used when a contact has no value for this property and the template does not supply an inline fallback. A string, number, boolean, or RFC 3339 datetime matching the declared type (strings up to 500 characters), or null for no fallback; a value of another type returns a validation error.
|
|
4959
4875
|
*/
|
|
4960
4876
|
fallback_value?: unknown;
|
|
4961
4877
|
};
|
|
4962
4878
|
/**
|
|
4963
4879
|
* The value type every contact must use for a property. Cannot be changed after creation.
|
|
4880
|
+
*
|
|
4881
|
+
* `datetime` values are RFC 3339 timestamps with an explicit offset (for example `2024-01-15T09:30:00Z` or `2024-01-15T11:30:00+02:00`); a bare date or a time with no offset is rejected. The value is normalized to UTC with second precision on write, so `2024-01-15T11:30:00+02:00` is stored and returned as `2024-01-15T09:30:00Z`, and any fractional seconds are dropped.
|
|
4882
|
+
*
|
|
4964
4883
|
*/
|
|
4965
|
-
type ContactPropertyType = "string" | "number" | "boolean";
|
|
4884
|
+
type ContactPropertyType = "string" | "number" | "boolean" | "datetime";
|
|
4966
4885
|
type ContactPropertyId = string;
|
|
4967
4886
|
type ContactProperty = {
|
|
4968
4887
|
/**
|
|
@@ -4975,7 +4894,7 @@ type ContactProperty = {
|
|
|
4975
4894
|
key: string;
|
|
4976
4895
|
type: ContactPropertyType;
|
|
4977
4896
|
/**
|
|
4978
|
-
* Default used when a contact has no value for this property and the template does not supply an inline fallback. A string, number, or
|
|
4897
|
+
* Default used when a contact has no value for this property and the template does not supply an inline fallback. A string, number, boolean, or RFC 3339 datetime matching the declared type (strings up to 500 characters), or null when no fallback is set.
|
|
4979
4898
|
*/
|
|
4980
4899
|
fallback_value?: unknown;
|
|
4981
4900
|
/**
|
|
@@ -5004,9 +4923,13 @@ type Audience = {
|
|
|
5004
4923
|
} & Timestamps;
|
|
5005
4924
|
type ContactUpdateRequest = {
|
|
5006
4925
|
/**
|
|
5007
|
-
* New email address for the contact. Trimmed and lowercased before it is stored and checked for uniqueness. Must not be in use by another contact in the workspace. Omit to keep the current address;
|
|
4926
|
+
* New email address for the contact. Trimmed and lowercased before it is stored and checked for uniqueness. Must not be in use by another contact in the workspace. Omit to keep the current address; set to null to remove it, as long as the contact keeps at least one identifier.
|
|
5008
4927
|
*/
|
|
5009
|
-
email?: string;
|
|
4928
|
+
email?: string | null;
|
|
4929
|
+
/**
|
|
4930
|
+
* New phone number for the contact, in E.164 format with the leading `+` and country code. Spaces and punctuation are accepted and stripped. Stored in its canonical form, which may differ from what you send, and unique within the workspace. Omit to keep the current number; set to null to remove it, as long as the contact keeps at least one identifier. An empty string behaves as null.
|
|
4931
|
+
*/
|
|
4932
|
+
phone?: string | null;
|
|
5010
4933
|
/**
|
|
5011
4934
|
* The contact's first name. Set to null to clear.
|
|
5012
4935
|
*/
|
|
@@ -5020,7 +4943,7 @@ type ContactUpdateRequest = {
|
|
|
5020
4943
|
*/
|
|
5021
4944
|
external_id?: string | null;
|
|
5022
4945
|
/**
|
|
5023
|
-
* Custom property values to change, merged into the contact's existing data. Keys you supply are set, keys set to null are removed, and keys you omit are left unchanged. Each key must be a property created via the contact properties API, and each value must be a string, number, or
|
|
4946
|
+
* Custom property values to change, merged into the contact's existing data. Keys you supply are set, keys set to null are removed, and keys you omit are left unchanged. Each key must be a property created via the contact properties API, and each value must be a string, number, boolean, or RFC 3339 datetime matching the property's declared type (strings up to 500 characters); writing an unregistered or archived key returns a validation error. The merged result is capped at 2 KB serialized.
|
|
5024
4947
|
*
|
|
5025
4948
|
*/
|
|
5026
4949
|
data?: {
|
|
@@ -5038,16 +4961,42 @@ type ContactUpsertError = {
|
|
|
5038
4961
|
* Machine-readable error category for this entry, such as `validation_error` or `conflict_error`, in the same vocabulary as the top-level error `type`. New categories may be added over time, so treat unrecognized values as a generic failure.
|
|
5039
4962
|
*/
|
|
5040
4963
|
type: string;
|
|
4964
|
+
/**
|
|
4965
|
+
* The specific error code for this entry, from the same catalog as the top-level error `code`: the discriminator within a category. `E04058` (the entry matched two different contacts, a human must decide) and `E04055` (the phone belongs to another contact, retry with different data) are both `conflict_error`; the code tells a sync which one it hit.
|
|
4966
|
+
*/
|
|
4967
|
+
code: string;
|
|
5041
4968
|
/**
|
|
5042
4969
|
* Human-readable explanation of why this entry failed.
|
|
5043
4970
|
*/
|
|
5044
4971
|
message: string;
|
|
5045
4972
|
};
|
|
4973
|
+
/**
|
|
4974
|
+
* Which identifier matched a batch entry to an existing contact. Null when the entry created a new contact.
|
|
4975
|
+
*/
|
|
4976
|
+
type ContactMatchedOn = "email" | "phone" | "external_id" | null;
|
|
4977
|
+
/**
|
|
4978
|
+
* The identifiers a batch entry supplied, in the normalized form they were matched with, null where the entry carried none. An echo of the request row for correlation, never the contact's current state.
|
|
4979
|
+
*/
|
|
4980
|
+
type ContactUpsertEntry = {
|
|
4981
|
+
/**
|
|
4982
|
+
* Email address this entry carried, trimmed and lowercased. Null when the entry carried none.
|
|
4983
|
+
*/
|
|
4984
|
+
email: string | null;
|
|
4985
|
+
/**
|
|
4986
|
+
* Phone number this entry carried, in its normalized international form. Null when the entry carried none. A row rejected for an invalid phone echoes the value as sent, trimmed, since no normalized form exists.
|
|
4987
|
+
*/
|
|
4988
|
+
phone: string | null;
|
|
4989
|
+
/**
|
|
4990
|
+
* Your own identifier for this entry, when the entry supplied one.
|
|
4991
|
+
*/
|
|
4992
|
+
external_id: string | null;
|
|
4993
|
+
};
|
|
5046
4994
|
type ContactUpsertResultItem = {
|
|
4995
|
+
entry: ContactUpsertEntry;
|
|
5047
4996
|
/**
|
|
5048
|
-
*
|
|
4997
|
+
* Which identifier matched this entry to an existing contact. Null when the entry created a new contact.
|
|
5049
4998
|
*/
|
|
5050
|
-
|
|
4999
|
+
matched_on: ContactMatchedOn;
|
|
5051
5000
|
/**
|
|
5052
5001
|
* What happened to this contact. `created` means a new contact was created for the address; `updated` means an existing contact with the address was updated; `failed` means the entry was rejected and `error` explains why. A failed entry does not affect the other entries in the request.
|
|
5053
5002
|
*/
|
|
@@ -5063,24 +5012,37 @@ type ContactUpsertResultItem = {
|
|
|
5063
5012
|
};
|
|
5064
5013
|
type ContactUpsertRequest = {
|
|
5065
5014
|
/**
|
|
5066
|
-
* Contacts to create or update, matched
|
|
5015
|
+
* Contacts to create or update, matched automatically against every identifier an entry supplies. Existing contacts are updated with the fields each entry supplies; omitted fields keep their stored values, so an entry can set fields but never clear them. Unmatched entries create contacts.
|
|
5067
5016
|
*/
|
|
5068
5017
|
contacts: Array<ContactCreateRequest>;
|
|
5069
5018
|
/**
|
|
5070
5019
|
* Audiences every contact in this request is added to. Contacts that are already members are left in place. Every listed audience must exist, or the whole request fails with a validation error and nothing is written.
|
|
5071
5020
|
*/
|
|
5072
5021
|
audience_ids?: Array<AudienceId>;
|
|
5022
|
+
/**
|
|
5023
|
+
* Optional. Forces every entry to be matched to an existing contact by this one field, which every entry must then carry. When omitted, each entry is matched automatically against every identifier it supplies: no match creates a contact, one match updates it, and an entry whose identifiers belong to more than one contact fails with an error naming each.
|
|
5024
|
+
*
|
|
5025
|
+
*/
|
|
5026
|
+
match_on?: ContactMatchKey;
|
|
5073
5027
|
/**
|
|
5074
5028
|
* How a supplied `data` object is applied to an existing contact. `merge` (the default) merges the supplied keys onto the contact's stored custom values, and a key with a `null` value deletes that one key. `replace` overwrites the whole stored `data` map with the supplied one. In both modes a contact that omits `data` keeps its stored values unchanged, so an import that touches one attribute never wipes the others.
|
|
5075
5029
|
*
|
|
5076
5030
|
*/
|
|
5077
5031
|
data_mode?: "merge" | "replace";
|
|
5078
5032
|
};
|
|
5033
|
+
/**
|
|
5034
|
+
* A contact identifier a batch entry can be matched on.
|
|
5035
|
+
*/
|
|
5036
|
+
type ContactMatchKey = "email" | "phone" | "external_id";
|
|
5079
5037
|
type ContactCreateRequest = {
|
|
5080
5038
|
/**
|
|
5081
|
-
* The contact's email address. Trimmed and lowercased before it is stored and checked for uniqueness. Unique within the workspace.
|
|
5039
|
+
* The contact's email address. Trimmed and lowercased before it is stored and checked for uniqueness. Unique within the workspace. Supply an email address, a phone number, or both.
|
|
5082
5040
|
*/
|
|
5083
|
-
email
|
|
5041
|
+
email?: string;
|
|
5042
|
+
/**
|
|
5043
|
+
* The contact's phone number in E.164 format, including the leading `+` and country code. Spaces and punctuation are accepted and stripped; the number is stored in its canonical form, which may differ from what you send, and is unique within the workspace. An empty string is treated as if the field were omitted. Supply an email address, a phone number, or both.
|
|
5044
|
+
*/
|
|
5045
|
+
phone?: string;
|
|
5084
5046
|
/**
|
|
5085
5047
|
* The contact's first name.
|
|
5086
5048
|
*/
|
|
@@ -5094,7 +5056,7 @@ type ContactCreateRequest = {
|
|
|
5094
5056
|
*/
|
|
5095
5057
|
external_id?: string;
|
|
5096
5058
|
/**
|
|
5097
|
-
* Custom property values for this contact. Each key must be a property created via the contact properties API, and each value must be a string, number, or
|
|
5059
|
+
* Custom property values for this contact. Each key must be a property created via the contact properties API, and each value must be a string, number, boolean, or RFC 3339 datetime matching the property's declared type (strings up to 500 characters); a null value is ignored. Unregistered or archived keys are rejected with a validation error. Total size is capped at 2 KB serialized.
|
|
5098
5060
|
*
|
|
5099
5061
|
*/
|
|
5100
5062
|
data?: {
|
|
@@ -5107,6 +5069,7 @@ type EmailMessageBatchResponse = {
|
|
|
5107
5069
|
*/
|
|
5108
5070
|
data: Array<EmailMessageBatchItem>;
|
|
5109
5071
|
};
|
|
5072
|
+
type EmailTemplateVersionId = string;
|
|
5110
5073
|
type EmailMessageBatchItem = {
|
|
5111
5074
|
/**
|
|
5112
5075
|
* Message ID assigned to this batch item.
|
|
@@ -5120,16 +5083,32 @@ type EmailMessageBatchItem = {
|
|
|
5120
5083
|
* Resolved category for this batch item.
|
|
5121
5084
|
*/
|
|
5122
5085
|
category: "marketing" | "transactional";
|
|
5086
|
+
/**
|
|
5087
|
+
* The template language this item asked for, in canonical form. Null when the item named no language or used no template. Every item in a batch resolves its own template reference, so this and `resolved_language` can differ from item to item.
|
|
5088
|
+
*
|
|
5089
|
+
*/
|
|
5090
|
+
readonly requested_language?: LanguageTag | null;
|
|
5091
|
+
/**
|
|
5092
|
+
* The template language this item was actually delivered in, in canonical form. Null when the item used no template. A value here differing from `requested_language` means the template did not carry the language asked for and its `on_missing_language` policy chose this one.
|
|
5093
|
+
*
|
|
5094
|
+
*/
|
|
5095
|
+
readonly resolved_language?: LanguageTag | null;
|
|
5096
|
+
/**
|
|
5097
|
+
* The template this item rendered from, or null for an item that supplied its content inline.
|
|
5098
|
+
*
|
|
5099
|
+
*/
|
|
5100
|
+
readonly template_id?: EmailTemplateId | null;
|
|
5101
|
+
/**
|
|
5102
|
+
* The exact template version this item rendered from, or null for an inline item. Record it if you need to reproduce what was sent: a template's live version changes every time you submit it.
|
|
5103
|
+
*
|
|
5104
|
+
*/
|
|
5105
|
+
readonly template_version_id?: EmailTemplateVersionId | null;
|
|
5123
5106
|
};
|
|
5124
5107
|
/**
|
|
5125
5108
|
* Batch of email message send requests. All items are validated before any are queued. Attachments are allowed on individual messages. Each message must stay within the 20 MB estimated generated message-size cap. The serialized JSON request body for the batch has a hard 20 MB cap.
|
|
5126
5109
|
*
|
|
5127
5110
|
*/
|
|
5128
5111
|
type EmailMessageBatchRequest = Array<EmailMessageSendRequest>;
|
|
5129
|
-
/**
|
|
5130
|
-
* A language tag in BCP-47 form, for example `en` or `pt-BR`.
|
|
5131
|
-
*/
|
|
5132
|
-
type LanguageTag = string;
|
|
5133
5112
|
type EmailTemplateSend = unknown & {
|
|
5134
5113
|
/**
|
|
5135
5114
|
* The template to send, by its id.
|
|
@@ -5145,7 +5124,7 @@ type EmailTemplateSend = unknown & {
|
|
|
5145
5124
|
*/
|
|
5146
5125
|
language?: LanguageTag;
|
|
5147
5126
|
/**
|
|
5148
|
-
* Values for the template's variables, keyed by variable name. A token with no matching value renders empty. Send everything the template's `variables` lists rather than only what you expect the chosen language to use: languages need not reference the same variables, and a value no language uses is ignored. Cap: 16 KB serialized.
|
|
5127
|
+
* Values for the template's variables, keyed by variable name. A token with no matching value renders empty. Nest values to fill dotted tokens: `{"contact": {"first_name": "Ada"}}` fills `{{ contact.first_name }}`. Send everything the template's `variables` lists rather than only what you expect the chosen language to use: languages need not reference the same variables, and a value no language uses is ignored. Cap: 16 KB serialized.
|
|
5149
5128
|
*
|
|
5150
5129
|
*/
|
|
5151
5130
|
parameters?: {
|
|
@@ -5401,6 +5380,26 @@ type EmailMessage = {
|
|
|
5401
5380
|
* Total click events across all recipients.
|
|
5402
5381
|
*/
|
|
5403
5382
|
readonly click_count: number;
|
|
5383
|
+
/**
|
|
5384
|
+
* The template language this send asked for, in canonical form (`pt-BR` for a request of `pt-br`). Null when the send named no language (it took the template's default) or used no template at all. Compare it with `resolved_language`: when they differ, the language you asked for was not available and the template's `on_missing_language` policy chose the one shown there instead.
|
|
5385
|
+
*
|
|
5386
|
+
*/
|
|
5387
|
+
readonly requested_language?: LanguageTag | null;
|
|
5388
|
+
/**
|
|
5389
|
+
* The template language this send was actually delivered in, in canonical form. Null when the send used no template. A non-null value with a null `requested_language` means the send named no language and took the template's default.
|
|
5390
|
+
*
|
|
5391
|
+
*/
|
|
5392
|
+
readonly resolved_language?: LanguageTag | null;
|
|
5393
|
+
/**
|
|
5394
|
+
* The template this send rendered from, or null for a send that supplied its content inline.
|
|
5395
|
+
*
|
|
5396
|
+
*/
|
|
5397
|
+
readonly template_id?: EmailTemplateId | null;
|
|
5398
|
+
/**
|
|
5399
|
+
* The exact template version this send rendered from, or null for an inline send. A template's live version changes every time you submit it, so this is what identifies the wording that was actually delivered, together with `resolved_language`.
|
|
5400
|
+
*
|
|
5401
|
+
*/
|
|
5402
|
+
readonly template_version_id?: EmailTemplateVersionId | null;
|
|
5404
5403
|
/**
|
|
5405
5404
|
* Structured `{name, value}` filter labels applied to this send. See EmailMessageSendRequest for the tags vs metadata distinction.
|
|
5406
5405
|
*/
|
|
@@ -5412,7 +5411,7 @@ type EmailMessage = {
|
|
|
5412
5411
|
[key: string]: unknown;
|
|
5413
5412
|
};
|
|
5414
5413
|
/**
|
|
5415
|
-
* The substitution values this send supplied, or
|
|
5414
|
+
* The substitution values this send supplied, whether inline or from a template, or null if none were supplied. They are the values applied to `subject` and to the bodies the content endpoint returns, kept so you can see what produced the delivered copy and not only the result.
|
|
5416
5415
|
*
|
|
5417
5416
|
*/
|
|
5418
5417
|
readonly parameters?: {
|
|
@@ -5451,6 +5450,21 @@ type EmailMessage = {
|
|
|
5451
5450
|
*/
|
|
5452
5451
|
readonly scheduled_at?: string | null;
|
|
5453
5452
|
};
|
|
5453
|
+
/**
|
|
5454
|
+
* An event addressed to one member rather than to a channel. Every connection that member currently holds receives it; if they hold none, the event is dropped.
|
|
5455
|
+
*/
|
|
5456
|
+
type RealtimeMemberPublish = {
|
|
5457
|
+
event: RealtimeEventName;
|
|
5458
|
+
data?: RealtimeEventData;
|
|
5459
|
+
};
|
|
5460
|
+
/**
|
|
5461
|
+
* Arbitrary JSON payload delivered as the event data — an object, array, or scalar. Cap: 10 KB serialized.
|
|
5462
|
+
*/
|
|
5463
|
+
type RealtimeEventData = unknown;
|
|
5464
|
+
/**
|
|
5465
|
+
* The event name clients bind to. Application event names are free-form; the `bird:` and `bird_internal:` prefixes are reserved for the protocol and rejected.
|
|
5466
|
+
*/
|
|
5467
|
+
type RealtimeEventName = string;
|
|
5454
5468
|
/**
|
|
5455
5469
|
* The members present on a presence channel.
|
|
5456
5470
|
*/
|
|
@@ -5532,14 +5546,6 @@ type RealtimeChannelInclude = "member_count" | "connection_count";
|
|
|
5532
5546
|
* Exclude this connection from delivery, to avoid echoing a change back to the client that triggered it. The value is the client's connection id, assigned when its connection is established.
|
|
5533
5547
|
*/
|
|
5534
5548
|
type RealtimeExcludeConnectionId = string;
|
|
5535
|
-
/**
|
|
5536
|
-
* Arbitrary JSON payload delivered as the event data — an object, array, or scalar. Cap: 10 KB serialized.
|
|
5537
|
-
*/
|
|
5538
|
-
type RealtimeEventData = unknown;
|
|
5539
|
-
/**
|
|
5540
|
-
* The event name clients bind to. Application event names are free-form; the `bird:` and `bird_internal:` prefixes are reserved for the protocol and rejected.
|
|
5541
|
-
*/
|
|
5542
|
-
type RealtimeEventName = string;
|
|
5543
5549
|
/**
|
|
5544
5550
|
* One item of a batch publish — a single event to a single channel.
|
|
5545
5551
|
*/
|
|
@@ -5582,23 +5588,73 @@ type RealtimePublish = {
|
|
|
5582
5588
|
include?: Array<RealtimeChannelInclude>;
|
|
5583
5589
|
};
|
|
5584
5590
|
type RealtimeAppId = string;
|
|
5585
|
-
type
|
|
5586
|
-
body
|
|
5587
|
-
headers
|
|
5591
|
+
type PublishRealtimeAppEventData = {
|
|
5592
|
+
body: RealtimePublish;
|
|
5593
|
+
headers?: {
|
|
5588
5594
|
/**
|
|
5589
5595
|
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
5590
5596
|
*/
|
|
5591
5597
|
"X-Workspace-Id"?: string;
|
|
5592
5598
|
/**
|
|
5593
|
-
*
|
|
5599
|
+
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5600
|
+
* Two distinct 409 errors signal misuse:
|
|
5601
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5602
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5603
|
+
* expires within 30 seconds.
|
|
5604
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5605
|
+
* against a different request body or method. Generate a new key.
|
|
5606
|
+
*
|
|
5607
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5594
5608
|
*
|
|
5595
5609
|
*/
|
|
5596
|
-
"
|
|
5610
|
+
"Idempotency-Key"?: string;
|
|
5611
|
+
};
|
|
5612
|
+
path: {
|
|
5597
5613
|
/**
|
|
5598
|
-
*
|
|
5614
|
+
* Realtime app ID
|
|
5615
|
+
*/
|
|
5616
|
+
realtime_app_id: RealtimeAppId;
|
|
5617
|
+
};
|
|
5618
|
+
query?: never;
|
|
5619
|
+
url: "/v1/realtime/apps/{realtime_app_id}/events";
|
|
5620
|
+
};
|
|
5621
|
+
type PublishRealtimeAppBatchData = {
|
|
5622
|
+
body: RealtimeBatchPublish;
|
|
5623
|
+
headers?: {
|
|
5624
|
+
/**
|
|
5625
|
+
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
5626
|
+
*/
|
|
5627
|
+
"X-Workspace-Id"?: string;
|
|
5628
|
+
/**
|
|
5629
|
+
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5630
|
+
* Two distinct 409 errors signal misuse:
|
|
5631
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5632
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5633
|
+
* expires within 30 seconds.
|
|
5634
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5635
|
+
* against a different request body or method. Generate a new key.
|
|
5599
5636
|
*
|
|
5637
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5638
|
+
*
|
|
5639
|
+
*/
|
|
5640
|
+
"Idempotency-Key"?: string;
|
|
5641
|
+
};
|
|
5642
|
+
path: {
|
|
5643
|
+
/**
|
|
5644
|
+
* Realtime app ID
|
|
5645
|
+
*/
|
|
5646
|
+
realtime_app_id: RealtimeAppId;
|
|
5647
|
+
};
|
|
5648
|
+
query?: never;
|
|
5649
|
+
url: "/v1/realtime/apps/{realtime_app_id}/batch-events";
|
|
5650
|
+
};
|
|
5651
|
+
type ListRealtimeAppChannelsData = {
|
|
5652
|
+
body?: never;
|
|
5653
|
+
headers?: {
|
|
5654
|
+
/**
|
|
5655
|
+
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
5600
5656
|
*/
|
|
5601
|
-
"X-
|
|
5657
|
+
"X-Workspace-Id"?: string;
|
|
5602
5658
|
};
|
|
5603
5659
|
path: {
|
|
5604
5660
|
/**
|
|
@@ -5620,21 +5676,11 @@ type ListRealtimeAppChannelsData = {
|
|
|
5620
5676
|
};
|
|
5621
5677
|
type GetRealtimeAppChannelData = {
|
|
5622
5678
|
body?: never;
|
|
5623
|
-
headers
|
|
5679
|
+
headers?: {
|
|
5624
5680
|
/**
|
|
5625
5681
|
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
5626
5682
|
*/
|
|
5627
5683
|
"X-Workspace-Id"?: string;
|
|
5628
|
-
/**
|
|
5629
|
-
* The Realtime app key. With X-Realtime-Secret it authenticates the request to the Realtime edge. Both come from the app's credentials (shown once at creation) and must belong to the calling workspace.
|
|
5630
|
-
*
|
|
5631
|
-
*/
|
|
5632
|
-
"X-Realtime-Key": string;
|
|
5633
|
-
/**
|
|
5634
|
-
* The Realtime app secret, paired with X-Realtime-Key. Sent over TLS and used only to sign the request to the edge — never stored. Rotate it by rotating the app key.
|
|
5635
|
-
*
|
|
5636
|
-
*/
|
|
5637
|
-
"X-Realtime-Secret": string;
|
|
5638
5684
|
};
|
|
5639
5685
|
path: {
|
|
5640
5686
|
/**
|
|
@@ -5654,6 +5700,40 @@ type GetRealtimeAppChannelData = {
|
|
|
5654
5700
|
};
|
|
5655
5701
|
url: "/v1/realtime/apps/{realtime_app_id}/channels/{channel_name}";
|
|
5656
5702
|
};
|
|
5703
|
+
type SendRealtimeAppMemberEventData = {
|
|
5704
|
+
body: RealtimeMemberPublish;
|
|
5705
|
+
headers?: {
|
|
5706
|
+
/**
|
|
5707
|
+
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
5708
|
+
*/
|
|
5709
|
+
"X-Workspace-Id"?: string;
|
|
5710
|
+
/**
|
|
5711
|
+
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5712
|
+
* Two distinct 409 errors signal misuse:
|
|
5713
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5714
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5715
|
+
* expires within 30 seconds.
|
|
5716
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5717
|
+
* against a different request body or method. Generate a new key.
|
|
5718
|
+
*
|
|
5719
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5720
|
+
*
|
|
5721
|
+
*/
|
|
5722
|
+
"Idempotency-Key"?: string;
|
|
5723
|
+
};
|
|
5724
|
+
path: {
|
|
5725
|
+
/**
|
|
5726
|
+
* Realtime app ID
|
|
5727
|
+
*/
|
|
5728
|
+
realtime_app_id: RealtimeAppId;
|
|
5729
|
+
/**
|
|
5730
|
+
* The member to deliver the event to.
|
|
5731
|
+
*/
|
|
5732
|
+
member_id: RealtimeMemberId;
|
|
5733
|
+
};
|
|
5734
|
+
query?: never;
|
|
5735
|
+
url: "/v1/realtime/apps/{realtime_app_id}/members/{member_id}/events";
|
|
5736
|
+
};
|
|
5657
5737
|
type ListEmailMessagesData = {
|
|
5658
5738
|
body?: never;
|
|
5659
5739
|
path?: never;
|
|
@@ -5709,15 +5789,19 @@ type ListContactsData = {
|
|
|
5709
5789
|
path?: never;
|
|
5710
5790
|
query?: {
|
|
5711
5791
|
/**
|
|
5712
|
-
* Return the contact with exactly this email address (case-insensitive). Email is unique within a workspace, so this matches at most one contact.
|
|
5792
|
+
* Return the contact with exactly this email address (case-insensitive). Email is unique within a workspace, so this matches at most one contact. An empty value is a validation error, never an unfiltered page.
|
|
5713
5793
|
*/
|
|
5714
5794
|
email?: string;
|
|
5715
5795
|
/**
|
|
5716
|
-
* Return the contact with exactly this
|
|
5796
|
+
* Return the contact with exactly this phone number in international E.164 form. Encode the leading plus sign as `%2B` (an unencoded `+` arrives as a space and is rejected). Phone numbers are unique within a workspace, so this matches at most one contact. Non-canonical forms of the same number match the contact they canonicalize to; a value that is not a phone number shape, or an empty value, is a validation error, never an unfiltered page.
|
|
5797
|
+
*/
|
|
5798
|
+
phone?: string;
|
|
5799
|
+
/**
|
|
5800
|
+
* Return the contact with exactly this external_id (your own identifier for the contact). Unique within a workspace, so this matches at most one contact. An empty value is a validation error, never an unfiltered page.
|
|
5717
5801
|
*/
|
|
5718
5802
|
external_id?: string;
|
|
5719
5803
|
/**
|
|
5720
|
-
* Case-insensitive substring match against the contact's email address.
|
|
5804
|
+
* Case-insensitive substring match against the contact's email address, first name, last name, or phone number. Phone matching is over the digits of the international form, so a full pasted number, a formatted number, or trailing digits all match; a national form with a leading trunk zero does not.
|
|
5721
5805
|
*/
|
|
5722
5806
|
q?: string;
|
|
5723
5807
|
/**
|
|
@@ -5732,6 +5816,10 @@ type ListContactsData = {
|
|
|
5732
5816
|
* Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
|
|
5733
5817
|
*/
|
|
5734
5818
|
ending_before?: string;
|
|
5819
|
+
/**
|
|
5820
|
+
* When true, the response includes a `total` field with the total number of items matching the request's filters across all pages.
|
|
5821
|
+
*/
|
|
5822
|
+
include_total?: boolean;
|
|
5735
5823
|
};
|
|
5736
5824
|
url: "/v1/contacts";
|
|
5737
5825
|
};
|
|
@@ -5741,10 +5829,10 @@ type CreateContactData = {
|
|
|
5741
5829
|
/**
|
|
5742
5830
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5743
5831
|
* Two distinct 409 errors signal misuse:
|
|
5744
|
-
* - `request_in_progress` (E01004)
|
|
5832
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5745
5833
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5746
5834
|
* expires within 30 seconds.
|
|
5747
|
-
* - `idempotency_key_reuse` (E01005)
|
|
5835
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5748
5836
|
* against a different request body or method. Generate a new key.
|
|
5749
5837
|
*
|
|
5750
5838
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -5762,10 +5850,10 @@ type CreateContactBatchData = {
|
|
|
5762
5850
|
/**
|
|
5763
5851
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5764
5852
|
* Two distinct 409 errors signal misuse:
|
|
5765
|
-
* - `request_in_progress` (E01004)
|
|
5853
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5766
5854
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5767
5855
|
* expires within 30 seconds.
|
|
5768
|
-
* - `idempotency_key_reuse` (E01005)
|
|
5856
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5769
5857
|
* against a different request body or method. Generate a new key.
|
|
5770
5858
|
*
|
|
5771
5859
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -5783,10 +5871,10 @@ type UpdateContactData = {
|
|
|
5783
5871
|
/**
|
|
5784
5872
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5785
5873
|
* Two distinct 409 errors signal misuse:
|
|
5786
|
-
* - `request_in_progress` (E01004)
|
|
5874
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5787
5875
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5788
5876
|
* expires within 30 seconds.
|
|
5789
|
-
* - `idempotency_key_reuse` (E01005)
|
|
5877
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5790
5878
|
* against a different request body or method. Generate a new key.
|
|
5791
5879
|
*
|
|
5792
5880
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -5828,10 +5916,10 @@ type CreateContactPropertyData = {
|
|
|
5828
5916
|
/**
|
|
5829
5917
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5830
5918
|
* Two distinct 409 errors signal misuse:
|
|
5831
|
-
* - `request_in_progress` (E01004)
|
|
5919
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5832
5920
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5833
5921
|
* expires within 30 seconds.
|
|
5834
|
-
* - `idempotency_key_reuse` (E01005)
|
|
5922
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5835
5923
|
* against a different request body or method. Generate a new key.
|
|
5836
5924
|
*
|
|
5837
5925
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -5849,10 +5937,10 @@ type UpdateContactPropertyData = {
|
|
|
5849
5937
|
/**
|
|
5850
5938
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5851
5939
|
* Two distinct 409 errors signal misuse:
|
|
5852
|
-
* - `request_in_progress` (E01004)
|
|
5940
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5853
5941
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5854
5942
|
* expires within 30 seconds.
|
|
5855
|
-
* - `idempotency_key_reuse` (E01005)
|
|
5943
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5856
5944
|
* against a different request body or method. Generate a new key.
|
|
5857
5945
|
*
|
|
5858
5946
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -5898,10 +5986,10 @@ type CreateAudienceData = {
|
|
|
5898
5986
|
/**
|
|
5899
5987
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5900
5988
|
* Two distinct 409 errors signal misuse:
|
|
5901
|
-
* - `request_in_progress` (E01004)
|
|
5989
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5902
5990
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5903
5991
|
* expires within 30 seconds.
|
|
5904
|
-
* - `idempotency_key_reuse` (E01005)
|
|
5992
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5905
5993
|
* against a different request body or method. Generate a new key.
|
|
5906
5994
|
*
|
|
5907
5995
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -5919,10 +6007,10 @@ type UpdateAudienceData = {
|
|
|
5919
6007
|
/**
|
|
5920
6008
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5921
6009
|
* Two distinct 409 errors signal misuse:
|
|
5922
|
-
* - `request_in_progress` (E01004)
|
|
6010
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5923
6011
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5924
6012
|
* expires within 30 seconds.
|
|
5925
|
-
* - `idempotency_key_reuse` (E01005)
|
|
6013
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5926
6014
|
* against a different request body or method. Generate a new key.
|
|
5927
6015
|
*
|
|
5928
6016
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -5949,7 +6037,7 @@ type ListAudienceContactsData = {
|
|
|
5949
6037
|
};
|
|
5950
6038
|
query?: {
|
|
5951
6039
|
/**
|
|
5952
|
-
* Case-insensitive substring match against the member's email address.
|
|
6040
|
+
* Case-insensitive substring match against the member's email address or phone number (digits of the international form).
|
|
5953
6041
|
*/
|
|
5954
6042
|
q?: string;
|
|
5955
6043
|
/**
|
|
@@ -5973,10 +6061,10 @@ type AssignAudienceContactsData = {
|
|
|
5973
6061
|
/**
|
|
5974
6062
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
5975
6063
|
* Two distinct 409 errors signal misuse:
|
|
5976
|
-
* - `request_in_progress` (E01004)
|
|
6064
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
5977
6065
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5978
6066
|
* expires within 30 seconds.
|
|
5979
|
-
* - `idempotency_key_reuse` (E01005)
|
|
6067
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
5980
6068
|
* against a different request body or method. Generate a new key.
|
|
5981
6069
|
*
|
|
5982
6070
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -5999,10 +6087,10 @@ type UnassignAudienceContactsData = {
|
|
|
5999
6087
|
/**
|
|
6000
6088
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
6001
6089
|
* Two distinct 409 errors signal misuse:
|
|
6002
|
-
* - `request_in_progress` (E01004)
|
|
6090
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
6003
6091
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6004
6092
|
* expires within 30 seconds.
|
|
6005
|
-
* - `idempotency_key_reuse` (E01005)
|
|
6093
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
6006
6094
|
* against a different request body or method. Generate a new key.
|
|
6007
6095
|
*
|
|
6008
6096
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -6108,10 +6196,10 @@ type CreateVerificationData = {
|
|
|
6108
6196
|
/**
|
|
6109
6197
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
6110
6198
|
* Two distinct 409 errors signal misuse:
|
|
6111
|
-
* - `request_in_progress` (E01004)
|
|
6199
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
6112
6200
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6113
6201
|
* expires within 30 seconds.
|
|
6114
|
-
* - `idempotency_key_reuse` (E01005)
|
|
6202
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
6115
6203
|
* against a different request body or method. Generate a new key.
|
|
6116
6204
|
*
|
|
6117
6205
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -6133,10 +6221,10 @@ type CreateVerificationCheckData = {
|
|
|
6133
6221
|
/**
|
|
6134
6222
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
6135
6223
|
* Two distinct 409 errors signal misuse:
|
|
6136
|
-
* - `request_in_progress` (E01004)
|
|
6224
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
6137
6225
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6138
6226
|
* expires within 30 seconds.
|
|
6139
|
-
* - `idempotency_key_reuse` (E01005)
|
|
6227
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
6140
6228
|
* against a different request body or method. Generate a new key.
|
|
6141
6229
|
*
|
|
6142
6230
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -6176,6 +6264,11 @@ type ListWhatsAppMessagesData = {
|
|
|
6176
6264
|
* Filter by status. Repeat the parameter to match any of several statuses.
|
|
6177
6265
|
*/
|
|
6178
6266
|
status?: Array<WhatsAppMessageStatus>;
|
|
6267
|
+
/**
|
|
6268
|
+
* Filter by whether the business sent the message (`outbound`) or received it from the contact (`inbound`).
|
|
6269
|
+
*
|
|
6270
|
+
*/
|
|
6271
|
+
direction?: MessageDirection;
|
|
6179
6272
|
/**
|
|
6180
6273
|
* Filter by contact phone number (E.164 exact match).
|
|
6181
6274
|
*/
|
|
@@ -6222,7 +6315,7 @@ type GetEmailStatsDailyData = {
|
|
|
6222
6315
|
*/
|
|
6223
6316
|
to?: string;
|
|
6224
6317
|
/**
|
|
6225
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6318
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6226
6319
|
*
|
|
6227
6320
|
*/
|
|
6228
6321
|
timezone?: string;
|
|
@@ -6271,7 +6364,7 @@ type GetEmailStatsHourlyData = {
|
|
|
6271
6364
|
*/
|
|
6272
6365
|
to?: string;
|
|
6273
6366
|
/**
|
|
6274
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6367
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6275
6368
|
*
|
|
6276
6369
|
*/
|
|
6277
6370
|
timezone?: string;
|
|
@@ -6320,7 +6413,7 @@ type GetEmailStatsByTagData = {
|
|
|
6320
6413
|
*/
|
|
6321
6414
|
to?: string;
|
|
6322
6415
|
/**
|
|
6323
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6416
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6324
6417
|
*
|
|
6325
6418
|
*/
|
|
6326
6419
|
timezone?: string;
|
|
@@ -6364,7 +6457,7 @@ type GetEmailStatsSummaryData = {
|
|
|
6364
6457
|
*/
|
|
6365
6458
|
to?: string;
|
|
6366
6459
|
/**
|
|
6367
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6460
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6368
6461
|
*
|
|
6369
6462
|
*/
|
|
6370
6463
|
timezone?: string;
|
|
@@ -6418,7 +6511,7 @@ type GetEmailStatsBySendingIpData = {
|
|
|
6418
6511
|
*/
|
|
6419
6512
|
to?: string;
|
|
6420
6513
|
/**
|
|
6421
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6514
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6422
6515
|
*
|
|
6423
6516
|
*/
|
|
6424
6517
|
timezone?: string;
|
|
@@ -6460,7 +6553,7 @@ type GetEmailStatsBySendingDomainData = {
|
|
|
6460
6553
|
*/
|
|
6461
6554
|
to?: string;
|
|
6462
6555
|
/**
|
|
6463
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6556
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6464
6557
|
*
|
|
6465
6558
|
*/
|
|
6466
6559
|
timezone?: string;
|
|
@@ -6502,7 +6595,7 @@ type GetEmailStatsByCategoryData = {
|
|
|
6502
6595
|
*/
|
|
6503
6596
|
to?: string;
|
|
6504
6597
|
/**
|
|
6505
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6598
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6506
6599
|
*
|
|
6507
6600
|
*/
|
|
6508
6601
|
timezone?: string;
|
|
@@ -6540,7 +6633,7 @@ type GetEmailStatsByMailboxProviderData = {
|
|
|
6540
6633
|
*/
|
|
6541
6634
|
to?: string;
|
|
6542
6635
|
/**
|
|
6543
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6636
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6544
6637
|
*
|
|
6545
6638
|
*/
|
|
6546
6639
|
timezone?: string;
|
|
@@ -6582,7 +6675,7 @@ type GetEmailStatsByMailboxProviderRegionData = {
|
|
|
6582
6675
|
*/
|
|
6583
6676
|
to?: string;
|
|
6584
6677
|
/**
|
|
6585
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6678
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6586
6679
|
*
|
|
6587
6680
|
*/
|
|
6588
6681
|
timezone?: string;
|
|
@@ -6624,7 +6717,7 @@ type GetEmailStatsByRecipientDomainData = {
|
|
|
6624
6717
|
*/
|
|
6625
6718
|
to?: string;
|
|
6626
6719
|
/**
|
|
6627
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6720
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6628
6721
|
*
|
|
6629
6722
|
*/
|
|
6630
6723
|
timezone?: string;
|
|
@@ -6666,7 +6759,7 @@ type GetEmailStatsByTemplateData = {
|
|
|
6666
6759
|
*/
|
|
6667
6760
|
to?: string;
|
|
6668
6761
|
/**
|
|
6669
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6762
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6670
6763
|
*
|
|
6671
6764
|
*/
|
|
6672
6765
|
timezone?: string;
|
|
@@ -6708,7 +6801,7 @@ type GetEmailStatsByLocationData = {
|
|
|
6708
6801
|
*/
|
|
6709
6802
|
to?: string;
|
|
6710
6803
|
/**
|
|
6711
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6804
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6712
6805
|
*
|
|
6713
6806
|
*/
|
|
6714
6807
|
timezone?: string;
|
|
@@ -6746,7 +6839,7 @@ type GetEmailStatsByClientData = {
|
|
|
6746
6839
|
*/
|
|
6747
6840
|
to?: string;
|
|
6748
6841
|
/**
|
|
6749
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6842
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6750
6843
|
*
|
|
6751
6844
|
*/
|
|
6752
6845
|
timezone?: string;
|
|
@@ -6784,7 +6877,7 @@ type GetEmailStatsByBounceCodeData = {
|
|
|
6784
6877
|
*/
|
|
6785
6878
|
to?: string;
|
|
6786
6879
|
/**
|
|
6787
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6880
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6788
6881
|
*
|
|
6789
6882
|
*/
|
|
6790
6883
|
timezone?: string;
|
|
@@ -6817,7 +6910,7 @@ type GetEmailStatsByComplaintTypeData = {
|
|
|
6817
6910
|
*/
|
|
6818
6911
|
to?: string;
|
|
6819
6912
|
/**
|
|
6820
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
6913
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
6821
6914
|
*
|
|
6822
6915
|
*/
|
|
6823
6916
|
timezone?: string;
|
|
@@ -6862,15 +6955,6 @@ type GetEmailStatsByBroadcastData = {
|
|
|
6862
6955
|
* Maximum number of broadcast rows to return, ranked by the `sort` field descending.
|
|
6863
6956
|
*/
|
|
6864
6957
|
limit?: number;
|
|
6865
|
-
/**
|
|
6866
|
-
* Requests a per-row `trend` series. Not available for the broadcast breakdown; supplying `true` returns 422.
|
|
6867
|
-
*
|
|
6868
|
-
*/
|
|
6869
|
-
include_trend?: boolean;
|
|
6870
|
-
/**
|
|
6871
|
-
* Bucket grain for the `trend` series. Has no effect on this breakdown, where `include_trend` is not available.
|
|
6872
|
-
*/
|
|
6873
|
-
trend_grain?: StatsTrendGrain;
|
|
6874
6958
|
};
|
|
6875
6959
|
url: "/v1/email/stats/broadcasts";
|
|
6876
6960
|
};
|
|
@@ -6916,10 +7000,10 @@ type CreateDomainData = {
|
|
|
6916
7000
|
/**
|
|
6917
7001
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
6918
7002
|
* Two distinct 409 errors signal misuse:
|
|
6919
|
-
* - `request_in_progress` (E01004)
|
|
7003
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
6920
7004
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6921
7005
|
* expires within 30 seconds.
|
|
6922
|
-
* - `idempotency_key_reuse` (E01005)
|
|
7006
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
6923
7007
|
* against a different request body or method. Generate a new key.
|
|
6924
7008
|
*
|
|
6925
7009
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -6937,10 +7021,10 @@ type UpdateDomainData = {
|
|
|
6937
7021
|
/**
|
|
6938
7022
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
6939
7023
|
* Two distinct 409 errors signal misuse:
|
|
6940
|
-
* - `request_in_progress` (E01004)
|
|
7024
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
6941
7025
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6942
7026
|
* expires within 30 seconds.
|
|
6943
|
-
* - `idempotency_key_reuse` (E01005)
|
|
7027
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
6944
7028
|
* against a different request body or method. Generate a new key.
|
|
6945
7029
|
*
|
|
6946
7030
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -7002,10 +7086,10 @@ type CreateMailboxData = {
|
|
|
7002
7086
|
/**
|
|
7003
7087
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
7004
7088
|
* Two distinct 409 errors signal misuse:
|
|
7005
|
-
* - `request_in_progress` (E01004)
|
|
7089
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
7006
7090
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7007
7091
|
* expires within 30 seconds.
|
|
7008
|
-
* - `idempotency_key_reuse` (E01005)
|
|
7092
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
7009
7093
|
* against a different request body or method. Generate a new key.
|
|
7010
7094
|
*
|
|
7011
7095
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -7023,10 +7107,10 @@ type UpdateMailboxData = {
|
|
|
7023
7107
|
/**
|
|
7024
7108
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
7025
7109
|
* Two distinct 409 errors signal misuse:
|
|
7026
|
-
* - `request_in_progress` (E01004)
|
|
7110
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
7027
7111
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7028
7112
|
* expires within 30 seconds.
|
|
7029
|
-
* - `idempotency_key_reuse` (E01005)
|
|
7113
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
7030
7114
|
* against a different request body or method. Generate a new key.
|
|
7031
7115
|
*
|
|
7032
7116
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -7068,7 +7152,7 @@ type GetMailboxStatsData = {
|
|
|
7068
7152
|
*/
|
|
7069
7153
|
to?: string;
|
|
7070
7154
|
/**
|
|
7071
|
-
* IANA timezone identifier (for example `Asia/Kathmandu`
|
|
7155
|
+
* IANA timezone identifier (for example `Asia/Kathmandu`) to report in; defaults to UTC. Day and hour boundaries and the default window when `from` and `to` are omitted both follow it, so a calendar-day `from` or `to` names a local day. A `from` or `to` carrying its own UTC offset is rejected while this is set: pass a calendar day or a `Z` instant.
|
|
7072
7156
|
*
|
|
7073
7157
|
*/
|
|
7074
7158
|
timezone?: string;
|
|
@@ -7114,10 +7198,10 @@ type CreateMailboxReceiveRuleData = {
|
|
|
7114
7198
|
/**
|
|
7115
7199
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
7116
7200
|
* Two distinct 409 errors signal misuse:
|
|
7117
|
-
* - `request_in_progress` (E01004)
|
|
7201
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
7118
7202
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7119
7203
|
* expires within 30 seconds.
|
|
7120
|
-
* - `idempotency_key_reuse` (E01005)
|
|
7204
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
7121
7205
|
* against a different request body or method. Generate a new key.
|
|
7122
7206
|
*
|
|
7123
7207
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -7191,10 +7275,10 @@ type DeleteEmailThreadData = {
|
|
|
7191
7275
|
/**
|
|
7192
7276
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
7193
7277
|
* Two distinct 409 errors signal misuse:
|
|
7194
|
-
* - `request_in_progress` (E01004)
|
|
7278
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
7195
7279
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7196
7280
|
* expires within 30 seconds.
|
|
7197
|
-
* - `idempotency_key_reuse` (E01005)
|
|
7281
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
7198
7282
|
* against a different request body or method. Generate a new key.
|
|
7199
7283
|
*
|
|
7200
7284
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -7222,10 +7306,10 @@ type UpdateEmailThreadData = {
|
|
|
7222
7306
|
/**
|
|
7223
7307
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
7224
7308
|
* Two distinct 409 errors signal misuse:
|
|
7225
|
-
* - `request_in_progress` (E01004)
|
|
7309
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
7226
7310
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7227
7311
|
* expires within 30 seconds.
|
|
7228
|
-
* - `idempotency_key_reuse` (E01005)
|
|
7312
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
7229
7313
|
* against a different request body or method. Generate a new key.
|
|
7230
7314
|
*
|
|
7231
7315
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -7285,10 +7369,10 @@ type ReplyEmailThreadMessageData = {
|
|
|
7285
7369
|
/**
|
|
7286
7370
|
* Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
|
|
7287
7371
|
* Two distinct 409 errors signal misuse:
|
|
7288
|
-
* - `request_in_progress` (E01004)
|
|
7372
|
+
* - `request_in_progress` (E01004): the same key is currently being
|
|
7289
7373
|
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7290
7374
|
* expires within 30 seconds.
|
|
7291
|
-
* - `idempotency_key_reuse` (E01005)
|
|
7375
|
+
* - `idempotency_key_reuse` (E01005): the same key has already completed
|
|
7292
7376
|
* against a different request body or method. Generate a new key.
|
|
7293
7377
|
*
|
|
7294
7378
|
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
@@ -7637,16 +7721,16 @@ declare abstract class Resource {
|
|
|
7637
7721
|
protected readonly client: Client;
|
|
7638
7722
|
constructor(core: BirdHTTPClient, client: Client);
|
|
7639
7723
|
/** Run a single typed call through the lifecycle. */
|
|
7640
|
-
protected call<T>(method: string, options: RequestOptions | undefined, invoke: (ctx: CallContext) => Promise<FetchOutcome<T
|
|
7724
|
+
protected call<T>(method: string, options: RequestOptions | undefined, invoke: (ctx: CallContext) => Promise<FetchOutcome<T>>, schemes?: string[]): APIPromise<T>;
|
|
7641
7725
|
/** Run a cursor-paginated list through the lifecycle (each page retried independently). */
|
|
7642
|
-
protected paginated<T>(method: string, options: RequestOptions | undefined, invoke: (ctx: CallContext, cursor: string | undefined) => Promise<FetchOutcome<CursorPage<T
|
|
7726
|
+
protected paginated<T>(method: string, options: RequestOptions | undefined, invoke: (ctx: CallContext, cursor: string | undefined) => Promise<FetchOutcome<CursorPage<T>>>, schemes?: string[]): PaginatedPromise<T>;
|
|
7643
7727
|
}
|
|
7644
7728
|
//#endregion
|
|
7645
7729
|
//#region src/resources/email.gen.d.ts
|
|
7646
7730
|
type EmailListQuery$1 = NonNullable<ListEmailMessagesData["query"]>;
|
|
7647
7731
|
declare class EmailResourceBase extends Resource {
|
|
7648
7732
|
/**
|
|
7649
|
-
* Fetch one email message by id
|
|
7733
|
+
* Fetch one email message by id, with aggregate delivery status and per-state recipient counts. The message body (html, text) is not returned. Per-recipient delivery statuses and the event log are separate sub-resources: GET /v1/email/messages/{message_id}/recipients and GET /v1/email/messages/{message_id}/events.
|
|
7650
7734
|
*
|
|
7651
7735
|
* @example
|
|
7652
7736
|
* const msg = await bird.email.get("em_abc123");
|
|
@@ -7656,7 +7740,7 @@ declare class EmailResourceBase extends Resource {
|
|
|
7656
7740
|
*/
|
|
7657
7741
|
get(messageId: string, options?: RequestOptions): APIPromise<EmailMessage>;
|
|
7658
7742
|
/**
|
|
7659
|
-
* List sent email messages, newest first, as a cursor page ({data, next_cursor, …}). Pass next_cursor back as starting_after to fetch the next page. Filter by creation time with the half-open range created_after (inclusive) / created_before (exclusive)
|
|
7743
|
+
* List sent email messages, newest first, as a cursor page ({data, next_cursor, …}). Pass next_cursor back as starting_after to fetch the next page. Filter by creation time with the half-open range created_after (inclusive) / created_before (exclusive). For a single UTC day, created_after is that day at 00:00:00Z and created_before is the next day at 00:00:00Z.
|
|
7660
7744
|
*
|
|
7661
7745
|
* @example
|
|
7662
7746
|
* for await (const message of bird.email.list({ status: "bounced" })) {
|
|
@@ -7665,7 +7749,7 @@ declare class EmailResourceBase extends Resource {
|
|
|
7665
7749
|
*/
|
|
7666
7750
|
list(query?: EmailListQuery$1, options?: RequestOptions): PaginatedPromise<EmailMessage>;
|
|
7667
7751
|
/**
|
|
7668
|
-
* Cancel a scheduled email before it sends. Only works while the message is still scheduled (status `scheduled`); once it starts sending
|
|
7752
|
+
* Cancel a scheduled email before it sends. Only works while the message is still scheduled (status `scheduled`); once it starts sending, or was already canceled, the call returns a conflict error. Canceling does not return consumed scheduled-send quota.
|
|
7669
7753
|
*
|
|
7670
7754
|
* @example
|
|
7671
7755
|
* await bird.email.cancel("em_abc123");
|
|
@@ -7800,7 +7884,7 @@ declare class EmailStatsResource extends Resource {
|
|
|
7800
7884
|
*/
|
|
7801
7885
|
byMailboxProviderRegion(query?: EmailStatsByMailboxProviderRegionQuery, options?: RequestOptions): APIPromise<EmailStatsByMailboxProviderRegionResponse>;
|
|
7802
7886
|
/**
|
|
7803
|
-
* Email delivery and engagement stats grouped by the template used at send time, keyed by template id (`emt_…`); only templated sends appear.
|
|
7887
|
+
* Email delivery and engagement stats grouped by the template used at send time, keyed by template id (`emt_…`); only templated sends appear. A single template's trend over time comes from email_stats_daily with its `template` filter.
|
|
7804
7888
|
*
|
|
7805
7889
|
* @example
|
|
7806
7890
|
* const { data } = await bird.email.stats.byTemplate({
|
|
@@ -7837,7 +7921,7 @@ declare class EmailStatsResource extends Resource {
|
|
|
7837
7921
|
*/
|
|
7838
7922
|
byClient(query?: EmailStatsByClientQuery, options?: RequestOptions): APIPromise<EmailStatsByClientResponse>;
|
|
7839
7923
|
/**
|
|
7840
|
-
* Bounce counts grouped by the SMTP error code the receiving server returned, with the hard/soft/admin/block/undetermined split; failure side only.
|
|
7924
|
+
* Bounce counts grouped by the SMTP error code the receiving server returned, with the hard/soft/admin/block/undetermined split; failure side only. It shows what is driving bounces, while bounces by destination come from email_stats_by_recipient_domain or email_stats_by_mailbox_provider.
|
|
7841
7925
|
*
|
|
7842
7926
|
* @example
|
|
7843
7927
|
* const { data } = await bird.email.stats.byBounceCode({
|
|
@@ -7858,7 +7942,7 @@ declare class EmailStatsResource extends Resource {
|
|
|
7858
7942
|
*/
|
|
7859
7943
|
byComplaintType(query?: EmailStatsByComplaintTypeQuery, options?: RequestOptions): APIPromise<EmailStatsByComplaintTypeResponse>;
|
|
7860
7944
|
/**
|
|
7861
|
-
* Email delivery and engagement stats grouped by broadcast; only broadcast sends appear. Reflects roughly the last 30 days of activity
|
|
7945
|
+
* Email delivery and engagement stats grouped by broadcast; only broadcast sends appear. Reflects roughly the last 30 days of activity.
|
|
7862
7946
|
*
|
|
7863
7947
|
* @example
|
|
7864
7948
|
* const { data } = await bird.email.stats.byBroadcast({
|
|
@@ -7878,7 +7962,7 @@ type EmailMailboxesCreateParams = NonNullable<CreateMailboxData["body"]>;
|
|
|
7878
7962
|
type EmailMailboxesUpdateParams = NonNullable<UpdateMailboxData["body"]>;
|
|
7879
7963
|
type EmailMailboxesUpdateQuery = NonNullable<UpdateMailboxData["query"]>;
|
|
7880
7964
|
type EmailMailboxesStatsQuery = NonNullable<GetMailboxStatsData["query"]>;
|
|
7881
|
-
declare class
|
|
7965
|
+
declare class EmailMailboxesResourceBase extends Resource {
|
|
7882
7966
|
/**
|
|
7883
7967
|
* List the workspace's mailboxes as a cursor page, newest first. Search addresses and display names with q, or filter by exact address, state, or domain.
|
|
7884
7968
|
*
|
|
@@ -7889,7 +7973,7 @@ declare class EmailMailboxesResource$1 extends Resource {
|
|
|
7889
7973
|
*/
|
|
7890
7974
|
list(query?: EmailMailboxesListQuery, options?: RequestOptions): PaginatedPromise<Mailbox>;
|
|
7891
7975
|
/**
|
|
7892
|
-
* Create a mailbox
|
|
7976
|
+
* Create a mailbox: a durable agent identity that owns an email address, groups mail into threads, and remembers conversations for its retention tier.
|
|
7893
7977
|
*
|
|
7894
7978
|
* @example Create a mailbox
|
|
7895
7979
|
* const mailbox = await bird.email.mailboxes.create({ display_name: "Support" });
|
|
@@ -7897,13 +7981,15 @@ declare class EmailMailboxesResource$1 extends Resource {
|
|
|
7897
7981
|
*/
|
|
7898
7982
|
create(params?: EmailMailboxesCreateParams, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7899
7983
|
/**
|
|
7984
|
+
* Read one mailbox by id. A mailbox deleted within its 30-day restore window is still returned, carrying a non-null `deleted_at`; once that window closes it is gone and this returns 404.
|
|
7985
|
+
*
|
|
7900
7986
|
* @example Get a mailbox
|
|
7901
7987
|
* const mailbox = await bird.email.mailboxes.get("mbx_01abc");
|
|
7902
7988
|
* console.log(mailbox.state); // "active"
|
|
7903
7989
|
*/
|
|
7904
7990
|
get(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7905
7991
|
/**
|
|
7906
|
-
* Update a mailbox's display name, reply-to, receive policy, retention tier,
|
|
7992
|
+
* Update a mailbox's display name, reply-to, receive policy, retention tier, IP pool, or metadata. Lowering the retention tier onto remembered messages older than the new horizon requires confirm=true.
|
|
7907
7993
|
*
|
|
7908
7994
|
* @example Change a mailbox's receive policy
|
|
7909
7995
|
* const mailbox = await bird.email.mailboxes.update("mbx_01abc", {
|
|
@@ -7936,6 +8022,8 @@ declare class EmailMailboxesResource$1 extends Resource {
|
|
|
7936
8022
|
*/
|
|
7937
8023
|
resume(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7938
8024
|
/**
|
|
8025
|
+
* Read a mailbox's sent and received email statistics over a window: a period summary plus a bucketed series. Rows are bucketed by event time rather than send time, so engagement that arrived during the period for messages sent earlier is counted here. Both window bounds must use the same form, calendar days or RFC 3339 instants, matching the granularity.
|
|
8026
|
+
*
|
|
7939
8027
|
* @example Get mailbox stats
|
|
7940
8028
|
* const stats = await bird.email.mailboxes.stats("mbx_01abc");
|
|
7941
8029
|
* console.log(stats.summary?.sends_accepted);
|
|
@@ -7993,7 +8081,7 @@ declare class EmailMailboxesReceiveRulesResource extends Resource {
|
|
|
7993
8081
|
*/
|
|
7994
8082
|
create(mailboxId: string, params: EmailMailboxesReceiveRulesCreateParams, options?: RequestOptions): APIPromise<ReceiveRule>;
|
|
7995
8083
|
/**
|
|
7996
|
-
* Remove a receive rule from a mailbox.
|
|
8084
|
+
* Remove a receive rule from a mailbox. Rules have no update operation, so a rule's allow or block action cannot be changed after it is created.
|
|
7997
8085
|
*
|
|
7998
8086
|
* @example Delete a rule
|
|
7999
8087
|
* await bird.email.mailboxes.receiveRules.delete("mbx_01abc", "erl_01xyz");
|
|
@@ -8002,7 +8090,7 @@ declare class EmailMailboxesReceiveRulesResource extends Resource {
|
|
|
8002
8090
|
}
|
|
8003
8091
|
//#endregion
|
|
8004
8092
|
//#region src/resources/emailMailboxes.d.ts
|
|
8005
|
-
declare class EmailMailboxesResource extends
|
|
8093
|
+
declare class EmailMailboxesResource extends EmailMailboxesResourceBase {
|
|
8006
8094
|
/** Messages sent from the mailbox's own address — `bird.email.mailboxes.messages.create(...)`. */
|
|
8007
8095
|
readonly messages: EmailMailboxesMessagesResource;
|
|
8008
8096
|
/** Per-sender allow/block rules — `bird.email.mailboxes.receiveRules.create(...)`, `.list(...)`, `.delete(...)`. */
|
|
@@ -8014,9 +8102,9 @@ declare class EmailMailboxesResource extends EmailMailboxesResource$1 {
|
|
|
8014
8102
|
type EmailThreadsListQuery = NonNullable<ListEmailThreadsData["query"]>;
|
|
8015
8103
|
type EmailThreadsUpdateParams = NonNullable<UpdateEmailThreadData["body"]>;
|
|
8016
8104
|
type EmailThreadsDeleteQuery = NonNullable<DeleteEmailThreadData["query"]>;
|
|
8017
|
-
declare class
|
|
8105
|
+
declare class EmailThreadsResourceBase extends Resource {
|
|
8018
8106
|
/**
|
|
8019
|
-
* List mailbox conversations as a cursor page, most recently active first. `label` selects the view
|
|
8107
|
+
* List mailbox conversations as a cursor page, most recently active first. `label` selects the view: inbox (default), archive, spam, blocked, or a custom label. Filter by mailbox, contact, participant address, or subject substring.
|
|
8020
8108
|
*
|
|
8021
8109
|
* @example List conversation threads
|
|
8022
8110
|
* for await (const thread of bird.email.threads.list({ mailbox_id: "mbx_01abc" })) {
|
|
@@ -8033,7 +8121,7 @@ declare class EmailThreadsResource$1 extends Resource {
|
|
|
8033
8121
|
*/
|
|
8034
8122
|
get(threadId: string, options?: RequestOptions): APIPromise<EmailThread>;
|
|
8035
8123
|
/**
|
|
8036
|
-
* Add or remove labels on a conversation
|
|
8124
|
+
* Add or remove labels on a conversation, or link and unlink a contact. Adding `spam` files it as spam, `archive` clears it out of the inbox, and `inbox` brings it back.
|
|
8037
8125
|
*
|
|
8038
8126
|
* @example Apply label changes to a thread
|
|
8039
8127
|
* const thread = await bird.email.threads.update("thr_01abc", {
|
|
@@ -8065,7 +8153,7 @@ declare class EmailThreadsMessagesResource extends Resource {
|
|
|
8065
8153
|
*/
|
|
8066
8154
|
list(threadId: string, query?: EmailThreadsMessagesListQuery, options?: RequestOptions): PaginatedPromise<EmailThreadMessage>;
|
|
8067
8155
|
/**
|
|
8068
|
-
* Get one conversation message with its extracted plain text
|
|
8156
|
+
* Get one conversation message with its extracted plain text, readable for the mailbox's full retention period without MIME parsing.
|
|
8069
8157
|
*
|
|
8070
8158
|
* @example Get a message
|
|
8071
8159
|
* const msg = await bird.email.threads.messages.get("thr_01abc", "rem_01xyz");
|
|
@@ -8101,7 +8189,7 @@ declare class EmailThreadsMessagesResource extends Resource {
|
|
|
8101
8189
|
}
|
|
8102
8190
|
//#endregion
|
|
8103
8191
|
//#region src/resources/emailThreads.d.ts
|
|
8104
|
-
declare class EmailThreadsResource extends
|
|
8192
|
+
declare class EmailThreadsResource extends EmailThreadsResourceBase {
|
|
8105
8193
|
/** Messages in a conversation — `bird.email.threads.messages.list(...)`, `.reply(...)`, … */
|
|
8106
8194
|
readonly messages: EmailThreadsMessagesResource;
|
|
8107
8195
|
constructor(...args: ConstructorParameters<typeof Resource>);
|
|
@@ -8334,7 +8422,7 @@ declare class DomainsResource extends Resource {
|
|
|
8334
8422
|
*/
|
|
8335
8423
|
get(domainId: string, options?: RequestOptions): APIPromise<Domain>;
|
|
8336
8424
|
/**
|
|
8337
|
-
* Register a new sending domain and get the DNS records to publish.
|
|
8425
|
+
* Register a new sending domain and get the DNS records to publish. Verification is a second step: the records go live at the DNS provider, then email_domains_verify confirms them. Propagation takes minutes to hours, so the first verify often still reports unverified and a later one succeeds.
|
|
8338
8426
|
*
|
|
8339
8427
|
* @example Register a sending domain
|
|
8340
8428
|
* const domain = await bird.domains.create({ domain: "mail.acme.com" });
|
|
@@ -8350,7 +8438,7 @@ declare class DomainsResource extends Resource {
|
|
|
8350
8438
|
*/
|
|
8351
8439
|
verify(domainId: string, options?: RequestOptions): APIPromise<Domain>;
|
|
8352
8440
|
/**
|
|
8353
|
-
* Update a sending domain's tracking and inbound configuration. Tracking:
|
|
8441
|
+
* Update a sending domain's tracking and inbound configuration. Tracking: click_tracking and open_tracking apply immediately to new sends, and the tracking domain can be set, changed, or removed (the name part only; Bird appends the sending domain). Enabling either toggle with no tracking domain configured returns 409, and removing the tracking domain while either toggle is still on also returns 409. Tracking-domain changes on a verified domain are staged behind DNS verification, so the current config keeps serving until the new records verify. Inbound receiving: inbound.enabled starts or stops receiving mail for the domain. Enabling requires the domain's DKIM to be verified first (a fresh enable on an unverified domain returns 422), and a domain already receiving inbound for another organization returns 422. The MX records to publish are always listed in dns_records regardless, so receiving starts only once inbound.enabled is set, even when those records are already published.
|
|
8354
8442
|
*
|
|
8355
8443
|
* @example Enable tracking on a domain
|
|
8356
8444
|
* await bird.domains.update("dom_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
@@ -8400,7 +8488,7 @@ declare class ContactPropertiesResource extends Resource {
|
|
|
8400
8488
|
*/
|
|
8401
8489
|
create(params: ContactPropertyCreateParams, options?: RequestOptions): APIPromise<ContactProperty>;
|
|
8402
8490
|
/**
|
|
8403
|
-
* Update a contact property's fallback value.
|
|
8491
|
+
* Update a contact property's fallback value. Only the fallback value can change; the key and type are fixed at creation, so a different key or type needs a new property.
|
|
8404
8492
|
*
|
|
8405
8493
|
* @example Change a property's fallback value
|
|
8406
8494
|
* await bird.contactProperties.update("cp_01krdgeqcxet5s7t44vh8rt9mg", { fallback_value: "free" });
|
|
@@ -8430,7 +8518,7 @@ type ContactUpdateParams = NonNullable<UpdateContactData["body"]>;
|
|
|
8430
8518
|
type ContactBatchParams = NonNullable<CreateContactBatchData["body"]>;
|
|
8431
8519
|
declare class ContactsResource extends Resource {
|
|
8432
8520
|
/**
|
|
8433
|
-
* List the workspace's contacts as a cursor page, newest first. Look one up by exact email or external_id, or search by email substring.
|
|
8521
|
+
* List the workspace's contacts as a cursor page, newest first. Look one up by exact email, phone, or external_id, or search by email, name, or phone substring. Pass include_total for a total count.
|
|
8434
8522
|
*
|
|
8435
8523
|
* @example Iterate every contact, or take one page
|
|
8436
8524
|
* for await (const contact of bird.contacts.list({ q: "acme.com" })) {
|
|
@@ -8440,7 +8528,7 @@ declare class ContactsResource extends Resource {
|
|
|
8440
8528
|
*/
|
|
8441
8529
|
list(query?: ContactListQuery, options?: RequestOptions): PaginatedPromise<Contact>;
|
|
8442
8530
|
/**
|
|
8443
|
-
* Get a single contact by ID (`con_`-prefixed). Look up an ID by exact email or external_id with `contacts.list`.
|
|
8531
|
+
* Get a single contact by ID (`con_`-prefixed). Look up an ID by exact email, phone, or external_id with `contacts.list`.
|
|
8444
8532
|
*
|
|
8445
8533
|
* @example Fetch a contact by id
|
|
8446
8534
|
* const contact = await bird.contacts.get("con_01krdgeqcxet5s7t44vh8rt9mg");
|
|
@@ -8448,7 +8536,7 @@ declare class ContactsResource extends Resource {
|
|
|
8448
8536
|
*/
|
|
8449
8537
|
get(contactId: string, options?: RequestOptions): APIPromise<Contact>;
|
|
8450
8538
|
/**
|
|
8451
|
-
* Create a contact by email address
|
|
8539
|
+
* Create a contact identified by an email address, an E.164 phone number, or both. Fails with a conflict if the email, phone, or external_id is already used by another contact. For bulk import or create-or-update semantics use `contacts.batch`.
|
|
8452
8540
|
*
|
|
8453
8541
|
* @example Create a contact
|
|
8454
8542
|
* const contact = await bird.contacts.create({
|
|
@@ -8457,9 +8545,9 @@ declare class ContactsResource extends Resource {
|
|
|
8457
8545
|
* });
|
|
8458
8546
|
* console.log(contact.id); // "con_…"
|
|
8459
8547
|
*/
|
|
8460
|
-
create(params
|
|
8548
|
+
create(params?: ContactCreateParams, options?: RequestOptions): APIPromise<Contact>;
|
|
8461
8549
|
/**
|
|
8462
|
-
* Update a contact's name, external_id, email, or custom data. Only supplied fields change; custom data keys are merged, with null removing a key.
|
|
8550
|
+
* Update a contact's name, external_id, email, phone, or custom data. Only supplied fields change; custom data keys are merged, with null removing a key. A contact keeps at least one identifier: clearing both email and phone is rejected.
|
|
8463
8551
|
*
|
|
8464
8552
|
* @example Change a contact's fields
|
|
8465
8553
|
* const contact = await bird.contacts.update("con_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
@@ -8476,14 +8564,14 @@ declare class ContactsResource extends Resource {
|
|
|
8476
8564
|
*/
|
|
8477
8565
|
delete(contactId: string, options?: RequestOptions): APIPromise<void>;
|
|
8478
8566
|
/**
|
|
8479
|
-
* Create or update up to 1,000 contacts in one request, matched
|
|
8567
|
+
* Create or update up to 1,000 contacts in one request, each entry matched automatically against every identifier it supplies (email, phone, external_id) or, with match_on, by that one field only, and optionally add them all to one or more audiences. Per-contact results are returned in submission order.
|
|
8480
8568
|
*
|
|
8481
|
-
* @example Create or update many contacts at once, matched by
|
|
8569
|
+
* @example Create or update many contacts at once, matched by the identifiers each entry carries
|
|
8482
8570
|
* const result = await bird.contacts.batch({
|
|
8483
8571
|
* contacts: [{ email: "jane@acme.com", first_name: "Jane" }],
|
|
8484
8572
|
* });
|
|
8485
8573
|
* for (const item of result.data) {
|
|
8486
|
-
* console.log(item.email, item.status);
|
|
8574
|
+
* console.log(item.entry.email, item.status);
|
|
8487
8575
|
* }
|
|
8488
8576
|
*/
|
|
8489
8577
|
batch(params: ContactBatchParams, options?: RequestOptions): APIPromise<ContactUpsertResult>;
|
|
@@ -8588,7 +8676,7 @@ declare class WhatsappResourceBase extends Resource {
|
|
|
8588
8676
|
*/
|
|
8589
8677
|
get(messageId: string, options?: RequestOptions): APIPromise<WhatsAppMessage>;
|
|
8590
8678
|
/**
|
|
8591
|
-
* List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Pass next_cursor back as starting_after to fetch the next page. Filter by status, contact phone number, bsuid, or tag. Use whatsapp_get for one message's current state.
|
|
8679
|
+
* List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status, contact phone number, bsuid, or tag. Use whatsapp_get for one message's current state.
|
|
8592
8680
|
*
|
|
8593
8681
|
* @example Iterate delivered messages
|
|
8594
8682
|
* for await (const msg of bird.whatsapp.list({ status: ["delivered"] })) {
|
|
@@ -8719,56 +8807,37 @@ declare class WebhooksResource {
|
|
|
8719
8807
|
unwrap(payload: string, headers: WebhookHeaders, options?: WebhookOptions): BirdWebhookEvent;
|
|
8720
8808
|
}
|
|
8721
8809
|
//#endregion
|
|
8722
|
-
//#region src/resources/realtime.d.ts
|
|
8723
|
-
|
|
8724
|
-
type
|
|
8725
|
-
|
|
8726
|
-
type RealtimeBatchPublishParams = RealtimeBatchPublish;
|
|
8727
|
-
/** Query params for `bird.realtime.channels.list`. */
|
|
8728
|
-
type RealtimeChannelsListQuery = NonNullable<ListRealtimeAppChannelsData["query"]>;
|
|
8729
|
-
/** Query params for `bird.realtime.channels.get`. */
|
|
8730
|
-
type RealtimeChannelGetQuery = NonNullable<GetRealtimeAppChannelData["query"]>;
|
|
8731
|
-
/**
|
|
8732
|
-
* Realtime app credentials — `new BirdClient({ realtime: { key, secret } })`.
|
|
8733
|
-
* They come from the app's credentials (shown once at creation) and must belong
|
|
8734
|
-
* to the calling workspace. Any Realtime method takes the same pair in its
|
|
8735
|
-
* trailing options to override the configured one for a single call — the way
|
|
8736
|
-
* to talk to a second app without a second client.
|
|
8737
|
-
*/
|
|
8738
|
-
interface RealtimeOptions {
|
|
8739
|
-
/** The Realtime app key, sent as `X-Realtime-Key`. */
|
|
8740
|
-
key?: string;
|
|
8741
|
-
/** The Realtime app secret, sent as `X-Realtime-Secret`. */
|
|
8742
|
-
secret?: string;
|
|
8743
|
-
}
|
|
8744
|
-
/** Per-call options for a Realtime method: the usual request options plus a credential override. */
|
|
8745
|
-
interface RealtimeRequestOptions extends RequestOptions, RealtimeOptions {}
|
|
8746
|
-
/** The resolved credential headers, in wire form. */
|
|
8747
|
-
interface RealtimeAuthHeaders {
|
|
8748
|
-
"X-Realtime-Key": string;
|
|
8749
|
-
"X-Realtime-Secret": string;
|
|
8750
|
-
}
|
|
8751
|
-
declare abstract class RealtimeBase extends Resource {
|
|
8752
|
-
#private;
|
|
8753
|
-
constructor(core: ConstructorParameters<typeof Resource>[0], client: ConstructorParameters<typeof Resource>[1], config?: RealtimeOptions);
|
|
8810
|
+
//#region src/resources/realtime.gen.d.ts
|
|
8811
|
+
type RealtimePublishParams = NonNullable<PublishRealtimeAppEventData["body"]>;
|
|
8812
|
+
type RealtimePublishBatchParams = NonNullable<PublishRealtimeAppBatchData["body"]>;
|
|
8813
|
+
declare class RealtimeResourceBase extends Resource {
|
|
8754
8814
|
/**
|
|
8755
|
-
*
|
|
8756
|
-
*
|
|
8757
|
-
*
|
|
8815
|
+
* @example Broadcast an event to a channel
|
|
8816
|
+
* const result = await bird.realtime.publish("rap_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8817
|
+
* event: "order.updated",
|
|
8818
|
+
* channels: ["orders", "presence-lobby"],
|
|
8819
|
+
* data: { order_id: "ord_123", status: "shipped" },
|
|
8820
|
+
* });
|
|
8821
|
+
* console.log(result.data?.length); // one entry per channel
|
|
8758
8822
|
*/
|
|
8759
|
-
|
|
8823
|
+
publish(realtimeAppId: string, params: RealtimePublishParams, options?: RequestOptions): APIPromise<RealtimePublishResult>;
|
|
8824
|
+
/**
|
|
8825
|
+
* @example Publish two events in one call
|
|
8826
|
+
* await bird.realtime.publishBatch("rap_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8827
|
+
* events: [
|
|
8828
|
+
* { event: "order.created", channel: "orders", data: { id: 1 } },
|
|
8829
|
+
* { event: "order.updated", channel: "orders", data: { id: 2 } },
|
|
8830
|
+
* ],
|
|
8831
|
+
* });
|
|
8832
|
+
*/
|
|
8833
|
+
publishBatch(realtimeAppId: string, params: RealtimePublishBatchParams, options?: RequestOptions): APIPromise<RealtimeBatchPublishResult>;
|
|
8760
8834
|
}
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
declare class RealtimeChannelsResource extends RealtimeBase {
|
|
8835
|
+
//#endregion
|
|
8836
|
+
//#region src/resources/realtimeChannels.gen.d.ts
|
|
8837
|
+
type RealtimeChannelListQuery = NonNullable<ListRealtimeAppChannelsData["query"]>;
|
|
8838
|
+
type RealtimeChannelGetQuery = NonNullable<GetRealtimeAppChannelData["query"]>;
|
|
8839
|
+
declare class RealtimeChannelsResource extends Resource {
|
|
8767
8840
|
/**
|
|
8768
|
-
* List the app's currently occupied channels, optionally filtered by name
|
|
8769
|
-
* prefix. The Realtime service returns them all in one response — this is a
|
|
8770
|
-
* point read, not a cursor list, so there is nothing to iterate.
|
|
8771
|
-
*
|
|
8772
8841
|
* @example List the occupied presence channels with their member counts
|
|
8773
8842
|
* const { data } = await bird.realtime.channels.list("rap_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8774
8843
|
* prefix: "presence-",
|
|
@@ -8776,89 +8845,63 @@ declare class RealtimeChannelsResource extends RealtimeBase {
|
|
|
8776
8845
|
* });
|
|
8777
8846
|
* for (const channel of data) console.log(channel.name, channel.member_count);
|
|
8778
8847
|
*/
|
|
8779
|
-
list(
|
|
8848
|
+
list(realtimeAppId: string, query?: RealtimeChannelListQuery, options?: RequestOptions): APIPromise<RealtimeChannelsList>;
|
|
8780
8849
|
/**
|
|
8781
|
-
* Read one channel's state. An unknown or never-used name is not an error —
|
|
8782
|
-
* it resolves with `occupied: false`.
|
|
8783
|
-
*
|
|
8784
8850
|
* @example Check whether anyone is in a channel
|
|
8785
|
-
* const channel = await bird.realtime.channels.get(
|
|
8786
|
-
* "
|
|
8787
|
-
*
|
|
8788
|
-
* { include: ["member_count"] },
|
|
8789
|
-
* );
|
|
8851
|
+
* const channel = await bird.realtime.channels.get("rap_01krdgeqcxet5s7t44vh8rt9mg", "presence-lobby", {
|
|
8852
|
+
* include: ["member_count"],
|
|
8853
|
+
* });
|
|
8790
8854
|
* console.log(channel.occupied, channel.member_count);
|
|
8791
8855
|
*/
|
|
8792
|
-
get(
|
|
8856
|
+
get(realtimeAppId: string, channelName: string, query?: RealtimeChannelGetQuery, options?: RequestOptions): APIPromise<RealtimeChannelInfo>;
|
|
8793
8857
|
/**
|
|
8794
|
-
* List the member ids subscribed to a presence channel. Ids only — the
|
|
8795
|
-
* `member_info` your authorization endpoint attaches is delivered to subscribed
|
|
8796
|
-
* clients over the realtime connection and is not available over REST.
|
|
8797
|
-
*
|
|
8798
8858
|
* @example Who is in the lobby
|
|
8799
|
-
* const { members } = await bird.realtime.channels.members(
|
|
8800
|
-
* "rap_01krdgeqcxet5s7t44vh8rt9mg",
|
|
8801
|
-
* "presence-lobby",
|
|
8802
|
-
* );
|
|
8859
|
+
* const { members } = await bird.realtime.channels.members("rap_01krdgeqcxet5s7t44vh8rt9mg", "presence-lobby");
|
|
8803
8860
|
* for (const member of members) console.log(member.member_id);
|
|
8804
8861
|
*/
|
|
8805
|
-
members(
|
|
8862
|
+
members(realtimeAppId: string, channelName: string, options?: RequestOptions): APIPromise<RealtimeChannelMembers>;
|
|
8806
8863
|
}
|
|
8807
|
-
|
|
8808
|
-
|
|
8864
|
+
//#endregion
|
|
8865
|
+
//#region src/resources/realtimeMembers.gen.d.ts
|
|
8866
|
+
type RealtimeMemberSendParams = NonNullable<SendRealtimeAppMemberEventData["body"]>;
|
|
8867
|
+
declare class RealtimeMembersResource extends Resource {
|
|
8868
|
+
/**
|
|
8869
|
+
* @example Notify one person wherever they are signed in
|
|
8870
|
+
* await bird.realtime.members.send("rap_01krdgeqcxet5s7t44vh8rt9mg", "user_42", {
|
|
8871
|
+
* event: "order-shipped",
|
|
8872
|
+
* data: { order_id: "ord_123" },
|
|
8873
|
+
* });
|
|
8874
|
+
*/
|
|
8875
|
+
send(realtimeAppId: string, memberId: string, params: RealtimeMemberSendParams, options?: RequestOptions): APIPromise<void>;
|
|
8809
8876
|
/**
|
|
8810
|
-
* Disconnect every active connection a member holds — sign-out, ban, or a
|
|
8811
|
-
* revoked session. Resolves once the disconnect is applied; the member may
|
|
8812
|
-
* reconnect immediately unless your authorization endpoint refuses them.
|
|
8813
|
-
*
|
|
8814
8877
|
* @example Kick a member off every connection
|
|
8815
8878
|
* await bird.realtime.members.disconnect("rap_01krdgeqcxet5s7t44vh8rt9mg", "user_42");
|
|
8816
8879
|
*/
|
|
8817
|
-
disconnect(
|
|
8880
|
+
disconnect(realtimeAppId: string, memberId: string, options?: RequestOptions): APIPromise<void>;
|
|
8881
|
+
}
|
|
8882
|
+
//#endregion
|
|
8883
|
+
//#region src/resources/realtime.d.ts
|
|
8884
|
+
/**
|
|
8885
|
+
* Realtime app credentials — `new BirdClient({ realtime: { key, secret } })`.
|
|
8886
|
+
* They come from the app's credentials (shown once at creation) and must belong
|
|
8887
|
+
* to the calling workspace.
|
|
8888
|
+
*/
|
|
8889
|
+
interface RealtimeOptions {
|
|
8890
|
+
/** The Realtime app key, sent as `X-Realtime-Key`. */
|
|
8891
|
+
key?: string;
|
|
8892
|
+
/** The Realtime app secret, sent as `X-Realtime-Secret`. */
|
|
8893
|
+
secret?: string;
|
|
8818
8894
|
}
|
|
8819
8895
|
/**
|
|
8820
8896
|
* `bird.realtime` — publish events to a Realtime app's channels and inspect its
|
|
8821
|
-
* live state.
|
|
8822
|
-
* `realtime: { key, secret }` on the client, or pass `{ key, secret }` in a
|
|
8823
|
-
* call's options to reach a different app. Reached as `bird.realtime.*`.
|
|
8897
|
+
* live state. Reached as `bird.realtime.*`.
|
|
8824
8898
|
*/
|
|
8825
|
-
declare class RealtimeResource extends
|
|
8899
|
+
declare class RealtimeResource extends RealtimeResourceBase {
|
|
8826
8900
|
/** Channel state — `bird.realtime.channels.list(...)`, `.get(...)`, `.members(...)`. */
|
|
8827
8901
|
readonly channels: RealtimeChannelsResource;
|
|
8828
|
-
/** Members — `bird.realtime.members.disconnect(...)`. */
|
|
8902
|
+
/** Members — `bird.realtime.members.send(...)`, `.disconnect(...)`. */
|
|
8829
8903
|
readonly members: RealtimeMembersResource;
|
|
8830
|
-
constructor(core: ConstructorParameters<typeof Resource>[0], client: ConstructorParameters<typeof Resource>[1]
|
|
8831
|
-
/**
|
|
8832
|
-
* Publish one event to one or more of the app's channels. Listing several
|
|
8833
|
-
* channels broadcasts the same event to all of them in a single call. Resolves
|
|
8834
|
-
* once the event is accepted — delivery to connected clients is asynchronous.
|
|
8835
|
-
*
|
|
8836
|
-
* Pass `exclude_connection_id` to skip the connection that triggered the
|
|
8837
|
-
* change, so the originating client doesn't echo its own update.
|
|
8838
|
-
*
|
|
8839
|
-
* @example Broadcast an event to a channel
|
|
8840
|
-
* const result = await bird.realtime.publish("rap_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8841
|
-
* event: "order.updated",
|
|
8842
|
-
* channels: ["orders", "presence-lobby"],
|
|
8843
|
-
* data: { order_id: "ord_123", status: "shipped" },
|
|
8844
|
-
* });
|
|
8845
|
-
* console.log(result.data?.length); // one entry per channel
|
|
8846
|
-
*/
|
|
8847
|
-
publish(appId: string, params: RealtimePublishParams, options?: RealtimeRequestOptions): APIPromise<RealtimePublishResult>;
|
|
8848
|
-
/**
|
|
8849
|
-
* Publish up to 10 events in one request, each to a single channel. Use it to
|
|
8850
|
-
* fan different events out at once; to send the *same* event to many channels,
|
|
8851
|
-
* use `publish` with several `channels` instead.
|
|
8852
|
-
*
|
|
8853
|
-
* @example Publish two events in one call
|
|
8854
|
-
* await bird.realtime.publishBatch("rap_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8855
|
-
* events: [
|
|
8856
|
-
* { event: "order.created", channel: "orders", data: { id: 1 } },
|
|
8857
|
-
* { event: "order.updated", channel: "orders", data: { id: 2 } },
|
|
8858
|
-
* ],
|
|
8859
|
-
* });
|
|
8860
|
-
*/
|
|
8861
|
-
publishBatch(appId: string, params: RealtimeBatchPublishParams, options?: RealtimeRequestOptions): APIPromise<RealtimeBatchPublishResult>;
|
|
8904
|
+
constructor(core: ConstructorParameters<typeof Resource>[0], client: ConstructorParameters<typeof Resource>[1]);
|
|
8862
8905
|
}
|
|
8863
8906
|
//#endregion
|
|
8864
8907
|
//#region src/client.d.ts
|
|
@@ -9020,10 +9063,6 @@ declare const WebhookEventType: {
|
|
|
9020
9063
|
readonly SmsFailed: "sms.failed";
|
|
9021
9064
|
readonly SmsRejected: "sms.rejected";
|
|
9022
9065
|
readonly SmsSent: "sms.sent";
|
|
9023
|
-
readonly SmsTfnVerificationApproved: "sms.tfn_verification.approved";
|
|
9024
|
-
readonly SmsTfnVerificationInfoRequested: "sms.tfn_verification.info_requested";
|
|
9025
|
-
readonly SmsTfnVerificationRejected: "sms.tfn_verification.rejected";
|
|
9026
|
-
readonly SmsTfnVerificationSubmitted: "sms.tfn_verification.submitted";
|
|
9027
9066
|
readonly SmsUndelivered: "sms.undelivered";
|
|
9028
9067
|
readonly VerifyAttemptDelivered: "verify.attempt.delivered";
|
|
9029
9068
|
readonly VerifyAttemptSent: "verify.attempt.sent";
|
|
@@ -9043,5 +9082,106 @@ declare const WebhookEventType: {
|
|
|
9043
9082
|
/** A known webhook event type value. */
|
|
9044
9083
|
type WebhookEventTypeValue = (typeof WebhookEventType)[keyof typeof WebhookEventType];
|
|
9045
9084
|
//#endregion
|
|
9046
|
-
|
|
9085
|
+
//#region src/open-enums.gen.d.ts
|
|
9086
|
+
/**
|
|
9087
|
+
* Values of EmailEventType known at this SDK version. The wire value is an open
|
|
9088
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
9089
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
9090
|
+
*/
|
|
9091
|
+
declare const EmailEventType: {
|
|
9092
|
+
readonly EmailAccepted: "email.accepted";
|
|
9093
|
+
readonly EmailBounced: "email.bounced";
|
|
9094
|
+
readonly EmailCanceled: "email.canceled";
|
|
9095
|
+
readonly EmailClicked: "email.clicked";
|
|
9096
|
+
readonly EmailComplained: "email.complained";
|
|
9097
|
+
readonly EmailDeferred: "email.deferred";
|
|
9098
|
+
readonly EmailDelivered: "email.delivered";
|
|
9099
|
+
readonly EmailListUnsubscribed: "email.list_unsubscribed";
|
|
9100
|
+
readonly EmailOpened: "email.opened";
|
|
9101
|
+
readonly EmailOutOfBandBounce: "email.out_of_band_bounce";
|
|
9102
|
+
readonly EmailProcessed: "email.processed";
|
|
9103
|
+
readonly EmailRejected: "email.rejected";
|
|
9104
|
+
readonly EmailScheduled: "email.scheduled";
|
|
9105
|
+
readonly EmailUnsubscribed: "email.unsubscribed";
|
|
9106
|
+
};
|
|
9107
|
+
/** A known EmailEventType value. */
|
|
9108
|
+
type EmailEventTypeValue = (typeof EmailEventType)[keyof typeof EmailEventType];
|
|
9109
|
+
/**
|
|
9110
|
+
* Values of VerificationAttemptFailureReason known at this SDK version. The wire value is an open
|
|
9111
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
9112
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
9113
|
+
*/
|
|
9114
|
+
declare const VerificationAttemptFailureReason: {
|
|
9115
|
+
readonly CarrierRejected: "carrier_rejected";
|
|
9116
|
+
readonly ChannelDisabled: "channel_disabled";
|
|
9117
|
+
readonly ChannelUnavailable: "channel_unavailable";
|
|
9118
|
+
readonly HardBounce: "hard_bounce";
|
|
9119
|
+
readonly SoftBounce: "soft_bounce";
|
|
9120
|
+
readonly Undelivered: "undelivered";
|
|
9121
|
+
};
|
|
9122
|
+
/** A known VerificationAttemptFailureReason value. */
|
|
9123
|
+
type VerificationAttemptFailureReasonValue = (typeof VerificationAttemptFailureReason)[keyof typeof VerificationAttemptFailureReason];
|
|
9124
|
+
/**
|
|
9125
|
+
* Values of VerificationChannel known at this SDK version. The wire value is an open
|
|
9126
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
9127
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
9128
|
+
*/
|
|
9129
|
+
declare const VerificationChannel: {
|
|
9130
|
+
readonly Email: "email";
|
|
9131
|
+
readonly Sms: "sms";
|
|
9132
|
+
readonly Whatsapp: "whatsapp";
|
|
9133
|
+
};
|
|
9134
|
+
/** A known VerificationChannel value. */
|
|
9135
|
+
type VerificationChannelValue = (typeof VerificationChannel)[keyof typeof VerificationChannel];
|
|
9136
|
+
/**
|
|
9137
|
+
* Values of VerificationTerminalReason known at this SDK version. The wire value is an open
|
|
9138
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
9139
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
9140
|
+
*/
|
|
9141
|
+
declare const VerificationTerminalReason: {
|
|
9142
|
+
readonly AttemptsExhausted: "attempts_exhausted";
|
|
9143
|
+
readonly TtlElapsed: "ttl_elapsed";
|
|
9144
|
+
};
|
|
9145
|
+
/** A known VerificationTerminalReason value. */
|
|
9146
|
+
type VerificationTerminalReasonValue = (typeof VerificationTerminalReason)[keyof typeof VerificationTerminalReason];
|
|
9147
|
+
/**
|
|
9148
|
+
* Values of WhatsAppErrorCode known at this SDK version. The wire value is an open
|
|
9149
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
9150
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
9151
|
+
*/
|
|
9152
|
+
declare const WhatsAppErrorCode: {
|
|
9153
|
+
readonly InsufficientBalance: "insufficient_balance";
|
|
9154
|
+
readonly InternalError: "internal_error";
|
|
9155
|
+
readonly PriceNotFound: "price_not_found";
|
|
9156
|
+
readonly RateLimited: "rate_limited";
|
|
9157
|
+
readonly RecipientSuppressed: "recipient_suppressed";
|
|
9158
|
+
readonly ServiceWindowExpired: "service_window_expired";
|
|
9159
|
+
readonly Undeliverable: "undeliverable";
|
|
9160
|
+
};
|
|
9161
|
+
/** A known WhatsAppErrorCode value. */
|
|
9162
|
+
type WhatsAppErrorCodeValue = (typeof WhatsAppErrorCode)[keyof typeof WhatsAppErrorCode];
|
|
9163
|
+
/**
|
|
9164
|
+
* Values of WhatsAppTemplateCategory known at this SDK version. The wire value is an open
|
|
9165
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
9166
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
9167
|
+
*/
|
|
9168
|
+
declare const WhatsAppTemplateCategory: {
|
|
9169
|
+
readonly Authentication: "authentication";
|
|
9170
|
+
readonly Marketing: "marketing";
|
|
9171
|
+
readonly Utility: "utility";
|
|
9172
|
+
};
|
|
9173
|
+
/** A known WhatsAppTemplateCategory value. */
|
|
9174
|
+
type WhatsAppTemplateCategoryValue = (typeof WhatsAppTemplateCategory)[keyof typeof WhatsAppTemplateCategory];
|
|
9175
|
+
/**
|
|
9176
|
+
* Values of WhatsAppTemplateParameterType known at this SDK version. The wire value is an open
|
|
9177
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
9178
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
9179
|
+
*/
|
|
9180
|
+
declare const WhatsAppTemplateParameterType: {
|
|
9181
|
+
readonly Text: "text";
|
|
9182
|
+
};
|
|
9183
|
+
/** A known WhatsAppTemplateParameterType value. */
|
|
9184
|
+
type WhatsAppTemplateParameterTypeValue = (typeof WhatsAppTemplateParameterType)[keyof typeof WhatsAppTemplateParameterType];
|
|
9185
|
+
//#endregion
|
|
9186
|
+
export { type APIPromise, type Audience, type AudienceAddContactsParams, type AudienceCreateParams, type AudienceListContactsQuery, type AudienceListQuery, type AudienceMember, type AudienceRemoveContactsParams, type AudienceUpdateParams, BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, type BirdClientOptions, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, type BirdRequest, type BirdResponse, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, type BirdWebhookEvent, BirdWebhookVerificationError, type Contact, type ContactBatchParams, type ContactCreateParams, type ContactListQuery, type ContactProperty, type ContactPropertyCreateParams, type ContactPropertyListQuery, type ContactPropertyUpdateParams, type ContactUpdateParams, type ContactUpsertResult, type CursorPage, type DnsRecord, type Domain, type DomainCapabilities, type DomainCreateParams, type DomainDkim, type DomainListQuery, type DomainUpdateParams, type EmailChannelDefaults, EmailEventType, type EmailEventTypeValue, type EmailListQuery, type EmailMailboxLabelList, type EmailMailboxesCreateParams, type EmailMailboxesListQuery, type EmailMailboxesMessagesCreateParams, type EmailMailboxesReceiveRulesCreateParams, type EmailMailboxesReceiveRulesListQuery, type EmailMailboxesStatsQuery, type EmailMailboxesUpdateParams, type EmailMailboxesUpdateQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailStatsByBounceCodeQuery, type EmailStatsByBounceCodeResponse, type EmailStatsByBroadcastQuery, type EmailStatsByBroadcastResponse, type EmailStatsByCategoryQuery, type EmailStatsByCategoryResponse, type EmailStatsByClientQuery, type EmailStatsByClientResponse, type EmailStatsByComplaintTypeQuery, type EmailStatsByComplaintTypeResponse, type EmailStatsByLocationQuery, type EmailStatsByLocationResponse, type EmailStatsByMailboxProviderQuery, type EmailStatsByMailboxProviderRegionQuery, type EmailStatsByMailboxProviderRegionResponse, type EmailStatsByMailboxProviderResponse, type EmailStatsByRecipientDomainQuery, type EmailStatsByRecipientDomainResponse, type EmailStatsBySendingDomainQuery, type EmailStatsBySendingDomainResponse, type EmailStatsBySendingIpQuery, type EmailStatsBySendingIpResponse, type EmailStatsByTagQuery, type EmailStatsByTemplateQuery, type EmailStatsByTemplateResponse, type EmailStatsDailyQuery, type EmailStatsHourlyQuery, type EmailStatsResponse, type EmailStatsSummary, type EmailStatsSummaryQuery, type EmailStatsTagsResponse, type EmailThread, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadsDeleteQuery, type EmailThreadsListQuery, type EmailThreadsMessagesListQuery, type EmailThreadsMessagesReplyParams, type EmailThreadsUpdateParams, type ErrorDetail, type ErrorNextAction, type Mailbox, type MailboxStatsResponse, type PaginatedPromise, type RealtimeBatchPublishResult, type RealtimeChannelGetQuery, type RealtimeChannelInclude, type RealtimeChannelInfo, type RealtimeChannelListItem, type RealtimeChannelListQuery, type RealtimeChannelMember, type RealtimeChannelMembers, type RealtimeChannelsList, type RealtimeOptions, type RealtimePublishBatchParams, type RealtimePublishParams, type RealtimePublishResult, type ReceiveRule, type RequestOptions, type SafeResult, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, type UnmetGate, type Verification, VerificationAttemptFailureReason, type VerificationAttemptFailureReasonValue, VerificationChannel, type VerificationChannelValue, type VerificationCheckResult, VerificationTerminalReason, type VerificationTerminalReasonValue, type VerifyVerificationsCheckParams, type VerifyVerificationsCreateParams, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, WhatsAppErrorCode, type WhatsAppErrorCodeValue, type WhatsAppEventList, type WhatsAppMessage, WhatsAppTemplateCategory, type WhatsAppTemplateCategoryValue, WhatsAppTemplateParameterType, type WhatsAppTemplateParameterTypeValue, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, baseUrlForRegion, regionFromApiKey };
|
|
9047
9187
|
//# sourceMappingURL=index.d.mts.map
|