@messagebird/sdk 0.12.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -80,7 +80,7 @@ interface ErrorDetail {
80
80
  /** What is wrong with this field. */
81
81
  message: string;
82
82
  }
83
- /** One recovery step: an operation to call to resolve the error (ADR-0073). */
83
+ /** One recovery step: an operation to call to resolve the error. */
84
84
  interface ErrorNextAction {
85
85
  /** operationId of the follow-up operation that resolves this error. */
86
86
  operation: string;
@@ -118,9 +118,9 @@ interface BirdAPIErrorFields {
118
118
  param?: string;
119
119
  /** Verbatim code from a downstream system (SMTP reply, payment decline). */
120
120
  vendorCode?: string;
121
- /** Human recovery line for this error, when a recovery is known (ADR-0073). */
121
+ /** Human recovery line for this error, when a recovery is known. */
122
122
  remediation?: string;
123
- /** Operations that resolve this error, in the order to try them (ADR-0073). */
123
+ /** Operations that resolve this error, in the order to try them. */
124
124
  next?: ErrorNextAction[];
125
125
  /** Verification requirements blocking this action, when it is blocked pending verification. */
126
126
  unmetGates?: UnmetGate[];
@@ -180,7 +180,7 @@ declare class BirdInternalError extends BirdAPIError {
180
180
  declare class BirdNotImplementedError extends BirdAPIError {
181
181
  constructor(fields: BirdAPIErrorFields);
182
182
  }
183
- /** 421 — request reached the wrong region (ADR-0036). */
183
+ /** 421 — request reached the wrong region. */
184
184
  declare class BirdMisdirectedError extends BirdAPIError {
185
185
  constructor(fields: BirdAPIErrorFields);
186
186
  }
@@ -223,7 +223,7 @@ interface RequestOptions {
223
223
  * failure `error` is a `BirdError` you can `instanceof`-narrow, and `data`/
224
224
  * `response` are `null` — the metadata you need (status, request id) is on the
225
225
  * error itself. A caller-initiated abort is not a Bird failure and still throws
226
- * (the native `AbortError`, ADR-0042 §1).
226
+ * (the native `AbortError`).
227
227
  */
228
228
  type SafeResult<T> = {
229
229
  data: T;
@@ -531,7 +531,11 @@ type EventVoiceCallInitiated = {
531
531
  data: EventVoiceCallInitiatedData;
532
532
  };
533
533
  /**
534
- * Call status. v1 records are always terminal and carry one of answered, no_answer, failed, rejected, or unknown. The remaining values are declared ahead of planned features so their arrival is not a breaking contract change: busy and canceled arrive with inbound (DID) termination — today both outcomes are folded into failed — and ringing and in_progress with a live-calls surface.
534
+ * Call status.
535
+ *
536
+ * A call that has ended carries answered, no_answer, failed, rejected, or unknown. A call that is still up carries ringing before it is picked up and in_progress once it is; both are what the `status` filter on the call list selects on to show calls happening right now.
537
+ *
538
+ * busy and canceled are declared ahead of the feature that produces them, so their arrival is not a breaking contract change: they come with inbound termination, and today both outcomes are folded into failed.
535
539
  *
536
540
  */
537
541
  type VoiceCallStatus = "answered" | "no_answer" | "busy" | "canceled" | "failed" | "rejected" | "unknown" | "ringing" | "in_progress";
@@ -585,6 +589,228 @@ type EventVoiceCallAnswered = {
585
589
  timestamp: string;
586
590
  data: EventVoiceCallAnsweredData;
587
591
  };
592
+ /**
593
+ * Payload of the verify.verification.verified event.
594
+ */
595
+ type EventVerifyVerificationVerifiedData = EventVerifyBase & {
596
+ /**
597
+ * The verification's state, always `verified`. Open enum for forward compatibility.
598
+ */
599
+ status: string;
600
+ /**
601
+ * The channel whose passcode the recipient confirmed, the channel that converted. Null when the verification was resolved without attributing a channel.
602
+ */
603
+ channel: VerificationChannel | null;
604
+ /**
605
+ * Time the verification was verified.
606
+ */
607
+ verified_at: string;
608
+ };
609
+ /**
610
+ * 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
+ */
612
+ type VerificationChannel = string;
613
+ /**
614
+ * 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
+ *
616
+ */
617
+ type VerificationTo = {
618
+ /**
619
+ * The recipient's email address. Case does not matter; the address is lowercased before use.
620
+ */
621
+ email_address?: string;
622
+ /**
623
+ * The recipient's phone number in E.164 format, with the leading `+` and country code (for example `+15551234567`). A number in any other format is rejected as an invalid recipient (`422`).
624
+ */
625
+ phone_number?: string;
626
+ };
627
+ type VerificationId = string;
628
+ /**
629
+ * Identity fields shared by every Verify lifecycle event payload.
630
+ */
631
+ type EventVerifyBase = {
632
+ /**
633
+ * ID of the verification session.
634
+ */
635
+ verification_id: VerificationId;
636
+ /**
637
+ * ID of the workspace.
638
+ */
639
+ workspace_id: WorkspaceId;
640
+ /**
641
+ * The recipient identity of the verification session (email address, phone number, or both), echoed on every event so you can correlate without an extra lookup. An individual attempt reports the single address it was dispatched to in its own `address` field.
642
+ */
643
+ to: VerificationTo;
644
+ /**
645
+ * The metadata object provided when the verification was created, echoed on every event for the session so you can correlate events with your own records. Null when the verification carried no metadata.
646
+ *
647
+ */
648
+ metadata: {
649
+ [key: string]: unknown;
650
+ } | null;
651
+ };
652
+ /**
653
+ * The verification was successfully resolved: the recipient confirmed the correct code.
654
+ */
655
+ type EventVerifyVerificationVerified = {
656
+ /**
657
+ * Event type.
658
+ */
659
+ type: "verify.verification.verified";
660
+ /**
661
+ * Time the verification was verified.
662
+ */
663
+ timestamp: string;
664
+ data: EventVerifyVerificationVerifiedData;
665
+ };
666
+ /**
667
+ * Payload of the verify.verification.created event.
668
+ */
669
+ type EventVerifyVerificationCreatedData = EventVerifyBase & {
670
+ /**
671
+ * The first channel of the verification's resolved channel plan.
672
+ */
673
+ channel: VerificationChannel;
674
+ /**
675
+ * The verification's state at creation, always `pending`. Open enum for forward compatibility.
676
+ */
677
+ status: string;
678
+ /**
679
+ * Time the verification session was created.
680
+ */
681
+ created_at: string;
682
+ };
683
+ /**
684
+ * A verification session was created and its first one-time passcode is being sent.
685
+ */
686
+ type EventVerifyVerificationCreated = {
687
+ /**
688
+ * Event type.
689
+ */
690
+ type: "verify.verification.created";
691
+ /**
692
+ * Time the verification session was created.
693
+ */
694
+ timestamp: string;
695
+ data: EventVerifyVerificationCreatedData;
696
+ };
697
+ /**
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), and `channel_unavailable` (the channel could not be used and the verification failed over).
699
+ */
700
+ type VerificationAttemptFailureReason = string;
701
+ /**
702
+ * Payload of the verify.attempt.undelivered event.
703
+ */
704
+ type EventVerifyAttemptUndeliveredData = EventVerifyBase & {
705
+ /**
706
+ * The channel this attempt was sent on.
707
+ */
708
+ channel: VerificationChannel;
709
+ /**
710
+ * The single address this attempt was dispatched to, an E.164 phone number or an email address.
711
+ */
712
+ address: string;
713
+ /**
714
+ * Why the attempt failed to reach the recipient.
715
+ */
716
+ reason: VerificationAttemptFailureReason;
717
+ /**
718
+ * Diagnostic text describing the failure, for display only. Null when none was reported.
719
+ */
720
+ error: string | null;
721
+ /**
722
+ * Time the failure was recorded.
723
+ */
724
+ failed_at: string;
725
+ };
726
+ /**
727
+ * A one-time passcode failed to deliver to the recipient.
728
+ */
729
+ type EventVerifyAttemptUndelivered = {
730
+ /**
731
+ * Event type.
732
+ */
733
+ type: "verify.attempt.undelivered";
734
+ /**
735
+ * Time the failure was recorded.
736
+ */
737
+ timestamp: string;
738
+ data: EventVerifyAttemptUndeliveredData;
739
+ };
740
+ /**
741
+ * Payload of the verify.attempt.sent event.
742
+ */
743
+ type EventVerifyAttemptSentData = EventVerifyBase & {
744
+ /**
745
+ * The channel this attempt was sent on.
746
+ */
747
+ channel: VerificationChannel;
748
+ /**
749
+ * The single address this attempt was dispatched to, an E.164 phone number or an email address.
750
+ */
751
+ address: string;
752
+ /**
753
+ * The sender the passcode was sent from: a phone number, alphanumeric sender ID, short code, or email address. Null when the channel exposes no sender.
754
+ */
755
+ from: string | null;
756
+ /**
757
+ * Time the passcode was dispatched.
758
+ */
759
+ sent_at: string;
760
+ };
761
+ /**
762
+ * A one-time passcode was dispatched to the recipient on a channel.
763
+ */
764
+ type EventVerifyAttemptSent = {
765
+ /**
766
+ * Event type.
767
+ */
768
+ type: "verify.attempt.sent";
769
+ /**
770
+ * Time the passcode was dispatched.
771
+ */
772
+ timestamp: string;
773
+ data: EventVerifyAttemptSentData;
774
+ };
775
+ /**
776
+ * Payload of the verify.attempt.delivered event.
777
+ */
778
+ type EventVerifyAttemptDeliveredData = EventVerifyBase & {
779
+ /**
780
+ * The channel this attempt was sent on.
781
+ */
782
+ channel: VerificationChannel;
783
+ /**
784
+ * The single address this attempt was dispatched to, an E.164 phone number or an email address.
785
+ */
786
+ address: string;
787
+ /**
788
+ * Carrier that delivered the message, when the carrier network reports it. Always null for email and WhatsApp.
789
+ */
790
+ carrier: string | null;
791
+ /**
792
+ * Mobile country code and mobile network code of the delivering carrier, when reported. Always null for email and WhatsApp.
793
+ */
794
+ mcc_mnc: string | null;
795
+ /**
796
+ * Time delivery was confirmed.
797
+ */
798
+ delivered_at: string;
799
+ };
800
+ /**
801
+ * The channel confirmed delivery of a one-time passcode to the recipient.
802
+ */
803
+ type EventVerifyAttemptDelivered = {
804
+ /**
805
+ * Event type.
806
+ */
807
+ type: "verify.attempt.delivered";
808
+ /**
809
+ * Time delivery was confirmed.
810
+ */
811
+ timestamp: string;
812
+ data: EventVerifyAttemptDeliveredData;
813
+ };
588
814
  /**
589
815
  * Payload of the sms.undelivered event.
590
816
  */
@@ -1818,6 +2044,16 @@ type WebhookEvent = ({
1818
2044
  } & EventSmsTfnVerificationSubmitted) | ({
1819
2045
  type: "sms.undelivered";
1820
2046
  } & EventSmsUndelivered) | ({
2047
+ type: "verify.attempt.delivered";
2048
+ } & EventVerifyAttemptDelivered) | ({
2049
+ type: "verify.attempt.sent";
2050
+ } & EventVerifyAttemptSent) | ({
2051
+ type: "verify.attempt.undelivered";
2052
+ } & EventVerifyAttemptUndelivered) | ({
2053
+ type: "verify.verification.created";
2054
+ } & EventVerifyVerificationCreated) | ({
2055
+ type: "verify.verification.verified";
2056
+ } & EventVerifyVerificationVerified) | ({
1821
2057
  type: "voice_call.answered";
1822
2058
  } & EventVoiceCallAnswered) | ({
1823
2059
  type: "voice_call.ended";
@@ -1840,20 +2076,6 @@ type Timestamps = {
1840
2076
  readonly created_at: string;
1841
2077
  readonly updated_at: string;
1842
2078
  };
1843
- type ListEnvelope = {
1844
- /**
1845
- * Cursor for the next page. Pass back as `starting_after` to advance forward. Null when no next page exists.
1846
- */
1847
- next_cursor: string | null;
1848
- /**
1849
- * Cursor for the previous page. Pass back as `ending_before` to step backward. Null when no previous page exists.
1850
- */
1851
- prev_cursor: string | null;
1852
- /**
1853
- * Refresh anchor. Pass back as `ending_before` later to fetch items that have appeared since this response. Non-null whenever `data` is non-empty; null only on an empty page. Distinct from `prev_cursor`.
1854
- */
1855
- refresh_cursor: string | null;
1856
- };
1857
2079
  /**
1858
2080
  * The labels available in a mailbox.
1859
2081
  */
@@ -1924,12 +2146,13 @@ type EmailMailboxComposeRequest = {
1924
2146
  metadata?: {
1925
2147
  [key: string]: unknown;
1926
2148
  };
1927
- /**
1928
- * Content classification — controls suppression policy. `marketing` blocks on all suppression reasons; `transactional` allows delivery through complaint and unsubscribe suppressions. Default: transactional.
1929
- *
1930
- */
1931
- category?: "marketing" | "transactional";
2149
+ category?: EmailMessageCategory;
1932
2150
  };
2151
+ /**
2152
+ * Content classification. Controls suppression policy: `marketing` blocks on all suppression reasons; `transactional` allows delivery through complaint and unsubscribe suppressions, for receipts, password resets, and similar operational mail.
2153
+ *
2154
+ */
2155
+ type EmailMessageCategory = "marketing" | "transactional";
1933
2156
  /**
1934
2157
  * File attached to an email send. The attachment bytes are passed as base64-encoded `content` directly in the request body (required). The `path` field (provide a URL and Bird fetches the attachment for you) is a preview feature and currently unavailable. Requests are rejected with 422 if `content` is missing — `path` alone does not satisfy the schema. When `path` becomes generally available, the schema will be relaxed so that exactly one of `content` or `path` is required.
1935
2158
  * Inline images for `<img src="cid:..."/>` references in the HTML body use the `content_id` field together with `content`.
@@ -2011,11 +2234,12 @@ type EmailThreadMessageReplyRequest = {
2011
2234
  metadata?: {
2012
2235
  [key: string]: unknown;
2013
2236
  };
2237
+ category?: EmailMessageCategory;
2014
2238
  /**
2015
- * Content classification controls suppression policy. `marketing` blocks on all suppression reasons; `transactional` allows delivery through complaint and unsubscribe suppressions. Default: transactional.
2239
+ * File attachments to include with the reply. The send is rejected when the estimated generated message size exceeds 20 MB (bodies plus all attachments after base64 encoding). Keep total raw attachment content at or below 15 MB for reliable headroom. Attachment metadata endures on the message's `attachment_manifest`; the bytes are downloadable for 30 days.
2016
2240
  *
2017
2241
  */
2018
- category?: "marketing" | "transactional";
2242
+ attachments?: Array<EmailAttachment>;
2019
2243
  };
2020
2244
  /**
2021
2245
  * The attachments on a conversation message.
@@ -2074,9 +2298,6 @@ type EmailLabelsUpdate = {
2074
2298
  */
2075
2299
  remove?: Array<string>;
2076
2300
  };
2077
- type EmailThreadMessageList = {
2078
- data: Array<EmailThreadMessage>;
2079
- } & ListEnvelope;
2080
2301
  /**
2081
2302
  * Link to the message's entry in the received-message or sent-message log, which carries delivery analytics such as per-recipient events. Log entries expire 30 days after the message occurred.
2082
2303
  *
@@ -2230,9 +2451,6 @@ type EmailThreadUpdateRequest = {
2230
2451
  */
2231
2452
  contact_id?: ContactId | null;
2232
2453
  };
2233
- type EmailThreadList = {
2234
- data: Array<EmailThread>;
2235
- } & ListEnvelope;
2236
2454
  /**
2237
2455
  * Matched search fragments for a thread, one array per field the query matched, with the matched terms wrapped in `**`. A field is present only when the query matched it, so the keys that are present tell you which fields produced the hit. Returned only on thread search results.
2238
2456
  *
@@ -2328,9 +2546,6 @@ type ReceiveRuleCreate = {
2328
2546
  */
2329
2547
  note?: string;
2330
2548
  };
2331
- type ReceiveRuleList = {
2332
- data: Array<ReceiveRule>;
2333
- } & ListEnvelope;
2334
2549
  type ReceiveRuleId = string;
2335
2550
  /**
2336
2551
  * An allow or block entry on a mailbox, evaluated when inbound mail arrives. Matching is against the message's envelope sender; domain entries also match subdomains. A given entry can be allow or block, never both.
@@ -2623,6 +2838,10 @@ type MailboxStatsSummary = {
2623
2838
  */
2624
2839
  readonly received: number;
2625
2840
  };
2841
+ /**
2842
+ * The bucket grain of the series, either `day` or `hour`.
2843
+ */
2844
+ type StatsGrain = "day" | "hour";
2626
2845
  /**
2627
2846
  * The window and bucket grain the response covers, echoed from the request, plus the freshness boundary the data is current to.
2628
2847
  *
@@ -2636,10 +2855,7 @@ type EmailStatsSeriesPeriod = {
2636
2855
  * Inclusive end of the window. A calendar day (YYYY-MM-DD, in the requested `timezone`) on the day grain; on the hour grain, an RFC 3339 UTC instant marking the start of the last hour bucket, which falls on a local hour boundary when `timezone` is set.
2637
2856
  */
2638
2857
  readonly to: string;
2639
- /**
2640
- * The bucket grain of the series, either `day` or `hour`.
2641
- */
2642
- readonly grain: string;
2858
+ readonly grain: StatsGrain;
2643
2859
  /**
2644
2860
  * The instant the statistics in this response are current to: events recorded up to roughly this time are reflected, while more recent events may not be yet. Statistics are served from a rolling aggregation that refreshes every few seconds, so a response is near-real-time but not live; use this field to label data freshness rather than assuming the numbers are to-the-second. Null when the freshness boundary is not being reported.
2645
2861
  *
@@ -2708,9 +2924,6 @@ type MailboxCreate = {
2708
2924
  [key: string]: unknown;
2709
2925
  };
2710
2926
  };
2711
- type MailboxList = {
2712
- data: Array<Mailbox>;
2713
- } & ListEnvelope;
2714
2927
  type InboundAddressId = string;
2715
2928
  /**
2716
2929
  * The principal that owns the mailbox. Always the workspace.
@@ -2809,14 +3022,26 @@ type Mailbox = {
2809
3022
  */
2810
3023
  type DomainUpdate = {
2811
3024
  settings?: DomainSettings;
2812
- return_path?: DomainReturnPathConfig & unknown;
3025
+ /**
3026
+ * Change the return-path name part. Cannot be removed — the return-path is required for sending.
3027
+ *
3028
+ */
3029
+ return_path?: DomainReturnPathConfig;
2813
3030
  /**
2814
3031
  * Set or change the tracking name part, or remove tracking by passing null. Removal requires `click_tracking` and `open_tracking` to be disabled first, and returns `409` otherwise. After removal, links in previously sent email keep resolving while the tracking records are reported as `deprecated`.
2815
3032
  *
2816
3033
  */
2817
3034
  tracking?: DomainTrackingConfig | null;
2818
- dkim?: DomainDkimConfig & unknown;
2819
- inbound?: DomainInboundConfig & unknown;
3035
+ /**
3036
+ * Change how the DKIM key is published. The current key keeps signing until the new configuration verifies, so mail is never sent unsigned during the transition.
3037
+ *
3038
+ */
3039
+ dkim?: DomainDkimConfig;
3040
+ /**
3041
+ * Enable or disable receiving on this domain. Enabling claims the domain for inbound and moves `capabilities.inbound.status` from `not_configured` to `pending`, then `verified` once the MX records resolve to Bird. The MX records to publish are always present under `dns_records` (`purpose: inbound_mx`) as a regional reference, so their presence does not mean receiving is on — a domain still needs enabling whenever `capabilities.inbound.status` is `not_configured`. Enabling requires the domain's DKIM to be verified first (ownership proof): a fresh enable on a domain whose DKIM is not verified returns `422` `E05019` and claims nothing. A domain already receiving inbound for another organization returns `422` `E05018`.
3042
+ *
3043
+ */
3044
+ inbound?: DomainInboundConfig;
2820
3045
  };
2821
3046
  /**
2822
3047
  * Inbound (receiving) configuration. Enable inbound to receive email addressed to this domain: Bird returns MX records to publish, and once they verify, mail to any local-part at this domain is delivered as an inbound message and the `email.received` webhook fires. The capability is enabled on the domain's own registration, so use a dedicated subdomain (e.g. `inbound.acme.com`), never your apex — apex MX would capture your corporate mail.
@@ -3006,11 +3231,31 @@ type DomainCapability = {
3006
3231
  readonly reason?: string | null;
3007
3232
  };
3008
3233
  type DomainCapabilities = {
3009
- sending: DomainCapability & unknown;
3010
- return_path: DomainCapability & unknown;
3011
- dmarc: DomainCapability & unknown;
3012
- tracking: DomainCapability & unknown;
3013
- inbound?: DomainCapability & unknown;
3234
+ /**
3235
+ * Overall authorization to send from this domain. Verified when the DKIM record, the return-path CNAME, and a DMARC policy are all in place. Required for live sends.
3236
+ *
3237
+ */
3238
+ sending: DomainCapability;
3239
+ /**
3240
+ * Return-path (bounce) CNAME verification. The return-path domain receives bounce and complaint notifications and is what mailbox providers check for SPF — no separate SPF record is needed.
3241
+ *
3242
+ */
3243
+ return_path: DomainCapability;
3244
+ /**
3245
+ * DMARC policy check. Satisfied by any valid DMARC record covering the sending domain — on the domain itself or on its registered (organizational) domain; `domain` reports where the policy was found. A minimal policy of `p=none` is sufficient.
3246
+ *
3247
+ */
3248
+ dmarc: DomainCapability;
3249
+ /**
3250
+ * Branded open/click tracking domain. `not_configured` until a tracking domain is set. Tracked links are served over HTTPS once the CNAME verifies.
3251
+ *
3252
+ */
3253
+ tracking: DomainCapability;
3254
+ /**
3255
+ * Inbound mail receiving. `not_configured` until receiving is enabled on this domain (see `DomainUpdate.inbound`), then `pending` while the published MX records are checked, and `verified` once they resolve to Bird. The MX records to publish are always listed under `dns_records` (`purpose: inbound_mx`) as a regional reference, even while this is `not_configured` — enabling is what actually starts delivery.
3256
+ *
3257
+ */
3258
+ inbound?: DomainCapability;
3014
3259
  };
3015
3260
  /**
3016
3261
  * Active DKIM signing configuration for the domain.
@@ -3088,7 +3333,10 @@ type Domain = {
3088
3333
  * Per-broadcast breakdown for the requested period, ranked by the `sort` metric (default `processed`) descending and capped at the requested `limit` (default 50, max 200).
3089
3334
  */
3090
3335
  type EmailStatsByBroadcastResponse = {
3091
- period: EmailStatsPeriod & unknown;
3336
+ /**
3337
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3338
+ */
3339
+ period: EmailStatsPeriod;
3092
3340
  /**
3093
3341
  * Broadcast breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no broadcast messages were active in the period.
3094
3342
  */
@@ -3176,7 +3424,10 @@ type EmailStatsPeriod = {
3176
3424
  * Per-complaint-type breakdown for the requested period, ranked by `complained` descending and capped at the requested `limit` (default 50, max 200).
3177
3425
  */
3178
3426
  type EmailStatsByComplaintTypeResponse = {
3179
- period: EmailStatsPeriod & unknown;
3427
+ /**
3428
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3429
+ */
3430
+ period: EmailStatsPeriod;
3180
3431
  /**
3181
3432
  * Complaint-type breakdown rows, ranked by `complained` descending. Empty when no complaints occurred in the period.
3182
3433
  */
@@ -3205,7 +3456,10 @@ type EmailComplaintTypeStatsPoint = {
3205
3456
  * Per-SMTP-code bounce breakdown for the requested period, ranked by the `sort` metric (default `bounced`) descending and capped at the requested `limit` (default 50, max 200).
3206
3457
  */
3207
3458
  type EmailStatsByBounceCodeResponse = {
3208
- period: EmailStatsPeriod & unknown;
3459
+ /**
3460
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3461
+ */
3462
+ period: EmailStatsPeriod;
3209
3463
  /**
3210
3464
  * Bounce-code breakdown rows, ranked by the `sort` metric (default `bounced`) descending. Empty when no bounces occurred in the period.
3211
3465
  */
@@ -3266,7 +3520,10 @@ type EmailBounceCodeStatsPoint = {
3266
3520
  * Per-client engagement breakdown for the requested period, grouped by the requested `group_by` facet, ranked by the `sort` metric (default `unique_opens`) descending and capped at the requested `limit` (default 50, max 200).
3267
3521
  */
3268
3522
  type EmailStatsByClientResponse = {
3269
- period: EmailStatsPeriod & unknown;
3523
+ /**
3524
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3525
+ */
3526
+ period: EmailStatsPeriod;
3270
3527
  /**
3271
3528
  * Client breakdown rows, ranked by the `sort` metric (default `unique_opens`) descending. Empty when no opens or clicks with a detected client occurred in the period.
3272
3529
  */
@@ -3332,7 +3589,10 @@ type EmailClientStatsPoint = {
3332
3589
  * Per-location engagement breakdown for the requested period, grouped at the requested `group_by` granularity, ranked by the `sort` metric (default `unique_opens`) descending and capped at the requested `limit` (default 50, max 200).
3333
3590
  */
3334
3591
  type EmailStatsByLocationResponse = {
3335
- period: EmailStatsPeriod & unknown;
3592
+ /**
3593
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3594
+ */
3595
+ period: EmailStatsPeriod;
3336
3596
  /**
3337
3597
  * Location breakdown rows, ranked by the `sort` metric (default `unique_opens`) descending. Empty when no opens or clicks with a resolved location occurred in the period.
3338
3598
  */
@@ -3371,7 +3631,10 @@ type EmailEngagementSortMetric = "opens" | "opens_non_prefetched" | "unique_open
3371
3631
  * Per-template breakdown for the requested period, ranked by the `sort` metric (default `processed`) descending and capped at the requested `limit` (default 50, max 200).
3372
3632
  */
3373
3633
  type EmailStatsByTemplateResponse = {
3374
- period: EmailStatsPeriod & unknown;
3634
+ /**
3635
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3636
+ */
3637
+ period: EmailStatsPeriod;
3375
3638
  /**
3376
3639
  * Template breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no templated messages were active in the period.
3377
3640
  */
@@ -3403,7 +3666,10 @@ type EmailTemplateStatsPoint = {
3403
3666
  * Per-recipient-domain breakdown for the requested period, ranked by the `sort` metric (default `processed`) descending and capped at the requested `limit` (default 50, max 200).
3404
3667
  */
3405
3668
  type EmailStatsByRecipientDomainResponse = {
3406
- period: EmailStatsPeriod & unknown;
3669
+ /**
3670
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3671
+ */
3672
+ period: EmailStatsPeriod;
3407
3673
  /**
3408
3674
  * Recipient-domain breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no eligible activity occurred in the period.
3409
3675
  */
@@ -3434,7 +3700,10 @@ type EmailRecipientDomainStatsPoint = {
3434
3700
  * Per-(mailbox provider, provider region) breakdown for the requested period, ranked by the `sort` metric (default `delivered`) descending and capped at the requested `limit` (default 50, max 200).
3435
3701
  */
3436
3702
  type EmailStatsByMailboxProviderRegionResponse = {
3437
- period: EmailStatsPeriod & unknown;
3703
+ /**
3704
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3705
+ */
3706
+ period: EmailStatsPeriod;
3438
3707
  /**
3439
3708
  * Provider-region breakdown rows, ranked by the `sort` metric (default `delivered`) descending. Empty when no deliveries occurred in the period.
3440
3709
  */
@@ -3521,7 +3790,10 @@ type EmailMailboxProviderRegionStatsPoint = {
3521
3790
  * Per-mailbox-provider breakdown for the requested period, ranked by the `sort` metric (default `delivered`) descending and capped at the requested `limit` (default 50, max 200).
3522
3791
  */
3523
3792
  type EmailStatsByMailboxProviderResponse = {
3524
- period: EmailStatsPeriod & unknown;
3793
+ /**
3794
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3795
+ */
3796
+ period: EmailStatsPeriod;
3525
3797
  /**
3526
3798
  * Mailbox-provider breakdown rows, ranked by the `sort` metric (default `delivered`) descending. Empty when no eligible activity occurred in the period.
3527
3799
  */
@@ -3558,7 +3830,10 @@ type EmailMailboxProviderSortMetric = "delivered" | "bounced" | "complained" | "
3558
3830
  * Per-category breakdown for the requested period, ranked by the `sort` metric (default `processed`) descending and capped at the requested `limit` (default 50, max 200).
3559
3831
  */
3560
3832
  type EmailStatsByCategoryResponse = {
3561
- period: EmailStatsPeriod & unknown;
3833
+ /**
3834
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3835
+ */
3836
+ period: EmailStatsPeriod;
3562
3837
  /**
3563
3838
  * Category breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no sends occurred in the period.
3564
3839
  */
@@ -3589,7 +3864,10 @@ type EmailCategoryStatsPoint = {
3589
3864
  * Per-sending-domain breakdown for the requested period, ranked by the `sort` metric (default `processed`) descending and capped at the requested `limit` (default 50, max 200).
3590
3865
  */
3591
3866
  type EmailStatsBySendingDomainResponse = {
3592
- period: EmailStatsPeriod & unknown;
3867
+ /**
3868
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3869
+ */
3870
+ period: EmailStatsPeriod;
3593
3871
  /**
3594
3872
  * Sending-domain breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no eligible activity occurred in the period.
3595
3873
  */
@@ -3620,7 +3898,10 @@ type EmailSendingDomainStatsPoint = {
3620
3898
  * Per-sending-IP breakdown for the requested period, ranked by the `sort` metric (default `delivered`) descending and capped at the requested `limit` (default 50, max 200).
3621
3899
  */
3622
3900
  type EmailStatsBySendingIpResponse = {
3623
- period: EmailStatsPeriod & unknown;
3901
+ /**
3902
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
3903
+ */
3904
+ period: EmailStatsPeriod;
3624
3905
  /**
3625
3906
  * Sending-IP breakdown rows, ranked by the `sort` metric (default `delivered`) descending. Empty when no per-IP-attributable activity (delivery, bounce, deferral, or late bounce) occurred in the period.
3626
3907
  */
@@ -3715,7 +3996,10 @@ type EmailSendingIpStatsPoint = {
3715
3996
  *
3716
3997
  */
3717
3998
  type EmailStatsSummary = {
3718
- period: EmailStatsSummaryPeriod & unknown;
3999
+ /**
4000
+ * The window the response covers (echoed back from the request, day or hour grain), plus `data_as_of`, the freshness boundary the data is current to.
4001
+ */
4002
+ period: EmailStatsSummaryPeriod;
3719
4003
  /**
3720
4004
  * Distinct email messages accepted, counted at the message level (one per accepted send regardless of recipient count) and summed per bucket across the period. This counts messages, not recipients, so it is not comparable to `delivery.accepted`, which counts recipients (a single message to 500 recipients is 1 here and up to 500 there).
3721
4005
  */
@@ -3780,7 +4064,10 @@ type EmailStatsComparisonDelta = {
3780
4064
  *
3781
4065
  */
3782
4066
  type EmailStatsComparison = {
3783
- period: EmailStatsSummaryPeriod & unknown;
4067
+ /**
4068
+ * The preceding window these comparison figures cover, the equal-length window ending immediately before the requested start (the prior day for day windows, the prior hour for hour windows). For a request covering 2026-05-01 to 2026-05-31, this is 2026-03-31 to 2026-04-30, both inclusive.
4069
+ */
4070
+ period: EmailStatsSummaryPeriod;
3784
4071
  /**
3785
4072
  * Distinct email messages accepted in the preceding period, counted at the message level.
3786
4073
  */
@@ -3813,7 +4100,10 @@ type EmailStatsSummaryPeriod = {
3813
4100
  * Per-tag breakdown for the requested period, ranked by the `sort` metric (default `processed`) descending and capped at the requested `limit` (default 50, max 200).
3814
4101
  */
3815
4102
  type EmailStatsTagsResponse = {
3816
- period: EmailStatsPeriod & unknown;
4103
+ /**
4104
+ * The date range the response covers (echoed back from the request), plus `data_as_of`, the freshness boundary the data is current to.
4105
+ */
4106
+ period: EmailStatsPeriod;
3817
4107
  /**
3818
4108
  * Tag breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no tagged sends occurred in the period.
3819
4109
  */
@@ -3875,158 +4165,41 @@ type EmailStatsPoint = {
3875
4165
  readonly engagement: EmailEngagementStats;
3876
4166
  readonly latency: EmailLatencyStats;
3877
4167
  };
3878
- type WhatsAppTemplateList = {
4168
+ type WhatsAppEventList = {
3879
4169
  /**
3880
- * The templates available to your workspace.
4170
+ * Timeline events for this WhatsApp message, in chronological order. The timeline is bounded and returned in full; this list is not paginated.
3881
4171
  */
3882
- data: Array<WhatsAppTemplate>;
4172
+ data: Array<WhatsAppEvent>;
3883
4173
  };
3884
- type WhatsAppTemplateButton = {
3885
- /**
3886
- * The button's behavior type.
3887
- */
3888
- readonly type: string;
4174
+ type WhatsAppEventId = string;
4175
+ type WhatsAppEvent = {
3889
4176
  /**
3890
- * How the recipient receives the one-time passcode. Present on authentication-template OTP buttons.
4177
+ * ID of the event (`ev_`-prefixed), unique within the message's timeline.
3891
4178
  */
3892
- readonly otp_type?: string;
4179
+ readonly id: WhatsAppEventId;
3893
4180
  /**
3894
- * The button's label text.
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.
4182
+ *
3895
4183
  */
3896
- readonly text: string;
4184
+ readonly type: string;
3897
4185
  /**
3898
- * The URL the button opens, with any variable placeholder shown inline. Present on link buttons.
4186
+ * When this event occurred.
3899
4187
  */
3900
- readonly url?: string;
4188
+ readonly occurred_at: string;
3901
4189
  /**
3902
- * Example values for this button's variables, in placeholder order. Present when the button URL has variables.
4190
+ * Failure detail. Present only on `whatsapp.failed` events.
3903
4191
  */
3904
- readonly example_parameters?: Array<WhatsAppTemplateExampleParameter>;
4192
+ error?: WhatsAppError;
3905
4193
  };
3906
- /**
3907
- * 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.
3908
- *
3909
- */
3910
- type WhatsAppTemplateParameterType = string;
3911
- type WhatsAppTemplateExampleParameter = {
4194
+ type WhatsAppMessageSendRequest = {
3912
4195
  /**
3913
- * The kind of value this parameter accepts.
4196
+ * The message recipient's phone number in E.164 format (for example `+31612345678`). A value that is not a valid phone number returns a `422` `WhatsAppInvalidRecipient`.
4197
+ *
3914
4198
  */
3915
- readonly type: WhatsAppTemplateParameterType;
4199
+ to: string;
3916
4200
  /**
3917
- * An example value for a text parameter. Present when `type` is `text`.
3918
- */
3919
- readonly text?: string;
3920
- /**
3921
- * The named placeholder this example fills, for templates that use named parameters. Absent for system templates, which use positional parameters.
3922
- */
3923
- readonly name?: string;
3924
- };
3925
- type WhatsAppTemplateComponent = {
3926
- /**
3927
- * The content block's type within the template.
3928
- */
3929
- readonly type: string;
3930
- /**
3931
- * The block's text content, with any variable placeholders shown inline. Present when the block carries text.
3932
- */
3933
- readonly text?: string;
3934
- /**
3935
- * Example values for this block's variables, in placeholder order (one per `{{n}}`). Use them to see what a filled message looks like. Present when the block has variables.
3936
- */
3937
- readonly example_parameters?: Array<WhatsAppTemplateExampleParameter>;
3938
- /**
3939
- * The buttons attached to this block. Present when the block carries buttons.
3940
- */
3941
- readonly buttons?: Array<WhatsAppTemplateButton>;
3942
- };
3943
- /**
3944
- * A message template's review and health status. `approved` (passed review and sendable), `pending` (review in progress), and `rejected` (failed review) are review outcomes. The rest reflect a template's ongoing health after approval: `paused` and `disabled` mean sending from it is suspended, `in_appeal` means a review decision is under appeal, `pending_deletion` means the template is queued for removal, and `limit_exceeded` means it has exceeded a usage limit. Every template in Bird's catalogue is currently `approved`. Open enum: new statuses may be added over time, so treat any unrecognized value as a future status rather than an error.
3945
- *
3946
- */
3947
- type WhatsAppTemplateStatus = string;
3948
- /**
3949
- * 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.
3950
- *
3951
- */
3952
- type WhatsAppTemplateCategory = string;
3953
- /**
3954
- * Language code of the template variant (for example `en` or `pt_BR`).
3955
- */
3956
- type WhatsAppLanguage = string;
3957
- /**
3958
- * Whether the template is a built-in Bird template (`system`) or one your workspace authored (`workspace`).
3959
- */
3960
- type TemplateScope = "system" | "workspace";
3961
- /**
3962
- * A WhatsApp template's name — the stable handle used to reference the template when sending. Lowercase letters, numbers, and underscores.
3963
- *
3964
- */
3965
- type WhatsAppTemplateName = string;
3966
- type WhatsAppTemplateId = string;
3967
- type WhatsAppTemplate = {
3968
- /**
3969
- * Stable Bird identifier for the template.
3970
- */
3971
- readonly id: WhatsAppTemplateId;
3972
- /**
3973
- * The template's stable handle. Pass it as the template reference when sending.
3974
- */
3975
- readonly name: WhatsAppTemplateName;
3976
- /**
3977
- * Optional description of the template's purpose. Null when unset.
3978
- */
3979
- readonly description?: string | null;
3980
- scope: TemplateScope;
3981
- readonly language: WhatsAppLanguage;
3982
- /**
3983
- * Content classification applied to messages sent from this template.
3984
- */
3985
- readonly category: WhatsAppTemplateCategory;
3986
- /**
3987
- * The template's review and health status.
3988
- */
3989
- readonly status: WhatsAppTemplateStatus;
3990
- /**
3991
- * The content blocks that make up the template, in display order.
3992
- */
3993
- readonly components: Array<WhatsAppTemplateComponent>;
3994
- };
3995
- type WhatsAppEventList = {
3996
- /**
3997
- * Timeline events for this WhatsApp message, in chronological order. The timeline is bounded and returned in full; this list is not paginated.
3998
- */
3999
- data: Array<WhatsAppEvent>;
4000
- };
4001
- type WhatsAppEventId = string;
4002
- type WhatsAppEvent = {
4003
- /**
4004
- * ID of the event (`ev_`-prefixed), unique within the message's timeline.
4005
- */
4006
- readonly id: WhatsAppEventId;
4007
- /**
4008
- * 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.
4009
- *
4010
- */
4011
- readonly type: string;
4012
- /**
4013
- * When this event occurred.
4014
- */
4015
- readonly occurred_at: string;
4016
- /**
4017
- * Failure detail. Present only on `whatsapp.failed` events.
4018
- */
4019
- error?: WhatsAppError;
4020
- };
4021
- type WhatsAppMessageSendRequest = {
4022
- /**
4023
- * The message recipient's phone number in E.164 format (for example `+31612345678`). A value that is not a valid phone number returns a `422` `WhatsAppInvalidRecipient`.
4024
- *
4025
- */
4026
- to: string;
4027
- /**
4028
- * The template to send. Bird selects the sender number from the template's category, so there is no sender field on this request. Templates are the only supported content type today: a request without one is rejected with a `422`.
4029
- *
4201
+ * The template to send. Bird selects the sender number from the template's category, so there is no sender field on this request. Templates are the only supported content type today: a request without one is rejected with a `422`.
4202
+ *
4030
4203
  */
4031
4204
  template?: WhatsAppTemplateSend;
4032
4205
  /**
@@ -4042,6 +4215,11 @@ type WhatsAppMessageSendRequest = {
4042
4215
  [key: string]: unknown;
4043
4216
  };
4044
4217
  };
4218
+ /**
4219
+ * 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
+ *
4221
+ */
4222
+ type WhatsAppTemplateParameterType = string;
4045
4223
  type WhatsAppMessageTemplateComponentParameter = {
4046
4224
  /**
4047
4225
  * The kind of value this parameter carries. `text` is the only kind today.
@@ -4068,6 +4246,15 @@ type WhatsAppMessageTemplateComponent = {
4068
4246
  */
4069
4247
  parameters?: Array<WhatsAppMessageTemplateComponentParameter>;
4070
4248
  };
4249
+ /**
4250
+ * Language code of the template variant (for example `en` or `pt_BR`).
4251
+ */
4252
+ type WhatsAppLanguage = string;
4253
+ /**
4254
+ * A WhatsApp template's name — the stable handle used to reference the template when sending. Lowercase letters, numbers, and underscores.
4255
+ *
4256
+ */
4257
+ type WhatsAppTemplateName = string;
4071
4258
  type WhatsAppTemplateSend = {
4072
4259
  /**
4073
4260
  * The template to send, by its name (for example `bird_otp`).
@@ -4084,11 +4271,30 @@ type WhatsAppTemplateSend = {
4084
4271
  */
4085
4272
  components?: Array<WhatsAppMessageTemplateComponent>;
4086
4273
  };
4274
+ /**
4275
+ * ISO 4217 three-letter currency code.
4276
+ */
4277
+ type CurrencyCode = string;
4278
+ type Money = {
4279
+ /**
4280
+ * Decimal amount as a string, in major currency units.
4281
+ */
4282
+ amount: string;
4283
+ /**
4284
+ * ISO 4217 currency code.
4285
+ */
4286
+ currency_code: CurrencyCode;
4287
+ };
4087
4288
  /**
4088
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; the 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` (an inbound message, `direction: inbound`, sent to you by a contact).
4089
4290
  *
4090
4291
  */
4091
4292
  type WhatsAppMessageStatus = "scheduled" | "accepted" | "sent" | "delivered" | "failed" | "rejected" | "canceled" | "received";
4293
+ /**
4294
+ * 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
+ *
4296
+ */
4297
+ type WhatsAppTemplateCategory = string;
4092
4298
  /**
4093
4299
  * The template a message was sent from. On reads `name`, `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).
4094
4300
  *
@@ -4155,6 +4361,7 @@ type WhatsAppMessage = {
4155
4361
  * When the message was read by the recipient. Null until then.
4156
4362
  */
4157
4363
  readonly read_at?: string | null;
4364
+ cost?: Money | null;
4158
4365
  /**
4159
4366
  * Structured `{name, value}` filter labels applied to this message.
4160
4367
  */
@@ -4181,28 +4388,13 @@ type VerificationCheckResult = {
4181
4388
  */
4182
4389
  readonly attempts_remaining?: number | null;
4183
4390
  };
4184
- /**
4185
- * 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.
4186
- */
4187
- type VerificationChannel = string;
4188
4391
  type VerificationChannelEntry = {
4189
4392
  channel: VerificationChannel;
4190
4393
  };
4191
4394
  /**
4192
- * 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.
4193
- *
4395
+ * 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.
4194
4396
  */
4195
- type VerificationTo = {
4196
- /**
4197
- * The recipient's email address. Case does not matter; the address is lowercased before use.
4198
- */
4199
- email_address?: string;
4200
- /**
4201
- * The recipient's phone number in E.164 format, with the leading `+` and country code (for example `+15551234567`). A number in any other format is rejected as an invalid recipient (`422`).
4202
- */
4203
- phone_number?: string;
4204
- };
4205
- type VerificationId = string;
4397
+ type VerificationTerminalReason = string;
4206
4398
  type Verification = {
4207
4399
  readonly id: VerificationId;
4208
4400
  /**
@@ -4210,9 +4402,9 @@ type Verification = {
4210
4402
  */
4211
4403
  readonly status: "pending" | "verified" | "failed" | "expired" | "canceled" | "blocked";
4212
4404
  /**
4213
- * Why the verification reached its final state: `attempts_exhausted` (too many incorrect passcodes) or `ttl_elapsed` (the time window elapsed before a correct passcode). Null while `pending` and once `verified`. Open enum; treat any unrecognized value as a future reason.
4405
+ * Why the verification reached its final state, or null while `pending` and once `verified`. See the enum for the values it can take.
4214
4406
  */
4215
- readonly reason?: string | null;
4407
+ readonly reason?: VerificationTerminalReason | null;
4216
4408
  readonly to: VerificationTo;
4217
4409
  /**
4218
4410
  * 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.
@@ -4267,6 +4459,10 @@ type VerificationOptions = {
4267
4459
  */
4268
4460
  channels?: Array<VerificationChannel>;
4269
4461
  };
4462
+ /**
4463
+ * Bucket grain for a stats trend series.
4464
+ */
4465
+ type StatsTrendGrain = "daily" | "hourly";
4270
4466
  type SmsTemplateList = {
4271
4467
  /**
4272
4468
  * The templates available to your workspace. The catalogue is small and returned in full; this list is not paginated.
@@ -4302,6 +4498,10 @@ type TemplateVariable = {
4302
4498
  * 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.
4303
4499
  */
4304
4500
  type SmsMessageCategory = "transactional" | "marketing" | "authentication" | "service";
4501
+ /**
4502
+ * Whether the template is a built-in Bird template (`system`) or one your workspace authored (`workspace`).
4503
+ */
4504
+ type TemplateScope = "system" | "workspace";
4305
4505
  /**
4306
4506
  * A template's send-by handle — the stable reference used in place of the template id when sending. Lowercase letters, numbers, hyphens, and underscores; starts and ends with a letter or number.
4307
4507
  *
@@ -4406,10 +4606,6 @@ type SmsCostBreakdown = {
4406
4606
  */
4407
4607
  carrier_surcharge: string;
4408
4608
  };
4409
- /**
4410
- * ISO 4217 three-letter currency code.
4411
- */
4412
- type CurrencyCode = string;
4413
4609
  /**
4414
4610
  * Cost of the message. Null until the message has been priced; the cost is populated as the message is processed, not at the moment it is accepted.
4415
4611
  */
@@ -4558,7 +4754,7 @@ type SmsMessageSendRequest = unknown & {
4558
4754
  */
4559
4755
  to: string;
4560
4756
  /**
4561
- * Sender to send from: an E.164 number (`+15557654321`), an alphanumeric sender ID (1-11 letters, digits, or spaces, for example `MyBrand`), or a short code (5-6 digits). A numeric sender must be a number your workspace owns; an alphanumeric sender is accepted where the destination country permits one. Required on a free-text send: omitting it returns a `422` `SMSNoEligibleSender`. Not accepted alongside `template`, which selects its sender automatically.
4757
+ * Sender to send from: an E.164 number (`+15557654321`), an alphanumeric sender ID (1-11 letters, digits, spaces, dashes, or underscores, at least one of them a letter, for example `MyBrand`), or a short code (5-6 digits). A numeric sender must be a number your workspace owns; an alphanumeric sender is accepted where the destination country permits one. Required on a free-text send: omitting it returns a `422` `SMSNoEligibleSender`. Not accepted alongside `template`, which selects its sender automatically.
4562
4758
  *
4563
4759
  */
4564
4760
  from?: string;
@@ -4641,6 +4837,10 @@ type SmsMessageSendRequest = unknown & {
4641
4837
  */
4642
4838
  track_clicks?: boolean;
4643
4839
  };
4840
+ /**
4841
+ * Whether a message was sent from the workspace (`outbound`) or received by it (`inbound`).
4842
+ */
4843
+ type MessageDirection = "outbound" | "inbound";
4644
4844
  type AudienceContactsRemoveRequest = {
4645
4845
  /**
4646
4846
  * Contacts to remove from the audience. Removing a contact that is not a member has no effect; duplicate IDs in the list are collapsed. If any ID does not exist in the workspace, the whole request fails with a validation error and no memberships are removed.
@@ -4753,15 +4953,16 @@ type ContactPropertyCreateRequest = {
4753
4953
  * The property key, used as the key in contact data and as the template variable name in broadcasts. Lowercase letters, digits, and underscores, starting with a letter. Cannot be changed after creation.
4754
4954
  */
4755
4955
  key: string;
4756
- /**
4757
- * The value type every contact must use for this property. Cannot be changed after creation.
4758
- */
4759
- type: "string" | "number" | "boolean";
4956
+ type: ContactPropertyType;
4760
4957
  /**
4761
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 boolean matching the declared type (strings up to 500 characters), or null for no fallback; a value of another type returns a validation error.
4762
4959
  */
4763
4960
  fallback_value?: unknown;
4764
4961
  };
4962
+ /**
4963
+ * The value type every contact must use for a property. Cannot be changed after creation.
4964
+ */
4965
+ type ContactPropertyType = "string" | "number" | "boolean";
4765
4966
  type ContactPropertyId = string;
4766
4967
  type ContactProperty = {
4767
4968
  /**
@@ -4772,10 +4973,7 @@ type ContactProperty = {
4772
4973
  * The property key, used as the key in contact data and as the template variable name in broadcasts. Lowercase letters, digits, and underscores, starting with a letter. Cannot be changed after creation.
4773
4974
  */
4774
4975
  key: string;
4775
- /**
4776
- * The value type every contact must use for this property. Cannot be changed after creation.
4777
- */
4778
- type: "string" | "number" | "boolean";
4976
+ type: ContactPropertyType;
4779
4977
  /**
4780
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 boolean matching the declared type (strings up to 500 characters), or null when no fallback is set.
4781
4979
  */
@@ -4928,17 +5126,31 @@ type EmailMessageBatchItem = {
4928
5126
  *
4929
5127
  */
4930
5128
  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
+ /**
5134
+ * 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.
5135
+ *
5136
+ */
5137
+ type TemplateSlug = string;
4931
5138
  type EmailTemplateSend = unknown & {
4932
5139
  /**
4933
5140
  * The template to send, by its id.
4934
5141
  */
4935
5142
  id?: EmailTemplateId;
4936
5143
  /**
4937
- * The template to send, by its name handle a workspace template (for example `welcome-email`) or a built-in `system` template (for example `bird_welcome`).
5144
+ * The template to send, by its slug handle. A workspace template (for example `welcome-email`) or a built-in `system` template (for example `bird_welcome`).
4938
5145
  */
4939
- name?: TemplateName;
5146
+ slug?: TemplateSlug;
5147
+ /**
5148
+ * Which of the template's languages to send. Omit it to send the template's default language. When the template does not carry the language you ask for, its own `on_missing_language` setting decides whether the closest available language is sent instead or the send is rejected.
5149
+ *
5150
+ */
5151
+ language?: LanguageTag;
4940
5152
  /**
4941
- * Values for the template's variables, keyed by variable name. A token with no matching value renders empty. Cap: 16 KB serialized.
5153
+ * 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.
4942
5154
  *
4943
5155
  */
4944
5156
  parameters?: {
@@ -5023,11 +5235,7 @@ type EmailMessageSendRequest = {
5023
5235
  *
5024
5236
  */
5025
5237
  ip_pool_id?: string;
5026
- /**
5027
- * Content classification — independent of which endpoint you use. Controls suppression policy: `marketing` blocks on all suppression reasons (use for marketing content); `transactional` allows delivery through complaint and unsubscribe suppressions (use for receipts, password resets, and similar operational messages). Default: marketing.
5028
- *
5029
- */
5030
- category?: "marketing" | "transactional";
5238
+ category?: EmailMessageCategory;
5031
5239
  /**
5032
5240
  * Preview feature — threaded replies. Currently unavailable; supplying this field returns `422 UnsupportedEmailFeature`. When generally available, sets In-Reply-To and References headers automatically.
5033
5241
  */
@@ -5131,11 +5339,7 @@ type EmailMessage = {
5131
5339
  * Message subject line.
5132
5340
  */
5133
5341
  subject: string;
5134
- /**
5135
- * Content classification. Controls suppression policy — `marketing` blocks on all suppression reasons; `transactional` allows delivery through complaint and unsubscribe suppressions.
5136
- *
5137
- */
5138
- category: "marketing" | "transactional";
5342
+ category: EmailMessageCategory;
5139
5343
  /**
5140
5344
  * Reply-To addresses, if set on the send. Empty/null when no Reply-To was provided.
5141
5345
  */
@@ -5240,34 +5444,237 @@ type EmailMessage = {
5240
5444
  */
5241
5445
  readonly scheduled_at?: string | null;
5242
5446
  };
5243
- type ListEmailMessagesData = {
5447
+ /**
5448
+ * The members present on a presence channel.
5449
+ */
5450
+ type RealtimeChannelMembers = {
5451
+ members: Array<RealtimeChannelMember>;
5452
+ };
5453
+ /**
5454
+ * An app-defined member id — the identity of your application's end user ("member"), assigned when your auth server authorizes them. Never a Bird user. Max 128 characters, restricted to URL-safe characters because member ids appear directly in API request paths. Broader than a channel name — allows `+ : @ . _ -` etc. for real identifiers (phone numbers, emails, `member:42`), but excludes `/ ? # %` and whitespace.
5455
+ */
5456
+ type RealtimeMemberId = string;
5457
+ /**
5458
+ * A member present on a presence channel.
5459
+ */
5460
+ type RealtimeChannelMember = {
5461
+ member_id: RealtimeMemberId;
5462
+ };
5463
+ type RealtimeChannelInfo = RealtimeChannelCounts & {
5464
+ /**
5465
+ * Whether at least one client is subscribed.
5466
+ */
5467
+ occupied: boolean;
5468
+ };
5469
+ /**
5470
+ * Per-channel counts, present only when requested via `include` and applicable.
5471
+ */
5472
+ type RealtimeChannelCounts = {
5473
+ /**
5474
+ * Distinct members (presence channels only; requires include=member_count).
5475
+ */
5476
+ member_count?: number;
5477
+ /**
5478
+ * Connections currently subscribed to this channel (requires include=connection_count and the app's connection-counting flag). Channel-scoped — distinct from the app-wide peak connections metric.
5479
+ */
5480
+ connection_count?: number;
5481
+ };
5482
+ /**
5483
+ * The app's occupied channels. The Realtime service does not paginate this listing, so all occupied channels are returned in one response.
5484
+ */
5485
+ type RealtimeChannelsList = {
5486
+ /**
5487
+ * The occupied channels, sorted by name.
5488
+ */
5489
+ data: Array<RealtimeChannelListItem>;
5490
+ };
5491
+ /**
5492
+ * A Realtime channel name. Only letters, digits, and _ - = @ , . ; Prefix with `private-` or `presence-` for authenticated channels.
5493
+ */
5494
+ type RealtimeChannelName = string;
5495
+ type RealtimeChannelListItem = RealtimeChannelCounts & {
5496
+ name: RealtimeChannelName;
5497
+ };
5498
+ /**
5499
+ * The result of a Realtime batch publish. The events were accepted for delivery; delivery to connected clients is asynchronous.
5500
+ *
5501
+ */
5502
+ type RealtimeBatchPublishResult = {
5503
+ /**
5504
+ * Per-event channel attributes at publish time, present only when at least one event asked for them via `include`. Positional: one item per event, in request order.
5505
+ */
5506
+ readonly data?: Array<RealtimeBatchPublishResultItem>;
5507
+ };
5508
+ type RealtimeBatchPublishResultItem = RealtimeChannelCounts & {
5509
+ channel: RealtimeChannelName;
5510
+ };
5511
+ /**
5512
+ * A batch of events, each delivered to a single channel, in one request.
5513
+ */
5514
+ type RealtimeBatchPublish = {
5515
+ /**
5516
+ * Up to 10 events per batch.
5517
+ */
5518
+ events: Array<RealtimeBatchEvent>;
5519
+ };
5520
+ /**
5521
+ * A per-channel attribute to include in the response. `member_count` is presence-channels only; `connection_count` requires the app's connection-counting flag.
5522
+ */
5523
+ type RealtimeChannelInclude = "member_count" | "connection_count";
5524
+ /**
5525
+ * 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.
5526
+ */
5527
+ type RealtimeExcludeConnectionId = string;
5528
+ /**
5529
+ * Arbitrary JSON payload delivered as the event data — an object, array, or scalar. Cap: 10 KB serialized.
5530
+ */
5531
+ type RealtimeEventData = unknown;
5532
+ /**
5533
+ * 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.
5534
+ */
5535
+ type RealtimeEventName = string;
5536
+ /**
5537
+ * One item of a batch publish — a single event to a single channel.
5538
+ */
5539
+ type RealtimeBatchEvent = {
5540
+ event: RealtimeEventName;
5541
+ channel: RealtimeChannelName;
5542
+ data?: RealtimeEventData;
5543
+ exclude_connection_id?: RealtimeExcludeConnectionId;
5544
+ /**
5545
+ * Attributes of this event's channel to return alongside the publish (same semantics and validation errors as on the channel endpoints). Requesting attributes counts as one additional message toward usage.
5546
+ */
5547
+ include?: Array<RealtimeChannelInclude>;
5548
+ };
5549
+ /**
5550
+ * The result of a Realtime publish. The event was accepted and fanned out to the requested channels; delivery to connected clients is asynchronous.
5551
+ *
5552
+ */
5553
+ type RealtimePublishResult = {
5554
+ /**
5555
+ * Per-channel attributes at publish time, present only when the request asked for them via `include`; one item per distinct target channel, sorted by name.
5556
+ */
5557
+ readonly data?: Array<RealtimeChannelListItem>;
5558
+ };
5559
+ /**
5560
+ * A Realtime publish: delivers one event to one or more channels of the app. Listing several channels fans the event out to all of them (broadcast) in a single call.
5561
+ *
5562
+ */
5563
+ type RealtimePublish = {
5564
+ event: RealtimeEventName;
5565
+ /**
5566
+ * The channels to deliver the event to (up to 100 per call). Prefix with `private-` or `presence-` for authenticated channels.
5567
+ *
5568
+ */
5569
+ channels: Array<RealtimeChannelName>;
5570
+ data?: RealtimeEventData;
5571
+ exclude_connection_id?: RealtimeExcludeConnectionId;
5572
+ /**
5573
+ * Per-channel attributes to return alongside the publish, reflecting each channel's state at publish time (same semantics and validation errors as on the channel endpoints: `member_count` is presence-channels only, `connection_count` requires the app's connection-counting flag). Requesting attributes counts as one additional message toward usage.
5574
+ */
5575
+ include?: Array<RealtimeChannelInclude>;
5576
+ };
5577
+ type RealtimeAppId = string;
5578
+ type ListRealtimeAppChannelsData = {
5244
5579
  body?: never;
5245
- path?: never;
5246
- query?: {
5580
+ headers: {
5247
5581
  /**
5248
- * Maximum number of items to return per page.
5582
+ * Workspace context. Required for session auth; derived from API key otherwise.
5249
5583
  */
5250
- limit?: number;
5584
+ "X-Workspace-Id"?: string;
5251
5585
  /**
5252
- * Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.
5586
+ * 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.
5587
+ *
5253
5588
  */
5254
- starting_after?: string;
5589
+ "X-Realtime-Key": string;
5255
5590
  /**
5256
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
5591
+ * 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.
5592
+ *
5257
5593
  */
5258
- ending_before?: string;
5594
+ "X-Realtime-Secret": string;
5595
+ };
5596
+ path: {
5259
5597
  /**
5260
- * Return only resources created at or after this timestamp (inclusive lower bound). Combine with `created_before` to filter to a time window. RFC 3339 / ISO 8601 with timezone.
5598
+ * Realtime app ID
5261
5599
  */
5262
- created_after?: string;
5600
+ realtime_app_id: RealtimeAppId;
5601
+ };
5602
+ query?: {
5263
5603
  /**
5264
- * Return only resources created strictly before this timestamp (exclusive upper bound). Combine with `created_after` to filter to a time window. RFC 3339 / ISO 8601 with timezone.
5604
+ * Only channels whose name starts with this prefix (e.g. "presence-").
5265
5605
  */
5266
- created_before?: string;
5606
+ prefix?: string;
5267
5607
  /**
5268
- * Filter by aggregate delivery status.
5608
+ * Per-channel attributes to include. Repeatable. Requesting `member_count` without a presence-channel `prefix`, or `connection_count` when the app's connection-counting flag is off, returns a validation error (400).
5269
5609
  */
5270
- status?: "scheduled" | "accepted" | "processed" | "deferred" | "delivered" | "partial_failure" | "bounced" | "complained" | "rejected" | "canceled";
5610
+ include?: Array<RealtimeChannelInclude>;
5611
+ };
5612
+ url: "/v1/realtime/apps/{realtime_app_id}/channels";
5613
+ };
5614
+ type GetRealtimeAppChannelData = {
5615
+ body?: never;
5616
+ headers: {
5617
+ /**
5618
+ * Workspace context. Required for session auth; derived from API key otherwise.
5619
+ */
5620
+ "X-Workspace-Id"?: string;
5621
+ /**
5622
+ * 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.
5623
+ *
5624
+ */
5625
+ "X-Realtime-Key": string;
5626
+ /**
5627
+ * 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.
5628
+ *
5629
+ */
5630
+ "X-Realtime-Secret": string;
5631
+ };
5632
+ path: {
5633
+ /**
5634
+ * Realtime app ID
5635
+ */
5636
+ realtime_app_id: RealtimeAppId;
5637
+ /**
5638
+ * Channel name
5639
+ */
5640
+ channel_name: RealtimeChannelName;
5641
+ };
5642
+ query?: {
5643
+ /**
5644
+ * Attributes to include. Repeatable. Requesting `member_count` for a non-presence channel, or `connection_count` when the app's connection-counting flag is off, returns a validation error (400).
5645
+ */
5646
+ include?: Array<RealtimeChannelInclude>;
5647
+ };
5648
+ url: "/v1/realtime/apps/{realtime_app_id}/channels/{channel_name}";
5649
+ };
5650
+ type ListEmailMessagesData = {
5651
+ body?: never;
5652
+ path?: never;
5653
+ query?: {
5654
+ /**
5655
+ * Maximum number of items to return per page.
5656
+ */
5657
+ limit?: number;
5658
+ /**
5659
+ * Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.
5660
+ */
5661
+ starting_after?: string;
5662
+ /**
5663
+ * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
5664
+ */
5665
+ ending_before?: string;
5666
+ /**
5667
+ * Return only resources created at or after this timestamp (inclusive lower bound). Combine with `created_before` to filter to a time window. RFC 3339 / ISO 8601 with timezone.
5668
+ */
5669
+ created_after?: string;
5670
+ /**
5671
+ * Return only resources created strictly before this timestamp (exclusive upper bound). Combine with `created_after` to filter to a time window. RFC 3339 / ISO 8601 with timezone.
5672
+ */
5673
+ created_before?: string;
5674
+ /**
5675
+ * Filter by aggregate delivery status.
5676
+ */
5677
+ status?: EmailMessageStatus;
5271
5678
  /**
5272
5679
  * Filter by tag. Accepts `name` to match any message carrying that tag name, or `name:value` to match a specific tag pair (e.g. `category:welcome`). Repeat the parameter to AND-combine several tag filters.
5273
5680
  *
@@ -5276,7 +5683,7 @@ type ListEmailMessagesData = {
5276
5683
  /**
5277
5684
  * Filter by category.
5278
5685
  */
5279
- category?: "marketing" | "transactional";
5686
+ category?: EmailMessageCategory;
5280
5687
  /**
5281
5688
  * Filter by recipient address. Exact match against any `to`/`cc`/`bcc` recipient on the message; normalised to lowercase before comparison.
5282
5689
  *
@@ -5342,6 +5749,53 @@ type CreateContactData = {
5342
5749
  query?: never;
5343
5750
  url: "/v1/contacts";
5344
5751
  };
5752
+ type CreateContactBatchData = {
5753
+ body: ContactUpsertRequest;
5754
+ headers?: {
5755
+ /**
5756
+ * 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).
5757
+ * Two distinct 409 errors signal misuse:
5758
+ * - `request_in_progress` (E01004) — the same key is currently being
5759
+ * processed by a concurrent request. Wait briefly and retry; the lock
5760
+ * expires within 30 seconds.
5761
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
5762
+ * against a different request body or method. Generate a new key.
5763
+ *
5764
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
5765
+ *
5766
+ */
5767
+ "Idempotency-Key"?: string;
5768
+ };
5769
+ path?: never;
5770
+ query?: never;
5771
+ url: "/v1/contacts/batch";
5772
+ };
5773
+ type UpdateContactData = {
5774
+ body: ContactUpdateRequest;
5775
+ headers?: {
5776
+ /**
5777
+ * 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).
5778
+ * Two distinct 409 errors signal misuse:
5779
+ * - `request_in_progress` (E01004) — the same key is currently being
5780
+ * processed by a concurrent request. Wait briefly and retry; the lock
5781
+ * expires within 30 seconds.
5782
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
5783
+ * against a different request body or method. Generate a new key.
5784
+ *
5785
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
5786
+ *
5787
+ */
5788
+ "Idempotency-Key"?: string;
5789
+ };
5790
+ path: {
5791
+ /**
5792
+ * ID of the contact to update (`con_`-prefixed).
5793
+ */
5794
+ contact_id: ContactId;
5795
+ };
5796
+ query?: never;
5797
+ url: "/v1/contacts/{contact_id}";
5798
+ };
5345
5799
  type ListContactPropertiesData = {
5346
5800
  body?: never;
5347
5801
  path?: never;
@@ -5361,6 +5815,53 @@ type ListContactPropertiesData = {
5361
5815
  };
5362
5816
  url: "/v1/contact-properties";
5363
5817
  };
5818
+ type CreateContactPropertyData = {
5819
+ body: ContactPropertyCreateRequest;
5820
+ headers?: {
5821
+ /**
5822
+ * 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).
5823
+ * Two distinct 409 errors signal misuse:
5824
+ * - `request_in_progress` (E01004) — the same key is currently being
5825
+ * processed by a concurrent request. Wait briefly and retry; the lock
5826
+ * expires within 30 seconds.
5827
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
5828
+ * against a different request body or method. Generate a new key.
5829
+ *
5830
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
5831
+ *
5832
+ */
5833
+ "Idempotency-Key"?: string;
5834
+ };
5835
+ path?: never;
5836
+ query?: never;
5837
+ url: "/v1/contact-properties";
5838
+ };
5839
+ type UpdateContactPropertyData = {
5840
+ body: ContactPropertyUpdateRequest;
5841
+ headers?: {
5842
+ /**
5843
+ * 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).
5844
+ * Two distinct 409 errors signal misuse:
5845
+ * - `request_in_progress` (E01004) — the same key is currently being
5846
+ * processed by a concurrent request. Wait briefly and retry; the lock
5847
+ * expires within 30 seconds.
5848
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
5849
+ * against a different request body or method. Generate a new key.
5850
+ *
5851
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
5852
+ *
5853
+ */
5854
+ "Idempotency-Key"?: string;
5855
+ };
5856
+ path: {
5857
+ /**
5858
+ * ID of the contact property to update (`prp_`-prefixed).
5859
+ */
5860
+ property_id: ContactPropertyId;
5861
+ };
5862
+ query?: never;
5863
+ url: "/v1/contact-properties/{property_id}";
5864
+ };
5364
5865
  type ListAudiencesData = {
5365
5866
  body?: never;
5366
5867
  path?: never;
@@ -5384,6 +5885,53 @@ type ListAudiencesData = {
5384
5885
  };
5385
5886
  url: "/v1/audiences";
5386
5887
  };
5888
+ type CreateAudienceData = {
5889
+ body: AudienceCreateRequest;
5890
+ headers?: {
5891
+ /**
5892
+ * 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).
5893
+ * Two distinct 409 errors signal misuse:
5894
+ * - `request_in_progress` (E01004) — the same key is currently being
5895
+ * processed by a concurrent request. Wait briefly and retry; the lock
5896
+ * expires within 30 seconds.
5897
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
5898
+ * against a different request body or method. Generate a new key.
5899
+ *
5900
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
5901
+ *
5902
+ */
5903
+ "Idempotency-Key"?: string;
5904
+ };
5905
+ path?: never;
5906
+ query?: never;
5907
+ url: "/v1/audiences";
5908
+ };
5909
+ type UpdateAudienceData = {
5910
+ body: AudienceUpdateRequest;
5911
+ headers?: {
5912
+ /**
5913
+ * 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).
5914
+ * Two distinct 409 errors signal misuse:
5915
+ * - `request_in_progress` (E01004) — the same key is currently being
5916
+ * processed by a concurrent request. Wait briefly and retry; the lock
5917
+ * expires within 30 seconds.
5918
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
5919
+ * against a different request body or method. Generate a new key.
5920
+ *
5921
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
5922
+ *
5923
+ */
5924
+ "Idempotency-Key"?: string;
5925
+ };
5926
+ path: {
5927
+ /**
5928
+ * ID of the audience to update (`adn_`-prefixed).
5929
+ */
5930
+ audience_id: AudienceId;
5931
+ };
5932
+ query?: never;
5933
+ url: "/v1/audiences/{audience_id}";
5934
+ };
5387
5935
  type ListAudienceContactsData = {
5388
5936
  body?: never;
5389
5937
  path: {
@@ -5412,6 +5960,58 @@ type ListAudienceContactsData = {
5412
5960
  };
5413
5961
  url: "/v1/audiences/{audience_id}/contacts";
5414
5962
  };
5963
+ type AssignAudienceContactsData = {
5964
+ body: AudienceContactsAddRequest;
5965
+ headers?: {
5966
+ /**
5967
+ * 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).
5968
+ * Two distinct 409 errors signal misuse:
5969
+ * - `request_in_progress` (E01004) — the same key is currently being
5970
+ * processed by a concurrent request. Wait briefly and retry; the lock
5971
+ * expires within 30 seconds.
5972
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
5973
+ * against a different request body or method. Generate a new key.
5974
+ *
5975
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
5976
+ *
5977
+ */
5978
+ "Idempotency-Key"?: string;
5979
+ };
5980
+ path: {
5981
+ /**
5982
+ * ID of the audience to add contacts to (`adn_`-prefixed).
5983
+ */
5984
+ audience_id: AudienceId;
5985
+ };
5986
+ query?: never;
5987
+ url: "/v1/audiences/{audience_id}/contacts";
5988
+ };
5989
+ type UnassignAudienceContactsData = {
5990
+ body: AudienceContactsRemoveRequest;
5991
+ headers?: {
5992
+ /**
5993
+ * 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).
5994
+ * Two distinct 409 errors signal misuse:
5995
+ * - `request_in_progress` (E01004) — the same key is currently being
5996
+ * processed by a concurrent request. Wait briefly and retry; the lock
5997
+ * expires within 30 seconds.
5998
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
5999
+ * against a different request body or method. Generate a new key.
6000
+ *
6001
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
6002
+ *
6003
+ */
6004
+ "Idempotency-Key"?: string;
6005
+ };
6006
+ path: {
6007
+ /**
6008
+ * ID of the audience to remove contacts from (`adn_`-prefixed).
6009
+ */
6010
+ audience_id: AudienceId;
6011
+ };
6012
+ query?: never;
6013
+ url: "/v1/audiences/{audience_id}/contacts/remove";
6014
+ };
5415
6015
  type ListSmsMessagesData = {
5416
6016
  body?: never;
5417
6017
  path?: never;
@@ -5439,7 +6039,7 @@ type ListSmsMessagesData = {
5439
6039
  /**
5440
6040
  * Filter by direction. Omit for both.
5441
6041
  */
5442
- direction?: "outbound" | "inbound";
6042
+ direction?: MessageDirection;
5443
6043
  /**
5444
6044
  * Keep only messages whose current `status` matches; repeat the parameter to match any of several. One of `scheduled`, `accepted`, `sent`, `delivered`, `undelivered`, `failed`, `rejected`, `canceled`, `expired`, or `received`.
5445
6045
  *
@@ -5453,7 +6053,7 @@ type ListSmsMessagesData = {
5453
6053
  /**
5454
6054
  * Filter by category.
5455
6055
  */
5456
- category?: "transactional" | "marketing" | "authentication" | "service";
6056
+ category?: SmsMessageCategory;
5457
6057
  /**
5458
6058
  * Filter by recipient phone number (E.164 exact match).
5459
6059
  */
@@ -5478,11 +6078,11 @@ type ListSmsTemplatesData = {
5478
6078
  * Keep only templates of this scope: `system` for Bird's built-in templates, `workspace` for templates authored in your workspace. Omit for all. Workspace-authored SMS templates are not available yet, so `workspace` currently matches nothing.
5479
6079
  *
5480
6080
  */
5481
- scope?: "system" | "workspace";
6081
+ scope?: TemplateScope;
5482
6082
  /**
5483
6083
  * Keep only templates whose `category` matches. Omit for all categories.
5484
6084
  */
5485
- category?: "transactional" | "marketing" | "authentication" | "service";
6085
+ category?: SmsMessageCategory;
5486
6086
  /**
5487
6087
  * Keep only templates available in this language, as a BCP-47 tag. Matches the template's `available_languages` entries exactly, with no fallback.
5488
6088
  *
@@ -5491,6 +6091,56 @@ type ListSmsTemplatesData = {
5491
6091
  };
5492
6092
  url: "/v1/sms/templates";
5493
6093
  };
6094
+ type CreateVerificationData = {
6095
+ body: VerificationCreateRequest;
6096
+ headers?: {
6097
+ /**
6098
+ * Workspace context. Required for session auth; derived from API key otherwise.
6099
+ */
6100
+ "X-Workspace-Id"?: string;
6101
+ /**
6102
+ * 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).
6103
+ * Two distinct 409 errors signal misuse:
6104
+ * - `request_in_progress` (E01004) — the same key is currently being
6105
+ * processed by a concurrent request. Wait briefly and retry; the lock
6106
+ * expires within 30 seconds.
6107
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
6108
+ * against a different request body or method. Generate a new key.
6109
+ *
6110
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
6111
+ *
6112
+ */
6113
+ "Idempotency-Key"?: string;
6114
+ };
6115
+ path?: never;
6116
+ query?: never;
6117
+ url: "/v1/verify/verifications";
6118
+ };
6119
+ type CreateVerificationCheckData = {
6120
+ body: VerificationCheckRequest;
6121
+ headers?: {
6122
+ /**
6123
+ * Workspace context. Required for session auth; derived from API key otherwise.
6124
+ */
6125
+ "X-Workspace-Id"?: string;
6126
+ /**
6127
+ * 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).
6128
+ * Two distinct 409 errors signal misuse:
6129
+ * - `request_in_progress` (E01004) — the same key is currently being
6130
+ * processed by a concurrent request. Wait briefly and retry; the lock
6131
+ * expires within 30 seconds.
6132
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
6133
+ * against a different request body or method. Generate a new key.
6134
+ *
6135
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
6136
+ *
6137
+ */
6138
+ "Idempotency-Key"?: string;
6139
+ };
6140
+ path?: never;
6141
+ query?: never;
6142
+ url: "/v1/verify/verifications/check";
6143
+ };
5494
6144
  type ListWhatsAppMessagesData = {
5495
6145
  body?: never;
5496
6146
  path?: never;
@@ -5688,7 +6338,7 @@ type GetEmailStatsByTagData = {
5688
6338
  /**
5689
6339
  * Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
5690
6340
  */
5691
- trend_grain?: "daily" | "hourly";
6341
+ trend_grain?: StatsTrendGrain;
5692
6342
  };
5693
6343
  url: "/v1/email/stats/tags";
5694
6344
  };
@@ -5786,7 +6436,7 @@ type GetEmailStatsBySendingIpData = {
5786
6436
  /**
5787
6437
  * Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
5788
6438
  */
5789
- trend_grain?: "daily" | "hourly";
6439
+ trend_grain?: StatsTrendGrain;
5790
6440
  };
5791
6441
  url: "/v1/email/stats/sending-ips";
5792
6442
  };
@@ -5828,7 +6478,7 @@ type GetEmailStatsBySendingDomainData = {
5828
6478
  /**
5829
6479
  * Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
5830
6480
  */
5831
- trend_grain?: "daily" | "hourly";
6481
+ trend_grain?: StatsTrendGrain;
5832
6482
  };
5833
6483
  url: "/v1/email/stats/sending-domains";
5834
6484
  };
@@ -5866,7 +6516,7 @@ type GetEmailStatsByCategoryData = {
5866
6516
  /**
5867
6517
  * Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
5868
6518
  */
5869
- trend_grain?: "daily" | "hourly";
6519
+ trend_grain?: StatsTrendGrain;
5870
6520
  };
5871
6521
  url: "/v1/email/stats/categories";
5872
6522
  };
@@ -5908,7 +6558,7 @@ type GetEmailStatsByMailboxProviderData = {
5908
6558
  /**
5909
6559
  * Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
5910
6560
  */
5911
- trend_grain?: "daily" | "hourly";
6561
+ trend_grain?: StatsTrendGrain;
5912
6562
  };
5913
6563
  url: "/v1/email/stats/mailbox-providers";
5914
6564
  };
@@ -5950,7 +6600,7 @@ type GetEmailStatsByMailboxProviderRegionData = {
5950
6600
  /**
5951
6601
  * Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
5952
6602
  */
5953
- trend_grain?: "daily" | "hourly";
6603
+ trend_grain?: StatsTrendGrain;
5954
6604
  };
5955
6605
  url: "/v1/email/stats/mailbox-provider-regions";
5956
6606
  };
@@ -5992,7 +6642,7 @@ type GetEmailStatsByRecipientDomainData = {
5992
6642
  /**
5993
6643
  * Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
5994
6644
  */
5995
- trend_grain?: "daily" | "hourly";
6645
+ trend_grain?: StatsTrendGrain;
5996
6646
  };
5997
6647
  url: "/v1/email/stats/recipient-domains";
5998
6648
  };
@@ -6034,7 +6684,7 @@ type GetEmailStatsByTemplateData = {
6034
6684
  /**
6035
6685
  * Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
6036
6686
  */
6037
- trend_grain?: "daily" | "hourly";
6687
+ trend_grain?: StatsTrendGrain;
6038
6688
  };
6039
6689
  url: "/v1/email/stats/templates";
6040
6690
  };
@@ -6213,7 +6863,7 @@ type GetEmailStatsByBroadcastData = {
6213
6863
  /**
6214
6864
  * Bucket grain for the `trend` series. Has no effect on this breakdown, where `include_trend` is not available.
6215
6865
  */
6216
- trend_grain?: "daily" | "hourly";
6866
+ trend_grain?: StatsTrendGrain;
6217
6867
  };
6218
6868
  url: "/v1/email/stats/broadcasts";
6219
6869
  };
@@ -6253,10 +6903,57 @@ type ListDomainsData = {
6253
6903
  };
6254
6904
  url: "/v1/email/domains";
6255
6905
  };
6256
- type ListMailboxesData = {
6257
- body?: never;
6258
- path?: never;
6259
- query?: {
6906
+ type CreateDomainData = {
6907
+ body: DomainCreate;
6908
+ headers?: {
6909
+ /**
6910
+ * 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).
6911
+ * Two distinct 409 errors signal misuse:
6912
+ * - `request_in_progress` (E01004) — the same key is currently being
6913
+ * processed by a concurrent request. Wait briefly and retry; the lock
6914
+ * expires within 30 seconds.
6915
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
6916
+ * against a different request body or method. Generate a new key.
6917
+ *
6918
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
6919
+ *
6920
+ */
6921
+ "Idempotency-Key"?: string;
6922
+ };
6923
+ path?: never;
6924
+ query?: never;
6925
+ url: "/v1/email/domains";
6926
+ };
6927
+ type UpdateDomainData = {
6928
+ body: DomainUpdate;
6929
+ headers?: {
6930
+ /**
6931
+ * 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).
6932
+ * Two distinct 409 errors signal misuse:
6933
+ * - `request_in_progress` (E01004) — the same key is currently being
6934
+ * processed by a concurrent request. Wait briefly and retry; the lock
6935
+ * expires within 30 seconds.
6936
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
6937
+ * against a different request body or method. Generate a new key.
6938
+ *
6939
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
6940
+ *
6941
+ */
6942
+ "Idempotency-Key"?: string;
6943
+ };
6944
+ path: {
6945
+ /**
6946
+ * Domain ID.
6947
+ */
6948
+ domain_id: DomainId;
6949
+ };
6950
+ query?: never;
6951
+ url: "/v1/email/domains/{domain_id}";
6952
+ };
6953
+ type ListMailboxesData = {
6954
+ body?: never;
6955
+ path?: never;
6956
+ query?: {
6260
6957
  /**
6261
6958
  * Filter to the mailbox with exactly this address.
6262
6959
  */
@@ -6292,6 +6989,58 @@ type ListMailboxesData = {
6292
6989
  };
6293
6990
  url: "/v1/email/mailboxes";
6294
6991
  };
6992
+ type CreateMailboxData = {
6993
+ body: MailboxCreate;
6994
+ headers?: {
6995
+ /**
6996
+ * 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).
6997
+ * Two distinct 409 errors signal misuse:
6998
+ * - `request_in_progress` (E01004) — the same key is currently being
6999
+ * processed by a concurrent request. Wait briefly and retry; the lock
7000
+ * expires within 30 seconds.
7001
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
7002
+ * against a different request body or method. Generate a new key.
7003
+ *
7004
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
7005
+ *
7006
+ */
7007
+ "Idempotency-Key"?: string;
7008
+ };
7009
+ path?: never;
7010
+ query?: never;
7011
+ url: "/v1/email/mailboxes";
7012
+ };
7013
+ type UpdateMailboxData = {
7014
+ body: MailboxUpdate;
7015
+ headers?: {
7016
+ /**
7017
+ * 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).
7018
+ * Two distinct 409 errors signal misuse:
7019
+ * - `request_in_progress` (E01004) — the same key is currently being
7020
+ * processed by a concurrent request. Wait briefly and retry; the lock
7021
+ * expires within 30 seconds.
7022
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
7023
+ * against a different request body or method. Generate a new key.
7024
+ *
7025
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
7026
+ *
7027
+ */
7028
+ "Idempotency-Key"?: string;
7029
+ };
7030
+ path: {
7031
+ /**
7032
+ * Mailbox ID.
7033
+ */
7034
+ mailbox_id: MailboxId;
7035
+ };
7036
+ query?: {
7037
+ /**
7038
+ * Required as `true` when lowering `retention_tier`, acknowledging that remembered messages older than the new horizon are deleted.
7039
+ */
7040
+ confirm?: boolean;
7041
+ };
7042
+ url: "/v1/email/mailboxes/{mailbox_id}";
7043
+ };
6295
7044
  type GetMailboxStatsData = {
6296
7045
  body?: never;
6297
7046
  path: {
@@ -6352,6 +7101,32 @@ type ListMailboxReceiveRulesData = {
6352
7101
  };
6353
7102
  url: "/v1/email/mailboxes/{mailbox_id}/receive-rules";
6354
7103
  };
7104
+ type CreateMailboxReceiveRuleData = {
7105
+ body: ReceiveRuleCreate;
7106
+ headers?: {
7107
+ /**
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).
7109
+ * Two distinct 409 errors signal misuse:
7110
+ * - `request_in_progress` (E01004) — the same key is currently being
7111
+ * processed by a concurrent request. Wait briefly and retry; the lock
7112
+ * expires within 30 seconds.
7113
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
7114
+ * against a different request body or method. Generate a new key.
7115
+ *
7116
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
7117
+ *
7118
+ */
7119
+ "Idempotency-Key"?: string;
7120
+ };
7121
+ path: {
7122
+ /**
7123
+ * Mailbox ID.
7124
+ */
7125
+ mailbox_id: MailboxId;
7126
+ };
7127
+ query?: never;
7128
+ url: "/v1/email/mailboxes/{mailbox_id}/receive-rules";
7129
+ };
6355
7130
  type ListEmailThreadsData = {
6356
7131
  body?: never;
6357
7132
  path?: never;
@@ -6403,6 +7178,63 @@ type ListEmailThreadsData = {
6403
7178
  };
6404
7179
  url: "/v1/email/threads";
6405
7180
  };
7181
+ type DeleteEmailThreadData = {
7182
+ body?: never;
7183
+ headers?: {
7184
+ /**
7185
+ * 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).
7186
+ * Two distinct 409 errors signal misuse:
7187
+ * - `request_in_progress` (E01004) — the same key is currently being
7188
+ * processed by a concurrent request. Wait briefly and retry; the lock
7189
+ * expires within 30 seconds.
7190
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
7191
+ * against a different request body or method. Generate a new key.
7192
+ *
7193
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
7194
+ *
7195
+ */
7196
+ "Idempotency-Key"?: string;
7197
+ };
7198
+ path: {
7199
+ /**
7200
+ * Thread ID.
7201
+ */
7202
+ thread_id: ThreadId;
7203
+ };
7204
+ query?: {
7205
+ /**
7206
+ * Permanently delete the conversation and its messages immediately instead of moving them to the trash.
7207
+ */
7208
+ permanent?: boolean;
7209
+ };
7210
+ url: "/v1/email/threads/{thread_id}";
7211
+ };
7212
+ type UpdateEmailThreadData = {
7213
+ body: EmailThreadUpdateRequest;
7214
+ headers?: {
7215
+ /**
7216
+ * 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).
7217
+ * Two distinct 409 errors signal misuse:
7218
+ * - `request_in_progress` (E01004) — the same key is currently being
7219
+ * processed by a concurrent request. Wait briefly and retry; the lock
7220
+ * expires within 30 seconds.
7221
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
7222
+ * against a different request body or method. Generate a new key.
7223
+ *
7224
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
7225
+ *
7226
+ */
7227
+ "Idempotency-Key"?: string;
7228
+ };
7229
+ path: {
7230
+ /**
7231
+ * Thread ID.
7232
+ */
7233
+ thread_id: ThreadId;
7234
+ };
7235
+ query?: never;
7236
+ url: "/v1/email/threads/{thread_id}";
7237
+ };
6406
7238
  type ListEmailThreadMessagesData = {
6407
7239
  body?: never;
6408
7240
  path: {
@@ -6415,7 +7247,7 @@ type ListEmailThreadMessagesData = {
6415
7247
  /**
6416
7248
  * Filter to received (`inbound`) or sent (`outbound`) messages.
6417
7249
  */
6418
- direction?: "inbound" | "outbound";
7250
+ direction?: MessageDirection;
6419
7251
  /**
6420
7252
  * Filter to messages carrying this label. `trash` lists trashed messages; any other label — `archive`, `spam`, `blocked`, `unread`, or a custom label — lists its non-trashed carriers. When omitted, received messages in the inbox and all sent messages are returned.
6421
7253
  *
@@ -6440,6 +7272,36 @@ type ListEmailThreadMessagesData = {
6440
7272
  };
6441
7273
  url: "/v1/email/threads/{thread_id}/messages";
6442
7274
  };
7275
+ type ReplyEmailThreadMessageData = {
7276
+ body: EmailThreadMessageReplyRequest;
7277
+ headers?: {
7278
+ /**
7279
+ * 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).
7280
+ * Two distinct 409 errors signal misuse:
7281
+ * - `request_in_progress` (E01004) — the same key is currently being
7282
+ * processed by a concurrent request. Wait briefly and retry; the lock
7283
+ * expires within 30 seconds.
7284
+ * - `idempotency_key_reuse` (E01005) — the same key has already completed
7285
+ * against a different request body or method. Generate a new key.
7286
+ *
7287
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
7288
+ *
7289
+ */
7290
+ "Idempotency-Key"?: string;
7291
+ };
7292
+ path: {
7293
+ /**
7294
+ * Thread ID.
7295
+ */
7296
+ thread_id: ThreadId;
7297
+ /**
7298
+ * Message ID (`rem_` for a received message, `em_` for a sent one).
7299
+ */
7300
+ message_id: string;
7301
+ };
7302
+ query?: never;
7303
+ url: "/v1/email/threads/{thread_id}/messages/{message_id}/reply";
7304
+ };
6443
7305
  //#endregion
6444
7306
  //#region src/generated/core/auth.gen.d.ts
6445
7307
  type AuthToken = string | undefined;
@@ -6773,6 +7635,37 @@ declare abstract class Resource {
6773
7635
  protected paginated<T>(method: string, options: RequestOptions | undefined, invoke: (ctx: CallContext, cursor: string | undefined) => Promise<FetchOutcome<CursorPage<T>>>): PaginatedPromise<T>;
6774
7636
  }
6775
7637
  //#endregion
7638
+ //#region src/resources/email.gen.d.ts
7639
+ type EmailListQuery$1 = NonNullable<ListEmailMessagesData["query"]>;
7640
+ declare class EmailResourceBase extends Resource {
7641
+ /**
7642
+ * Fetch one email message by id — 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.
7643
+ *
7644
+ * @example
7645
+ * const msg = await bird.email.get("em_abc123");
7646
+ * msg.status; // "accepted" | "processed" | "delivered" | "bounced" | …
7647
+ * msg.delivered_count;
7648
+ * msg.bounced_count;
7649
+ */
7650
+ get(messageId: string, options?: RequestOptions): APIPromise<EmailMessage>;
7651
+ /**
7652
+ * 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) — e.g. for a single UTC day set created_after to that day at 00:00:00Z and created_before to the next day at 00:00:00Z.
7653
+ *
7654
+ * @example
7655
+ * for await (const message of bird.email.list({ status: "bounced" })) {
7656
+ * console.log(message.id);
7657
+ * }
7658
+ */
7659
+ list(query?: EmailListQuery$1, options?: RequestOptions): PaginatedPromise<EmailMessage>;
7660
+ /**
7661
+ * 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.
7662
+ *
7663
+ * @example
7664
+ * await bird.email.cancel("em_abc123");
7665
+ */
7666
+ cancel(messageId: string, options?: RequestOptions): APIPromise<void>;
7667
+ }
7668
+ //#endregion
6776
7669
  //#region src/resources/emailStats.gen.d.ts
6777
7670
  type EmailStatsSummaryQuery = NonNullable<GetEmailStatsSummaryData["query"]>;
6778
7671
  type EmailStatsDailyQuery = NonNullable<GetEmailStatsDailyData["query"]>;
@@ -6992,7 +7885,7 @@ type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
6992
7885
  type DefaultedKeys<D> = D extends object ? Extract<keyof D, keyof EmailSendParams> : never;
6993
7886
  /** `send` params with defaulted fields made optional. */
6994
7887
  type EmailSend<D> = PartialBy<EmailSendParams, DefaultedKeys<D>>;
6995
- declare class EmailResource<D extends EmailChannelDefaults | undefined = undefined> extends Resource {
7888
+ declare class EmailResource<D extends EmailChannelDefaults | undefined = undefined> extends EmailResourceBase {
6996
7889
  #private;
6997
7890
  /** Email statistics — `bird.email.stats.summary(...)`, `.daily(...)`, `.byTag(...)`, … */
6998
7891
  readonly stats: EmailStatsResource;
@@ -7084,251 +7977,201 @@ declare class EmailResource<D extends EmailChannelDefaults | undefined = undefin
7084
7977
  * for (const item of batch.data) console.log(item.id, item.status);
7085
7978
  */
7086
7979
  sendBatch(params: EmailSendBatchParams, options?: RequestOptions): APIPromise<EmailSendBatchResult>;
7087
- /**
7088
- * Fetch a message with aggregate delivery status.
7089
- *
7090
- * @example
7091
- * const msg = await bird.email.get("em_abc123");
7092
- * msg.status; // "accepted" | "processed" | "delivered" | "bounced" | …
7093
- * msg.delivered_count;
7094
- * msg.bounced_count;
7095
- */
7096
- get(messageId: string, options?: RequestOptions): APIPromise<EmailMessage>;
7097
- /**
7098
- * Cancel a message scheduled with `scheduled_at` before it sends. Only a
7099
- * message that is still scheduled can be canceled; one that already started
7100
- * sending — or was previously canceled — rejects with a conflict error.
7101
- * Canceling does not return consumed scheduled-send quota.
7102
- *
7103
- * @example
7104
- * await bird.email.cancel("em_abc123");
7105
- */
7106
- cancel(messageId: string, options?: RequestOptions): APIPromise<void>;
7107
- /**
7108
- * List messages, newest first. `await` resolves the first page; `for await`
7109
- * walks every message across all pages.
7110
- *
7111
- * @example Iterate every message, or take one page
7112
- * for await (const message of bird.email.list({ status: "bounced" })) {
7113
- * console.log(message.id);
7114
- * }
7115
- * const page = await bird.email.list({ limit: 50 }); // page.data, page.next_cursor
7116
- */
7117
- list(query?: EmailListQuery, options?: RequestOptions): PaginatedPromise<EmailMessage>;
7118
7980
  }
7119
7981
  //#endregion
7120
- //#region src/resources/audiences.d.ts
7121
- /** Body for `bird.audiences.create`. */
7122
- type AudienceCreateParams = AudienceCreateRequest;
7123
- /** Body for `bird.audiences.update` — a partial patch. */
7124
- type AudienceUpdateParams = AudienceUpdateRequest;
7125
- /** Body for `bird.audiences.addContacts`. */
7126
- type AudienceAddContactsParams = AudienceContactsAddRequest;
7127
- /** Body for `bird.audiences.removeContacts`. */
7128
- type AudienceRemoveContactsParams = AudienceContactsRemoveRequest;
7129
- /** Filters and cursor params for `bird.audiences.list`. */
7982
+ //#region src/resources/audiences.gen.d.ts
7130
7983
  type AudienceListQuery = NonNullable<ListAudiencesData["query"]>;
7131
- /** Cursor params for `bird.audiences.listContacts`. */
7132
- type AudienceContactsQuery = NonNullable<ListAudienceContactsData["query"]>;
7984
+ type AudienceCreateParams = NonNullable<CreateAudienceData["body"]>;
7985
+ type AudienceUpdateParams = NonNullable<UpdateAudienceData["body"]>;
7986
+ type AudienceListContactsQuery = NonNullable<ListAudienceContactsData["query"]>;
7987
+ type AudienceAddContactsParams = NonNullable<AssignAudienceContactsData["body"]>;
7988
+ type AudienceRemoveContactsParams = NonNullable<UnassignAudienceContactsData["body"]>;
7133
7989
  declare class AudiencesResource extends Resource {
7134
7990
  /**
7135
- * Create an audience.
7136
- *
7137
- * @example Create an audience
7138
- * const audience = await bird.audiences.create({ name: "Newsletter subscribers" });
7139
- * console.log(audience.id); // "aud_…"
7140
- */
7141
- create(params: AudienceCreateParams, options?: RequestOptions): APIPromise<Audience>;
7142
- /**
7143
- * List the workspace's audiences, newest first. `await` resolves the first
7144
- * page; `for await` walks every audience across pages.
7991
+ * List the workspace's audiences as a cursor page, newest first. Filter by name substring with `q`.
7145
7992
  *
7146
- * @example
7993
+ * @example Iterate every audience, or take one page
7147
7994
  * for await (const audience of bird.audiences.list()) {
7148
7995
  * console.log(audience.id, audience.name);
7149
7996
  * }
7150
7997
  */
7151
7998
  list(query?: AudienceListQuery, options?: RequestOptions): PaginatedPromise<Audience>;
7152
7999
  /**
7153
- * Fetch a single audience by id.
8000
+ * Get a single audience by ID: name, description, and type. Members are listed separately with `audiences.list_contacts`.
7154
8001
  *
7155
- * @example
7156
- * const audience = await bird.audiences.get("aud_01krdgeqcxet5s7t44vh8rt9mg");
8002
+ * @example Fetch an audience by id
8003
+ * const audience = await bird.audiences.get("adn_01krdgeqcxet5s7t44vh8rt9mg");
8004
+ * console.log(audience.name);
7157
8005
  */
7158
8006
  get(audienceId: string, options?: RequestOptions): APIPromise<Audience>;
7159
8007
  /**
7160
- * Update an audience. Only the fields you send change.
8008
+ * Create an audience in the workspace. New audiences start empty; add contacts with `audiences.add_contacts` or `contacts.batch`. Only static audiences can be created today.
7161
8009
  *
7162
- * @example
7163
- * await bird.audiences.update("aud_01krdgeqcxet5s7t44vh8rt9mg", { name: "Renamed" });
8010
+ * @example Create an audience
8011
+ * const audience = await bird.audiences.create({ name: "Newsletter subscribers" });
8012
+ * console.log(audience.id); // "adn_…"
7164
8013
  */
7165
- update(audienceId: string, params: AudienceUpdateParams, options?: RequestOptions): APIPromise<Audience>;
8014
+ create(params: AudienceCreateParams, options?: RequestOptions): APIPromise<Audience>;
7166
8015
  /**
7167
- * Delete an audience. Its contacts are unaffected.
8016
+ * Update an audience's name or description. Omitted fields are unchanged; a null description clears it.
7168
8017
  *
7169
- * @example
7170
- * await bird.audiences.delete("aud_01krdgeqcxet5s7t44vh8rt9mg");
8018
+ * @example Rename an audience
8019
+ * await bird.audiences.update("adn_01krdgeqcxet5s7t44vh8rt9mg", { name: "Renamed" });
8020
+ */
8021
+ update(audienceId: string, params?: AudienceUpdateParams, options?: RequestOptions): APIPromise<Audience>;
8022
+ /**
8023
+ * Delete an audience and its memberships; contacts themselves are not deleted. Fails while a broadcast targeting the audience is scheduled, accepted, sending, or canceling.
8024
+ *
8025
+ * @example Delete an audience by id
8026
+ * await bird.audiences.delete("adn_01krdgeqcxet5s7t44vh8rt9mg");
7171
8027
  */
7172
8028
  delete(audienceId: string, options?: RequestOptions): APIPromise<void>;
7173
8029
  /**
7174
- * List the contacts in an audience, newest first. `await` resolves the first
7175
- * page; `for await` walks every member across pages.
8030
+ * List the contacts in a static audience by ID, as a cursor page ordered by when each contact joined (most recent first). Each entry pairs the contact with its join time.
7176
8031
  *
7177
- * @example
7178
- * for await (const member of bird.audiences.listContacts("aud_01krdgeqcxet5s7t44vh8rt9mg")) {
8032
+ * @example Iterate an audience's members
8033
+ * for await (const member of bird.audiences.listContacts("adn_01krdgeqcxet5s7t44vh8rt9mg")) {
7179
8034
  * console.log(member.contact.id, member.joined_at);
7180
8035
  * }
7181
8036
  */
7182
- listContacts(audienceId: string, query?: AudienceContactsQuery, options?: RequestOptions): PaginatedPromise<AudienceMember>;
8037
+ listContacts(audienceId: string, query?: AudienceListContactsQuery, options?: RequestOptions): PaginatedPromise<AudienceMember>;
7183
8038
  /**
7184
- * Add contacts to an audience by id.
8039
+ * Add up to 1,000 existing contacts to a static audience by ID. Fails entirely if any contact ID does not exist.
7185
8040
  *
7186
- * @example
7187
- * await bird.audiences.addContacts("aud_01krdgeqcxet5s7t44vh8rt9mg", {
7188
- * contact_ids: ["con_1", "con_2"],
8041
+ * @example Add contacts to an audience
8042
+ * await bird.audiences.addContacts("adn_01krdgeqcxet5s7t44vh8rt9mg", {
8043
+ * contact_ids: ["con_01krdgeqcxet5s7t44vh8rt9mg"],
7189
8044
  * });
7190
8045
  */
7191
8046
  addContacts(audienceId: string, params: AudienceAddContactsParams, options?: RequestOptions): APIPromise<void>;
7192
8047
  /**
7193
- * Remove a set of contacts from an audience.
8048
+ * Remove up to 1,000 contacts from a static audience by ID. Fails entirely if any contact ID does not exist; contacts are not deleted.
7194
8049
  *
7195
- * @example
7196
- * await bird.audiences.removeContacts("aud_01krdgeqcxet5s7t44vh8rt9mg", {
7197
- * contact_ids: ["con_1", "con_2"],
8050
+ * @example Remove contacts from an audience
8051
+ * await bird.audiences.removeContacts("adn_01krdgeqcxet5s7t44vh8rt9mg", {
8052
+ * contact_ids: ["con_01krdgeqcxet5s7t44vh8rt9mg"],
7198
8053
  * });
7199
8054
  */
7200
8055
  removeContacts(audienceId: string, params: AudienceRemoveContactsParams, options?: RequestOptions): APIPromise<void>;
7201
8056
  /**
7202
- * Remove a single contact from an audience.
8057
+ * Remove one contact's membership from an audience. The contact itself is not deleted and stays a member of any other audiences.
7203
8058
  *
7204
- * @example
7205
- * await bird.audiences.removeContact("aud_01krdgeqcxet5s7t44vh8rt9mg", "con_1");
8059
+ * @example Remove one contact's membership
8060
+ * await bird.audiences.removeContact(
8061
+ * "adn_01krdgeqcxet5s7t44vh8rt9mg",
8062
+ * "con_01krdgeqcxet5s7t44vh8rt9mg",
8063
+ * );
7206
8064
  */
7207
8065
  removeContact(audienceId: string, contactId: string, options?: RequestOptions): APIPromise<void>;
7208
8066
  }
7209
8067
  //#endregion
7210
- //#region src/resources/domains.d.ts
7211
- /** Body for `bird.domains.create`. */
7212
- type DomainCreateParams = DomainCreate;
7213
- /**
7214
- * Body for `bird.domains.update` — a partial patch. Omit a field to leave it
7215
- * unchanged; send `tracking: null` to remove the tracking domain (both tracking
7216
- * toggles must be off first, else the API returns 409).
7217
- */
7218
- type DomainUpdateParams = DomainUpdate;
7219
- /** Filters and cursor params for `bird.domains.list`. */
8068
+ //#region src/resources/domains.gen.d.ts
7220
8069
  type DomainListQuery = NonNullable<ListDomainsData["query"]>;
8070
+ type DomainCreateParams = NonNullable<CreateDomainData["body"]>;
8071
+ type DomainUpdateParams = NonNullable<UpdateDomainData["body"]>;
7221
8072
  declare class DomainsResource extends Resource {
7222
8073
  /**
7223
- * Register a sending domain. Returns it in `pending` with the `dns_records`
7224
- * to publish at your DNS provider; call `verify` once they are in place.
7225
- *
7226
- * @example Register a sending domain
7227
- * const domain = await bird.domains.create({ domain: "mail.acme.com" });
7228
- * console.log(domain.id, domain.status); // "dom_…", "pending"
7229
- */
7230
- create(params: DomainCreateParams, options?: RequestOptions): APIPromise<Domain>;
7231
- /**
7232
- * List the workspace's sending domains, newest first. `await` resolves the
7233
- * first page; `for await` walks every domain across pages.
8074
+ * List the workspace's sending domains with their verification status, as a cursor page.
7234
8075
  *
7235
- * @example
8076
+ * @example Iterate every sending domain
7236
8077
  * for await (const domain of bird.domains.list()) {
7237
8078
  * console.log(domain.id, domain.status);
7238
8079
  * }
7239
8080
  */
7240
8081
  list(query?: DomainListQuery, options?: RequestOptions): PaginatedPromise<Domain>;
7241
8082
  /**
7242
- * Fetch a single sending domain by id, with its DNS records and their
7243
- * per-record verification state.
8083
+ * Fetch one sending domain: verification status and the DNS records with their individual verification states.
7244
8084
  *
7245
- * @example
8085
+ * @example Fetch a sending domain by id
7246
8086
  * const domain = await bird.domains.get("dom_01krdgeqcxet5s7t44vh8rt9mg");
8087
+ * console.log(domain.domain);
7247
8088
  */
7248
8089
  get(domainId: string, options?: RequestOptions): APIPromise<Domain>;
7249
8090
  /**
7250
- * Update a sending domain. Only the fields you send change; `settings` apply
7251
- * immediately, while `return_path`/`tracking`/`dkim` changes are staged until
7252
- * their new DNS records verify.
8091
+ * Register a new sending domain and get the DNS records to publish. Flow: call this, publish the returned DNS records at your DNS provider, then call email_domains_verify (repeat until status is verified — DNS propagation can take minutes to hours).
7253
8092
  *
7254
- * @example
8093
+ * @example Register a sending domain
8094
+ * const domain = await bird.domains.create({ domain: "mail.acme.com" });
8095
+ * console.log(domain.id, domain.status); // "dom_…", "pending"
8096
+ */
8097
+ create(params: DomainCreateParams, options?: RequestOptions): APIPromise<Domain>;
8098
+ /**
8099
+ * Trigger a DNS verification check for a sending domain and return the refreshed domain with per-record results. Safe to repeat while waiting for DNS propagation.
8100
+ *
8101
+ * @example Re-run the DNS verification check
8102
+ * const domain = await bird.domains.verify("dom_01krdgeqcxet5s7t44vh8rt9mg");
8103
+ * console.log(domain.status); // "verified" once DNS is in place
8104
+ */
8105
+ verify(domainId: string, options?: RequestOptions): APIPromise<Domain>;
8106
+ /**
8107
+ * Update a sending domain's tracking and inbound configuration. Tracking: toggle click_tracking and open_tracking (applied immediately to new sends), and set, change, or remove the tracking domain (the name part only — Bird appends the sending domain). Enabling either toggle with no tracking domain configured returns 409; 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: set inbound.enabled to start or stop 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 enabling — not merely publishing them — is what turns receiving on.
8108
+ *
8109
+ * @example Enable tracking on a domain
7255
8110
  * await bird.domains.update("dom_01krdgeqcxet5s7t44vh8rt9mg", {
7256
8111
  * settings: { click_tracking: true, open_tracking: true },
7257
8112
  * tracking: { name: "links" },
7258
8113
  * });
7259
8114
  */
7260
- update(domainId: string, params: DomainUpdateParams, options?: RequestOptions): APIPromise<Domain>;
8115
+ update(domainId: string, params?: DomainUpdateParams, options?: RequestOptions): APIPromise<Domain>;
7261
8116
  /**
7262
- * Delete a sending domain. Mail already accepted still sends; you can no
7263
- * longer send new mail from it.
8117
+ * Delete a sending domain by id. Revokes its sender authorization: new sends from the domain are rejected afterward, while historical statistics and events for past sends are preserved. Destructive.
7264
8118
  *
7265
- * @example
8119
+ * @example Delete a sending domain by id
7266
8120
  * await bird.domains.delete("dom_01krdgeqcxet5s7t44vh8rt9mg");
7267
8121
  */
7268
8122
  delete(domainId: string, options?: RequestOptions): APIPromise<void>;
7269
- /**
7270
- * Trigger a fresh DNS check and return the refreshed domain with per-record
7271
- * results. Safe to repeat while waiting for DNS to propagate.
7272
- *
7273
- * @example
7274
- * const domain = await bird.domains.verify("dom_01krdgeqcxet5s7t44vh8rt9mg");
7275
- * console.log(domain.status); // "verified" once DNS is in place
7276
- */
7277
- verify(domainId: string, options?: RequestOptions): APIPromise<Domain>;
7278
8123
  }
7279
8124
  //#endregion
7280
- //#region src/resources/contactProperties.d.ts
7281
- /** Body for `bird.contactProperties.create`. */
7282
- type ContactPropertyCreateParams = ContactPropertyCreateRequest;
7283
- /** Body for `bird.contactProperties.update` — a partial patch. */
7284
- type ContactPropertyUpdateParams = ContactPropertyUpdateRequest;
7285
- /** Filters and cursor params for `bird.contactProperties.list`. */
8125
+ //#region src/resources/contactProperties.gen.d.ts
7286
8126
  type ContactPropertyListQuery = NonNullable<ListContactPropertiesData["query"]>;
8127
+ type ContactPropertyCreateParams = NonNullable<CreateContactPropertyData["body"]>;
8128
+ type ContactPropertyUpdateParams = NonNullable<UpdateContactPropertyData["body"]>;
7287
8129
  declare class ContactPropertiesResource extends Resource {
7288
8130
  /**
7289
- * Define a contact property. The `key` must be unique in the workspace and is
7290
- * how contacts reference the field in their `data`.
7291
- *
7292
- * @example
7293
- * const prop = await bird.contactProperties.create({ key: "plan", type: "string" });
7294
- * console.log(prop.id); // "cp_…"
7295
- */
7296
- create(params: ContactPropertyCreateParams, options?: RequestOptions): APIPromise<ContactProperty>;
7297
- /**
7298
- * List the workspace's contact properties. `await` resolves the first page;
7299
- * `for await` walks every property across pages.
8131
+ * List the workspace's contact properties as a cursor page, newest first. Archived properties are included, marked by their archived flag.
7300
8132
  *
7301
- * @example
8133
+ * @example Iterate every contact property, or take one page
7302
8134
  * for await (const prop of bird.contactProperties.list()) {
7303
8135
  * console.log(prop.key, prop.type);
7304
8136
  * }
8137
+ * const page = await bird.contactProperties.list({ limit: 50 }); // page.data, page.next_cursor
7305
8138
  */
7306
8139
  list(query?: ContactPropertyListQuery, options?: RequestOptions): PaginatedPromise<ContactProperty>;
7307
8140
  /**
7308
- * Fetch a single contact property by id.
8141
+ * Get a single contact property by ID: key, type, fallback value, and archived state.
7309
8142
  *
7310
- * @example
8143
+ * @example Fetch a contact property by id
7311
8144
  * const prop = await bird.contactProperties.get("cp_01krdgeqcxet5s7t44vh8rt9mg");
8145
+ * console.log(prop.key, prop.type);
7312
8146
  */
7313
8147
  get(propertyId: string, options?: RequestOptions): APIPromise<ContactProperty>;
7314
8148
  /**
7315
- * Update a contact property. Only the fields you send change.
8149
+ * Define a custom contact property (key + value type) that becomes available in contact data and as a broadcast template variable. The key and type cannot change after creation; a workspace holds at most 200 properties, archived included.
7316
8150
  *
7317
- * @example
8151
+ * @example Define a custom property
8152
+ * const prop = await bird.contactProperties.create({ key: "plan", type: "string" });
8153
+ * console.log(prop.id); // "cp_…"
8154
+ */
8155
+ create(params: ContactPropertyCreateParams, options?: RequestOptions): APIPromise<ContactProperty>;
8156
+ /**
8157
+ * Update a contact property's fallback value. The key and type are immutable; create a new property instead.
8158
+ *
8159
+ * @example Change a property's fallback value
7318
8160
  * await bird.contactProperties.update("cp_01krdgeqcxet5s7t44vh8rt9mg", { fallback_value: "free" });
7319
8161
  */
7320
- update(propertyId: string, params: ContactPropertyUpdateParams, options?: RequestOptions): APIPromise<ContactProperty>;
8162
+ update(propertyId: string, params?: ContactPropertyUpdateParams, options?: RequestOptions): APIPromise<ContactProperty>;
7321
8163
  /**
7322
- * Archive a contact property, retiring the field without deleting its data.
8164
+ * Archive a contact property: the key is rejected in new contact writes and stops rendering in templates, while stored values remain readable. The key stays reserved and counts toward the 200-property limit; reverse with `contact_properties.unarchive`.
7323
8165
  *
7324
- * @example
7325
- * await bird.contactProperties.archive("cp_01krdgeqcxet5s7t44vh8rt9mg");
8166
+ * @example Archive a property, retiring the field without deleting its data
8167
+ * const prop = await bird.contactProperties.archive("cp_01krdgeqcxet5s7t44vh8rt9mg");
8168
+ * console.log(prop.key, prop.archived);
7326
8169
  */
7327
8170
  archive(propertyId: string, options?: RequestOptions): APIPromise<ContactProperty>;
7328
8171
  /**
7329
- * Restore an archived contact property.
8172
+ * Reactivate an archived contact property so its key is accepted in contact writes and renders in templates again. Fails with a conflict if the property is not archived.
7330
8173
  *
7331
- * @example
8174
+ * @example Restore an archived property
7332
8175
  * await bird.contactProperties.unarchive("cp_01krdgeqcxet5s7t44vh8rt9mg");
7333
8176
  */
7334
8177
  unarchive(propertyId: string, options?: RequestOptions): APIPromise<ContactProperty>;
@@ -7337,7 +8180,9 @@ declare class ContactPropertiesResource extends Resource {
7337
8180
  //#region src/resources/contacts.gen.d.ts
7338
8181
  type ContactListQuery = NonNullable<ListContactsData["query"]>;
7339
8182
  type ContactCreateParams = NonNullable<CreateContactData["body"]>;
7340
- declare class ContactsResourceBase extends Resource {
8183
+ type ContactUpdateParams = NonNullable<UpdateContactData["body"]>;
8184
+ type ContactBatchParams = NonNullable<CreateContactBatchData["body"]>;
8185
+ declare class ContactsResource extends Resource {
7341
8186
  /**
7342
8187
  * 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.
7343
8188
  *
@@ -7367,6 +8212,16 @@ declare class ContactsResourceBase extends Resource {
7367
8212
  * console.log(contact.id); // "con_…"
7368
8213
  */
7369
8214
  create(params: ContactCreateParams, options?: RequestOptions): APIPromise<Contact>;
8215
+ /**
8216
+ * 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.
8217
+ *
8218
+ * @example Change a contact's fields
8219
+ * const contact = await bird.contacts.update("con_01krdgeqcxet5s7t44vh8rt9mg", {
8220
+ * first_name: "Jane",
8221
+ * });
8222
+ * console.log(contact.first_name);
8223
+ */
8224
+ update(contactId: string, params?: ContactUpdateParams, options?: RequestOptions): APIPromise<Contact>;
7370
8225
  /**
7371
8226
  * Delete a contact and remove it from every audience it belongs to. Suppression records for the address are unaffected.
7372
8227
  *
@@ -7374,33 +8229,40 @@ declare class ContactsResourceBase extends Resource {
7374
8229
  * await bird.contacts.delete("con_01krdgeqcxet5s7t44vh8rt9mg");
7375
8230
  */
7376
8231
  delete(contactId: string, options?: RequestOptions): APIPromise<void>;
8232
+ /**
8233
+ * Create or update up to 1,000 contacts in one request, matched by email address, and optionally add them all to one or more audiences. Per-contact results are returned in submission order.
8234
+ *
8235
+ * @example Create or update many contacts at once, matched by email
8236
+ * const result = await bird.contacts.batch({
8237
+ * contacts: [{ email: "jane@acme.com", first_name: "Jane" }],
8238
+ * });
8239
+ * for (const item of result.data) {
8240
+ * console.log(item.email, item.status);
8241
+ * }
8242
+ */
8243
+ batch(params: ContactBatchParams, options?: RequestOptions): APIPromise<ContactUpsertResult>;
7377
8244
  }
7378
8245
  //#endregion
7379
- //#region src/resources/contacts.d.ts
7380
- /** Body for `bird.contacts.update` — a partial patch. */
7381
- type ContactUpdateParams = ContactUpdateRequest;
7382
- /** Body for `bird.contacts.batch` — create-or-update many contacts in one call. */
7383
- type ContactBatchParams = ContactUpsertRequest;
7384
- declare class ContactsResource extends ContactsResourceBase {
8246
+ //#region src/resources/sms.gen.d.ts
8247
+ type SmsListQuery = NonNullable<ListSmsMessagesData["query"]>;
8248
+ declare class SmsResourceBase extends Resource {
7385
8249
  /**
7386
- * Update a contact. Only the fields you send change.
8250
+ * Get one SMS message by id: its current delivery status, segment breakdown, cost, and failure detail if it failed.
7387
8251
  *
7388
- * @example
7389
- * const contact = await bird.contacts.update("con_01krdgeqcxet5s7t44vh8rt9mg", {
7390
- * first_name: "Jane",
7391
- * });
8252
+ * @example Read a message back
8253
+ * const msg = await bird.sms.get("sms_abc123");
8254
+ * msg.status; // "accepted" | "delivered" | …
7392
8255
  */
7393
- update(contactId: string, params: ContactUpdateParams, options?: RequestOptions): APIPromise<Contact>;
8256
+ get(messageId: string, options?: RequestOptions): APIPromise<SmsMessage>;
7394
8257
  /**
7395
- * Create or update many contacts in one call, matched by email. Returns a
7396
- * per-contact result.
8258
+ * List SMS 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, category, recipient, sender, or tag.
7397
8259
  *
7398
- * @example
7399
- * const result = await bird.contacts.batch({
7400
- * contacts: [{ email: "jane@acme.com", first_name: "Jane" }],
7401
- * });
8260
+ * @example Iterate outbound messages
8261
+ * for await (const msg of bird.sms.list({ direction: "outbound" })) {
8262
+ * console.log(msg.id, msg.status);
8263
+ * }
7402
8264
  */
7403
- batch(params: ContactBatchParams, options?: RequestOptions): APIPromise<ContactUpsertResult>;
8265
+ list(query?: SmsListQuery, options?: RequestOptions): PaginatedPromise<SmsMessage>;
7404
8266
  }
7405
8267
  //#endregion
7406
8268
  //#region src/resources/sms.d.ts
@@ -7411,8 +8273,7 @@ type SmsSendBatchParams = SmsMessageBatchRequest;
7411
8273
  /** Result of `bird.sms.sendBatch`. */
7412
8274
  type SmsSendBatchResult = SmsMessageBatchResponse;
7413
8275
  /** Filters and cursor params for `bird.sms.list`. */
7414
- type SmsListQuery = NonNullable<ListSmsMessagesData["query"]>;
7415
- declare class SmsResource extends Resource {
8276
+ declare class SmsResource extends SmsResourceBase {
7416
8277
  /**
7417
8278
  * Send one SMS to a single recipient. Supply either `text` (with a `category`)
7418
8279
  * or a stored `template` (by `id` or `name`, with its `parameters`). The
@@ -7445,37 +8306,13 @@ declare class SmsResource extends Resource {
7445
8306
  * ]);
7446
8307
  */
7447
8308
  sendBatch(params: SmsSendBatchParams, options?: RequestOptions): APIPromise<SmsSendBatchResult>;
7448
- /**
7449
- * Fetch a single SMS message: its current delivery status, segment breakdown,
7450
- * cost, and failure detail if it failed.
7451
- *
7452
- * @example
7453
- * const msg = await bird.sms.get("sms_abc123");
7454
- * msg.status; // "accepted" | "delivered" | …
7455
- */
7456
- get(messageId: string, options?: RequestOptions): APIPromise<SmsMessage>;
7457
- /**
7458
- * List SMS messages, newest first. `await` resolves the first page; `for await`
7459
- * walks every message across all pages. Filter by direction, status, category,
7460
- * recipient, sender, or tag.
7461
- *
7462
- * @example
7463
- * for await (const msg of bird.sms.list({ direction: "outbound" })) {
7464
- * console.log(msg.id, msg.status);
7465
- * }
7466
- */
7467
- list(query?: SmsListQuery, options?: RequestOptions): PaginatedPromise<SmsMessage>;
7468
8309
  }
7469
8310
  //#endregion
7470
- //#region src/resources/smsTemplates.d.ts
7471
- /** Filters for `bird.smsTemplates.list`. */
8311
+ //#region src/resources/smsTemplates.gen.d.ts
7472
8312
  type SmsTemplateListQuery = NonNullable<ListSmsTemplatesData["query"]>;
7473
8313
  declare class SmsTemplatesResource extends Resource {
7474
8314
  /**
7475
- * List the SMS templates available to the workspace Bird's built-in
7476
- * templates plus any the workspace authored. The catalogue is small and
7477
- * returned in full (`.data`); this list is not paginated. Filter by `scope`,
7478
- * `category`, or `language` (a BCP-47 language tag).
8315
+ * List the SMS templates available to your workspace, including Bird's built-in templates. Filter by scope, category, or language. The catalogue is small and returned in full; this list is not paginated. Use sms_templates_get to read one template's variables before sending with it.
7479
8316
  *
7480
8317
  * @example List the built-in templates
7481
8318
  * const { data } = await bird.smsTemplates.list({ scope: "system" });
@@ -7483,127 +8320,102 @@ declare class SmsTemplatesResource extends Resource {
7483
8320
  */
7484
8321
  list(query?: SmsTemplateListQuery, options?: RequestOptions): APIPromise<SmsTemplateList>;
7485
8322
  /**
7486
- * Fetch a single SMS template by its name or id, including its body and the
7487
- * variables it expects.
8323
+ * Get one SMS template by its name or id, including its body and the variables it expects. Fetch it before sms_send to see which parameter keys a template send requires.
7488
8324
  *
7489
- * @example
8325
+ * @example Read one template by name or id
7490
8326
  * const tpl = await bird.smsTemplates.get("bird_otp_verification");
7491
8327
  * console.log(tpl.body, tpl.variables);
7492
8328
  */
7493
8329
  get(templateRef: string, options?: RequestOptions): APIPromise<SmsTemplate>;
7494
8330
  }
7495
8331
  //#endregion
7496
- //#region src/resources/whatsapp.d.ts
7497
- /** Body for `bird.whatsapp.send` — a template send; Bird picks the sender from the template's category. */
7498
- type WhatsappSendParams = WhatsAppMessageSendRequest;
7499
- /** Filters and cursor params for `bird.whatsapp.list`. */
8332
+ //#region src/resources/whatsapp.gen.d.ts
7500
8333
  type WhatsappListQuery = NonNullable<ListWhatsAppMessagesData["query"]>;
7501
- /** Filter for `bird.whatsapp.listEvents`. */
7502
8334
  type WhatsappListEventsQuery = NonNullable<ListWhatsAppMessageEventsData["query"]>;
7503
- declare class WhatsappResource extends Resource {
8335
+ declare class WhatsappResourceBase extends Resource {
7504
8336
  /**
7505
- * Send a template message. Bird selects the sender number from the
7506
- * template's category, so there is no sender field on the request. The
7507
- * result is `accepted`, not yet delivered — read it back with `get` to
7508
- * confirm.
8337
+ * Get one WhatsApp message by id: current delivery status, sent/delivered/read timestamps, the template it was sent from, and failure detail if it failed. For the per-event timeline use whatsapp_list_events.
7509
8338
  *
7510
- * @example
7511
- * const msg = await bird.whatsapp.send({
7512
- * to: "+15551234567",
7513
- * template: {
7514
- * name: "bird_otp",
7515
- * components: [
7516
- * { type: "body", parameters: [{ type: "text", text: "123456" }] },
7517
- * ],
7518
- * },
7519
- * });
7520
- * console.log(msg.id, msg.status);
7521
- */
7522
- send(params: WhatsappSendParams, options?: RequestOptions): APIPromise<WhatsAppMessage>;
7523
- /**
7524
- * Fetch a single WhatsApp message: its current delivery status and failure
7525
- * detail if it failed.
7526
- *
7527
- * @example
8339
+ * @example Read a message back
7528
8340
  * const msg = await bird.whatsapp.get("wa_abc123");
7529
8341
  * msg.status; // "accepted" | "delivered" | …
7530
8342
  */
7531
8343
  get(messageId: string, options?: RequestOptions): APIPromise<WhatsAppMessage>;
7532
8344
  /**
7533
- * List WhatsApp messages, newest first. `await` resolves the first page;
7534
- * `for await` walks every message across all pages. Filter by status,
7535
- * recipient phone number, or business-scoped user ID.
8345
+ * 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.
7536
8346
  *
7537
- * @example
8347
+ * @example Iterate delivered messages
7538
8348
  * for await (const msg of bird.whatsapp.list({ status: ["delivered"] })) {
7539
8349
  * console.log(msg.id, msg.status);
7540
8350
  * }
7541
8351
  */
7542
8352
  list(query?: WhatsappListQuery, options?: RequestOptions): PaginatedPromise<WhatsAppMessage>;
7543
8353
  /**
7544
- * List a WhatsApp message's lifecycle event timeline, in chronological
7545
- * order. The timeline is bounded and returned in full — this list is not
7546
- * paginated.
8354
+ * Get one WhatsApp message's delivery timeline, oldest first: whatsapp.accepted, whatsapp.sent, whatsapp.delivered, whatsapp.read, and whatsapp.failed events, with failure detail on failed events. Not paginated; an unknown message id is a 404. Use whatsapp_get for the condensed current status.
7547
8355
  *
7548
- * @example
8356
+ * @example Read one message's delivery timeline
7549
8357
  * const { data } = await bird.whatsapp.listEvents("wa_abc123");
7550
8358
  * for (const event of data) console.log(event.type, event.occurred_at);
7551
8359
  */
7552
8360
  listEvents(messageId: string, query?: WhatsappListEventsQuery, options?: RequestOptions): APIPromise<WhatsAppEventList>;
7553
8361
  }
7554
8362
  //#endregion
7555
- //#region src/resources/whatsappTemplates.d.ts
7556
- declare class WhatsappTemplatesResource extends Resource {
8363
+ //#region src/resources/whatsapp.d.ts
8364
+ /** Body for `bird.whatsapp.send` a template send; Bird picks the sender from the template's category. */
8365
+ type WhatsappSendParams = WhatsAppMessageSendRequest;
8366
+ declare class WhatsappResource extends WhatsappResourceBase {
7557
8367
  /**
7558
- * List the WhatsApp message templates available to the workspace Meta's
7559
- * approved templates for this business account. The catalogue is small and
7560
- * returned in full (`.data`); this list is not paginated.
8368
+ * Send a template message. Bird selects the sender number from the
8369
+ * template's category, so there is no sender field on the request. The
8370
+ * result is `accepted`, not yet delivered read it back with `get` to
8371
+ * confirm.
7561
8372
  *
7562
8373
  * @example
7563
- * const { data } = await bird.whatsappTemplates.list();
7564
- * for (const tpl of data) console.log(tpl.name, tpl.status);
8374
+ * const msg = await bird.whatsapp.send({
8375
+ * to: "+15551234567",
8376
+ * template: {
8377
+ * name: "bird_otp",
8378
+ * components: [
8379
+ * { type: "body", parameters: [{ type: "text", text: "123456" }] },
8380
+ * ],
8381
+ * },
8382
+ * });
8383
+ * console.log(msg.id, msg.status);
7565
8384
  */
7566
- list(options?: RequestOptions): APIPromise<WhatsAppTemplateList>;
8385
+ send(params: WhatsappSendParams, options?: RequestOptions): APIPromise<WhatsAppMessage>;
7567
8386
  }
7568
8387
  //#endregion
7569
- //#region src/resources/verify.d.ts
7570
- /** Body for `bird.verify.verifications.create` — a recipient in `to`, plus optional `options`/`metadata`. */
7571
- type VerificationCreateParams = VerificationCreateRequest;
7572
- /** Body for `bird.verify.verifications.check` the recipient in `to` and the submitted `code`. */
7573
- type VerificationCheckParams = VerificationCheckRequest;
7574
- declare class VerificationsResource extends Resource {
7575
- /**
7576
- * Start a verification and send a one-time passcode to the recipient in `to`
7577
- * (a `phone_number` over SMS, an `email_address` over email, or both). Calling
7578
- * again for the same recipient re-sends the code after the cooldown rather than
7579
- * starting a second verification. The passcode is never returned — submit the
7580
- * recipient's entry with `check`.
7581
- *
7582
- * @example Start over SMS
8388
+ //#region src/resources/verifyVerifications.gen.d.ts
8389
+ type VerifyVerificationsCreateParams = NonNullable<CreateVerificationData["body"]>;
8390
+ type VerifyVerificationsCheckParams = NonNullable<CreateVerificationCheckData["body"]>;
8391
+ declare class VerifyVerificationsResource extends Resource {
8392
+ /**
8393
+ * Start a verification: generate a one-time passcode and send it to the recipient in `to` (a phone number over SMS, an email address over email, or both; with both, it is sent over one channel and fails over to the other, not to both at once). Calling again for the same recipient reuses the in-progress verification and sends a fresh code after the resend cooldown; it does not start a second one, so use this both to send and to resend. The passcode is never returned; submit what the recipient enters with verify_verifications_check. SMS delivery draws on the workspace's SMS balance.
8394
+ *
8395
+ * @example Start a verification over SMS
7583
8396
  * const verification = await bird.verify.verifications.create({
7584
8397
  * to: { phone_number: "+15551234567" },
7585
8398
  * });
7586
8399
  * console.log(verification.id, verification.status);
7587
8400
  */
7588
- create(params: VerificationCreateParams, options?: RequestOptions): APIPromise<Verification>;
8401
+ create(params: VerifyVerificationsCreateParams, options?: RequestOptions): APIPromise<Verification>;
7589
8402
  /**
7590
- * Check a passcode the recipient submitted. Identify the verification by the same
7591
- * `to` recipient used to start it — no id needed. A wrong or expired code resolves
7592
- * with `success: false` and a `reason`, not an error; a verification already
7593
- * resolved is no longer checkable and returns a 404 error.
8403
+ * Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification id needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`), not an error. A verification that has already reached a final state is no longer checkable and returns 404, as does a missing verification; malformed input or rate limiting is also an error status.
7594
8404
  *
7595
- * @example
8405
+ * @example Check a submitted passcode
7596
8406
  * const result = await bird.verify.verifications.check({
7597
8407
  * to: { phone_number: "+15551234567" },
7598
8408
  * code: "123456",
7599
8409
  * });
7600
8410
  * console.log(result.success);
7601
8411
  */
7602
- check(params: VerificationCheckParams, options?: RequestOptions): APIPromise<VerificationCheckResult>;
8412
+ check(params: VerifyVerificationsCheckParams, options?: RequestOptions): APIPromise<VerificationCheckResult>;
7603
8413
  }
8414
+ //#endregion
8415
+ //#region src/resources/verify.d.ts
7604
8416
  /** The Verify product namespace — holds the `verifications` collection. */
7605
8417
  declare class VerifyResource {
7606
- readonly verifications: VerificationsResource;
8418
+ readonly verifications: VerifyVerificationsResource;
7607
8419
  constructor(...args: ConstructorParameters<typeof Resource>);
7608
8420
  }
7609
8421
  //#endregion
@@ -7661,24 +8473,24 @@ declare class WebhooksResource {
7661
8473
  unwrap(payload: string, headers: WebhookHeaders, options?: WebhookOptions): BirdWebhookEvent;
7662
8474
  }
7663
8475
  //#endregion
7664
- //#region src/resources/mailbox.d.ts
7665
- /** Parameters for creating a mailbox. */
7666
- type MailboxCreateParams = MailboxCreate;
7667
- /** Partial update for a mailbox; omitted fields are unchanged. */
7668
- type MailboxUpdateParams = MailboxUpdate;
7669
- /** Filters for `bird.mailbox.list`. */
8476
+ //#region src/resources/mailbox.gen.d.ts
7670
8477
  type MailboxListQuery = NonNullable<ListMailboxesData["query"]>;
7671
- /** Stats query parameters. */
8478
+ type MailboxCreateParams = NonNullable<CreateMailboxData["body"]>;
8479
+ type MailboxUpdateParams = NonNullable<UpdateMailboxData["body"]>;
8480
+ type MailboxUpdateQuery = NonNullable<UpdateMailboxData["query"]>;
7672
8481
  type MailboxStatsQuery = NonNullable<GetMailboxStatsData["query"]>;
7673
- /** Parameters for composing a new message from a mailbox. */
7674
- type MailboxComposeParams = EmailMailboxComposeRequest;
7675
- /** Parameters for creating a receive rule. */
7676
- type MailboxReceiveRuleCreateParams = ReceiveRuleCreate;
7677
- /** Filters for `bird.mailboxReceiveRule.list`. */
7678
- type MailboxReceiveRuleListQuery = NonNullable<ListMailboxReceiveRulesData["query"]>;
7679
- declare class MailboxResource extends Resource {
8482
+ declare class MailboxResourceBase extends Resource {
8483
+ /**
8484
+ * 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.
8485
+ *
8486
+ * @example List mailboxes
8487
+ * for await (const mailbox of bird.mailbox.list()) {
8488
+ * console.log(mailbox.address);
8489
+ * }
8490
+ */
8491
+ list(query?: MailboxListQuery, options?: RequestOptions): PaginatedPromise<Mailbox>;
7680
8492
  /**
7681
- * Create a mailbox. Omit `local_part` to auto-generate a handle on inbox.ai.
8493
+ * Create a mailbox a durable agent identity that owns an email address, groups mail into threads, and remembers conversations for its retention tier.
7682
8494
  *
7683
8495
  * @example Create a mailbox
7684
8496
  * const mailbox = await bird.mailbox.create({ display_name: "Support" });
@@ -7686,49 +8498,64 @@ declare class MailboxResource extends Resource {
7686
8498
  */
7687
8499
  create(params?: MailboxCreateParams, options?: RequestOptions): APIPromise<Mailbox>;
7688
8500
  /**
7689
- * Get a mailbox by id.
7690
- *
7691
8501
  * @example Get a mailbox
7692
8502
  * const mailbox = await bird.mailbox.get("mbx_01abc");
7693
8503
  * console.log(mailbox.state); // "active"
7694
8504
  */
7695
8505
  get(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
7696
8506
  /**
7697
- * Update a mailbox. Only the fields you provide change.
8507
+ * Update a mailbox's display name, reply-to, receive policy, retention tier, contact, or metadata. Lowering the retention tier onto remembered messages older than the new horizon requires confirm=true.
7698
8508
  *
7699
- * @example Update receive policy
7700
- * const mailbox = await bird.mailbox.update("mbx_01abc", { receive_policy: "open" });
8509
+ * @example Change a mailbox's receive policy
8510
+ * const mailbox = await bird.mailbox.update("mbx_01abc", {
8511
+ * receive_policy: "open",
8512
+ * });
8513
+ * console.log(mailbox.id, mailbox.receive_policy);
7701
8514
  */
7702
- update(mailboxId: string, params: MailboxUpdateParams, options?: RequestOptions): APIPromise<Mailbox>;
8515
+ update(mailboxId: string, params?: MailboxUpdateParams, query?: MailboxUpdateQuery, options?: RequestOptions): APIPromise<Mailbox>;
7703
8516
  /**
7704
- * Soft-delete a mailbox. It can be restored within 30 days.
8517
+ * Delete a mailbox. The address stops receiving immediately and is quarantined; the mailbox and its remembered messages stay restorable for 30 days via the restore endpoint, then are permanently deleted.
7705
8518
  *
7706
8519
  * @example Delete a mailbox
7707
8520
  * await bird.mailbox.delete("mbx_01abc");
7708
8521
  */
7709
8522
  delete(mailboxId: string, options?: RequestOptions): APIPromise<void>;
7710
8523
  /**
7711
- * Restore a deleted mailbox within its 30-day window.
8524
+ * Restore a mailbox deleted less than 30 days ago: the address starts receiving again and the remembered messages are back. Past the window the mailbox is permanently deleted and returns 404; a mailbox that is not deleted returns 409.
7712
8525
  *
7713
- * @example Restore a mailbox
8526
+ * @example Restore a deleted mailbox
7714
8527
  * const mailbox = await bird.mailbox.restore("mbx_01abc");
8528
+ * console.log(mailbox.deleted_at); // null
7715
8529
  */
7716
8530
  restore(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
7717
8531
  /**
7718
- * Reactivate a suspended mailbox.
8532
+ * Reactivate a suspended mailbox so it can send and receive again and its threads become visible. Fails if your plan does not have room for another active mailbox (or another custom inbox.ai handle); delete an active mailbox or upgrade first. A mailbox that is not suspended returns 409.
7719
8533
  *
7720
- * @example Resume a mailbox
8534
+ * @example Resume a suspended mailbox
7721
8535
  * const mailbox = await bird.mailbox.resume("mbx_01abc");
8536
+ * console.log(mailbox.state); // "active"
7722
8537
  */
7723
8538
  resume(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
7724
8539
  /**
7725
- * Get email activity statistics for a mailbox.
7726
- *
7727
8540
  * @example Get mailbox stats
7728
8541
  * const stats = await bird.mailbox.stats("mbx_01abc");
7729
8542
  * console.log(stats.summary?.sends_accepted);
7730
8543
  */
7731
8544
  stats(mailboxId: string, query?: MailboxStatsQuery, options?: RequestOptions): APIPromise<MailboxStatsResponse>;
8545
+ /**
8546
+ * List the labels available in a mailbox: the built-in system labels (inbox, archive, spam, blocked, sent, trash, unread) plus every custom label in use.
8547
+ *
8548
+ * @example List a mailbox's labels
8549
+ * const labels = await bird.mailbox.labels("mbx_01abc");
8550
+ * console.log(labels.data.map((label) => label.name));
8551
+ */
8552
+ labels(mailboxId: string, options?: RequestOptions): APIPromise<EmailMailboxLabelList>;
8553
+ }
8554
+ //#endregion
8555
+ //#region src/resources/mailbox.d.ts
8556
+ /** Parameters for composing a new message from a mailbox. */
8557
+ type MailboxComposeParams = EmailMailboxComposeRequest;
8558
+ declare class MailboxResource extends MailboxResourceBase {
7732
8559
  /**
7733
8560
  * Send a new email from this mailbox, starting a new conversation.
7734
8561
  *
@@ -7740,104 +8567,97 @@ declare class MailboxResource extends Resource {
7740
8567
  * });
7741
8568
  */
7742
8569
  compose(mailboxId: string, params: MailboxComposeParams, options?: RequestOptions): APIPromise<EmailThreadMessage>;
8570
+ }
8571
+ //#endregion
8572
+ //#region src/resources/mailboxReceiveRule.gen.d.ts
8573
+ type MailboxReceiveRuleListQuery = NonNullable<ListMailboxReceiveRulesData["query"]>;
8574
+ type MailboxReceiveRuleCreateParams = NonNullable<CreateMailboxReceiveRuleData["body"]>;
8575
+ declare class MailboxReceiveRuleResource extends Resource {
7743
8576
  /**
7744
- * List labels available in a mailbox.
7745
- *
7746
- * @example List labels
7747
- * const labels = await bird.mailbox.labels("mbx_01abc");
7748
- * console.log(labels.data.map(l => l.name));
7749
- */
7750
- labels(mailboxId: string, options?: RequestOptions): APIPromise<EmailMailboxLabelList>;
7751
- /**
7752
- * List mailboxes in the workspace. `await` resolves the first page;
7753
- * `for await` walks every mailbox.
8577
+ * List a mailbox's allow/block receive rules as a cursor page, oldest first. Filter by action.
7754
8578
  *
7755
- * @example List mailboxes
7756
- * for await (const mailbox of bird.mailbox.list()) {
7757
- * console.log(mailbox.address);
8579
+ * @example List a mailbox's receive rules
8580
+ * for await (const rule of bird.mailboxReceiveRule.list("mbx_01abc")) {
8581
+ * console.log(rule.action, rule.entry);
7758
8582
  * }
7759
8583
  */
7760
- list(query?: MailboxListQuery, options?: RequestOptions): PaginatedPromise<Mailbox>;
7761
- }
7762
- declare class MailboxReceiveRuleResource extends Resource {
8584
+ list(mailboxId: string, query?: MailboxReceiveRuleListQuery, options?: RequestOptions): PaginatedPromise<ReceiveRule>;
7763
8585
  /**
7764
- * Add an allow or block rule to a mailbox. Block rules always win.
8586
+ * Add an allow or block rule for a sender address or domain to a mailbox. Block always wins; up to 200 rules per mailbox.
7765
8587
  *
7766
8588
  * @example Block a domain
7767
8589
  * const rule = await bird.mailboxReceiveRule.create("mbx_01abc", {
7768
8590
  * action: "block",
7769
8591
  * entry: "spam.example.com",
7770
8592
  * });
8593
+ * console.log(rule.id);
7771
8594
  */
7772
8595
  create(mailboxId: string, params: MailboxReceiveRuleCreateParams, options?: RequestOptions): APIPromise<ReceiveRule>;
7773
8596
  /**
7774
- * Remove a receive rule.
8597
+ * Remove a receive rule from a mailbox. Delete-and-recreate is how an entry's action is flipped.
7775
8598
  *
7776
8599
  * @example Delete a rule
7777
8600
  * await bird.mailboxReceiveRule.delete("mbx_01abc", "erl_01xyz");
7778
8601
  */
7779
8602
  delete(mailboxId: string, ruleId: string, options?: RequestOptions): APIPromise<void>;
7780
- /**
7781
- * List receive rules for a mailbox.
7782
- *
7783
- * @example List rules
7784
- * for await (const rule of bird.mailboxReceiveRule.list("mbx_01abc")) {
7785
- * console.log(rule.action, rule.entry);
7786
- * }
7787
- */
7788
- list(mailboxId: string, query?: MailboxReceiveRuleListQuery, options?: RequestOptions): PaginatedPromise<ReceiveRule>;
7789
8603
  }
7790
8604
  //#endregion
7791
- //#region src/resources/mailboxThread.d.ts
7792
- /** Partial update for a thread — add/remove labels, link/unlink a contact. */
7793
- type MailboxThreadUpdateParams = EmailThreadUpdateRequest;
7794
- /** Filters for `bird.mailboxThread.list`. */
8605
+ //#region src/resources/mailboxThread.gen.d.ts
7795
8606
  type MailboxThreadListQuery = NonNullable<ListEmailThreadsData["query"]>;
7796
- /** Parameters for `bird.mailboxThreadMessage.reply`. */
7797
- type MailboxThreadMessageReplyParams = EmailThreadMessageReplyRequest;
7798
- /** Filters for `bird.mailboxThreadMessage.list`. */
7799
- type MailboxThreadMessageListQuery = NonNullable<ListEmailThreadMessagesData["query"]>;
8607
+ type MailboxThreadUpdateParams = NonNullable<UpdateEmailThreadData["body"]>;
8608
+ type MailboxThreadDeleteQuery = NonNullable<DeleteEmailThreadData["query"]>;
7800
8609
  declare class MailboxThreadResource extends Resource {
7801
8610
  /**
7802
- * Get a conversation thread.
8611
+ * 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.
8612
+ *
8613
+ * @example List conversation threads
8614
+ * for await (const thread of bird.mailboxThread.list({ mailbox_id: "mbx_01abc" })) {
8615
+ * console.log(thread.id, thread.subject);
8616
+ * }
8617
+ */
8618
+ list(query?: MailboxThreadListQuery, options?: RequestOptions): PaginatedPromise<EmailThread>;
8619
+ /**
8620
+ * Get one conversation: participants, counts, labels, read state. Fetch its messages with the thread messages endpoint.
7803
8621
  *
7804
8622
  * @example Get a thread
7805
8623
  * const thread = await bird.mailboxThread.get("thr_01abc");
7806
- * console.log(thread.message_count);
8624
+ * console.log(thread.subject);
7807
8625
  */
7808
8626
  get(threadId: string, options?: RequestOptions): APIPromise<EmailThread>;
7809
8627
  /**
7810
- * Apply label changes or contact link changes to a thread.
8628
+ * Add or remove labels on a conversation adding `spam` files it as spam, adding `archive` clears it out of the inbox, adding `inbox` brings it back — or link/unlink a contact.
7811
8629
  *
7812
- * @example Archive a thread
8630
+ * @example Apply label changes to a thread
7813
8631
  * const thread = await bird.mailboxThread.update("thr_01abc", {
7814
8632
  * labels: { add: ["archive"] },
7815
8633
  * });
8634
+ * console.log(thread.id);
7816
8635
  */
7817
- update(threadId: string, params: MailboxThreadUpdateParams, options?: RequestOptions): APIPromise<EmailThread>;
8636
+ update(threadId: string, params?: MailboxThreadUpdateParams, options?: RequestOptions): APIPromise<EmailThread>;
7818
8637
  /**
7819
- * Move a thread to trash. Pass `query.permanent = true` to delete immediately.
8638
+ * Move a conversation and all its messages to trash (purged after 30 days), or delete permanently with ?permanent=true.
7820
8639
  *
7821
8640
  * @example Delete a thread
7822
- * await bird.mailboxThread.delete("thr_01abc");
8641
+ * await bird.mailboxThread.delete("thr_01abc", { permanent: true });
7823
8642
  */
7824
- delete(threadId: string, query?: {
7825
- permanent?: boolean;
7826
- }, options?: RequestOptions): APIPromise<void>;
8643
+ delete(threadId: string, query?: MailboxThreadDeleteQuery, options?: RequestOptions): APIPromise<void>;
8644
+ }
8645
+ //#endregion
8646
+ //#region src/resources/mailboxThreadMessage.gen.d.ts
8647
+ type MailboxThreadMessageListQuery = NonNullable<ListEmailThreadMessagesData["query"]>;
8648
+ type MailboxThreadMessageReplyParams = NonNullable<ReplyEmailThreadMessageData["body"]>;
8649
+ declare class MailboxThreadMessageResource extends Resource {
7827
8650
  /**
7828
- * List threads across the workspace's mailboxes. `await` resolves the first
7829
- * page; `for await` walks every thread.
8651
+ * List the messages in a conversation newest first, both directions. Page older messages with starting_after, and pass include=extracted_text to inline each message's durable plain text.
7830
8652
  *
7831
- * @example List threads in the inbox
7832
- * for await (const thread of bird.mailboxThread.list()) {
7833
- * console.log(thread.id, thread.message_count);
8653
+ * @example List a thread's messages
8654
+ * for await (const msg of bird.mailboxThreadMessage.list("thr_01abc")) {
8655
+ * console.log(msg.id, msg.direction);
7834
8656
  * }
7835
8657
  */
7836
- list(query?: MailboxThreadListQuery, options?: RequestOptions): PaginatedPromise<EmailThread>;
7837
- }
7838
- declare class MailboxThreadMessageResource extends Resource {
8658
+ list(threadId: string, query?: MailboxThreadMessageListQuery, options?: RequestOptions): PaginatedPromise<EmailThreadMessage>;
7839
8659
  /**
7840
- * Get metadata for a message (not the body; use `body` for that).
8660
+ * Get one conversation message with its extracted plain text — readable for the mailbox's full retention period, no MIME parsing needed.
7841
8661
  *
7842
8662
  * @example Get a message
7843
8663
  * const msg = await bird.mailboxThreadMessage.get("thr_01abc", "rem_01xyz");
@@ -7845,40 +8665,173 @@ declare class MailboxThreadMessageResource extends Resource {
7845
8665
  */
7846
8666
  get(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessage>;
7847
8667
  /**
7848
- * Get the parsed HTML and plain-text body of a message.
8668
+ * Get the original rendered HTML and plain-text body of a conversation message. Available 30 days; after that use the message's extracted_text.
7849
8669
  *
7850
- * @example Get message body
8670
+ * @example Get a message body
7851
8671
  * const body = await bird.mailboxThreadMessage.body("thr_01abc", "rem_01xyz");
7852
8672
  * console.log(body.text);
7853
8673
  */
7854
8674
  body(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessageBody>;
7855
8675
  /**
7856
- * Reply to a message from the mailbox's own address.
8676
+ * Reply to a specific conversation message from the mailbox's own address. To reply to a conversation, target its newest received message. Recipients, subject, and threading headers are derived automatically.
7857
8677
  *
7858
8678
  * @example Reply to a message
7859
8679
  * const reply = await bird.mailboxThreadMessage.reply("thr_01abc", "rem_01xyz", {
7860
8680
  * text: "Thanks for reaching out!",
7861
8681
  * });
8682
+ * console.log(reply.id);
7862
8683
  */
7863
- reply(threadId: string, messageId: string, params: MailboxThreadMessageReplyParams, options?: RequestOptions): APIPromise<EmailThreadMessage>;
8684
+ reply(threadId: string, messageId: string, params?: MailboxThreadMessageReplyParams, options?: RequestOptions): APIPromise<EmailThreadMessage>;
7864
8685
  /**
7865
- * List the attachment manifest for a message.
8686
+ * List the attachments on a conversation message. Bytes are downloadable for 30 days; the metadata also rides the message's attachment_manifest durably.
7866
8687
  *
7867
- * @example List attachments
8688
+ * @example List a message's attachments
7868
8689
  * const atts = await bird.mailboxThreadMessage.attachments("thr_01abc", "rem_01xyz");
7869
- * console.log(atts.data.map(a => a.filename));
8690
+ * console.log(atts.data.map((a) => a.filename));
7870
8691
  */
7871
8692
  attachments(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessageAttachmentList>;
8693
+ }
8694
+ //#endregion
8695
+ //#region src/resources/realtime.d.ts
8696
+ /** Body for `bird.realtime.publish` — one event to one or more channels. */
8697
+ type RealtimePublishParams = RealtimePublish;
8698
+ /** Body for `bird.realtime.publishBatch` — up to 10 events, one channel each. */
8699
+ type RealtimeBatchPublishParams = RealtimeBatchPublish;
8700
+ /** Query params for `bird.realtime.channels.list`. */
8701
+ type RealtimeChannelsListQuery = NonNullable<ListRealtimeAppChannelsData["query"]>;
8702
+ /** Query params for `bird.realtime.channels.get`. */
8703
+ type RealtimeChannelGetQuery = NonNullable<GetRealtimeAppChannelData["query"]>;
8704
+ /**
8705
+ * Realtime app credentials — `new BirdClient({ realtime: { key, secret } })`.
8706
+ * They come from the app's credentials (shown once at creation) and must belong
8707
+ * to the calling workspace. Any Realtime method takes the same pair in its
8708
+ * trailing options to override the configured one for a single call — the way
8709
+ * to talk to a second app without a second client.
8710
+ */
8711
+ interface RealtimeOptions {
8712
+ /** The Realtime app key, sent as `X-Realtime-Key`. */
8713
+ key?: string;
8714
+ /** The Realtime app secret, sent as `X-Realtime-Secret`. */
8715
+ secret?: string;
8716
+ }
8717
+ /** Per-call options for a Realtime method: the usual request options plus a credential override. */
8718
+ interface RealtimeRequestOptions extends RequestOptions, RealtimeOptions {}
8719
+ /** The resolved credential headers, in wire form. */
8720
+ interface RealtimeAuthHeaders {
8721
+ "X-Realtime-Key": string;
8722
+ "X-Realtime-Secret": string;
8723
+ }
8724
+ declare abstract class RealtimeBase extends Resource {
8725
+ #private;
8726
+ constructor(core: ConstructorParameters<typeof Resource>[0], client: ConstructorParameters<typeof Resource>[1], config?: RealtimeOptions);
7872
8727
  /**
7873
- * List messages in a thread. `await` resolves the first page; `for await`
7874
- * walks every message.
8728
+ * Resolve the app credentials for one call. Called eagerly at the top of each
8729
+ * method so a missing credential throws before the lifecycle starts — never
8730
+ * as a rejected promise after a request is already in flight.
8731
+ */
8732
+ protected auth(options?: RealtimeOptions): RealtimeAuthHeaders;
8733
+ }
8734
+ /**
8735
+ * `bird.realtime.channels` — reads the app's live channel state. Channels exist
8736
+ * implicitly: one appears when the first connection subscribes and vanishes when
8737
+ * the last one leaves, so these report occupancy, never existence.
8738
+ */
8739
+ declare class RealtimeChannelsResource extends RealtimeBase {
8740
+ /**
8741
+ * List the app's currently occupied channels, optionally filtered by name
8742
+ * prefix. The Realtime service returns them all in one response — this is a
8743
+ * point read, not a cursor list, so there is nothing to iterate.
7875
8744
  *
7876
- * @example List messages
7877
- * for await (const msg of bird.mailboxThreadMessage.list("thr_01abc")) {
7878
- * console.log(msg.id, msg.direction);
7879
- * }
8745
+ * @example List the occupied presence channels with their member counts
8746
+ * const { data } = await bird.realtime.channels.list("rap_01krdgeqcxet5s7t44vh8rt9mg", {
8747
+ * prefix: "presence-",
8748
+ * include: ["member_count"],
8749
+ * });
8750
+ * for (const channel of data) console.log(channel.name, channel.member_count);
7880
8751
  */
7881
- list(threadId: string, query?: MailboxThreadMessageListQuery, options?: RequestOptions): PaginatedPromise<EmailThreadMessage>;
8752
+ list(appId: string, query?: RealtimeChannelsListQuery, options?: RealtimeRequestOptions): APIPromise<RealtimeChannelsList>;
8753
+ /**
8754
+ * Read one channel's state. An unknown or never-used name is not an error —
8755
+ * it resolves with `occupied: false`.
8756
+ *
8757
+ * @example Check whether anyone is in a channel
8758
+ * const channel = await bird.realtime.channels.get(
8759
+ * "rap_01krdgeqcxet5s7t44vh8rt9mg",
8760
+ * "presence-lobby",
8761
+ * { include: ["member_count"] },
8762
+ * );
8763
+ * console.log(channel.occupied, channel.member_count);
8764
+ */
8765
+ get(appId: string, channelName: string, query?: RealtimeChannelGetQuery, options?: RealtimeRequestOptions): APIPromise<RealtimeChannelInfo>;
8766
+ /**
8767
+ * List the member ids subscribed to a presence channel. Ids only — the
8768
+ * `member_info` your authorization endpoint attaches is delivered to subscribed
8769
+ * clients over the realtime connection and is not available over REST.
8770
+ *
8771
+ * @example Who is in the lobby
8772
+ * const { members } = await bird.realtime.channels.members(
8773
+ * "rap_01krdgeqcxet5s7t44vh8rt9mg",
8774
+ * "presence-lobby",
8775
+ * );
8776
+ * for (const member of members) console.log(member.member_id);
8777
+ */
8778
+ members(appId: string, channelName: string, options?: RealtimeRequestOptions): APIPromise<RealtimeChannelMembers>;
8779
+ }
8780
+ /** `bird.realtime.members` — acts on a member across all of its connections. */
8781
+ declare class RealtimeMembersResource extends RealtimeBase {
8782
+ /**
8783
+ * Disconnect every active connection a member holds — sign-out, ban, or a
8784
+ * revoked session. Resolves once the disconnect is applied; the member may
8785
+ * reconnect immediately unless your authorization endpoint refuses them.
8786
+ *
8787
+ * @example Kick a member off every connection
8788
+ * await bird.realtime.members.disconnect("rap_01krdgeqcxet5s7t44vh8rt9mg", "user_42");
8789
+ */
8790
+ disconnect(appId: string, memberId: string, options?: RealtimeRequestOptions): APIPromise<void>;
8791
+ }
8792
+ /**
8793
+ * `bird.realtime` — publish events to a Realtime app's channels and inspect its
8794
+ * live state. Every method needs the app's key/secret pair: set it once as
8795
+ * `realtime: { key, secret }` on the client, or pass `{ key, secret }` in a
8796
+ * call's options to reach a different app. Reached as `bird.realtime.*`.
8797
+ */
8798
+ declare class RealtimeResource extends RealtimeBase {
8799
+ /** Channel state — `bird.realtime.channels.list(...)`, `.get(...)`, `.members(...)`. */
8800
+ readonly channels: RealtimeChannelsResource;
8801
+ /** Members — `bird.realtime.members.disconnect(...)`. */
8802
+ readonly members: RealtimeMembersResource;
8803
+ constructor(core: ConstructorParameters<typeof Resource>[0], client: ConstructorParameters<typeof Resource>[1], config?: RealtimeOptions);
8804
+ /**
8805
+ * Publish one event to one or more of the app's channels. Listing several
8806
+ * channels broadcasts the same event to all of them in a single call. Resolves
8807
+ * once the event is accepted — delivery to connected clients is asynchronous.
8808
+ *
8809
+ * Pass `exclude_connection_id` to skip the connection that triggered the
8810
+ * change, so the originating client doesn't echo its own update.
8811
+ *
8812
+ * @example Broadcast an event to a channel
8813
+ * const result = await bird.realtime.publish("rap_01krdgeqcxet5s7t44vh8rt9mg", {
8814
+ * event: "order.updated",
8815
+ * channels: ["orders", "presence-lobby"],
8816
+ * data: { order_id: "ord_123", status: "shipped" },
8817
+ * });
8818
+ * console.log(result.data?.length); // one entry per channel
8819
+ */
8820
+ publish(appId: string, params: RealtimePublishParams, options?: RealtimeRequestOptions): APIPromise<RealtimePublishResult>;
8821
+ /**
8822
+ * Publish up to 10 events in one request, each to a single channel. Use it to
8823
+ * fan different events out at once; to send the *same* event to many channels,
8824
+ * use `publish` with several `channels` instead.
8825
+ *
8826
+ * @example Publish two events in one call
8827
+ * await bird.realtime.publishBatch("rap_01krdgeqcxet5s7t44vh8rt9mg", {
8828
+ * events: [
8829
+ * { event: "order.created", channel: "orders", data: { id: 1 } },
8830
+ * { event: "order.updated", channel: "orders", data: { id: 2 } },
8831
+ * ],
8832
+ * });
8833
+ */
8834
+ publishBatch(appId: string, params: RealtimeBatchPublishParams, options?: RealtimeRequestOptions): APIPromise<RealtimeBatchPublishResult>;
7882
8835
  }
7883
8836
  //#endregion
7884
8837
  //#region src/client.d.ts
@@ -7903,6 +8856,11 @@ interface BirdClientOptions {
7903
8856
  email?: EmailChannelDefaults;
7904
8857
  /** Webhooks config — `secret` is the default used by `bird.webhooks.unwrap`. */
7905
8858
  webhooks?: WebhookOptions;
8859
+ /**
8860
+ * Realtime app credentials. Every `bird.realtime.*` call authenticates to the
8861
+ * Realtime edge with this key/secret pair; a call's options can override it.
8862
+ */
8863
+ realtime?: RealtimeOptions;
7906
8864
  }
7907
8865
  /** A raw request for the `bird.request` escape hatch. */
7908
8866
  interface BirdRequest {
@@ -7962,8 +8920,6 @@ declare class BirdClient<const O extends BirdClientOptions = BirdClientOptions>
7962
8920
  readonly smsTemplates: SmsTemplatesResource;
7963
8921
  /** The WhatsApp channel — `bird.whatsapp.send(...)`, `.get(...)`, `.list(...)`, `.listEvents(...)`. */
7964
8922
  readonly whatsapp: WhatsappResource;
7965
- /** WhatsApp templates — `bird.whatsappTemplates.list(...)`. */
7966
- readonly whatsappTemplates: WhatsappTemplatesResource;
7967
8923
  /** The Verify product — `bird.verify.verifications.create(...)`, `.check(...)`. */
7968
8924
  readonly verify: VerifyResource;
7969
8925
  /** Contacts — `bird.contacts.create(...)`, `.list(...)`, `.get(...)`, `.batch(...)`, … */
@@ -7984,6 +8940,8 @@ declare class BirdClient<const O extends BirdClientOptions = BirdClientOptions>
7984
8940
  readonly mailboxThread: MailboxThreadResource;
7985
8941
  /** Thread messages — `bird.mailboxThreadMessage.list(...)`, `.get(...)`, `.reply(...)`, `.body(...)`, … */
7986
8942
  readonly mailboxThreadMessage: MailboxThreadMessageResource;
8943
+ /** Realtime — `bird.realtime.publish(...)`, `.channels.list(...)`, `.members.disconnect(...)`, … */
8944
+ readonly realtime: RealtimeResource;
7987
8945
  constructor(options: O);
7988
8946
  /**
7989
8947
  * Escape hatch for endpoints the typed resources don't cover. Runs the full
@@ -8037,11 +8995,6 @@ declare const WebhookEventType: {
8037
8995
  readonly EmailScheduled: "email.scheduled";
8038
8996
  readonly EmailSuppressionCreated: "email_suppression.created";
8039
8997
  readonly EmailUnsubscribed: "email.unsubscribed";
8040
- readonly RealtimeCacheChannels: "realtime.cache_channels";
8041
- readonly RealtimeChannelExistence: "realtime.channel_existence";
8042
- readonly RealtimeClientEvents: "realtime.client_events";
8043
- readonly RealtimeConnectionCount: "realtime.connection_count";
8044
- readonly RealtimePresence: "realtime.presence";
8045
8998
  readonly SmsAccepted: "sms.accepted";
8046
8999
  readonly SmsDelivered: "sms.delivered";
8047
9000
  readonly SmsExpired: "sms.expired";
@@ -8053,6 +9006,11 @@ declare const WebhookEventType: {
8053
9006
  readonly SmsTfnVerificationRejected: "sms.tfn_verification.rejected";
8054
9007
  readonly SmsTfnVerificationSubmitted: "sms.tfn_verification.submitted";
8055
9008
  readonly SmsUndelivered: "sms.undelivered";
9009
+ readonly VerifyAttemptDelivered: "verify.attempt.delivered";
9010
+ readonly VerifyAttemptSent: "verify.attempt.sent";
9011
+ readonly VerifyAttemptUndelivered: "verify.attempt.undelivered";
9012
+ readonly VerifyVerificationCreated: "verify.verification.created";
9013
+ readonly VerifyVerificationVerified: "verify.verification.verified";
8056
9014
  readonly VoiceCallAnswered: "voice_call.answered";
8057
9015
  readonly VoiceCallEnded: "voice_call.ended";
8058
9016
  readonly VoiceCallInitiated: "voice_call.initiated";
@@ -8066,5 +9024,5 @@ declare const WebhookEventType: {
8066
9024
  /** A known webhook event type value. */
8067
9025
  type WebhookEventTypeValue = (typeof WebhookEventType)[keyof typeof WebhookEventType];
8068
9026
  //#endregion
8069
- export { type APIPromise, type Audience, type AudienceAddContactsParams, type AudienceContactsQuery, type AudienceCreateParams, 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, type EmailListQuery, type EmailMailboxLabelList, 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 EmailThreadList, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadMessageList, type ErrorDetail, type ErrorNextAction, type Mailbox, type MailboxComposeParams, type MailboxCreateParams, type MailboxList, type MailboxListQuery, type MailboxReceiveRuleCreateParams, type MailboxReceiveRuleListQuery, type MailboxStatsResponse, type MailboxThreadListQuery, type MailboxThreadMessageListQuery, type MailboxThreadMessageReplyParams, type MailboxThreadUpdateParams, type MailboxUpdateParams, type PaginatedPromise, type ReceiveRule, type ReceiveRuleList, type RequestOptions, type SafeResult, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, type UnmetGate, type Verification, type VerificationCheckParams, type VerificationCheckResult, type VerificationCreateParams, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, type WhatsAppEventList, type WhatsAppMessage, type WhatsAppTemplate, type WhatsAppTemplateList, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, baseUrlForRegion, regionFromApiKey };
9027
+ 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, type EmailListQuery, type EmailMailboxLabelList, 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 ErrorDetail, type ErrorNextAction, type Mailbox, type MailboxComposeParams, type MailboxCreateParams, type MailboxListQuery, type MailboxReceiveRuleCreateParams, type MailboxReceiveRuleListQuery, type MailboxStatsResponse, type MailboxThreadDeleteQuery, type MailboxThreadListQuery, type MailboxThreadMessageListQuery, type MailboxThreadMessageReplyParams, type MailboxThreadUpdateParams, type MailboxUpdateParams, type PaginatedPromise, type RealtimeBatchPublishParams, type RealtimeBatchPublishResult, type RealtimeChannelGetQuery, type RealtimeChannelInclude, type RealtimeChannelInfo, type RealtimeChannelListItem, type RealtimeChannelMember, type RealtimeChannelMembers, type RealtimeChannelsList, type RealtimeChannelsListQuery, type RealtimeOptions, type RealtimePublishParams, type RealtimePublishResult, type RealtimeRequestOptions, 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, type VerificationCheckResult, type VerifyVerificationsCheckParams, type VerifyVerificationsCreateParams, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, type WhatsAppEventList, type WhatsAppMessage, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, baseUrlForRegion, regionFromApiKey };
8070
9028
  //# sourceMappingURL=index.d.mts.map