@messagebird/sdk 0.12.2 → 0.15.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/README.md +0 -1
- package/dist/index.d.mts +1499 -745
- package/dist/index.mjs +1127 -845
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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";
|
|
@@ -691,7 +695,7 @@ type EventVerifyVerificationCreated = {
|
|
|
691
695
|
data: EventVerifyVerificationCreatedData;
|
|
692
696
|
};
|
|
693
697
|
/**
|
|
694
|
-
* 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.
|
|
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).
|
|
695
699
|
*/
|
|
696
700
|
type VerificationAttemptFailureReason = string;
|
|
697
701
|
/**
|
|
@@ -2072,20 +2076,6 @@ type Timestamps = {
|
|
|
2072
2076
|
readonly created_at: string;
|
|
2073
2077
|
readonly updated_at: string;
|
|
2074
2078
|
};
|
|
2075
|
-
type ListEnvelope = {
|
|
2076
|
-
/**
|
|
2077
|
-
* Cursor for the next page. Pass back as `starting_after` to advance forward. Null when no next page exists.
|
|
2078
|
-
*/
|
|
2079
|
-
next_cursor: string | null;
|
|
2080
|
-
/**
|
|
2081
|
-
* Cursor for the previous page. Pass back as `ending_before` to step backward. Null when no previous page exists.
|
|
2082
|
-
*/
|
|
2083
|
-
prev_cursor: string | null;
|
|
2084
|
-
/**
|
|
2085
|
-
* 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`.
|
|
2086
|
-
*/
|
|
2087
|
-
refresh_cursor: string | null;
|
|
2088
|
-
};
|
|
2089
2079
|
/**
|
|
2090
2080
|
* The labels available in a mailbox.
|
|
2091
2081
|
*/
|
|
@@ -2156,12 +2146,13 @@ type EmailMailboxComposeRequest = {
|
|
|
2156
2146
|
metadata?: {
|
|
2157
2147
|
[key: string]: unknown;
|
|
2158
2148
|
};
|
|
2159
|
-
|
|
2160
|
-
* Content classification — controls suppression policy. `marketing` blocks on all suppression reasons; `transactional` allows delivery through complaint and unsubscribe suppressions. Default: transactional.
|
|
2161
|
-
*
|
|
2162
|
-
*/
|
|
2163
|
-
category?: "marketing" | "transactional";
|
|
2149
|
+
category?: EmailMessageCategory;
|
|
2164
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";
|
|
2165
2156
|
/**
|
|
2166
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.
|
|
2167
2158
|
* Inline images for `<img src="cid:..."/>` references in the HTML body use the `content_id` field together with `content`.
|
|
@@ -2243,11 +2234,12 @@ type EmailThreadMessageReplyRequest = {
|
|
|
2243
2234
|
metadata?: {
|
|
2244
2235
|
[key: string]: unknown;
|
|
2245
2236
|
};
|
|
2237
|
+
category?: EmailMessageCategory;
|
|
2246
2238
|
/**
|
|
2247
|
-
*
|
|
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.
|
|
2248
2240
|
*
|
|
2249
2241
|
*/
|
|
2250
|
-
|
|
2242
|
+
attachments?: Array<EmailAttachment>;
|
|
2251
2243
|
};
|
|
2252
2244
|
/**
|
|
2253
2245
|
* The attachments on a conversation message.
|
|
@@ -2306,9 +2298,6 @@ type EmailLabelsUpdate = {
|
|
|
2306
2298
|
*/
|
|
2307
2299
|
remove?: Array<string>;
|
|
2308
2300
|
};
|
|
2309
|
-
type EmailThreadMessageList = {
|
|
2310
|
-
data: Array<EmailThreadMessage>;
|
|
2311
|
-
} & ListEnvelope;
|
|
2312
2301
|
/**
|
|
2313
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.
|
|
2314
2303
|
*
|
|
@@ -2462,9 +2451,6 @@ type EmailThreadUpdateRequest = {
|
|
|
2462
2451
|
*/
|
|
2463
2452
|
contact_id?: ContactId | null;
|
|
2464
2453
|
};
|
|
2465
|
-
type EmailThreadList = {
|
|
2466
|
-
data: Array<EmailThread>;
|
|
2467
|
-
} & ListEnvelope;
|
|
2468
2454
|
/**
|
|
2469
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.
|
|
2470
2456
|
*
|
|
@@ -2560,9 +2546,6 @@ type ReceiveRuleCreate = {
|
|
|
2560
2546
|
*/
|
|
2561
2547
|
note?: string;
|
|
2562
2548
|
};
|
|
2563
|
-
type ReceiveRuleList = {
|
|
2564
|
-
data: Array<ReceiveRule>;
|
|
2565
|
-
} & ListEnvelope;
|
|
2566
2549
|
type ReceiveRuleId = string;
|
|
2567
2550
|
/**
|
|
2568
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.
|
|
@@ -2941,9 +2924,6 @@ type MailboxCreate = {
|
|
|
2941
2924
|
[key: string]: unknown;
|
|
2942
2925
|
};
|
|
2943
2926
|
};
|
|
2944
|
-
type MailboxList = {
|
|
2945
|
-
data: Array<Mailbox>;
|
|
2946
|
-
} & ListEnvelope;
|
|
2947
2927
|
type InboundAddressId = string;
|
|
2948
2928
|
/**
|
|
2949
2929
|
* The principal that owns the mailbox. Always the workspace.
|
|
@@ -3042,14 +3022,26 @@ type Mailbox = {
|
|
|
3042
3022
|
*/
|
|
3043
3023
|
type DomainUpdate = {
|
|
3044
3024
|
settings?: DomainSettings;
|
|
3045
|
-
|
|
3025
|
+
/**
|
|
3026
|
+
* Change the return-path name part. Cannot be removed — the return-path is required for sending.
|
|
3027
|
+
*
|
|
3028
|
+
*/
|
|
3029
|
+
return_path?: DomainReturnPathConfig;
|
|
3046
3030
|
/**
|
|
3047
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`.
|
|
3048
3032
|
*
|
|
3049
3033
|
*/
|
|
3050
3034
|
tracking?: DomainTrackingConfig | null;
|
|
3051
|
-
|
|
3052
|
-
|
|
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;
|
|
3053
3045
|
};
|
|
3054
3046
|
/**
|
|
3055
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.
|
|
@@ -3239,11 +3231,31 @@ type DomainCapability = {
|
|
|
3239
3231
|
readonly reason?: string | null;
|
|
3240
3232
|
};
|
|
3241
3233
|
type DomainCapabilities = {
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
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;
|
|
3247
3259
|
};
|
|
3248
3260
|
/**
|
|
3249
3261
|
* Active DKIM signing configuration for the domain.
|
|
@@ -3321,7 +3333,10 @@ type Domain = {
|
|
|
3321
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).
|
|
3322
3334
|
*/
|
|
3323
3335
|
type EmailStatsByBroadcastResponse = {
|
|
3324
|
-
|
|
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;
|
|
3325
3340
|
/**
|
|
3326
3341
|
* Broadcast breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no broadcast messages were active in the period.
|
|
3327
3342
|
*/
|
|
@@ -3409,7 +3424,10 @@ type EmailStatsPeriod = {
|
|
|
3409
3424
|
* Per-complaint-type breakdown for the requested period, ranked by `complained` descending and capped at the requested `limit` (default 50, max 200).
|
|
3410
3425
|
*/
|
|
3411
3426
|
type EmailStatsByComplaintTypeResponse = {
|
|
3412
|
-
|
|
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;
|
|
3413
3431
|
/**
|
|
3414
3432
|
* Complaint-type breakdown rows, ranked by `complained` descending. Empty when no complaints occurred in the period.
|
|
3415
3433
|
*/
|
|
@@ -3438,7 +3456,10 @@ type EmailComplaintTypeStatsPoint = {
|
|
|
3438
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).
|
|
3439
3457
|
*/
|
|
3440
3458
|
type EmailStatsByBounceCodeResponse = {
|
|
3441
|
-
|
|
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;
|
|
3442
3463
|
/**
|
|
3443
3464
|
* Bounce-code breakdown rows, ranked by the `sort` metric (default `bounced`) descending. Empty when no bounces occurred in the period.
|
|
3444
3465
|
*/
|
|
@@ -3499,7 +3520,10 @@ type EmailBounceCodeStatsPoint = {
|
|
|
3499
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).
|
|
3500
3521
|
*/
|
|
3501
3522
|
type EmailStatsByClientResponse = {
|
|
3502
|
-
|
|
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;
|
|
3503
3527
|
/**
|
|
3504
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.
|
|
3505
3529
|
*/
|
|
@@ -3565,7 +3589,10 @@ type EmailClientStatsPoint = {
|
|
|
3565
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).
|
|
3566
3590
|
*/
|
|
3567
3591
|
type EmailStatsByLocationResponse = {
|
|
3568
|
-
|
|
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;
|
|
3569
3596
|
/**
|
|
3570
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.
|
|
3571
3598
|
*/
|
|
@@ -3604,7 +3631,10 @@ type EmailEngagementSortMetric = "opens" | "opens_non_prefetched" | "unique_open
|
|
|
3604
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).
|
|
3605
3632
|
*/
|
|
3606
3633
|
type EmailStatsByTemplateResponse = {
|
|
3607
|
-
|
|
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;
|
|
3608
3638
|
/**
|
|
3609
3639
|
* Template breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no templated messages were active in the period.
|
|
3610
3640
|
*/
|
|
@@ -3636,7 +3666,10 @@ type EmailTemplateStatsPoint = {
|
|
|
3636
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).
|
|
3637
3667
|
*/
|
|
3638
3668
|
type EmailStatsByRecipientDomainResponse = {
|
|
3639
|
-
|
|
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;
|
|
3640
3673
|
/**
|
|
3641
3674
|
* Recipient-domain breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no eligible activity occurred in the period.
|
|
3642
3675
|
*/
|
|
@@ -3667,7 +3700,10 @@ type EmailRecipientDomainStatsPoint = {
|
|
|
3667
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).
|
|
3668
3701
|
*/
|
|
3669
3702
|
type EmailStatsByMailboxProviderRegionResponse = {
|
|
3670
|
-
|
|
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;
|
|
3671
3707
|
/**
|
|
3672
3708
|
* Provider-region breakdown rows, ranked by the `sort` metric (default `delivered`) descending. Empty when no deliveries occurred in the period.
|
|
3673
3709
|
*/
|
|
@@ -3754,7 +3790,10 @@ type EmailMailboxProviderRegionStatsPoint = {
|
|
|
3754
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).
|
|
3755
3791
|
*/
|
|
3756
3792
|
type EmailStatsByMailboxProviderResponse = {
|
|
3757
|
-
|
|
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;
|
|
3758
3797
|
/**
|
|
3759
3798
|
* Mailbox-provider breakdown rows, ranked by the `sort` metric (default `delivered`) descending. Empty when no eligible activity occurred in the period.
|
|
3760
3799
|
*/
|
|
@@ -3791,7 +3830,10 @@ type EmailMailboxProviderSortMetric = "delivered" | "bounced" | "complained" | "
|
|
|
3791
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).
|
|
3792
3831
|
*/
|
|
3793
3832
|
type EmailStatsByCategoryResponse = {
|
|
3794
|
-
|
|
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;
|
|
3795
3837
|
/**
|
|
3796
3838
|
* Category breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no sends occurred in the period.
|
|
3797
3839
|
*/
|
|
@@ -3822,7 +3864,10 @@ type EmailCategoryStatsPoint = {
|
|
|
3822
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).
|
|
3823
3865
|
*/
|
|
3824
3866
|
type EmailStatsBySendingDomainResponse = {
|
|
3825
|
-
|
|
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;
|
|
3826
3871
|
/**
|
|
3827
3872
|
* Sending-domain breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no eligible activity occurred in the period.
|
|
3828
3873
|
*/
|
|
@@ -3853,7 +3898,10 @@ type EmailSendingDomainStatsPoint = {
|
|
|
3853
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).
|
|
3854
3899
|
*/
|
|
3855
3900
|
type EmailStatsBySendingIpResponse = {
|
|
3856
|
-
|
|
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;
|
|
3857
3905
|
/**
|
|
3858
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.
|
|
3859
3907
|
*/
|
|
@@ -3948,7 +3996,10 @@ type EmailSendingIpStatsPoint = {
|
|
|
3948
3996
|
*
|
|
3949
3997
|
*/
|
|
3950
3998
|
type EmailStatsSummary = {
|
|
3951
|
-
|
|
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;
|
|
3952
4003
|
/**
|
|
3953
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).
|
|
3954
4005
|
*/
|
|
@@ -4013,7 +4064,10 @@ type EmailStatsComparisonDelta = {
|
|
|
4013
4064
|
*
|
|
4014
4065
|
*/
|
|
4015
4066
|
type EmailStatsComparison = {
|
|
4016
|
-
|
|
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;
|
|
4017
4071
|
/**
|
|
4018
4072
|
* Distinct email messages accepted in the preceding period, counted at the message level.
|
|
4019
4073
|
*/
|
|
@@ -4046,7 +4100,10 @@ type EmailStatsSummaryPeriod = {
|
|
|
4046
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).
|
|
4047
4101
|
*/
|
|
4048
4102
|
type EmailStatsTagsResponse = {
|
|
4049
|
-
|
|
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;
|
|
4050
4107
|
/**
|
|
4051
4108
|
* Tag breakdown rows, ranked by the `sort` metric (default `processed`) descending. Empty when no tagged sends occurred in the period.
|
|
4052
4109
|
*/
|
|
@@ -4108,123 +4165,6 @@ type EmailStatsPoint = {
|
|
|
4108
4165
|
readonly engagement: EmailEngagementStats;
|
|
4109
4166
|
readonly latency: EmailLatencyStats;
|
|
4110
4167
|
};
|
|
4111
|
-
type WhatsAppTemplateList = {
|
|
4112
|
-
/**
|
|
4113
|
-
* The templates available to your workspace.
|
|
4114
|
-
*/
|
|
4115
|
-
data: Array<WhatsAppTemplate>;
|
|
4116
|
-
};
|
|
4117
|
-
type WhatsAppTemplateButton = {
|
|
4118
|
-
/**
|
|
4119
|
-
* The button's behavior type.
|
|
4120
|
-
*/
|
|
4121
|
-
readonly type: string;
|
|
4122
|
-
/**
|
|
4123
|
-
* How the recipient receives the one-time passcode. Present on authentication-template OTP buttons.
|
|
4124
|
-
*/
|
|
4125
|
-
readonly otp_type?: string;
|
|
4126
|
-
/**
|
|
4127
|
-
* The button's label text.
|
|
4128
|
-
*/
|
|
4129
|
-
readonly text: string;
|
|
4130
|
-
/**
|
|
4131
|
-
* The URL the button opens, with any variable placeholder shown inline. Present on link buttons.
|
|
4132
|
-
*/
|
|
4133
|
-
readonly url?: string;
|
|
4134
|
-
/**
|
|
4135
|
-
* Example values for this button's variables, in placeholder order. Present when the button URL has variables.
|
|
4136
|
-
*/
|
|
4137
|
-
readonly example_parameters?: Array<WhatsAppTemplateExampleParameter>;
|
|
4138
|
-
};
|
|
4139
|
-
/**
|
|
4140
|
-
* 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.
|
|
4141
|
-
*
|
|
4142
|
-
*/
|
|
4143
|
-
type WhatsAppTemplateParameterType = string;
|
|
4144
|
-
type WhatsAppTemplateExampleParameter = {
|
|
4145
|
-
/**
|
|
4146
|
-
* The kind of value this parameter accepts.
|
|
4147
|
-
*/
|
|
4148
|
-
readonly type: WhatsAppTemplateParameterType;
|
|
4149
|
-
/**
|
|
4150
|
-
* An example value for a text parameter. Present when `type` is `text`.
|
|
4151
|
-
*/
|
|
4152
|
-
readonly text?: string;
|
|
4153
|
-
/**
|
|
4154
|
-
* The named placeholder this example fills, for templates that use named parameters. Absent for system templates, which use positional parameters.
|
|
4155
|
-
*/
|
|
4156
|
-
readonly name?: string;
|
|
4157
|
-
};
|
|
4158
|
-
type WhatsAppTemplateComponent = {
|
|
4159
|
-
/**
|
|
4160
|
-
* The content block's type within the template.
|
|
4161
|
-
*/
|
|
4162
|
-
readonly type: string;
|
|
4163
|
-
/**
|
|
4164
|
-
* The block's text content, with any variable placeholders shown inline. Present when the block carries text.
|
|
4165
|
-
*/
|
|
4166
|
-
readonly text?: string;
|
|
4167
|
-
/**
|
|
4168
|
-
* 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.
|
|
4169
|
-
*/
|
|
4170
|
-
readonly example_parameters?: Array<WhatsAppTemplateExampleParameter>;
|
|
4171
|
-
/**
|
|
4172
|
-
* The buttons attached to this block. Present when the block carries buttons.
|
|
4173
|
-
*/
|
|
4174
|
-
readonly buttons?: Array<WhatsAppTemplateButton>;
|
|
4175
|
-
};
|
|
4176
|
-
/**
|
|
4177
|
-
* 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.
|
|
4178
|
-
*
|
|
4179
|
-
*/
|
|
4180
|
-
type WhatsAppTemplateStatus = string;
|
|
4181
|
-
/**
|
|
4182
|
-
* 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.
|
|
4183
|
-
*
|
|
4184
|
-
*/
|
|
4185
|
-
type WhatsAppTemplateCategory = string;
|
|
4186
|
-
/**
|
|
4187
|
-
* Language code of the template variant (for example `en` or `pt_BR`).
|
|
4188
|
-
*/
|
|
4189
|
-
type WhatsAppLanguage = string;
|
|
4190
|
-
/**
|
|
4191
|
-
* Whether the template is a built-in Bird template (`system`) or one your workspace authored (`workspace`).
|
|
4192
|
-
*/
|
|
4193
|
-
type TemplateScope = "system" | "workspace";
|
|
4194
|
-
/**
|
|
4195
|
-
* A WhatsApp template's name — the stable handle used to reference the template when sending. Lowercase letters, numbers, and underscores.
|
|
4196
|
-
*
|
|
4197
|
-
*/
|
|
4198
|
-
type WhatsAppTemplateName = string;
|
|
4199
|
-
type WhatsAppTemplateId = string;
|
|
4200
|
-
type WhatsAppTemplate = {
|
|
4201
|
-
/**
|
|
4202
|
-
* Stable Bird identifier for the template.
|
|
4203
|
-
*/
|
|
4204
|
-
readonly id: WhatsAppTemplateId;
|
|
4205
|
-
/**
|
|
4206
|
-
* The template's stable handle. Pass it as the template reference when sending.
|
|
4207
|
-
*/
|
|
4208
|
-
readonly name: WhatsAppTemplateName;
|
|
4209
|
-
/**
|
|
4210
|
-
* Optional description of the template's purpose. Null when unset.
|
|
4211
|
-
*/
|
|
4212
|
-
readonly description?: string | null;
|
|
4213
|
-
scope: TemplateScope;
|
|
4214
|
-
readonly language: WhatsAppLanguage;
|
|
4215
|
-
/**
|
|
4216
|
-
* Content classification applied to messages sent from this template.
|
|
4217
|
-
*/
|
|
4218
|
-
readonly category: WhatsAppTemplateCategory;
|
|
4219
|
-
/**
|
|
4220
|
-
* The template's review and health status.
|
|
4221
|
-
*/
|
|
4222
|
-
readonly status: WhatsAppTemplateStatus;
|
|
4223
|
-
/**
|
|
4224
|
-
* The content blocks that make up the template, in display order.
|
|
4225
|
-
*/
|
|
4226
|
-
readonly components: Array<WhatsAppTemplateComponent>;
|
|
4227
|
-
};
|
|
4228
4168
|
type WhatsAppEventList = {
|
|
4229
4169
|
/**
|
|
4230
4170
|
* Timeline events for this WhatsApp message, in chronological order. The timeline is bounded and returned in full; this list is not paginated.
|
|
@@ -4275,6 +4215,11 @@ type WhatsAppMessageSendRequest = {
|
|
|
4275
4215
|
[key: string]: unknown;
|
|
4276
4216
|
};
|
|
4277
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;
|
|
4278
4223
|
type WhatsAppMessageTemplateComponentParameter = {
|
|
4279
4224
|
/**
|
|
4280
4225
|
* The kind of value this parameter carries. `text` is the only kind today.
|
|
@@ -4301,6 +4246,15 @@ type WhatsAppMessageTemplateComponent = {
|
|
|
4301
4246
|
*/
|
|
4302
4247
|
parameters?: Array<WhatsAppMessageTemplateComponentParameter>;
|
|
4303
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;
|
|
4304
4258
|
type WhatsAppTemplateSend = {
|
|
4305
4259
|
/**
|
|
4306
4260
|
* The template to send, by its name (for example `bird_otp`).
|
|
@@ -4317,11 +4271,30 @@ type WhatsAppTemplateSend = {
|
|
|
4317
4271
|
*/
|
|
4318
4272
|
components?: Array<WhatsAppMessageTemplateComponent>;
|
|
4319
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
|
+
};
|
|
4320
4288
|
/**
|
|
4321
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).
|
|
4322
4290
|
*
|
|
4323
4291
|
*/
|
|
4324
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;
|
|
4325
4298
|
/**
|
|
4326
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).
|
|
4327
4300
|
*
|
|
@@ -4388,6 +4361,7 @@ type WhatsAppMessage = {
|
|
|
4388
4361
|
* When the message was read by the recipient. Null until then.
|
|
4389
4362
|
*/
|
|
4390
4363
|
readonly read_at?: string | null;
|
|
4364
|
+
cost?: Money | null;
|
|
4391
4365
|
/**
|
|
4392
4366
|
* Structured `{name, value}` filter labels applied to this message.
|
|
4393
4367
|
*/
|
|
@@ -4485,6 +4459,10 @@ type VerificationOptions = {
|
|
|
4485
4459
|
*/
|
|
4486
4460
|
channels?: Array<VerificationChannel>;
|
|
4487
4461
|
};
|
|
4462
|
+
/**
|
|
4463
|
+
* Bucket grain for a stats trend series.
|
|
4464
|
+
*/
|
|
4465
|
+
type StatsTrendGrain = "daily" | "hourly";
|
|
4488
4466
|
type SmsTemplateList = {
|
|
4489
4467
|
/**
|
|
4490
4468
|
* The templates available to your workspace. The catalogue is small and returned in full; this list is not paginated.
|
|
@@ -4520,6 +4498,10 @@ type TemplateVariable = {
|
|
|
4520
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.
|
|
4521
4499
|
*/
|
|
4522
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";
|
|
4523
4505
|
/**
|
|
4524
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.
|
|
4525
4507
|
*
|
|
@@ -4624,10 +4606,6 @@ type SmsCostBreakdown = {
|
|
|
4624
4606
|
*/
|
|
4625
4607
|
carrier_surcharge: string;
|
|
4626
4608
|
};
|
|
4627
|
-
/**
|
|
4628
|
-
* ISO 4217 three-letter currency code.
|
|
4629
|
-
*/
|
|
4630
|
-
type CurrencyCode = string;
|
|
4631
4609
|
/**
|
|
4632
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.
|
|
4633
4611
|
*/
|
|
@@ -4776,7 +4754,7 @@ type SmsMessageSendRequest = unknown & {
|
|
|
4776
4754
|
*/
|
|
4777
4755
|
to: string;
|
|
4778
4756
|
/**
|
|
4779
|
-
* Sender to send from: an E.164 number (`+15557654321`), an alphanumeric sender ID (1-11 letters, digits, or
|
|
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.
|
|
4780
4758
|
*
|
|
4781
4759
|
*/
|
|
4782
4760
|
from?: string;
|
|
@@ -4859,6 +4837,10 @@ type SmsMessageSendRequest = unknown & {
|
|
|
4859
4837
|
*/
|
|
4860
4838
|
track_clicks?: boolean;
|
|
4861
4839
|
};
|
|
4840
|
+
/**
|
|
4841
|
+
* Whether a message was sent from the workspace (`outbound`) or received by it (`inbound`).
|
|
4842
|
+
*/
|
|
4843
|
+
type MessageDirection = "outbound" | "inbound";
|
|
4862
4844
|
type AudienceContactsRemoveRequest = {
|
|
4863
4845
|
/**
|
|
4864
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.
|
|
@@ -4971,15 +4953,16 @@ type ContactPropertyCreateRequest = {
|
|
|
4971
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.
|
|
4972
4954
|
*/
|
|
4973
4955
|
key: string;
|
|
4974
|
-
|
|
4975
|
-
* The value type every contact must use for this property. Cannot be changed after creation.
|
|
4976
|
-
*/
|
|
4977
|
-
type: "string" | "number" | "boolean";
|
|
4956
|
+
type: ContactPropertyType;
|
|
4978
4957
|
/**
|
|
4979
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.
|
|
4980
4959
|
*/
|
|
4981
4960
|
fallback_value?: unknown;
|
|
4982
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";
|
|
4983
4966
|
type ContactPropertyId = string;
|
|
4984
4967
|
type ContactProperty = {
|
|
4985
4968
|
/**
|
|
@@ -4990,10 +4973,7 @@ type ContactProperty = {
|
|
|
4990
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.
|
|
4991
4974
|
*/
|
|
4992
4975
|
key: string;
|
|
4993
|
-
|
|
4994
|
-
* The value type every contact must use for this property. Cannot be changed after creation.
|
|
4995
|
-
*/
|
|
4996
|
-
type: "string" | "number" | "boolean";
|
|
4976
|
+
type: ContactPropertyType;
|
|
4997
4977
|
/**
|
|
4998
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.
|
|
4999
4979
|
*/
|
|
@@ -5146,17 +5126,31 @@ type EmailMessageBatchItem = {
|
|
|
5146
5126
|
*
|
|
5147
5127
|
*/
|
|
5148
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;
|
|
5149
5138
|
type EmailTemplateSend = unknown & {
|
|
5150
5139
|
/**
|
|
5151
5140
|
* The template to send, by its id.
|
|
5152
5141
|
*/
|
|
5153
5142
|
id?: EmailTemplateId;
|
|
5154
5143
|
/**
|
|
5155
|
-
* The template to send, by its
|
|
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`).
|
|
5156
5145
|
*/
|
|
5157
|
-
|
|
5146
|
+
slug?: TemplateSlug;
|
|
5147
|
+
/**
|
|
5148
|
+
* Which of the template's languages to send. Omit it to send the template's default language, unless the template sets `language_source_required`, in which case a send naming no language is rejected. 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;
|
|
5158
5152
|
/**
|
|
5159
|
-
* 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.
|
|
5160
5154
|
*
|
|
5161
5155
|
*/
|
|
5162
5156
|
parameters?: {
|
|
@@ -5242,10 +5236,10 @@ type EmailMessageSendRequest = {
|
|
|
5242
5236
|
*/
|
|
5243
5237
|
ip_pool_id?: string;
|
|
5244
5238
|
/**
|
|
5245
|
-
* Content classification
|
|
5239
|
+
* 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. When you send with `template` and omit this field, the message takes the template's own classification, so a template created as `transactional` sends as transactional. Set this field to classify a single send differently from its template; it always takes precedence. Sends that carry no template and no category are `marketing`.
|
|
5246
5240
|
*
|
|
5247
5241
|
*/
|
|
5248
|
-
category?:
|
|
5242
|
+
category?: EmailMessageCategory;
|
|
5249
5243
|
/**
|
|
5250
5244
|
* Preview feature — threaded replies. Currently unavailable; supplying this field returns `422 UnsupportedEmailFeature`. When generally available, sets In-Reply-To and References headers automatically.
|
|
5251
5245
|
*/
|
|
@@ -5346,14 +5340,11 @@ type EmailMessage = {
|
|
|
5346
5340
|
*/
|
|
5347
5341
|
bcc?: Array<EmailAddress>;
|
|
5348
5342
|
/**
|
|
5349
|
-
*
|
|
5350
|
-
*/
|
|
5351
|
-
subject: string;
|
|
5352
|
-
/**
|
|
5353
|
-
* Content classification. Controls suppression policy — `marketing` blocks on all suppression reasons; `transactional` allows delivery through complaint and unsubscribe suppressions.
|
|
5343
|
+
* The subject line as delivered. For a send that used a template, the stored subject is the template's, so this reports it with the send's `parameters` substituted in, which is what the recipient saw.
|
|
5354
5344
|
*
|
|
5355
5345
|
*/
|
|
5356
|
-
|
|
5346
|
+
subject: string;
|
|
5347
|
+
category: EmailMessageCategory;
|
|
5357
5348
|
/**
|
|
5358
5349
|
* Reply-To addresses, if set on the send. Empty/null when no Reply-To was provided.
|
|
5359
5350
|
*/
|
|
@@ -5425,6 +5416,13 @@ type EmailMessage = {
|
|
|
5425
5416
|
metadata?: {
|
|
5426
5417
|
[key: string]: unknown;
|
|
5427
5418
|
};
|
|
5419
|
+
/**
|
|
5420
|
+
* The substitution values this send supplied, or null for a send that carried its content inline. They are the values applied to `subject` and to the bodies the content endpoint returns, kept so you can see what produced the delivered copy and not only the result.
|
|
5421
|
+
*
|
|
5422
|
+
*/
|
|
5423
|
+
readonly parameters?: {
|
|
5424
|
+
[key: string]: unknown;
|
|
5425
|
+
} | null;
|
|
5428
5426
|
/**
|
|
5429
5427
|
* Attachment metadata for the send. Empty when no attachments were included. Raw content is not echoed; when content storage is enabled, download an attachment by its `id` via the message's attachment endpoint.
|
|
5430
5428
|
*/
|
|
@@ -5458,48 +5456,251 @@ type EmailMessage = {
|
|
|
5458
5456
|
*/
|
|
5459
5457
|
readonly scheduled_at?: string | null;
|
|
5460
5458
|
};
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5459
|
+
/**
|
|
5460
|
+
* The members present on a presence channel.
|
|
5461
|
+
*/
|
|
5462
|
+
type RealtimeChannelMembers = {
|
|
5463
|
+
members: Array<RealtimeChannelMember>;
|
|
5464
|
+
};
|
|
5465
|
+
/**
|
|
5466
|
+
* 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.
|
|
5467
|
+
*/
|
|
5468
|
+
type RealtimeMemberId = string;
|
|
5469
|
+
/**
|
|
5470
|
+
* A member present on a presence channel.
|
|
5471
|
+
*/
|
|
5472
|
+
type RealtimeChannelMember = {
|
|
5473
|
+
member_id: RealtimeMemberId;
|
|
5474
|
+
};
|
|
5475
|
+
type RealtimeChannelInfo = RealtimeChannelCounts & {
|
|
5476
|
+
/**
|
|
5477
|
+
* Whether at least one client is subscribed.
|
|
5478
|
+
*/
|
|
5479
|
+
occupied: boolean;
|
|
5480
|
+
};
|
|
5481
|
+
/**
|
|
5482
|
+
* Per-channel counts, present only when requested via `include` and applicable.
|
|
5483
|
+
*/
|
|
5484
|
+
type RealtimeChannelCounts = {
|
|
5485
|
+
/**
|
|
5486
|
+
* Distinct members (presence channels only; requires include=member_count).
|
|
5487
|
+
*/
|
|
5488
|
+
member_count?: number;
|
|
5489
|
+
/**
|
|
5490
|
+
* 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.
|
|
5491
|
+
*/
|
|
5492
|
+
connection_count?: number;
|
|
5493
|
+
};
|
|
5494
|
+
/**
|
|
5495
|
+
* The app's occupied channels. The Realtime service does not paginate this listing, so all occupied channels are returned in one response.
|
|
5496
|
+
*/
|
|
5497
|
+
type RealtimeChannelsList = {
|
|
5498
|
+
/**
|
|
5499
|
+
* The occupied channels, sorted by name.
|
|
5500
|
+
*/
|
|
5501
|
+
data: Array<RealtimeChannelListItem>;
|
|
5502
|
+
};
|
|
5503
|
+
/**
|
|
5504
|
+
* A Realtime channel name. Only letters, digits, and _ - = @ , . ; Prefix with `private-` or `presence-` for authenticated channels.
|
|
5505
|
+
*/
|
|
5506
|
+
type RealtimeChannelName = string;
|
|
5507
|
+
type RealtimeChannelListItem = RealtimeChannelCounts & {
|
|
5508
|
+
name: RealtimeChannelName;
|
|
5509
|
+
};
|
|
5510
|
+
/**
|
|
5511
|
+
* The result of a Realtime batch publish. The events were accepted for delivery; delivery to connected clients is asynchronous.
|
|
5512
|
+
*
|
|
5513
|
+
*/
|
|
5514
|
+
type RealtimeBatchPublishResult = {
|
|
5515
|
+
/**
|
|
5516
|
+
* 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.
|
|
5517
|
+
*/
|
|
5518
|
+
readonly data?: Array<RealtimeBatchPublishResultItem>;
|
|
5519
|
+
};
|
|
5520
|
+
type RealtimeBatchPublishResultItem = RealtimeChannelCounts & {
|
|
5521
|
+
channel: RealtimeChannelName;
|
|
5522
|
+
};
|
|
5523
|
+
/**
|
|
5524
|
+
* A batch of events, each delivered to a single channel, in one request.
|
|
5525
|
+
*/
|
|
5526
|
+
type RealtimeBatchPublish = {
|
|
5527
|
+
/**
|
|
5528
|
+
* Up to 10 events per batch.
|
|
5529
|
+
*/
|
|
5530
|
+
events: Array<RealtimeBatchEvent>;
|
|
5531
|
+
};
|
|
5532
|
+
/**
|
|
5533
|
+
* A per-channel attribute to include in the response. `member_count` is presence-channels only; `connection_count` requires the app's connection-counting flag.
|
|
5534
|
+
*/
|
|
5535
|
+
type RealtimeChannelInclude = "member_count" | "connection_count";
|
|
5536
|
+
/**
|
|
5537
|
+
* 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.
|
|
5538
|
+
*/
|
|
5539
|
+
type RealtimeExcludeConnectionId = string;
|
|
5540
|
+
/**
|
|
5541
|
+
* Arbitrary JSON payload delivered as the event data — an object, array, or scalar. Cap: 10 KB serialized.
|
|
5542
|
+
*/
|
|
5543
|
+
type RealtimeEventData = unknown;
|
|
5544
|
+
/**
|
|
5545
|
+
* 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.
|
|
5546
|
+
*/
|
|
5547
|
+
type RealtimeEventName = string;
|
|
5548
|
+
/**
|
|
5549
|
+
* One item of a batch publish — a single event to a single channel.
|
|
5550
|
+
*/
|
|
5551
|
+
type RealtimeBatchEvent = {
|
|
5552
|
+
event: RealtimeEventName;
|
|
5553
|
+
channel: RealtimeChannelName;
|
|
5554
|
+
data?: RealtimeEventData;
|
|
5555
|
+
exclude_connection_id?: RealtimeExcludeConnectionId;
|
|
5556
|
+
/**
|
|
5557
|
+
* 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.
|
|
5558
|
+
*/
|
|
5559
|
+
include?: Array<RealtimeChannelInclude>;
|
|
5560
|
+
};
|
|
5561
|
+
/**
|
|
5562
|
+
* The result of a Realtime publish. The event was accepted and fanned out to the requested channels; delivery to connected clients is asynchronous.
|
|
5563
|
+
*
|
|
5564
|
+
*/
|
|
5565
|
+
type RealtimePublishResult = {
|
|
5566
|
+
/**
|
|
5567
|
+
* 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.
|
|
5568
|
+
*/
|
|
5569
|
+
readonly data?: Array<RealtimeChannelListItem>;
|
|
5570
|
+
};
|
|
5571
|
+
/**
|
|
5572
|
+
* 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.
|
|
5573
|
+
*
|
|
5574
|
+
*/
|
|
5575
|
+
type RealtimePublish = {
|
|
5576
|
+
event: RealtimeEventName;
|
|
5577
|
+
/**
|
|
5578
|
+
* The channels to deliver the event to (up to 100 per call). Prefix with `private-` or `presence-` for authenticated channels.
|
|
5579
|
+
*
|
|
5580
|
+
*/
|
|
5581
|
+
channels: Array<RealtimeChannelName>;
|
|
5582
|
+
data?: RealtimeEventData;
|
|
5583
|
+
exclude_connection_id?: RealtimeExcludeConnectionId;
|
|
5584
|
+
/**
|
|
5585
|
+
* 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.
|
|
5586
|
+
*/
|
|
5587
|
+
include?: Array<RealtimeChannelInclude>;
|
|
5588
|
+
};
|
|
5589
|
+
type RealtimeAppId = string;
|
|
5590
|
+
type ListRealtimeAppChannelsData = {
|
|
5591
|
+
body?: never;
|
|
5592
|
+
headers: {
|
|
5593
|
+
/**
|
|
5594
|
+
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
5595
|
+
*/
|
|
5596
|
+
"X-Workspace-Id"?: string;
|
|
5597
|
+
/**
|
|
5598
|
+
* 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.
|
|
5599
|
+
*
|
|
5600
|
+
*/
|
|
5601
|
+
"X-Realtime-Key": string;
|
|
5602
|
+
/**
|
|
5603
|
+
* 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.
|
|
5604
|
+
*
|
|
5605
|
+
*/
|
|
5606
|
+
"X-Realtime-Secret": string;
|
|
5607
|
+
};
|
|
5608
|
+
path: {
|
|
5609
|
+
/**
|
|
5610
|
+
* Realtime app ID
|
|
5611
|
+
*/
|
|
5612
|
+
realtime_app_id: RealtimeAppId;
|
|
5613
|
+
};
|
|
5614
|
+
query?: {
|
|
5615
|
+
/**
|
|
5616
|
+
* Only channels whose name starts with this prefix (e.g. "presence-").
|
|
5617
|
+
*/
|
|
5618
|
+
prefix?: string;
|
|
5619
|
+
/**
|
|
5620
|
+
* 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).
|
|
5621
|
+
*/
|
|
5622
|
+
include?: Array<RealtimeChannelInclude>;
|
|
5623
|
+
};
|
|
5624
|
+
url: "/v1/realtime/apps/{realtime_app_id}/channels";
|
|
5625
|
+
};
|
|
5626
|
+
type GetRealtimeAppChannelData = {
|
|
5627
|
+
body?: never;
|
|
5628
|
+
headers: {
|
|
5629
|
+
/**
|
|
5630
|
+
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
5631
|
+
*/
|
|
5632
|
+
"X-Workspace-Id"?: string;
|
|
5633
|
+
/**
|
|
5634
|
+
* 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.
|
|
5635
|
+
*
|
|
5636
|
+
*/
|
|
5637
|
+
"X-Realtime-Key": string;
|
|
5638
|
+
/**
|
|
5639
|
+
* 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.
|
|
5640
|
+
*
|
|
5641
|
+
*/
|
|
5642
|
+
"X-Realtime-Secret": string;
|
|
5643
|
+
};
|
|
5644
|
+
path: {
|
|
5645
|
+
/**
|
|
5646
|
+
* Realtime app ID
|
|
5647
|
+
*/
|
|
5648
|
+
realtime_app_id: RealtimeAppId;
|
|
5649
|
+
/**
|
|
5650
|
+
* Channel name
|
|
5651
|
+
*/
|
|
5652
|
+
channel_name: RealtimeChannelName;
|
|
5653
|
+
};
|
|
5654
|
+
query?: {
|
|
5655
|
+
/**
|
|
5656
|
+
* 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).
|
|
5657
|
+
*/
|
|
5658
|
+
include?: Array<RealtimeChannelInclude>;
|
|
5659
|
+
};
|
|
5660
|
+
url: "/v1/realtime/apps/{realtime_app_id}/channels/{channel_name}";
|
|
5661
|
+
};
|
|
5662
|
+
type ListEmailMessagesData = {
|
|
5663
|
+
body?: never;
|
|
5664
|
+
path?: never;
|
|
5665
|
+
query?: {
|
|
5666
|
+
/**
|
|
5667
|
+
* Maximum number of items to return per page.
|
|
5668
|
+
*/
|
|
5669
|
+
limit?: number;
|
|
5670
|
+
/**
|
|
5671
|
+
* Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.
|
|
5672
|
+
*/
|
|
5673
|
+
starting_after?: string;
|
|
5674
|
+
/**
|
|
5675
|
+
* Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
|
|
5676
|
+
*/
|
|
5677
|
+
ending_before?: string;
|
|
5678
|
+
/**
|
|
5679
|
+
* 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.
|
|
5680
|
+
*/
|
|
5681
|
+
created_after?: string;
|
|
5682
|
+
/**
|
|
5683
|
+
* 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.
|
|
5684
|
+
*/
|
|
5685
|
+
created_before?: string;
|
|
5686
|
+
/**
|
|
5687
|
+
* Filter by aggregate delivery status.
|
|
5688
|
+
*/
|
|
5689
|
+
status?: EmailMessageStatus;
|
|
5690
|
+
/**
|
|
5691
|
+
* 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.
|
|
5692
|
+
*
|
|
5693
|
+
*/
|
|
5694
|
+
tag?: Array<string>;
|
|
5695
|
+
/**
|
|
5696
|
+
* Filter by category.
|
|
5697
|
+
*/
|
|
5698
|
+
category?: EmailMessageCategory;
|
|
5699
|
+
/**
|
|
5700
|
+
* Filter by recipient address. Exact match against any `to`/`cc`/`bcc` recipient on the message; normalised to lowercase before comparison.
|
|
5701
|
+
*
|
|
5702
|
+
*/
|
|
5703
|
+
to?: string;
|
|
5503
5704
|
/**
|
|
5504
5705
|
* Filter by sender address. Exact match against the message `from` field; normalised to lowercase before comparison.
|
|
5505
5706
|
*
|
|
@@ -5560,6 +5761,53 @@ type CreateContactData = {
|
|
|
5560
5761
|
query?: never;
|
|
5561
5762
|
url: "/v1/contacts";
|
|
5562
5763
|
};
|
|
5764
|
+
type CreateContactBatchData = {
|
|
5765
|
+
body: ContactUpsertRequest;
|
|
5766
|
+
headers?: {
|
|
5767
|
+
/**
|
|
5768
|
+
* 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).
|
|
5769
|
+
* Two distinct 409 errors signal misuse:
|
|
5770
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
5771
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5772
|
+
* expires within 30 seconds.
|
|
5773
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
5774
|
+
* against a different request body or method. Generate a new key.
|
|
5775
|
+
*
|
|
5776
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5777
|
+
*
|
|
5778
|
+
*/
|
|
5779
|
+
"Idempotency-Key"?: string;
|
|
5780
|
+
};
|
|
5781
|
+
path?: never;
|
|
5782
|
+
query?: never;
|
|
5783
|
+
url: "/v1/contacts/batch";
|
|
5784
|
+
};
|
|
5785
|
+
type UpdateContactData = {
|
|
5786
|
+
body: ContactUpdateRequest;
|
|
5787
|
+
headers?: {
|
|
5788
|
+
/**
|
|
5789
|
+
* 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).
|
|
5790
|
+
* Two distinct 409 errors signal misuse:
|
|
5791
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
5792
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5793
|
+
* expires within 30 seconds.
|
|
5794
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
5795
|
+
* against a different request body or method. Generate a new key.
|
|
5796
|
+
*
|
|
5797
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5798
|
+
*
|
|
5799
|
+
*/
|
|
5800
|
+
"Idempotency-Key"?: string;
|
|
5801
|
+
};
|
|
5802
|
+
path: {
|
|
5803
|
+
/**
|
|
5804
|
+
* ID of the contact to update (`con_`-prefixed).
|
|
5805
|
+
*/
|
|
5806
|
+
contact_id: ContactId;
|
|
5807
|
+
};
|
|
5808
|
+
query?: never;
|
|
5809
|
+
url: "/v1/contacts/{contact_id}";
|
|
5810
|
+
};
|
|
5563
5811
|
type ListContactPropertiesData = {
|
|
5564
5812
|
body?: never;
|
|
5565
5813
|
path?: never;
|
|
@@ -5579,6 +5827,53 @@ type ListContactPropertiesData = {
|
|
|
5579
5827
|
};
|
|
5580
5828
|
url: "/v1/contact-properties";
|
|
5581
5829
|
};
|
|
5830
|
+
type CreateContactPropertyData = {
|
|
5831
|
+
body: ContactPropertyCreateRequest;
|
|
5832
|
+
headers?: {
|
|
5833
|
+
/**
|
|
5834
|
+
* 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).
|
|
5835
|
+
* Two distinct 409 errors signal misuse:
|
|
5836
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
5837
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5838
|
+
* expires within 30 seconds.
|
|
5839
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
5840
|
+
* against a different request body or method. Generate a new key.
|
|
5841
|
+
*
|
|
5842
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5843
|
+
*
|
|
5844
|
+
*/
|
|
5845
|
+
"Idempotency-Key"?: string;
|
|
5846
|
+
};
|
|
5847
|
+
path?: never;
|
|
5848
|
+
query?: never;
|
|
5849
|
+
url: "/v1/contact-properties";
|
|
5850
|
+
};
|
|
5851
|
+
type UpdateContactPropertyData = {
|
|
5852
|
+
body: ContactPropertyUpdateRequest;
|
|
5853
|
+
headers?: {
|
|
5854
|
+
/**
|
|
5855
|
+
* 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).
|
|
5856
|
+
* Two distinct 409 errors signal misuse:
|
|
5857
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
5858
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5859
|
+
* expires within 30 seconds.
|
|
5860
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
5861
|
+
* against a different request body or method. Generate a new key.
|
|
5862
|
+
*
|
|
5863
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5864
|
+
*
|
|
5865
|
+
*/
|
|
5866
|
+
"Idempotency-Key"?: string;
|
|
5867
|
+
};
|
|
5868
|
+
path: {
|
|
5869
|
+
/**
|
|
5870
|
+
* ID of the contact property to update (`prp_`-prefixed).
|
|
5871
|
+
*/
|
|
5872
|
+
property_id: ContactPropertyId;
|
|
5873
|
+
};
|
|
5874
|
+
query?: never;
|
|
5875
|
+
url: "/v1/contact-properties/{property_id}";
|
|
5876
|
+
};
|
|
5582
5877
|
type ListAudiencesData = {
|
|
5583
5878
|
body?: never;
|
|
5584
5879
|
path?: never;
|
|
@@ -5602,6 +5897,53 @@ type ListAudiencesData = {
|
|
|
5602
5897
|
};
|
|
5603
5898
|
url: "/v1/audiences";
|
|
5604
5899
|
};
|
|
5900
|
+
type CreateAudienceData = {
|
|
5901
|
+
body: AudienceCreateRequest;
|
|
5902
|
+
headers?: {
|
|
5903
|
+
/**
|
|
5904
|
+
* 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).
|
|
5905
|
+
* Two distinct 409 errors signal misuse:
|
|
5906
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
5907
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5908
|
+
* expires within 30 seconds.
|
|
5909
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
5910
|
+
* against a different request body or method. Generate a new key.
|
|
5911
|
+
*
|
|
5912
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5913
|
+
*
|
|
5914
|
+
*/
|
|
5915
|
+
"Idempotency-Key"?: string;
|
|
5916
|
+
};
|
|
5917
|
+
path?: never;
|
|
5918
|
+
query?: never;
|
|
5919
|
+
url: "/v1/audiences";
|
|
5920
|
+
};
|
|
5921
|
+
type UpdateAudienceData = {
|
|
5922
|
+
body: AudienceUpdateRequest;
|
|
5923
|
+
headers?: {
|
|
5924
|
+
/**
|
|
5925
|
+
* 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).
|
|
5926
|
+
* Two distinct 409 errors signal misuse:
|
|
5927
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
5928
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5929
|
+
* expires within 30 seconds.
|
|
5930
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
5931
|
+
* against a different request body or method. Generate a new key.
|
|
5932
|
+
*
|
|
5933
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5934
|
+
*
|
|
5935
|
+
*/
|
|
5936
|
+
"Idempotency-Key"?: string;
|
|
5937
|
+
};
|
|
5938
|
+
path: {
|
|
5939
|
+
/**
|
|
5940
|
+
* ID of the audience to update (`adn_`-prefixed).
|
|
5941
|
+
*/
|
|
5942
|
+
audience_id: AudienceId;
|
|
5943
|
+
};
|
|
5944
|
+
query?: never;
|
|
5945
|
+
url: "/v1/audiences/{audience_id}";
|
|
5946
|
+
};
|
|
5605
5947
|
type ListAudienceContactsData = {
|
|
5606
5948
|
body?: never;
|
|
5607
5949
|
path: {
|
|
@@ -5630,6 +5972,58 @@ type ListAudienceContactsData = {
|
|
|
5630
5972
|
};
|
|
5631
5973
|
url: "/v1/audiences/{audience_id}/contacts";
|
|
5632
5974
|
};
|
|
5975
|
+
type AssignAudienceContactsData = {
|
|
5976
|
+
body: AudienceContactsAddRequest;
|
|
5977
|
+
headers?: {
|
|
5978
|
+
/**
|
|
5979
|
+
* 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).
|
|
5980
|
+
* Two distinct 409 errors signal misuse:
|
|
5981
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
5982
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
5983
|
+
* expires within 30 seconds.
|
|
5984
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
5985
|
+
* against a different request body or method. Generate a new key.
|
|
5986
|
+
*
|
|
5987
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
5988
|
+
*
|
|
5989
|
+
*/
|
|
5990
|
+
"Idempotency-Key"?: string;
|
|
5991
|
+
};
|
|
5992
|
+
path: {
|
|
5993
|
+
/**
|
|
5994
|
+
* ID of the audience to add contacts to (`adn_`-prefixed).
|
|
5995
|
+
*/
|
|
5996
|
+
audience_id: AudienceId;
|
|
5997
|
+
};
|
|
5998
|
+
query?: never;
|
|
5999
|
+
url: "/v1/audiences/{audience_id}/contacts";
|
|
6000
|
+
};
|
|
6001
|
+
type UnassignAudienceContactsData = {
|
|
6002
|
+
body: AudienceContactsRemoveRequest;
|
|
6003
|
+
headers?: {
|
|
6004
|
+
/**
|
|
6005
|
+
* 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).
|
|
6006
|
+
* Two distinct 409 errors signal misuse:
|
|
6007
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
6008
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6009
|
+
* expires within 30 seconds.
|
|
6010
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
6011
|
+
* against a different request body or method. Generate a new key.
|
|
6012
|
+
*
|
|
6013
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
6014
|
+
*
|
|
6015
|
+
*/
|
|
6016
|
+
"Idempotency-Key"?: string;
|
|
6017
|
+
};
|
|
6018
|
+
path: {
|
|
6019
|
+
/**
|
|
6020
|
+
* ID of the audience to remove contacts from (`adn_`-prefixed).
|
|
6021
|
+
*/
|
|
6022
|
+
audience_id: AudienceId;
|
|
6023
|
+
};
|
|
6024
|
+
query?: never;
|
|
6025
|
+
url: "/v1/audiences/{audience_id}/contacts/remove";
|
|
6026
|
+
};
|
|
5633
6027
|
type ListSmsMessagesData = {
|
|
5634
6028
|
body?: never;
|
|
5635
6029
|
path?: never;
|
|
@@ -5657,7 +6051,7 @@ type ListSmsMessagesData = {
|
|
|
5657
6051
|
/**
|
|
5658
6052
|
* Filter by direction. Omit for both.
|
|
5659
6053
|
*/
|
|
5660
|
-
direction?:
|
|
6054
|
+
direction?: MessageDirection;
|
|
5661
6055
|
/**
|
|
5662
6056
|
* 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`.
|
|
5663
6057
|
*
|
|
@@ -5671,7 +6065,7 @@ type ListSmsMessagesData = {
|
|
|
5671
6065
|
/**
|
|
5672
6066
|
* Filter by category.
|
|
5673
6067
|
*/
|
|
5674
|
-
category?:
|
|
6068
|
+
category?: SmsMessageCategory;
|
|
5675
6069
|
/**
|
|
5676
6070
|
* Filter by recipient phone number (E.164 exact match).
|
|
5677
6071
|
*/
|
|
@@ -5696,11 +6090,11 @@ type ListSmsTemplatesData = {
|
|
|
5696
6090
|
* 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.
|
|
5697
6091
|
*
|
|
5698
6092
|
*/
|
|
5699
|
-
scope?:
|
|
6093
|
+
scope?: TemplateScope;
|
|
5700
6094
|
/**
|
|
5701
6095
|
* Keep only templates whose `category` matches. Omit for all categories.
|
|
5702
6096
|
*/
|
|
5703
|
-
category?:
|
|
6097
|
+
category?: SmsMessageCategory;
|
|
5704
6098
|
/**
|
|
5705
6099
|
* Keep only templates available in this language, as a BCP-47 tag. Matches the template's `available_languages` entries exactly, with no fallback.
|
|
5706
6100
|
*
|
|
@@ -5709,6 +6103,56 @@ type ListSmsTemplatesData = {
|
|
|
5709
6103
|
};
|
|
5710
6104
|
url: "/v1/sms/templates";
|
|
5711
6105
|
};
|
|
6106
|
+
type CreateVerificationData = {
|
|
6107
|
+
body: VerificationCreateRequest;
|
|
6108
|
+
headers?: {
|
|
6109
|
+
/**
|
|
6110
|
+
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
6111
|
+
*/
|
|
6112
|
+
"X-Workspace-Id"?: string;
|
|
6113
|
+
/**
|
|
6114
|
+
* 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).
|
|
6115
|
+
* Two distinct 409 errors signal misuse:
|
|
6116
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
6117
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6118
|
+
* expires within 30 seconds.
|
|
6119
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
6120
|
+
* against a different request body or method. Generate a new key.
|
|
6121
|
+
*
|
|
6122
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
6123
|
+
*
|
|
6124
|
+
*/
|
|
6125
|
+
"Idempotency-Key"?: string;
|
|
6126
|
+
};
|
|
6127
|
+
path?: never;
|
|
6128
|
+
query?: never;
|
|
6129
|
+
url: "/v1/verify/verifications";
|
|
6130
|
+
};
|
|
6131
|
+
type CreateVerificationCheckData = {
|
|
6132
|
+
body: VerificationCheckRequest;
|
|
6133
|
+
headers?: {
|
|
6134
|
+
/**
|
|
6135
|
+
* Workspace context. Required for session auth; derived from API key otherwise.
|
|
6136
|
+
*/
|
|
6137
|
+
"X-Workspace-Id"?: string;
|
|
6138
|
+
/**
|
|
6139
|
+
* 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).
|
|
6140
|
+
* Two distinct 409 errors signal misuse:
|
|
6141
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
6142
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6143
|
+
* expires within 30 seconds.
|
|
6144
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
6145
|
+
* against a different request body or method. Generate a new key.
|
|
6146
|
+
*
|
|
6147
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
6148
|
+
*
|
|
6149
|
+
*/
|
|
6150
|
+
"Idempotency-Key"?: string;
|
|
6151
|
+
};
|
|
6152
|
+
path?: never;
|
|
6153
|
+
query?: never;
|
|
6154
|
+
url: "/v1/verify/verifications/check";
|
|
6155
|
+
};
|
|
5712
6156
|
type ListWhatsAppMessagesData = {
|
|
5713
6157
|
body?: never;
|
|
5714
6158
|
path?: never;
|
|
@@ -5906,7 +6350,7 @@ type GetEmailStatsByTagData = {
|
|
|
5906
6350
|
/**
|
|
5907
6351
|
* Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
|
|
5908
6352
|
*/
|
|
5909
|
-
trend_grain?:
|
|
6353
|
+
trend_grain?: StatsTrendGrain;
|
|
5910
6354
|
};
|
|
5911
6355
|
url: "/v1/email/stats/tags";
|
|
5912
6356
|
};
|
|
@@ -6004,7 +6448,7 @@ type GetEmailStatsBySendingIpData = {
|
|
|
6004
6448
|
/**
|
|
6005
6449
|
* Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
|
|
6006
6450
|
*/
|
|
6007
|
-
trend_grain?:
|
|
6451
|
+
trend_grain?: StatsTrendGrain;
|
|
6008
6452
|
};
|
|
6009
6453
|
url: "/v1/email/stats/sending-ips";
|
|
6010
6454
|
};
|
|
@@ -6046,7 +6490,7 @@ type GetEmailStatsBySendingDomainData = {
|
|
|
6046
6490
|
/**
|
|
6047
6491
|
* Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
|
|
6048
6492
|
*/
|
|
6049
|
-
trend_grain?:
|
|
6493
|
+
trend_grain?: StatsTrendGrain;
|
|
6050
6494
|
};
|
|
6051
6495
|
url: "/v1/email/stats/sending-domains";
|
|
6052
6496
|
};
|
|
@@ -6084,7 +6528,7 @@ type GetEmailStatsByCategoryData = {
|
|
|
6084
6528
|
/**
|
|
6085
6529
|
* Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
|
|
6086
6530
|
*/
|
|
6087
|
-
trend_grain?:
|
|
6531
|
+
trend_grain?: StatsTrendGrain;
|
|
6088
6532
|
};
|
|
6089
6533
|
url: "/v1/email/stats/categories";
|
|
6090
6534
|
};
|
|
@@ -6126,7 +6570,7 @@ type GetEmailStatsByMailboxProviderData = {
|
|
|
6126
6570
|
/**
|
|
6127
6571
|
* Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
|
|
6128
6572
|
*/
|
|
6129
|
-
trend_grain?:
|
|
6573
|
+
trend_grain?: StatsTrendGrain;
|
|
6130
6574
|
};
|
|
6131
6575
|
url: "/v1/email/stats/mailbox-providers";
|
|
6132
6576
|
};
|
|
@@ -6168,7 +6612,7 @@ type GetEmailStatsByMailboxProviderRegionData = {
|
|
|
6168
6612
|
/**
|
|
6169
6613
|
* Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
|
|
6170
6614
|
*/
|
|
6171
|
-
trend_grain?:
|
|
6615
|
+
trend_grain?: StatsTrendGrain;
|
|
6172
6616
|
};
|
|
6173
6617
|
url: "/v1/email/stats/mailbox-provider-regions";
|
|
6174
6618
|
};
|
|
@@ -6210,7 +6654,7 @@ type GetEmailStatsByRecipientDomainData = {
|
|
|
6210
6654
|
/**
|
|
6211
6655
|
* Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
|
|
6212
6656
|
*/
|
|
6213
|
-
trend_grain?:
|
|
6657
|
+
trend_grain?: StatsTrendGrain;
|
|
6214
6658
|
};
|
|
6215
6659
|
url: "/v1/email/stats/recipient-domains";
|
|
6216
6660
|
};
|
|
@@ -6252,7 +6696,7 @@ type GetEmailStatsByTemplateData = {
|
|
|
6252
6696
|
/**
|
|
6253
6697
|
* Bucket grain for the `trend` series. Has no effect unless `include_trend=true`.
|
|
6254
6698
|
*/
|
|
6255
|
-
trend_grain?:
|
|
6699
|
+
trend_grain?: StatsTrendGrain;
|
|
6256
6700
|
};
|
|
6257
6701
|
url: "/v1/email/stats/templates";
|
|
6258
6702
|
};
|
|
@@ -6431,7 +6875,7 @@ type GetEmailStatsByBroadcastData = {
|
|
|
6431
6875
|
/**
|
|
6432
6876
|
* Bucket grain for the `trend` series. Has no effect on this breakdown, where `include_trend` is not available.
|
|
6433
6877
|
*/
|
|
6434
|
-
trend_grain?:
|
|
6878
|
+
trend_grain?: StatsTrendGrain;
|
|
6435
6879
|
};
|
|
6436
6880
|
url: "/v1/email/stats/broadcasts";
|
|
6437
6881
|
};
|
|
@@ -6471,6 +6915,53 @@ type ListDomainsData = {
|
|
|
6471
6915
|
};
|
|
6472
6916
|
url: "/v1/email/domains";
|
|
6473
6917
|
};
|
|
6918
|
+
type CreateDomainData = {
|
|
6919
|
+
body: DomainCreate;
|
|
6920
|
+
headers?: {
|
|
6921
|
+
/**
|
|
6922
|
+
* 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).
|
|
6923
|
+
* Two distinct 409 errors signal misuse:
|
|
6924
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
6925
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6926
|
+
* expires within 30 seconds.
|
|
6927
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
6928
|
+
* against a different request body or method. Generate a new key.
|
|
6929
|
+
*
|
|
6930
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
6931
|
+
*
|
|
6932
|
+
*/
|
|
6933
|
+
"Idempotency-Key"?: string;
|
|
6934
|
+
};
|
|
6935
|
+
path?: never;
|
|
6936
|
+
query?: never;
|
|
6937
|
+
url: "/v1/email/domains";
|
|
6938
|
+
};
|
|
6939
|
+
type UpdateDomainData = {
|
|
6940
|
+
body: DomainUpdate;
|
|
6941
|
+
headers?: {
|
|
6942
|
+
/**
|
|
6943
|
+
* 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).
|
|
6944
|
+
* Two distinct 409 errors signal misuse:
|
|
6945
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
6946
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
6947
|
+
* expires within 30 seconds.
|
|
6948
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
6949
|
+
* against a different request body or method. Generate a new key.
|
|
6950
|
+
*
|
|
6951
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
6952
|
+
*
|
|
6953
|
+
*/
|
|
6954
|
+
"Idempotency-Key"?: string;
|
|
6955
|
+
};
|
|
6956
|
+
path: {
|
|
6957
|
+
/**
|
|
6958
|
+
* Domain ID.
|
|
6959
|
+
*/
|
|
6960
|
+
domain_id: DomainId;
|
|
6961
|
+
};
|
|
6962
|
+
query?: never;
|
|
6963
|
+
url: "/v1/email/domains/{domain_id}";
|
|
6964
|
+
};
|
|
6474
6965
|
type ListMailboxesData = {
|
|
6475
6966
|
body?: never;
|
|
6476
6967
|
path?: never;
|
|
@@ -6510,6 +7001,58 @@ type ListMailboxesData = {
|
|
|
6510
7001
|
};
|
|
6511
7002
|
url: "/v1/email/mailboxes";
|
|
6512
7003
|
};
|
|
7004
|
+
type CreateMailboxData = {
|
|
7005
|
+
body: MailboxCreate;
|
|
7006
|
+
headers?: {
|
|
7007
|
+
/**
|
|
7008
|
+
* 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).
|
|
7009
|
+
* Two distinct 409 errors signal misuse:
|
|
7010
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
7011
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7012
|
+
* expires within 30 seconds.
|
|
7013
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
7014
|
+
* against a different request body or method. Generate a new key.
|
|
7015
|
+
*
|
|
7016
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
7017
|
+
*
|
|
7018
|
+
*/
|
|
7019
|
+
"Idempotency-Key"?: string;
|
|
7020
|
+
};
|
|
7021
|
+
path?: never;
|
|
7022
|
+
query?: never;
|
|
7023
|
+
url: "/v1/email/mailboxes";
|
|
7024
|
+
};
|
|
7025
|
+
type UpdateMailboxData = {
|
|
7026
|
+
body: MailboxUpdate;
|
|
7027
|
+
headers?: {
|
|
7028
|
+
/**
|
|
7029
|
+
* 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).
|
|
7030
|
+
* Two distinct 409 errors signal misuse:
|
|
7031
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
7032
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7033
|
+
* expires within 30 seconds.
|
|
7034
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
7035
|
+
* against a different request body or method. Generate a new key.
|
|
7036
|
+
*
|
|
7037
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
7038
|
+
*
|
|
7039
|
+
*/
|
|
7040
|
+
"Idempotency-Key"?: string;
|
|
7041
|
+
};
|
|
7042
|
+
path: {
|
|
7043
|
+
/**
|
|
7044
|
+
* Mailbox ID.
|
|
7045
|
+
*/
|
|
7046
|
+
mailbox_id: MailboxId;
|
|
7047
|
+
};
|
|
7048
|
+
query?: {
|
|
7049
|
+
/**
|
|
7050
|
+
* Required as `true` when lowering `retention_tier`, acknowledging that remembered messages older than the new horizon are deleted.
|
|
7051
|
+
*/
|
|
7052
|
+
confirm?: boolean;
|
|
7053
|
+
};
|
|
7054
|
+
url: "/v1/email/mailboxes/{mailbox_id}";
|
|
7055
|
+
};
|
|
6513
7056
|
type GetMailboxStatsData = {
|
|
6514
7057
|
body?: never;
|
|
6515
7058
|
path: {
|
|
@@ -6570,6 +7113,32 @@ type ListMailboxReceiveRulesData = {
|
|
|
6570
7113
|
};
|
|
6571
7114
|
url: "/v1/email/mailboxes/{mailbox_id}/receive-rules";
|
|
6572
7115
|
};
|
|
7116
|
+
type CreateMailboxReceiveRuleData = {
|
|
7117
|
+
body: ReceiveRuleCreate;
|
|
7118
|
+
headers?: {
|
|
7119
|
+
/**
|
|
7120
|
+
* 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).
|
|
7121
|
+
* Two distinct 409 errors signal misuse:
|
|
7122
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
7123
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7124
|
+
* expires within 30 seconds.
|
|
7125
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
7126
|
+
* against a different request body or method. Generate a new key.
|
|
7127
|
+
*
|
|
7128
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
7129
|
+
*
|
|
7130
|
+
*/
|
|
7131
|
+
"Idempotency-Key"?: string;
|
|
7132
|
+
};
|
|
7133
|
+
path: {
|
|
7134
|
+
/**
|
|
7135
|
+
* Mailbox ID.
|
|
7136
|
+
*/
|
|
7137
|
+
mailbox_id: MailboxId;
|
|
7138
|
+
};
|
|
7139
|
+
query?: never;
|
|
7140
|
+
url: "/v1/email/mailboxes/{mailbox_id}/receive-rules";
|
|
7141
|
+
};
|
|
6573
7142
|
type ListEmailThreadsData = {
|
|
6574
7143
|
body?: never;
|
|
6575
7144
|
path?: never;
|
|
@@ -6603,23 +7172,80 @@ type ListEmailThreadsData = {
|
|
|
6603
7172
|
*/
|
|
6604
7173
|
after?: string;
|
|
6605
7174
|
/**
|
|
6606
|
-
* Filter to conversations whose most recent message is at or before this time. This is a time filter, not a cursor.
|
|
7175
|
+
* Filter to conversations whose most recent message is at or before this time. This is a time filter, not a cursor.
|
|
7176
|
+
*/
|
|
7177
|
+
before?: string;
|
|
7178
|
+
/**
|
|
7179
|
+
* Maximum number of items to return per page.
|
|
7180
|
+
*/
|
|
7181
|
+
limit?: number;
|
|
7182
|
+
/**
|
|
7183
|
+
* Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.
|
|
7184
|
+
*/
|
|
7185
|
+
starting_after?: string;
|
|
7186
|
+
/**
|
|
7187
|
+
* Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
|
|
7188
|
+
*/
|
|
7189
|
+
ending_before?: string;
|
|
7190
|
+
};
|
|
7191
|
+
url: "/v1/email/threads";
|
|
7192
|
+
};
|
|
7193
|
+
type DeleteEmailThreadData = {
|
|
7194
|
+
body?: never;
|
|
7195
|
+
headers?: {
|
|
7196
|
+
/**
|
|
7197
|
+
* 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).
|
|
7198
|
+
* Two distinct 409 errors signal misuse:
|
|
7199
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
7200
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7201
|
+
* expires within 30 seconds.
|
|
7202
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
7203
|
+
* against a different request body or method. Generate a new key.
|
|
7204
|
+
*
|
|
7205
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
7206
|
+
*
|
|
7207
|
+
*/
|
|
7208
|
+
"Idempotency-Key"?: string;
|
|
7209
|
+
};
|
|
7210
|
+
path: {
|
|
7211
|
+
/**
|
|
7212
|
+
* Thread ID.
|
|
6607
7213
|
*/
|
|
6608
|
-
|
|
7214
|
+
thread_id: ThreadId;
|
|
7215
|
+
};
|
|
7216
|
+
query?: {
|
|
6609
7217
|
/**
|
|
6610
|
-
*
|
|
7218
|
+
* Permanently delete the conversation and its messages immediately instead of moving them to the trash.
|
|
6611
7219
|
*/
|
|
6612
|
-
|
|
7220
|
+
permanent?: boolean;
|
|
7221
|
+
};
|
|
7222
|
+
url: "/v1/email/threads/{thread_id}";
|
|
7223
|
+
};
|
|
7224
|
+
type UpdateEmailThreadData = {
|
|
7225
|
+
body: EmailThreadUpdateRequest;
|
|
7226
|
+
headers?: {
|
|
6613
7227
|
/**
|
|
6614
|
-
*
|
|
7228
|
+
* 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).
|
|
7229
|
+
* Two distinct 409 errors signal misuse:
|
|
7230
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
7231
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7232
|
+
* expires within 30 seconds.
|
|
7233
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
7234
|
+
* against a different request body or method. Generate a new key.
|
|
7235
|
+
*
|
|
7236
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
7237
|
+
*
|
|
6615
7238
|
*/
|
|
6616
|
-
|
|
7239
|
+
"Idempotency-Key"?: string;
|
|
7240
|
+
};
|
|
7241
|
+
path: {
|
|
6617
7242
|
/**
|
|
6618
|
-
*
|
|
7243
|
+
* Thread ID.
|
|
6619
7244
|
*/
|
|
6620
|
-
|
|
7245
|
+
thread_id: ThreadId;
|
|
6621
7246
|
};
|
|
6622
|
-
|
|
7247
|
+
query?: never;
|
|
7248
|
+
url: "/v1/email/threads/{thread_id}";
|
|
6623
7249
|
};
|
|
6624
7250
|
type ListEmailThreadMessagesData = {
|
|
6625
7251
|
body?: never;
|
|
@@ -6633,7 +7259,7 @@ type ListEmailThreadMessagesData = {
|
|
|
6633
7259
|
/**
|
|
6634
7260
|
* Filter to received (`inbound`) or sent (`outbound`) messages.
|
|
6635
7261
|
*/
|
|
6636
|
-
direction?:
|
|
7262
|
+
direction?: MessageDirection;
|
|
6637
7263
|
/**
|
|
6638
7264
|
* 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.
|
|
6639
7265
|
*
|
|
@@ -6658,6 +7284,36 @@ type ListEmailThreadMessagesData = {
|
|
|
6658
7284
|
};
|
|
6659
7285
|
url: "/v1/email/threads/{thread_id}/messages";
|
|
6660
7286
|
};
|
|
7287
|
+
type ReplyEmailThreadMessageData = {
|
|
7288
|
+
body: EmailThreadMessageReplyRequest;
|
|
7289
|
+
headers?: {
|
|
7290
|
+
/**
|
|
7291
|
+
* 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).
|
|
7292
|
+
* Two distinct 409 errors signal misuse:
|
|
7293
|
+
* - `request_in_progress` (E01004) — the same key is currently being
|
|
7294
|
+
* processed by a concurrent request. Wait briefly and retry; the lock
|
|
7295
|
+
* expires within 30 seconds.
|
|
7296
|
+
* - `idempotency_key_reuse` (E01005) — the same key has already completed
|
|
7297
|
+
* against a different request body or method. Generate a new key.
|
|
7298
|
+
*
|
|
7299
|
+
* Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
|
|
7300
|
+
*
|
|
7301
|
+
*/
|
|
7302
|
+
"Idempotency-Key"?: string;
|
|
7303
|
+
};
|
|
7304
|
+
path: {
|
|
7305
|
+
/**
|
|
7306
|
+
* Thread ID.
|
|
7307
|
+
*/
|
|
7308
|
+
thread_id: ThreadId;
|
|
7309
|
+
/**
|
|
7310
|
+
* Message ID (`rem_` for a received message, `em_` for a sent one).
|
|
7311
|
+
*/
|
|
7312
|
+
message_id: string;
|
|
7313
|
+
};
|
|
7314
|
+
query?: never;
|
|
7315
|
+
url: "/v1/email/threads/{thread_id}/messages/{message_id}/reply";
|
|
7316
|
+
};
|
|
6661
7317
|
//#endregion
|
|
6662
7318
|
//#region src/generated/core/auth.gen.d.ts
|
|
6663
7319
|
type AuthToken = string | undefined;
|
|
@@ -6991,6 +7647,37 @@ declare abstract class Resource {
|
|
|
6991
7647
|
protected paginated<T>(method: string, options: RequestOptions | undefined, invoke: (ctx: CallContext, cursor: string | undefined) => Promise<FetchOutcome<CursorPage<T>>>): PaginatedPromise<T>;
|
|
6992
7648
|
}
|
|
6993
7649
|
//#endregion
|
|
7650
|
+
//#region src/resources/email.gen.d.ts
|
|
7651
|
+
type EmailListQuery$1 = NonNullable<ListEmailMessagesData["query"]>;
|
|
7652
|
+
declare class EmailResourceBase extends Resource {
|
|
7653
|
+
/**
|
|
7654
|
+
* 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.
|
|
7655
|
+
*
|
|
7656
|
+
* @example
|
|
7657
|
+
* const msg = await bird.email.get("em_abc123");
|
|
7658
|
+
* msg.status; // "accepted" | "processed" | "delivered" | "bounced" | …
|
|
7659
|
+
* msg.delivered_count;
|
|
7660
|
+
* msg.bounced_count;
|
|
7661
|
+
*/
|
|
7662
|
+
get(messageId: string, options?: RequestOptions): APIPromise<EmailMessage>;
|
|
7663
|
+
/**
|
|
7664
|
+
* 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.
|
|
7665
|
+
*
|
|
7666
|
+
* @example
|
|
7667
|
+
* for await (const message of bird.email.list({ status: "bounced" })) {
|
|
7668
|
+
* console.log(message.id);
|
|
7669
|
+
* }
|
|
7670
|
+
*/
|
|
7671
|
+
list(query?: EmailListQuery$1, options?: RequestOptions): PaginatedPromise<EmailMessage>;
|
|
7672
|
+
/**
|
|
7673
|
+
* 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.
|
|
7674
|
+
*
|
|
7675
|
+
* @example
|
|
7676
|
+
* await bird.email.cancel("em_abc123");
|
|
7677
|
+
*/
|
|
7678
|
+
cancel(messageId: string, options?: RequestOptions): APIPromise<void>;
|
|
7679
|
+
}
|
|
7680
|
+
//#endregion
|
|
6994
7681
|
//#region src/resources/emailStats.gen.d.ts
|
|
6995
7682
|
type EmailStatsSummaryQuery = NonNullable<GetEmailStatsSummaryData["query"]>;
|
|
6996
7683
|
type EmailStatsDailyQuery = NonNullable<GetEmailStatsDailyData["query"]>;
|
|
@@ -7190,6 +7877,241 @@ declare class EmailStatsResource extends Resource {
|
|
|
7190
7877
|
byBroadcast(query?: EmailStatsByBroadcastQuery, options?: RequestOptions): APIPromise<EmailStatsByBroadcastResponse>;
|
|
7191
7878
|
}
|
|
7192
7879
|
//#endregion
|
|
7880
|
+
//#region src/resources/emailMailboxes.gen.d.ts
|
|
7881
|
+
type EmailMailboxesListQuery = NonNullable<ListMailboxesData["query"]>;
|
|
7882
|
+
type EmailMailboxesCreateParams = NonNullable<CreateMailboxData["body"]>;
|
|
7883
|
+
type EmailMailboxesUpdateParams = NonNullable<UpdateMailboxData["body"]>;
|
|
7884
|
+
type EmailMailboxesUpdateQuery = NonNullable<UpdateMailboxData["query"]>;
|
|
7885
|
+
type EmailMailboxesStatsQuery = NonNullable<GetMailboxStatsData["query"]>;
|
|
7886
|
+
declare class EmailMailboxesResource$1 extends Resource {
|
|
7887
|
+
/**
|
|
7888
|
+
* 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.
|
|
7889
|
+
*
|
|
7890
|
+
* @example List mailboxes
|
|
7891
|
+
* for await (const mailbox of bird.email.mailboxes.list()) {
|
|
7892
|
+
* console.log(mailbox.address);
|
|
7893
|
+
* }
|
|
7894
|
+
*/
|
|
7895
|
+
list(query?: EmailMailboxesListQuery, options?: RequestOptions): PaginatedPromise<Mailbox>;
|
|
7896
|
+
/**
|
|
7897
|
+
* Create a mailbox — a durable agent identity that owns an email address, groups mail into threads, and remembers conversations for its retention tier.
|
|
7898
|
+
*
|
|
7899
|
+
* @example Create a mailbox
|
|
7900
|
+
* const mailbox = await bird.email.mailboxes.create({ display_name: "Support" });
|
|
7901
|
+
* console.log(mailbox.address); // "abc123@inbox.ai"
|
|
7902
|
+
*/
|
|
7903
|
+
create(params?: EmailMailboxesCreateParams, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7904
|
+
/**
|
|
7905
|
+
* @example Get a mailbox
|
|
7906
|
+
* const mailbox = await bird.email.mailboxes.get("mbx_01abc");
|
|
7907
|
+
* console.log(mailbox.state); // "active"
|
|
7908
|
+
*/
|
|
7909
|
+
get(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7910
|
+
/**
|
|
7911
|
+
* 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.
|
|
7912
|
+
*
|
|
7913
|
+
* @example Change a mailbox's receive policy
|
|
7914
|
+
* const mailbox = await bird.email.mailboxes.update("mbx_01abc", {
|
|
7915
|
+
* receive_policy: "open",
|
|
7916
|
+
* });
|
|
7917
|
+
* console.log(mailbox.id, mailbox.receive_policy);
|
|
7918
|
+
*/
|
|
7919
|
+
update(mailboxId: string, params?: EmailMailboxesUpdateParams, query?: EmailMailboxesUpdateQuery, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7920
|
+
/**
|
|
7921
|
+
* 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.
|
|
7922
|
+
*
|
|
7923
|
+
* @example Delete a mailbox
|
|
7924
|
+
* await bird.email.mailboxes.delete("mbx_01abc");
|
|
7925
|
+
*/
|
|
7926
|
+
delete(mailboxId: string, options?: RequestOptions): APIPromise<void>;
|
|
7927
|
+
/**
|
|
7928
|
+
* 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.
|
|
7929
|
+
*
|
|
7930
|
+
* @example Restore a deleted mailbox
|
|
7931
|
+
* const mailbox = await bird.email.mailboxes.restore("mbx_01abc");
|
|
7932
|
+
* console.log(mailbox.deleted_at); // null
|
|
7933
|
+
*/
|
|
7934
|
+
restore(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7935
|
+
/**
|
|
7936
|
+
* 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.
|
|
7937
|
+
*
|
|
7938
|
+
* @example Resume a suspended mailbox
|
|
7939
|
+
* const mailbox = await bird.email.mailboxes.resume("mbx_01abc");
|
|
7940
|
+
* console.log(mailbox.state); // "active"
|
|
7941
|
+
*/
|
|
7942
|
+
resume(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7943
|
+
/**
|
|
7944
|
+
* @example Get mailbox stats
|
|
7945
|
+
* const stats = await bird.email.mailboxes.stats("mbx_01abc");
|
|
7946
|
+
* console.log(stats.summary?.sends_accepted);
|
|
7947
|
+
*/
|
|
7948
|
+
stats(mailboxId: string, query?: EmailMailboxesStatsQuery, options?: RequestOptions): APIPromise<MailboxStatsResponse>;
|
|
7949
|
+
/**
|
|
7950
|
+
* 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.
|
|
7951
|
+
*
|
|
7952
|
+
* @example List a mailbox's labels
|
|
7953
|
+
* const labels = await bird.email.mailboxes.labels("mbx_01abc");
|
|
7954
|
+
* console.log(labels.data.map((label) => label.name));
|
|
7955
|
+
*/
|
|
7956
|
+
labels(mailboxId: string, options?: RequestOptions): APIPromise<EmailMailboxLabelList>;
|
|
7957
|
+
}
|
|
7958
|
+
//#endregion
|
|
7959
|
+
//#region src/resources/emailMailboxesMessages.d.ts
|
|
7960
|
+
/** Parameters for sending a new message from a mailbox. */
|
|
7961
|
+
type EmailMailboxesMessagesCreateParams = EmailMailboxComposeRequest;
|
|
7962
|
+
declare class EmailMailboxesMessagesResource extends Resource {
|
|
7963
|
+
/**
|
|
7964
|
+
* Send a new email from this mailbox, starting a new conversation.
|
|
7965
|
+
*
|
|
7966
|
+
* @example Send from a mailbox
|
|
7967
|
+
* const msg = await bird.email.mailboxes.messages.create("mbx_01abc", {
|
|
7968
|
+
* to: ["customer@example.com"],
|
|
7969
|
+
* subject: "Hello",
|
|
7970
|
+
* text: "Hi there!",
|
|
7971
|
+
* });
|
|
7972
|
+
*/
|
|
7973
|
+
create(mailboxId: string, params: EmailMailboxesMessagesCreateParams, options?: RequestOptions): APIPromise<EmailThreadMessage>;
|
|
7974
|
+
}
|
|
7975
|
+
//#endregion
|
|
7976
|
+
//#region src/resources/emailMailboxesReceiveRules.gen.d.ts
|
|
7977
|
+
type EmailMailboxesReceiveRulesListQuery = NonNullable<ListMailboxReceiveRulesData["query"]>;
|
|
7978
|
+
type EmailMailboxesReceiveRulesCreateParams = NonNullable<CreateMailboxReceiveRuleData["body"]>;
|
|
7979
|
+
declare class EmailMailboxesReceiveRulesResource extends Resource {
|
|
7980
|
+
/**
|
|
7981
|
+
* List a mailbox's allow/block receive rules as a cursor page, oldest first. Filter by action.
|
|
7982
|
+
*
|
|
7983
|
+
* @example List a mailbox's receive rules
|
|
7984
|
+
* for await (const rule of bird.email.mailboxes.receiveRules.list("mbx_01abc")) {
|
|
7985
|
+
* console.log(rule.action, rule.entry);
|
|
7986
|
+
* }
|
|
7987
|
+
*/
|
|
7988
|
+
list(mailboxId: string, query?: EmailMailboxesReceiveRulesListQuery, options?: RequestOptions): PaginatedPromise<ReceiveRule>;
|
|
7989
|
+
/**
|
|
7990
|
+
* Add an allow or block rule for a sender address or domain to a mailbox. Block always wins; up to 200 rules per mailbox.
|
|
7991
|
+
*
|
|
7992
|
+
* @example Block a domain
|
|
7993
|
+
* const rule = await bird.email.mailboxes.receiveRules.create("mbx_01abc", {
|
|
7994
|
+
* action: "block",
|
|
7995
|
+
* entry: "spam.example.com",
|
|
7996
|
+
* });
|
|
7997
|
+
* console.log(rule.id);
|
|
7998
|
+
*/
|
|
7999
|
+
create(mailboxId: string, params: EmailMailboxesReceiveRulesCreateParams, options?: RequestOptions): APIPromise<ReceiveRule>;
|
|
8000
|
+
/**
|
|
8001
|
+
* Remove a receive rule from a mailbox. Delete-and-recreate is how an entry's action is flipped.
|
|
8002
|
+
*
|
|
8003
|
+
* @example Delete a rule
|
|
8004
|
+
* await bird.email.mailboxes.receiveRules.delete("mbx_01abc", "erl_01xyz");
|
|
8005
|
+
*/
|
|
8006
|
+
delete(mailboxId: string, ruleId: string, options?: RequestOptions): APIPromise<void>;
|
|
8007
|
+
}
|
|
8008
|
+
//#endregion
|
|
8009
|
+
//#region src/resources/emailMailboxes.d.ts
|
|
8010
|
+
declare class EmailMailboxesResource extends EmailMailboxesResource$1 {
|
|
8011
|
+
/** Messages sent from the mailbox's own address — `bird.email.mailboxes.messages.create(...)`. */
|
|
8012
|
+
readonly messages: EmailMailboxesMessagesResource;
|
|
8013
|
+
/** Per-sender allow/block rules — `bird.email.mailboxes.receiveRules.create(...)`, `.list(...)`, `.delete(...)`. */
|
|
8014
|
+
readonly receiveRules: EmailMailboxesReceiveRulesResource;
|
|
8015
|
+
constructor(...args: ConstructorParameters<typeof Resource>);
|
|
8016
|
+
}
|
|
8017
|
+
//#endregion
|
|
8018
|
+
//#region src/resources/emailThreads.gen.d.ts
|
|
8019
|
+
type EmailThreadsListQuery = NonNullable<ListEmailThreadsData["query"]>;
|
|
8020
|
+
type EmailThreadsUpdateParams = NonNullable<UpdateEmailThreadData["body"]>;
|
|
8021
|
+
type EmailThreadsDeleteQuery = NonNullable<DeleteEmailThreadData["query"]>;
|
|
8022
|
+
declare class EmailThreadsResource$1 extends Resource {
|
|
8023
|
+
/**
|
|
8024
|
+
* 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.
|
|
8025
|
+
*
|
|
8026
|
+
* @example List conversation threads
|
|
8027
|
+
* for await (const thread of bird.email.threads.list({ mailbox_id: "mbx_01abc" })) {
|
|
8028
|
+
* console.log(thread.id, thread.subject);
|
|
8029
|
+
* }
|
|
8030
|
+
*/
|
|
8031
|
+
list(query?: EmailThreadsListQuery, options?: RequestOptions): PaginatedPromise<EmailThread>;
|
|
8032
|
+
/**
|
|
8033
|
+
* Get one conversation: participants, counts, labels, read state. Fetch its messages with the thread messages endpoint.
|
|
8034
|
+
*
|
|
8035
|
+
* @example Get a thread
|
|
8036
|
+
* const thread = await bird.email.threads.get("thr_01abc");
|
|
8037
|
+
* console.log(thread.subject);
|
|
8038
|
+
*/
|
|
8039
|
+
get(threadId: string, options?: RequestOptions): APIPromise<EmailThread>;
|
|
8040
|
+
/**
|
|
8041
|
+
* 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.
|
|
8042
|
+
*
|
|
8043
|
+
* @example Apply label changes to a thread
|
|
8044
|
+
* const thread = await bird.email.threads.update("thr_01abc", {
|
|
8045
|
+
* labels: { add: ["archive"] },
|
|
8046
|
+
* });
|
|
8047
|
+
* console.log(thread.id);
|
|
8048
|
+
*/
|
|
8049
|
+
update(threadId: string, params?: EmailThreadsUpdateParams, options?: RequestOptions): APIPromise<EmailThread>;
|
|
8050
|
+
/**
|
|
8051
|
+
* Move a conversation and all its messages to trash (purged after 30 days), or delete permanently with ?permanent=true.
|
|
8052
|
+
*
|
|
8053
|
+
* @example Delete a thread
|
|
8054
|
+
* await bird.email.threads.delete("thr_01abc", { permanent: true });
|
|
8055
|
+
*/
|
|
8056
|
+
delete(threadId: string, query?: EmailThreadsDeleteQuery, options?: RequestOptions): APIPromise<void>;
|
|
8057
|
+
}
|
|
8058
|
+
//#endregion
|
|
8059
|
+
//#region src/resources/emailThreadsMessages.gen.d.ts
|
|
8060
|
+
type EmailThreadsMessagesListQuery = NonNullable<ListEmailThreadMessagesData["query"]>;
|
|
8061
|
+
type EmailThreadsMessagesReplyParams = NonNullable<ReplyEmailThreadMessageData["body"]>;
|
|
8062
|
+
declare class EmailThreadsMessagesResource extends Resource {
|
|
8063
|
+
/**
|
|
8064
|
+
* 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.
|
|
8065
|
+
*
|
|
8066
|
+
* @example List a thread's messages
|
|
8067
|
+
* for await (const msg of bird.email.threads.messages.list("thr_01abc")) {
|
|
8068
|
+
* console.log(msg.id, msg.direction);
|
|
8069
|
+
* }
|
|
8070
|
+
*/
|
|
8071
|
+
list(threadId: string, query?: EmailThreadsMessagesListQuery, options?: RequestOptions): PaginatedPromise<EmailThreadMessage>;
|
|
8072
|
+
/**
|
|
8073
|
+
* Get one conversation message with its extracted plain text — readable for the mailbox's full retention period, no MIME parsing needed.
|
|
8074
|
+
*
|
|
8075
|
+
* @example Get a message
|
|
8076
|
+
* const msg = await bird.email.threads.messages.get("thr_01abc", "rem_01xyz");
|
|
8077
|
+
* console.log(msg.direction); // "inbound"
|
|
8078
|
+
*/
|
|
8079
|
+
get(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessage>;
|
|
8080
|
+
/**
|
|
8081
|
+
* Get the original rendered HTML and plain-text body of a conversation message. Available 30 days; after that use the message's extracted_text.
|
|
8082
|
+
*
|
|
8083
|
+
* @example Get a message body
|
|
8084
|
+
* const body = await bird.email.threads.messages.body("thr_01abc", "rem_01xyz");
|
|
8085
|
+
* console.log(body.text);
|
|
8086
|
+
*/
|
|
8087
|
+
body(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessageBody>;
|
|
8088
|
+
/**
|
|
8089
|
+
* 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.
|
|
8090
|
+
*
|
|
8091
|
+
* @example Reply to a message
|
|
8092
|
+
* const reply = await bird.email.threads.messages.reply("thr_01abc", "rem_01xyz", {
|
|
8093
|
+
* text: "Thanks for reaching out!",
|
|
8094
|
+
* });
|
|
8095
|
+
* console.log(reply.id);
|
|
8096
|
+
*/
|
|
8097
|
+
reply(threadId: string, messageId: string, params?: EmailThreadsMessagesReplyParams, options?: RequestOptions): APIPromise<EmailThreadMessage>;
|
|
8098
|
+
/**
|
|
8099
|
+
* List the attachments on a conversation message. Bytes are downloadable for 30 days; the metadata also rides the message's attachment_manifest durably.
|
|
8100
|
+
*
|
|
8101
|
+
* @example List a message's attachments
|
|
8102
|
+
* const atts = await bird.email.threads.messages.attachments("thr_01abc", "rem_01xyz");
|
|
8103
|
+
* console.log(atts.data.map((a) => a.filename));
|
|
8104
|
+
*/
|
|
8105
|
+
attachments(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessageAttachmentList>;
|
|
8106
|
+
}
|
|
8107
|
+
//#endregion
|
|
8108
|
+
//#region src/resources/emailThreads.d.ts
|
|
8109
|
+
declare class EmailThreadsResource extends EmailThreadsResource$1 {
|
|
8110
|
+
/** Messages in a conversation — `bird.email.threads.messages.list(...)`, `.reply(...)`, … */
|
|
8111
|
+
readonly messages: EmailThreadsMessagesResource;
|
|
8112
|
+
constructor(...args: ConstructorParameters<typeof Resource>);
|
|
8113
|
+
}
|
|
8114
|
+
//#endregion
|
|
7193
8115
|
//#region src/resources/email.d.ts
|
|
7194
8116
|
/** Body for `bird.email.send`. */
|
|
7195
8117
|
type EmailSendParams = EmailMessageSendRequest;
|
|
@@ -7210,10 +8132,14 @@ type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
|
7210
8132
|
type DefaultedKeys<D> = D extends object ? Extract<keyof D, keyof EmailSendParams> : never;
|
|
7211
8133
|
/** `send` params with defaulted fields made optional. */
|
|
7212
8134
|
type EmailSend<D> = PartialBy<EmailSendParams, DefaultedKeys<D>>;
|
|
7213
|
-
declare class EmailResource<D extends EmailChannelDefaults | undefined = undefined> extends
|
|
8135
|
+
declare class EmailResource<D extends EmailChannelDefaults | undefined = undefined> extends EmailResourceBase {
|
|
7214
8136
|
#private;
|
|
7215
8137
|
/** Email statistics — `bird.email.stats.summary(...)`, `.daily(...)`, `.byTag(...)`, … */
|
|
7216
8138
|
readonly stats: EmailStatsResource;
|
|
8139
|
+
/** Durable agent mailboxes — `bird.email.mailboxes.list(...)`, `.create(...)`, … */
|
|
8140
|
+
readonly mailboxes: EmailMailboxesResource;
|
|
8141
|
+
/** Conversations across every mailbox — `bird.email.threads.list(...)`, `.get(...)`, … */
|
|
8142
|
+
readonly threads: EmailThreadsResource;
|
|
7217
8143
|
constructor(core: ConstructorParameters<typeof Resource>[0], client: ConstructorParameters<typeof Resource>[1], defaults?: D);
|
|
7218
8144
|
/**
|
|
7219
8145
|
* Send an email message. Resolves once the message is accepted for delivery
|
|
@@ -7302,202 +8228,156 @@ declare class EmailResource<D extends EmailChannelDefaults | undefined = undefin
|
|
|
7302
8228
|
* for (const item of batch.data) console.log(item.id, item.status);
|
|
7303
8229
|
*/
|
|
7304
8230
|
sendBatch(params: EmailSendBatchParams, options?: RequestOptions): APIPromise<EmailSendBatchResult>;
|
|
7305
|
-
/**
|
|
7306
|
-
* Fetch a message with aggregate delivery status.
|
|
7307
|
-
*
|
|
7308
|
-
* @example
|
|
7309
|
-
* const msg = await bird.email.get("em_abc123");
|
|
7310
|
-
* msg.status; // "accepted" | "processed" | "delivered" | "bounced" | …
|
|
7311
|
-
* msg.delivered_count;
|
|
7312
|
-
* msg.bounced_count;
|
|
7313
|
-
*/
|
|
7314
|
-
get(messageId: string, options?: RequestOptions): APIPromise<EmailMessage>;
|
|
7315
|
-
/**
|
|
7316
|
-
* Cancel a message scheduled with `scheduled_at` before it sends. Only a
|
|
7317
|
-
* message that is still scheduled can be canceled; one that already started
|
|
7318
|
-
* sending — or was previously canceled — rejects with a conflict error.
|
|
7319
|
-
* Canceling does not return consumed scheduled-send quota.
|
|
7320
|
-
*
|
|
7321
|
-
* @example
|
|
7322
|
-
* await bird.email.cancel("em_abc123");
|
|
7323
|
-
*/
|
|
7324
|
-
cancel(messageId: string, options?: RequestOptions): APIPromise<void>;
|
|
7325
|
-
/**
|
|
7326
|
-
* List messages, newest first. `await` resolves the first page; `for await`
|
|
7327
|
-
* walks every message across all pages.
|
|
7328
|
-
*
|
|
7329
|
-
* @example Iterate every message, or take one page
|
|
7330
|
-
* for await (const message of bird.email.list({ status: "bounced" })) {
|
|
7331
|
-
* console.log(message.id);
|
|
7332
|
-
* }
|
|
7333
|
-
* const page = await bird.email.list({ limit: 50 }); // page.data, page.next_cursor
|
|
7334
|
-
*/
|
|
7335
|
-
list(query?: EmailListQuery, options?: RequestOptions): PaginatedPromise<EmailMessage>;
|
|
7336
8231
|
}
|
|
7337
8232
|
//#endregion
|
|
7338
|
-
//#region src/resources/audiences.d.ts
|
|
7339
|
-
/** Body for `bird.audiences.create`. */
|
|
7340
|
-
type AudienceCreateParams = AudienceCreateRequest;
|
|
7341
|
-
/** Body for `bird.audiences.update` — a partial patch. */
|
|
7342
|
-
type AudienceUpdateParams = AudienceUpdateRequest;
|
|
7343
|
-
/** Body for `bird.audiences.addContacts`. */
|
|
7344
|
-
type AudienceAddContactsParams = AudienceContactsAddRequest;
|
|
7345
|
-
/** Body for `bird.audiences.removeContacts`. */
|
|
7346
|
-
type AudienceRemoveContactsParams = AudienceContactsRemoveRequest;
|
|
7347
|
-
/** Filters and cursor params for `bird.audiences.list`. */
|
|
8233
|
+
//#region src/resources/audiences.gen.d.ts
|
|
7348
8234
|
type AudienceListQuery = NonNullable<ListAudiencesData["query"]>;
|
|
7349
|
-
|
|
7350
|
-
type
|
|
8235
|
+
type AudienceCreateParams = NonNullable<CreateAudienceData["body"]>;
|
|
8236
|
+
type AudienceUpdateParams = NonNullable<UpdateAudienceData["body"]>;
|
|
8237
|
+
type AudienceListContactsQuery = NonNullable<ListAudienceContactsData["query"]>;
|
|
8238
|
+
type AudienceAddContactsParams = NonNullable<AssignAudienceContactsData["body"]>;
|
|
8239
|
+
type AudienceRemoveContactsParams = NonNullable<UnassignAudienceContactsData["body"]>;
|
|
7351
8240
|
declare class AudiencesResource extends Resource {
|
|
7352
8241
|
/**
|
|
7353
|
-
*
|
|
7354
|
-
*
|
|
7355
|
-
* @example Create an audience
|
|
7356
|
-
* const audience = await bird.audiences.create({ name: "Newsletter subscribers" });
|
|
7357
|
-
* console.log(audience.id); // "aud_…"
|
|
7358
|
-
*/
|
|
7359
|
-
create(params: AudienceCreateParams, options?: RequestOptions): APIPromise<Audience>;
|
|
7360
|
-
/**
|
|
7361
|
-
* List the workspace's audiences, newest first. `await` resolves the first
|
|
7362
|
-
* page; `for await` walks every audience across pages.
|
|
8242
|
+
* List the workspace's audiences as a cursor page, newest first. Filter by name substring with `q`.
|
|
7363
8243
|
*
|
|
7364
|
-
* @example
|
|
8244
|
+
* @example Iterate every audience, or take one page
|
|
7365
8245
|
* for await (const audience of bird.audiences.list()) {
|
|
7366
8246
|
* console.log(audience.id, audience.name);
|
|
7367
8247
|
* }
|
|
7368
8248
|
*/
|
|
7369
8249
|
list(query?: AudienceListQuery, options?: RequestOptions): PaginatedPromise<Audience>;
|
|
7370
8250
|
/**
|
|
7371
|
-
*
|
|
8251
|
+
* Get a single audience by ID: name, description, and type. Members are listed separately with `audiences.list_contacts`.
|
|
7372
8252
|
*
|
|
7373
|
-
* @example
|
|
7374
|
-
* const audience = await bird.audiences.get("
|
|
8253
|
+
* @example Fetch an audience by id
|
|
8254
|
+
* const audience = await bird.audiences.get("adn_01krdgeqcxet5s7t44vh8rt9mg");
|
|
8255
|
+
* console.log(audience.name);
|
|
7375
8256
|
*/
|
|
7376
8257
|
get(audienceId: string, options?: RequestOptions): APIPromise<Audience>;
|
|
7377
8258
|
/**
|
|
7378
|
-
*
|
|
8259
|
+
* 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.
|
|
7379
8260
|
*
|
|
7380
|
-
* @example
|
|
7381
|
-
* await bird.audiences.
|
|
8261
|
+
* @example Create an audience
|
|
8262
|
+
* const audience = await bird.audiences.create({ name: "Newsletter subscribers" });
|
|
8263
|
+
* console.log(audience.id); // "adn_…"
|
|
7382
8264
|
*/
|
|
7383
|
-
|
|
8265
|
+
create(params: AudienceCreateParams, options?: RequestOptions): APIPromise<Audience>;
|
|
7384
8266
|
/**
|
|
7385
|
-
*
|
|
8267
|
+
* Update an audience's name or description. Omitted fields are unchanged; a null description clears it.
|
|
7386
8268
|
*
|
|
7387
|
-
* @example
|
|
7388
|
-
* await bird.audiences.
|
|
8269
|
+
* @example Rename an audience
|
|
8270
|
+
* await bird.audiences.update("adn_01krdgeqcxet5s7t44vh8rt9mg", { name: "Renamed" });
|
|
8271
|
+
*/
|
|
8272
|
+
update(audienceId: string, params?: AudienceUpdateParams, options?: RequestOptions): APIPromise<Audience>;
|
|
8273
|
+
/**
|
|
8274
|
+
* Delete an audience and its memberships; contacts themselves are not deleted. Fails while a broadcast targeting the audience is scheduled, accepted, sending, or canceling.
|
|
8275
|
+
*
|
|
8276
|
+
* @example Delete an audience by id
|
|
8277
|
+
* await bird.audiences.delete("adn_01krdgeqcxet5s7t44vh8rt9mg");
|
|
7389
8278
|
*/
|
|
7390
8279
|
delete(audienceId: string, options?: RequestOptions): APIPromise<void>;
|
|
7391
8280
|
/**
|
|
7392
|
-
* List the contacts in
|
|
7393
|
-
* page; `for await` walks every member across pages.
|
|
8281
|
+
* 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.
|
|
7394
8282
|
*
|
|
7395
|
-
* @example
|
|
7396
|
-
* for await (const member of bird.audiences.listContacts("
|
|
8283
|
+
* @example Iterate an audience's members
|
|
8284
|
+
* for await (const member of bird.audiences.listContacts("adn_01krdgeqcxet5s7t44vh8rt9mg")) {
|
|
7397
8285
|
* console.log(member.contact.id, member.joined_at);
|
|
7398
8286
|
* }
|
|
7399
8287
|
*/
|
|
7400
|
-
listContacts(audienceId: string, query?:
|
|
8288
|
+
listContacts(audienceId: string, query?: AudienceListContactsQuery, options?: RequestOptions): PaginatedPromise<AudienceMember>;
|
|
7401
8289
|
/**
|
|
7402
|
-
* Add contacts to
|
|
8290
|
+
* Add up to 1,000 existing contacts to a static audience by ID. Fails entirely if any contact ID does not exist.
|
|
7403
8291
|
*
|
|
7404
|
-
* @example
|
|
7405
|
-
* await bird.audiences.addContacts("
|
|
7406
|
-
* contact_ids: ["
|
|
8292
|
+
* @example Add contacts to an audience
|
|
8293
|
+
* await bird.audiences.addContacts("adn_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8294
|
+
* contact_ids: ["con_01krdgeqcxet5s7t44vh8rt9mg"],
|
|
7407
8295
|
* });
|
|
7408
8296
|
*/
|
|
7409
8297
|
addContacts(audienceId: string, params: AudienceAddContactsParams, options?: RequestOptions): APIPromise<void>;
|
|
7410
8298
|
/**
|
|
7411
|
-
* Remove
|
|
8299
|
+
* 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.
|
|
7412
8300
|
*
|
|
7413
|
-
* @example
|
|
7414
|
-
* await bird.audiences.removeContacts("
|
|
7415
|
-
* contact_ids: ["
|
|
8301
|
+
* @example Remove contacts from an audience
|
|
8302
|
+
* await bird.audiences.removeContacts("adn_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8303
|
+
* contact_ids: ["con_01krdgeqcxet5s7t44vh8rt9mg"],
|
|
7416
8304
|
* });
|
|
7417
8305
|
*/
|
|
7418
8306
|
removeContacts(audienceId: string, params: AudienceRemoveContactsParams, options?: RequestOptions): APIPromise<void>;
|
|
7419
8307
|
/**
|
|
7420
|
-
* Remove
|
|
8308
|
+
* Remove one contact's membership from an audience. The contact itself is not deleted and stays a member of any other audiences.
|
|
7421
8309
|
*
|
|
7422
|
-
* @example
|
|
7423
|
-
* await bird.audiences.removeContact(
|
|
8310
|
+
* @example Remove one contact's membership
|
|
8311
|
+
* await bird.audiences.removeContact(
|
|
8312
|
+
* "adn_01krdgeqcxet5s7t44vh8rt9mg",
|
|
8313
|
+
* "con_01krdgeqcxet5s7t44vh8rt9mg",
|
|
8314
|
+
* );
|
|
7424
8315
|
*/
|
|
7425
8316
|
removeContact(audienceId: string, contactId: string, options?: RequestOptions): APIPromise<void>;
|
|
7426
8317
|
}
|
|
7427
8318
|
//#endregion
|
|
7428
|
-
//#region src/resources/domains.d.ts
|
|
7429
|
-
/** Body for `bird.domains.create`. */
|
|
7430
|
-
type DomainCreateParams = DomainCreate;
|
|
7431
|
-
/**
|
|
7432
|
-
* Body for `bird.domains.update` — a partial patch. Omit a field to leave it
|
|
7433
|
-
* unchanged; send `tracking: null` to remove the tracking domain (both tracking
|
|
7434
|
-
* toggles must be off first, else the API returns 409).
|
|
7435
|
-
*/
|
|
7436
|
-
type DomainUpdateParams = DomainUpdate;
|
|
7437
|
-
/** Filters and cursor params for `bird.domains.list`. */
|
|
8319
|
+
//#region src/resources/domains.gen.d.ts
|
|
7438
8320
|
type DomainListQuery = NonNullable<ListDomainsData["query"]>;
|
|
8321
|
+
type DomainCreateParams = NonNullable<CreateDomainData["body"]>;
|
|
8322
|
+
type DomainUpdateParams = NonNullable<UpdateDomainData["body"]>;
|
|
7439
8323
|
declare class DomainsResource extends Resource {
|
|
7440
8324
|
/**
|
|
7441
|
-
*
|
|
7442
|
-
* to publish at your DNS provider; call `verify` once they are in place.
|
|
8325
|
+
* List the workspace's sending domains with their verification status, as a cursor page.
|
|
7443
8326
|
*
|
|
7444
|
-
* @example
|
|
7445
|
-
* const domain = await bird.domains.create({ domain: "mail.acme.com" });
|
|
7446
|
-
* console.log(domain.id, domain.status); // "dom_…", "pending"
|
|
7447
|
-
*/
|
|
7448
|
-
create(params: DomainCreateParams, options?: RequestOptions): APIPromise<Domain>;
|
|
7449
|
-
/**
|
|
7450
|
-
* List the workspace's sending domains, newest first. `await` resolves the
|
|
7451
|
-
* first page; `for await` walks every domain across pages.
|
|
7452
|
-
*
|
|
7453
|
-
* @example
|
|
8327
|
+
* @example Iterate every sending domain
|
|
7454
8328
|
* for await (const domain of bird.domains.list()) {
|
|
7455
8329
|
* console.log(domain.id, domain.status);
|
|
7456
8330
|
* }
|
|
7457
8331
|
*/
|
|
7458
8332
|
list(query?: DomainListQuery, options?: RequestOptions): PaginatedPromise<Domain>;
|
|
7459
8333
|
/**
|
|
7460
|
-
* Fetch
|
|
7461
|
-
* per-record verification state.
|
|
8334
|
+
* Fetch one sending domain: verification status and the DNS records with their individual verification states.
|
|
7462
8335
|
*
|
|
7463
|
-
* @example
|
|
8336
|
+
* @example Fetch a sending domain by id
|
|
7464
8337
|
* const domain = await bird.domains.get("dom_01krdgeqcxet5s7t44vh8rt9mg");
|
|
8338
|
+
* console.log(domain.domain);
|
|
7465
8339
|
*/
|
|
7466
8340
|
get(domainId: string, options?: RequestOptions): APIPromise<Domain>;
|
|
7467
8341
|
/**
|
|
7468
|
-
*
|
|
7469
|
-
* immediately, while `return_path`/`tracking`/`dkim` changes are staged until
|
|
7470
|
-
* their new DNS records verify.
|
|
8342
|
+
* 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).
|
|
7471
8343
|
*
|
|
7472
|
-
* @example
|
|
8344
|
+
* @example Register a sending domain
|
|
8345
|
+
* const domain = await bird.domains.create({ domain: "mail.acme.com" });
|
|
8346
|
+
* console.log(domain.id, domain.status); // "dom_…", "pending"
|
|
8347
|
+
*/
|
|
8348
|
+
create(params: DomainCreateParams, options?: RequestOptions): APIPromise<Domain>;
|
|
8349
|
+
/**
|
|
8350
|
+
* 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.
|
|
8351
|
+
*
|
|
8352
|
+
* @example Re-run the DNS verification check
|
|
8353
|
+
* const domain = await bird.domains.verify("dom_01krdgeqcxet5s7t44vh8rt9mg");
|
|
8354
|
+
* console.log(domain.status); // "verified" once DNS is in place
|
|
8355
|
+
*/
|
|
8356
|
+
verify(domainId: string, options?: RequestOptions): APIPromise<Domain>;
|
|
8357
|
+
/**
|
|
8358
|
+
* 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.
|
|
8359
|
+
*
|
|
8360
|
+
* @example Enable tracking on a domain
|
|
7473
8361
|
* await bird.domains.update("dom_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
7474
8362
|
* settings: { click_tracking: true, open_tracking: true },
|
|
7475
8363
|
* tracking: { name: "links" },
|
|
7476
8364
|
* });
|
|
7477
8365
|
*/
|
|
7478
|
-
update(domainId: string, params
|
|
8366
|
+
update(domainId: string, params?: DomainUpdateParams, options?: RequestOptions): APIPromise<Domain>;
|
|
7479
8367
|
/**
|
|
7480
|
-
* Delete a sending domain.
|
|
7481
|
-
* longer send new mail from it.
|
|
8368
|
+
* 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.
|
|
7482
8369
|
*
|
|
7483
|
-
* @example
|
|
8370
|
+
* @example Delete a sending domain by id
|
|
7484
8371
|
* await bird.domains.delete("dom_01krdgeqcxet5s7t44vh8rt9mg");
|
|
7485
8372
|
*/
|
|
7486
8373
|
delete(domainId: string, options?: RequestOptions): APIPromise<void>;
|
|
7487
|
-
/**
|
|
7488
|
-
* Trigger a fresh DNS check and return the refreshed domain with per-record
|
|
7489
|
-
* results. Safe to repeat while waiting for DNS to propagate.
|
|
7490
|
-
*
|
|
7491
|
-
* @example
|
|
7492
|
-
* const domain = await bird.domains.verify("dom_01krdgeqcxet5s7t44vh8rt9mg");
|
|
7493
|
-
* console.log(domain.status); // "verified" once DNS is in place
|
|
7494
|
-
*/
|
|
7495
|
-
verify(domainId: string, options?: RequestOptions): APIPromise<Domain>;
|
|
7496
8374
|
}
|
|
7497
8375
|
//#endregion
|
|
7498
8376
|
//#region src/resources/contactProperties.gen.d.ts
|
|
7499
8377
|
type ContactPropertyListQuery = NonNullable<ListContactPropertiesData["query"]>;
|
|
7500
|
-
|
|
8378
|
+
type ContactPropertyCreateParams = NonNullable<CreateContactPropertyData["body"]>;
|
|
8379
|
+
type ContactPropertyUpdateParams = NonNullable<UpdateContactPropertyData["body"]>;
|
|
8380
|
+
declare class ContactPropertiesResource extends Resource {
|
|
7501
8381
|
/**
|
|
7502
8382
|
* List the workspace's contact properties as a cursor page, newest first. Archived properties are included, marked by their archived flag.
|
|
7503
8383
|
*
|
|
@@ -7516,6 +8396,21 @@ declare class ContactPropertiesResourceBase extends Resource {
|
|
|
7516
8396
|
* console.log(prop.key, prop.type);
|
|
7517
8397
|
*/
|
|
7518
8398
|
get(propertyId: string, options?: RequestOptions): APIPromise<ContactProperty>;
|
|
8399
|
+
/**
|
|
8400
|
+
* 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.
|
|
8401
|
+
*
|
|
8402
|
+
* @example Define a custom property
|
|
8403
|
+
* const prop = await bird.contactProperties.create({ key: "plan", type: "string" });
|
|
8404
|
+
* console.log(prop.id); // "cp_…"
|
|
8405
|
+
*/
|
|
8406
|
+
create(params: ContactPropertyCreateParams, options?: RequestOptions): APIPromise<ContactProperty>;
|
|
8407
|
+
/**
|
|
8408
|
+
* Update a contact property's fallback value. The key and type are immutable; create a new property instead.
|
|
8409
|
+
*
|
|
8410
|
+
* @example Change a property's fallback value
|
|
8411
|
+
* await bird.contactProperties.update("cp_01krdgeqcxet5s7t44vh8rt9mg", { fallback_value: "free" });
|
|
8412
|
+
*/
|
|
8413
|
+
update(propertyId: string, params?: ContactPropertyUpdateParams, options?: RequestOptions): APIPromise<ContactProperty>;
|
|
7519
8414
|
/**
|
|
7520
8415
|
* 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`.
|
|
7521
8416
|
*
|
|
@@ -7533,34 +8428,12 @@ declare class ContactPropertiesResourceBase extends Resource {
|
|
|
7533
8428
|
unarchive(propertyId: string, options?: RequestOptions): APIPromise<ContactProperty>;
|
|
7534
8429
|
}
|
|
7535
8430
|
//#endregion
|
|
7536
|
-
//#region src/resources/contactProperties.d.ts
|
|
7537
|
-
/** Body for `bird.contactProperties.create`. */
|
|
7538
|
-
type ContactPropertyCreateParams = ContactPropertyCreateRequest;
|
|
7539
|
-
/** Body for `bird.contactProperties.update` — a partial patch. */
|
|
7540
|
-
type ContactPropertyUpdateParams = ContactPropertyUpdateRequest;
|
|
7541
|
-
declare class ContactPropertiesResource extends ContactPropertiesResourceBase {
|
|
7542
|
-
/**
|
|
7543
|
-
* Define a contact property. The `key` must be unique in the workspace and is
|
|
7544
|
-
* how contacts reference the field in their `data`.
|
|
7545
|
-
*
|
|
7546
|
-
* @example
|
|
7547
|
-
* const prop = await bird.contactProperties.create({ key: "plan", type: "string" });
|
|
7548
|
-
* console.log(prop.id); // "cp_…"
|
|
7549
|
-
*/
|
|
7550
|
-
create(params: ContactPropertyCreateParams, options?: RequestOptions): APIPromise<ContactProperty>;
|
|
7551
|
-
/**
|
|
7552
|
-
* Update a contact property. Only the fields you send change.
|
|
7553
|
-
*
|
|
7554
|
-
* @example
|
|
7555
|
-
* await bird.contactProperties.update("cp_01krdgeqcxet5s7t44vh8rt9mg", { fallback_value: "free" });
|
|
7556
|
-
*/
|
|
7557
|
-
update(propertyId: string, params: ContactPropertyUpdateParams, options?: RequestOptions): APIPromise<ContactProperty>;
|
|
7558
|
-
}
|
|
7559
|
-
//#endregion
|
|
7560
8431
|
//#region src/resources/contacts.gen.d.ts
|
|
7561
8432
|
type ContactListQuery = NonNullable<ListContactsData["query"]>;
|
|
7562
8433
|
type ContactCreateParams = NonNullable<CreateContactData["body"]>;
|
|
7563
|
-
|
|
8434
|
+
type ContactUpdateParams = NonNullable<UpdateContactData["body"]>;
|
|
8435
|
+
type ContactBatchParams = NonNullable<CreateContactBatchData["body"]>;
|
|
8436
|
+
declare class ContactsResource extends Resource {
|
|
7564
8437
|
/**
|
|
7565
8438
|
* 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.
|
|
7566
8439
|
*
|
|
@@ -7590,6 +8463,16 @@ declare class ContactsResourceBase extends Resource {
|
|
|
7590
8463
|
* console.log(contact.id); // "con_…"
|
|
7591
8464
|
*/
|
|
7592
8465
|
create(params: ContactCreateParams, options?: RequestOptions): APIPromise<Contact>;
|
|
8466
|
+
/**
|
|
8467
|
+
* 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.
|
|
8468
|
+
*
|
|
8469
|
+
* @example Change a contact's fields
|
|
8470
|
+
* const contact = await bird.contacts.update("con_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8471
|
+
* first_name: "Jane",
|
|
8472
|
+
* });
|
|
8473
|
+
* console.log(contact.first_name);
|
|
8474
|
+
*/
|
|
8475
|
+
update(contactId: string, params?: ContactUpdateParams, options?: RequestOptions): APIPromise<Contact>;
|
|
7593
8476
|
/**
|
|
7594
8477
|
* Delete a contact and remove it from every audience it belongs to. Suppression records for the address are unaffected.
|
|
7595
8478
|
*
|
|
@@ -7597,33 +8480,40 @@ declare class ContactsResourceBase extends Resource {
|
|
|
7597
8480
|
* await bird.contacts.delete("con_01krdgeqcxet5s7t44vh8rt9mg");
|
|
7598
8481
|
*/
|
|
7599
8482
|
delete(contactId: string, options?: RequestOptions): APIPromise<void>;
|
|
8483
|
+
/**
|
|
8484
|
+
* 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.
|
|
8485
|
+
*
|
|
8486
|
+
* @example Create or update many contacts at once, matched by email
|
|
8487
|
+
* const result = await bird.contacts.batch({
|
|
8488
|
+
* contacts: [{ email: "jane@acme.com", first_name: "Jane" }],
|
|
8489
|
+
* });
|
|
8490
|
+
* for (const item of result.data) {
|
|
8491
|
+
* console.log(item.email, item.status);
|
|
8492
|
+
* }
|
|
8493
|
+
*/
|
|
8494
|
+
batch(params: ContactBatchParams, options?: RequestOptions): APIPromise<ContactUpsertResult>;
|
|
7600
8495
|
}
|
|
7601
8496
|
//#endregion
|
|
7602
|
-
//#region src/resources/
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
/** Body for `bird.contacts.batch` — create-or-update many contacts in one call. */
|
|
7606
|
-
type ContactBatchParams = ContactUpsertRequest;
|
|
7607
|
-
declare class ContactsResource extends ContactsResourceBase {
|
|
8497
|
+
//#region src/resources/sms.gen.d.ts
|
|
8498
|
+
type SmsListQuery = NonNullable<ListSmsMessagesData["query"]>;
|
|
8499
|
+
declare class SmsResourceBase extends Resource {
|
|
7608
8500
|
/**
|
|
7609
|
-
*
|
|
8501
|
+
* Get one SMS message by id: its current delivery status, segment breakdown, cost, and failure detail if it failed.
|
|
7610
8502
|
*
|
|
7611
|
-
* @example
|
|
7612
|
-
* const
|
|
7613
|
-
*
|
|
7614
|
-
* });
|
|
8503
|
+
* @example Read a message back
|
|
8504
|
+
* const msg = await bird.sms.get("sms_abc123");
|
|
8505
|
+
* msg.status; // "accepted" | "delivered" | …
|
|
7615
8506
|
*/
|
|
7616
|
-
|
|
8507
|
+
get(messageId: string, options?: RequestOptions): APIPromise<SmsMessage>;
|
|
7617
8508
|
/**
|
|
7618
|
-
*
|
|
7619
|
-
* per-contact result.
|
|
8509
|
+
* 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.
|
|
7620
8510
|
*
|
|
7621
|
-
* @example
|
|
7622
|
-
* const
|
|
7623
|
-
*
|
|
7624
|
-
* }
|
|
8511
|
+
* @example Iterate outbound messages
|
|
8512
|
+
* for await (const msg of bird.sms.list({ direction: "outbound" })) {
|
|
8513
|
+
* console.log(msg.id, msg.status);
|
|
8514
|
+
* }
|
|
7625
8515
|
*/
|
|
7626
|
-
|
|
8516
|
+
list(query?: SmsListQuery, options?: RequestOptions): PaginatedPromise<SmsMessage>;
|
|
7627
8517
|
}
|
|
7628
8518
|
//#endregion
|
|
7629
8519
|
//#region src/resources/sms.d.ts
|
|
@@ -7634,8 +8524,7 @@ type SmsSendBatchParams = SmsMessageBatchRequest;
|
|
|
7634
8524
|
/** Result of `bird.sms.sendBatch`. */
|
|
7635
8525
|
type SmsSendBatchResult = SmsMessageBatchResponse;
|
|
7636
8526
|
/** Filters and cursor params for `bird.sms.list`. */
|
|
7637
|
-
|
|
7638
|
-
declare class SmsResource extends Resource {
|
|
8527
|
+
declare class SmsResource extends SmsResourceBase {
|
|
7639
8528
|
/**
|
|
7640
8529
|
* Send one SMS to a single recipient. Supply either `text` (with a `category`)
|
|
7641
8530
|
* or a stored `template` (by `id` or `name`, with its `parameters`). The
|
|
@@ -7668,37 +8557,13 @@ declare class SmsResource extends Resource {
|
|
|
7668
8557
|
* ]);
|
|
7669
8558
|
*/
|
|
7670
8559
|
sendBatch(params: SmsSendBatchParams, options?: RequestOptions): APIPromise<SmsSendBatchResult>;
|
|
7671
|
-
/**
|
|
7672
|
-
* Fetch a single SMS message: its current delivery status, segment breakdown,
|
|
7673
|
-
* cost, and failure detail if it failed.
|
|
7674
|
-
*
|
|
7675
|
-
* @example
|
|
7676
|
-
* const msg = await bird.sms.get("sms_abc123");
|
|
7677
|
-
* msg.status; // "accepted" | "delivered" | …
|
|
7678
|
-
*/
|
|
7679
|
-
get(messageId: string, options?: RequestOptions): APIPromise<SmsMessage>;
|
|
7680
|
-
/**
|
|
7681
|
-
* List SMS messages, newest first. `await` resolves the first page; `for await`
|
|
7682
|
-
* walks every message across all pages. Filter by direction, status, category,
|
|
7683
|
-
* recipient, sender, or tag.
|
|
7684
|
-
*
|
|
7685
|
-
* @example
|
|
7686
|
-
* for await (const msg of bird.sms.list({ direction: "outbound" })) {
|
|
7687
|
-
* console.log(msg.id, msg.status);
|
|
7688
|
-
* }
|
|
7689
|
-
*/
|
|
7690
|
-
list(query?: SmsListQuery, options?: RequestOptions): PaginatedPromise<SmsMessage>;
|
|
7691
8560
|
}
|
|
7692
8561
|
//#endregion
|
|
7693
|
-
//#region src/resources/smsTemplates.d.ts
|
|
7694
|
-
/** Filters for `bird.smsTemplates.list`. */
|
|
8562
|
+
//#region src/resources/smsTemplates.gen.d.ts
|
|
7695
8563
|
type SmsTemplateListQuery = NonNullable<ListSmsTemplatesData["query"]>;
|
|
7696
8564
|
declare class SmsTemplatesResource extends Resource {
|
|
7697
8565
|
/**
|
|
7698
|
-
* List the SMS templates available to
|
|
7699
|
-
* templates plus any the workspace authored. The catalogue is small and
|
|
7700
|
-
* returned in full (`.data`); this list is not paginated. Filter by `scope`,
|
|
7701
|
-
* `category`, or `language` (a BCP-47 language tag).
|
|
8566
|
+
* 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.
|
|
7702
8567
|
*
|
|
7703
8568
|
* @example List the built-in templates
|
|
7704
8569
|
* const { data } = await bird.smsTemplates.list({ scope: "system" });
|
|
@@ -7706,127 +8571,102 @@ declare class SmsTemplatesResource extends Resource {
|
|
|
7706
8571
|
*/
|
|
7707
8572
|
list(query?: SmsTemplateListQuery, options?: RequestOptions): APIPromise<SmsTemplateList>;
|
|
7708
8573
|
/**
|
|
7709
|
-
*
|
|
7710
|
-
* variables it expects.
|
|
8574
|
+
* 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.
|
|
7711
8575
|
*
|
|
7712
|
-
* @example
|
|
8576
|
+
* @example Read one template by name or id
|
|
7713
8577
|
* const tpl = await bird.smsTemplates.get("bird_otp_verification");
|
|
7714
8578
|
* console.log(tpl.body, tpl.variables);
|
|
7715
8579
|
*/
|
|
7716
8580
|
get(templateRef: string, options?: RequestOptions): APIPromise<SmsTemplate>;
|
|
7717
8581
|
}
|
|
7718
8582
|
//#endregion
|
|
7719
|
-
//#region src/resources/whatsapp.d.ts
|
|
7720
|
-
/** Body for `bird.whatsapp.send` — a template send; Bird picks the sender from the template's category. */
|
|
7721
|
-
type WhatsappSendParams = WhatsAppMessageSendRequest;
|
|
7722
|
-
/** Filters and cursor params for `bird.whatsapp.list`. */
|
|
8583
|
+
//#region src/resources/whatsapp.gen.d.ts
|
|
7723
8584
|
type WhatsappListQuery = NonNullable<ListWhatsAppMessagesData["query"]>;
|
|
7724
|
-
/** Filter for `bird.whatsapp.listEvents`. */
|
|
7725
8585
|
type WhatsappListEventsQuery = NonNullable<ListWhatsAppMessageEventsData["query"]>;
|
|
7726
|
-
declare class
|
|
7727
|
-
/**
|
|
7728
|
-
* Send a template message. Bird selects the sender number from the
|
|
7729
|
-
* template's category, so there is no sender field on the request. The
|
|
7730
|
-
* result is `accepted`, not yet delivered — read it back with `get` to
|
|
7731
|
-
* confirm.
|
|
7732
|
-
*
|
|
7733
|
-
* @example
|
|
7734
|
-
* const msg = await bird.whatsapp.send({
|
|
7735
|
-
* to: "+15551234567",
|
|
7736
|
-
* template: {
|
|
7737
|
-
* name: "bird_otp",
|
|
7738
|
-
* components: [
|
|
7739
|
-
* { type: "body", parameters: [{ type: "text", text: "123456" }] },
|
|
7740
|
-
* ],
|
|
7741
|
-
* },
|
|
7742
|
-
* });
|
|
7743
|
-
* console.log(msg.id, msg.status);
|
|
7744
|
-
*/
|
|
7745
|
-
send(params: WhatsappSendParams, options?: RequestOptions): APIPromise<WhatsAppMessage>;
|
|
8586
|
+
declare class WhatsappResourceBase extends Resource {
|
|
7746
8587
|
/**
|
|
7747
|
-
*
|
|
7748
|
-
* detail if it failed.
|
|
8588
|
+
* 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.
|
|
7749
8589
|
*
|
|
7750
|
-
* @example
|
|
8590
|
+
* @example Read a message back
|
|
7751
8591
|
* const msg = await bird.whatsapp.get("wa_abc123");
|
|
7752
8592
|
* msg.status; // "accepted" | "delivered" | …
|
|
7753
8593
|
*/
|
|
7754
8594
|
get(messageId: string, options?: RequestOptions): APIPromise<WhatsAppMessage>;
|
|
7755
8595
|
/**
|
|
7756
|
-
* List WhatsApp messages, newest first.
|
|
7757
|
-
* `for await` walks every message across all pages. Filter by status,
|
|
7758
|
-
* recipient phone number, or business-scoped user ID.
|
|
8596
|
+
* 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.
|
|
7759
8597
|
*
|
|
7760
|
-
* @example
|
|
8598
|
+
* @example Iterate delivered messages
|
|
7761
8599
|
* for await (const msg of bird.whatsapp.list({ status: ["delivered"] })) {
|
|
7762
8600
|
* console.log(msg.id, msg.status);
|
|
7763
8601
|
* }
|
|
7764
8602
|
*/
|
|
7765
8603
|
list(query?: WhatsappListQuery, options?: RequestOptions): PaginatedPromise<WhatsAppMessage>;
|
|
7766
8604
|
/**
|
|
7767
|
-
*
|
|
7768
|
-
* order. The timeline is bounded and returned in full — this list is not
|
|
7769
|
-
* paginated.
|
|
8605
|
+
* 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.
|
|
7770
8606
|
*
|
|
7771
|
-
* @example
|
|
8607
|
+
* @example Read one message's delivery timeline
|
|
7772
8608
|
* const { data } = await bird.whatsapp.listEvents("wa_abc123");
|
|
7773
8609
|
* for (const event of data) console.log(event.type, event.occurred_at);
|
|
7774
8610
|
*/
|
|
7775
8611
|
listEvents(messageId: string, query?: WhatsappListEventsQuery, options?: RequestOptions): APIPromise<WhatsAppEventList>;
|
|
7776
8612
|
}
|
|
7777
8613
|
//#endregion
|
|
7778
|
-
//#region src/resources/
|
|
7779
|
-
|
|
8614
|
+
//#region src/resources/whatsapp.d.ts
|
|
8615
|
+
/** Body for `bird.whatsapp.send` — a template send; Bird picks the sender from the template's category. */
|
|
8616
|
+
type WhatsappSendParams = WhatsAppMessageSendRequest;
|
|
8617
|
+
declare class WhatsappResource extends WhatsappResourceBase {
|
|
7780
8618
|
/**
|
|
7781
|
-
*
|
|
7782
|
-
*
|
|
7783
|
-
*
|
|
8619
|
+
* Send a template message. Bird selects the sender number from the
|
|
8620
|
+
* template's category, so there is no sender field on the request. The
|
|
8621
|
+
* result is `accepted`, not yet delivered — read it back with `get` to
|
|
8622
|
+
* confirm.
|
|
7784
8623
|
*
|
|
7785
8624
|
* @example
|
|
7786
|
-
* const
|
|
7787
|
-
*
|
|
8625
|
+
* const msg = await bird.whatsapp.send({
|
|
8626
|
+
* to: "+15551234567",
|
|
8627
|
+
* template: {
|
|
8628
|
+
* name: "bird_otp",
|
|
8629
|
+
* components: [
|
|
8630
|
+
* { type: "body", parameters: [{ type: "text", text: "123456" }] },
|
|
8631
|
+
* ],
|
|
8632
|
+
* },
|
|
8633
|
+
* });
|
|
8634
|
+
* console.log(msg.id, msg.status);
|
|
7788
8635
|
*/
|
|
7789
|
-
|
|
8636
|
+
send(params: WhatsappSendParams, options?: RequestOptions): APIPromise<WhatsAppMessage>;
|
|
7790
8637
|
}
|
|
7791
8638
|
//#endregion
|
|
7792
|
-
//#region src/resources/
|
|
7793
|
-
|
|
7794
|
-
type
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
* Start a verification
|
|
7800
|
-
* (a `phone_number` over SMS, an `email_address` over email, or both). Calling
|
|
7801
|
-
* again for the same recipient re-sends the code after the cooldown rather than
|
|
7802
|
-
* starting a second verification. The passcode is never returned — submit the
|
|
7803
|
-
* recipient's entry with `check`.
|
|
7804
|
-
*
|
|
7805
|
-
* @example Start over SMS
|
|
8639
|
+
//#region src/resources/verifyVerifications.gen.d.ts
|
|
8640
|
+
type VerifyVerificationsCreateParams = NonNullable<CreateVerificationData["body"]>;
|
|
8641
|
+
type VerifyVerificationsCheckParams = NonNullable<CreateVerificationCheckData["body"]>;
|
|
8642
|
+
declare class VerifyVerificationsResource extends Resource {
|
|
8643
|
+
/**
|
|
8644
|
+
* 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.
|
|
8645
|
+
*
|
|
8646
|
+
* @example Start a verification over SMS
|
|
7806
8647
|
* const verification = await bird.verify.verifications.create({
|
|
7807
8648
|
* to: { phone_number: "+15551234567" },
|
|
7808
8649
|
* });
|
|
7809
8650
|
* console.log(verification.id, verification.status);
|
|
7810
8651
|
*/
|
|
7811
|
-
create(params:
|
|
8652
|
+
create(params: VerifyVerificationsCreateParams, options?: RequestOptions): APIPromise<Verification>;
|
|
7812
8653
|
/**
|
|
7813
|
-
* Check a passcode
|
|
7814
|
-
* `to` recipient used to start it — no id needed. A wrong or expired code resolves
|
|
7815
|
-
* with `success: false` and a `reason`, not an error; a verification already
|
|
7816
|
-
* resolved is no longer checkable and returns a 404 error.
|
|
8654
|
+
* 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.
|
|
7817
8655
|
*
|
|
7818
|
-
* @example
|
|
8656
|
+
* @example Check a submitted passcode
|
|
7819
8657
|
* const result = await bird.verify.verifications.check({
|
|
7820
8658
|
* to: { phone_number: "+15551234567" },
|
|
7821
8659
|
* code: "123456",
|
|
7822
8660
|
* });
|
|
7823
8661
|
* console.log(result.success);
|
|
7824
8662
|
*/
|
|
7825
|
-
check(params:
|
|
8663
|
+
check(params: VerifyVerificationsCheckParams, options?: RequestOptions): APIPromise<VerificationCheckResult>;
|
|
7826
8664
|
}
|
|
8665
|
+
//#endregion
|
|
8666
|
+
//#region src/resources/verify.d.ts
|
|
7827
8667
|
/** The Verify product namespace — holds the `verifications` collection. */
|
|
7828
8668
|
declare class VerifyResource {
|
|
7829
|
-
readonly verifications:
|
|
8669
|
+
readonly verifications: VerifyVerificationsResource;
|
|
7830
8670
|
constructor(...args: ConstructorParameters<typeof Resource>);
|
|
7831
8671
|
}
|
|
7832
8672
|
//#endregion
|
|
@@ -7884,224 +8724,146 @@ declare class WebhooksResource {
|
|
|
7884
8724
|
unwrap(payload: string, headers: WebhookHeaders, options?: WebhookOptions): BirdWebhookEvent;
|
|
7885
8725
|
}
|
|
7886
8726
|
//#endregion
|
|
7887
|
-
//#region src/resources/
|
|
7888
|
-
/**
|
|
7889
|
-
type
|
|
7890
|
-
/**
|
|
7891
|
-
type
|
|
7892
|
-
/**
|
|
7893
|
-
type
|
|
7894
|
-
/**
|
|
7895
|
-
type
|
|
7896
|
-
/**
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
* console.log(mailbox.address); // "abc123@inbox.ai"
|
|
7909
|
-
*/
|
|
7910
|
-
create(params?: MailboxCreateParams, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7911
|
-
/**
|
|
7912
|
-
* Get a mailbox by id.
|
|
7913
|
-
*
|
|
7914
|
-
* @example Get a mailbox
|
|
7915
|
-
* const mailbox = await bird.mailbox.get("mbx_01abc");
|
|
7916
|
-
* console.log(mailbox.state); // "active"
|
|
7917
|
-
*/
|
|
7918
|
-
get(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7919
|
-
/**
|
|
7920
|
-
* Update a mailbox. Only the fields you provide change.
|
|
7921
|
-
*
|
|
7922
|
-
* @example Update receive policy
|
|
7923
|
-
* const mailbox = await bird.mailbox.update("mbx_01abc", { receive_policy: "open" });
|
|
7924
|
-
*/
|
|
7925
|
-
update(mailboxId: string, params: MailboxUpdateParams, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7926
|
-
/**
|
|
7927
|
-
* Soft-delete a mailbox. It can be restored within 30 days.
|
|
7928
|
-
*
|
|
7929
|
-
* @example Delete a mailbox
|
|
7930
|
-
* await bird.mailbox.delete("mbx_01abc");
|
|
7931
|
-
*/
|
|
7932
|
-
delete(mailboxId: string, options?: RequestOptions): APIPromise<void>;
|
|
7933
|
-
/**
|
|
7934
|
-
* Restore a deleted mailbox within its 30-day window.
|
|
7935
|
-
*
|
|
7936
|
-
* @example Restore a mailbox
|
|
7937
|
-
* const mailbox = await bird.mailbox.restore("mbx_01abc");
|
|
7938
|
-
*/
|
|
7939
|
-
restore(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7940
|
-
/**
|
|
7941
|
-
* Reactivate a suspended mailbox.
|
|
7942
|
-
*
|
|
7943
|
-
* @example Resume a mailbox
|
|
7944
|
-
* const mailbox = await bird.mailbox.resume("mbx_01abc");
|
|
7945
|
-
*/
|
|
7946
|
-
resume(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox>;
|
|
7947
|
-
/**
|
|
7948
|
-
* Get email activity statistics for a mailbox.
|
|
7949
|
-
*
|
|
7950
|
-
* @example Get mailbox stats
|
|
7951
|
-
* const stats = await bird.mailbox.stats("mbx_01abc");
|
|
7952
|
-
* console.log(stats.summary?.sends_accepted);
|
|
7953
|
-
*/
|
|
7954
|
-
stats(mailboxId: string, query?: MailboxStatsQuery, options?: RequestOptions): APIPromise<MailboxStatsResponse>;
|
|
7955
|
-
/**
|
|
7956
|
-
* Send a new email from this mailbox, starting a new conversation.
|
|
7957
|
-
*
|
|
7958
|
-
* @example Send from a mailbox
|
|
7959
|
-
* const msg = await bird.mailbox.compose("mbx_01abc", {
|
|
7960
|
-
* to: ["customer@example.com"],
|
|
7961
|
-
* subject: "Hello",
|
|
7962
|
-
* text: "Hi there!",
|
|
7963
|
-
* });
|
|
7964
|
-
*/
|
|
7965
|
-
compose(mailboxId: string, params: MailboxComposeParams, options?: RequestOptions): APIPromise<EmailThreadMessage>;
|
|
7966
|
-
/**
|
|
7967
|
-
* List labels available in a mailbox.
|
|
7968
|
-
*
|
|
7969
|
-
* @example List labels
|
|
7970
|
-
* const labels = await bird.mailbox.labels("mbx_01abc");
|
|
7971
|
-
* console.log(labels.data.map(l => l.name));
|
|
7972
|
-
*/
|
|
7973
|
-
labels(mailboxId: string, options?: RequestOptions): APIPromise<EmailMailboxLabelList>;
|
|
7974
|
-
/**
|
|
7975
|
-
* List mailboxes in the workspace. `await` resolves the first page;
|
|
7976
|
-
* `for await` walks every mailbox.
|
|
7977
|
-
*
|
|
7978
|
-
* @example List mailboxes
|
|
7979
|
-
* for await (const mailbox of bird.mailbox.list()) {
|
|
7980
|
-
* console.log(mailbox.address);
|
|
7981
|
-
* }
|
|
7982
|
-
*/
|
|
7983
|
-
list(query?: MailboxListQuery, options?: RequestOptions): PaginatedPromise<Mailbox>;
|
|
8727
|
+
//#region src/resources/realtime.d.ts
|
|
8728
|
+
/** Body for `bird.realtime.publish` — one event to one or more channels. */
|
|
8729
|
+
type RealtimePublishParams = RealtimePublish;
|
|
8730
|
+
/** Body for `bird.realtime.publishBatch` — up to 10 events, one channel each. */
|
|
8731
|
+
type RealtimeBatchPublishParams = RealtimeBatchPublish;
|
|
8732
|
+
/** Query params for `bird.realtime.channels.list`. */
|
|
8733
|
+
type RealtimeChannelsListQuery = NonNullable<ListRealtimeAppChannelsData["query"]>;
|
|
8734
|
+
/** Query params for `bird.realtime.channels.get`. */
|
|
8735
|
+
type RealtimeChannelGetQuery = NonNullable<GetRealtimeAppChannelData["query"]>;
|
|
8736
|
+
/**
|
|
8737
|
+
* Realtime app credentials — `new BirdClient({ realtime: { key, secret } })`.
|
|
8738
|
+
* They come from the app's credentials (shown once at creation) and must belong
|
|
8739
|
+
* to the calling workspace. Any Realtime method takes the same pair in its
|
|
8740
|
+
* trailing options to override the configured one for a single call — the way
|
|
8741
|
+
* to talk to a second app without a second client.
|
|
8742
|
+
*/
|
|
8743
|
+
interface RealtimeOptions {
|
|
8744
|
+
/** The Realtime app key, sent as `X-Realtime-Key`. */
|
|
8745
|
+
key?: string;
|
|
8746
|
+
/** The Realtime app secret, sent as `X-Realtime-Secret`. */
|
|
8747
|
+
secret?: string;
|
|
7984
8748
|
}
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
create(mailboxId: string, params: MailboxReceiveRuleCreateParams, options?: RequestOptions): APIPromise<ReceiveRule>;
|
|
7996
|
-
/**
|
|
7997
|
-
* Remove a receive rule.
|
|
7998
|
-
*
|
|
7999
|
-
* @example Delete a rule
|
|
8000
|
-
* await bird.mailboxReceiveRule.delete("mbx_01abc", "erl_01xyz");
|
|
8001
|
-
*/
|
|
8002
|
-
delete(mailboxId: string, ruleId: string, options?: RequestOptions): APIPromise<void>;
|
|
8749
|
+
/** Per-call options for a Realtime method: the usual request options plus a credential override. */
|
|
8750
|
+
interface RealtimeRequestOptions extends RequestOptions, RealtimeOptions {}
|
|
8751
|
+
/** The resolved credential headers, in wire form. */
|
|
8752
|
+
interface RealtimeAuthHeaders {
|
|
8753
|
+
"X-Realtime-Key": string;
|
|
8754
|
+
"X-Realtime-Secret": string;
|
|
8755
|
+
}
|
|
8756
|
+
declare abstract class RealtimeBase extends Resource {
|
|
8757
|
+
#private;
|
|
8758
|
+
constructor(core: ConstructorParameters<typeof Resource>[0], client: ConstructorParameters<typeof Resource>[1], config?: RealtimeOptions);
|
|
8003
8759
|
/**
|
|
8004
|
-
*
|
|
8005
|
-
*
|
|
8006
|
-
*
|
|
8007
|
-
* for await (const rule of bird.mailboxReceiveRule.list("mbx_01abc")) {
|
|
8008
|
-
* console.log(rule.action, rule.entry);
|
|
8009
|
-
* }
|
|
8760
|
+
* Resolve the app credentials for one call. Called eagerly at the top of each
|
|
8761
|
+
* method so a missing credential throws before the lifecycle starts — never
|
|
8762
|
+
* as a rejected promise after a request is already in flight.
|
|
8010
8763
|
*/
|
|
8011
|
-
|
|
8764
|
+
protected auth(options?: RealtimeOptions): RealtimeAuthHeaders;
|
|
8012
8765
|
}
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
/** Parameters for `bird.mailboxThreadMessage.reply`. */
|
|
8020
|
-
type MailboxThreadMessageReplyParams = EmailThreadMessageReplyRequest;
|
|
8021
|
-
/** Filters for `bird.mailboxThreadMessage.list`. */
|
|
8022
|
-
type MailboxThreadMessageListQuery = NonNullable<ListEmailThreadMessagesData["query"]>;
|
|
8023
|
-
declare class MailboxThreadResource extends Resource {
|
|
8024
|
-
/**
|
|
8025
|
-
* Get a conversation thread.
|
|
8026
|
-
*
|
|
8027
|
-
* @example Get a thread
|
|
8028
|
-
* const thread = await bird.mailboxThread.get("thr_01abc");
|
|
8029
|
-
* console.log(thread.message_count);
|
|
8030
|
-
*/
|
|
8031
|
-
get(threadId: string, options?: RequestOptions): APIPromise<EmailThread>;
|
|
8766
|
+
/**
|
|
8767
|
+
* `bird.realtime.channels` — reads the app's live channel state. Channels exist
|
|
8768
|
+
* implicitly: one appears when the first connection subscribes and vanishes when
|
|
8769
|
+
* the last one leaves, so these report occupancy, never existence.
|
|
8770
|
+
*/
|
|
8771
|
+
declare class RealtimeChannelsResource extends RealtimeBase {
|
|
8032
8772
|
/**
|
|
8033
|
-
*
|
|
8773
|
+
* List the app's currently occupied channels, optionally filtered by name
|
|
8774
|
+
* prefix. The Realtime service returns them all in one response — this is a
|
|
8775
|
+
* point read, not a cursor list, so there is nothing to iterate.
|
|
8034
8776
|
*
|
|
8035
|
-
* @example
|
|
8036
|
-
* const
|
|
8037
|
-
*
|
|
8777
|
+
* @example List the occupied presence channels with their member counts
|
|
8778
|
+
* const { data } = await bird.realtime.channels.list("rap_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8779
|
+
* prefix: "presence-",
|
|
8780
|
+
* include: ["member_count"],
|
|
8038
8781
|
* });
|
|
8782
|
+
* for (const channel of data) console.log(channel.name, channel.member_count);
|
|
8039
8783
|
*/
|
|
8040
|
-
|
|
8784
|
+
list(appId: string, query?: RealtimeChannelsListQuery, options?: RealtimeRequestOptions): APIPromise<RealtimeChannelsList>;
|
|
8041
8785
|
/**
|
|
8042
|
-
*
|
|
8786
|
+
* Read one channel's state. An unknown or never-used name is not an error —
|
|
8787
|
+
* it resolves with `occupied: false`.
|
|
8043
8788
|
*
|
|
8044
|
-
* @example
|
|
8045
|
-
* await bird.
|
|
8789
|
+
* @example Check whether anyone is in a channel
|
|
8790
|
+
* const channel = await bird.realtime.channels.get(
|
|
8791
|
+
* "rap_01krdgeqcxet5s7t44vh8rt9mg",
|
|
8792
|
+
* "presence-lobby",
|
|
8793
|
+
* { include: ["member_count"] },
|
|
8794
|
+
* );
|
|
8795
|
+
* console.log(channel.occupied, channel.member_count);
|
|
8046
8796
|
*/
|
|
8047
|
-
|
|
8048
|
-
permanent?: boolean;
|
|
8049
|
-
}, options?: RequestOptions): APIPromise<void>;
|
|
8797
|
+
get(appId: string, channelName: string, query?: RealtimeChannelGetQuery, options?: RealtimeRequestOptions): APIPromise<RealtimeChannelInfo>;
|
|
8050
8798
|
/**
|
|
8051
|
-
* List
|
|
8052
|
-
*
|
|
8799
|
+
* List the member ids subscribed to a presence channel. Ids only — the
|
|
8800
|
+
* `member_info` your authorization endpoint attaches is delivered to subscribed
|
|
8801
|
+
* clients over the realtime connection and is not available over REST.
|
|
8053
8802
|
*
|
|
8054
|
-
* @example
|
|
8055
|
-
*
|
|
8056
|
-
*
|
|
8057
|
-
*
|
|
8803
|
+
* @example Who is in the lobby
|
|
8804
|
+
* const { members } = await bird.realtime.channels.members(
|
|
8805
|
+
* "rap_01krdgeqcxet5s7t44vh8rt9mg",
|
|
8806
|
+
* "presence-lobby",
|
|
8807
|
+
* );
|
|
8808
|
+
* for (const member of members) console.log(member.member_id);
|
|
8058
8809
|
*/
|
|
8059
|
-
|
|
8810
|
+
members(appId: string, channelName: string, options?: RealtimeRequestOptions): APIPromise<RealtimeChannelMembers>;
|
|
8060
8811
|
}
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
* Get metadata for a message (not the body; use `body` for that).
|
|
8064
|
-
*
|
|
8065
|
-
* @example Get a message
|
|
8066
|
-
* const msg = await bird.mailboxThreadMessage.get("thr_01abc", "rem_01xyz");
|
|
8067
|
-
* console.log(msg.direction); // "inbound"
|
|
8068
|
-
*/
|
|
8069
|
-
get(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessage>;
|
|
8812
|
+
/** `bird.realtime.members` — acts on a member across all of its connections. */
|
|
8813
|
+
declare class RealtimeMembersResource extends RealtimeBase {
|
|
8070
8814
|
/**
|
|
8071
|
-
*
|
|
8815
|
+
* Disconnect every active connection a member holds — sign-out, ban, or a
|
|
8816
|
+
* revoked session. Resolves once the disconnect is applied; the member may
|
|
8817
|
+
* reconnect immediately unless your authorization endpoint refuses them.
|
|
8072
8818
|
*
|
|
8073
|
-
* @example
|
|
8074
|
-
*
|
|
8075
|
-
* console.log(body.text);
|
|
8819
|
+
* @example Kick a member off every connection
|
|
8820
|
+
* await bird.realtime.members.disconnect("rap_01krdgeqcxet5s7t44vh8rt9mg", "user_42");
|
|
8076
8821
|
*/
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8822
|
+
disconnect(appId: string, memberId: string, options?: RealtimeRequestOptions): APIPromise<void>;
|
|
8823
|
+
}
|
|
8824
|
+
/**
|
|
8825
|
+
* `bird.realtime` — publish events to a Realtime app's channels and inspect its
|
|
8826
|
+
* live state. Every method needs the app's key/secret pair: set it once as
|
|
8827
|
+
* `realtime: { key, secret }` on the client, or pass `{ key, secret }` in a
|
|
8828
|
+
* call's options to reach a different app. Reached as `bird.realtime.*`.
|
|
8829
|
+
*/
|
|
8830
|
+
declare class RealtimeResource extends RealtimeBase {
|
|
8831
|
+
/** Channel state — `bird.realtime.channels.list(...)`, `.get(...)`, `.members(...)`. */
|
|
8832
|
+
readonly channels: RealtimeChannelsResource;
|
|
8833
|
+
/** Members — `bird.realtime.members.disconnect(...)`. */
|
|
8834
|
+
readonly members: RealtimeMembersResource;
|
|
8835
|
+
constructor(core: ConstructorParameters<typeof Resource>[0], client: ConstructorParameters<typeof Resource>[1], config?: RealtimeOptions);
|
|
8836
|
+
/**
|
|
8837
|
+
* Publish one event to one or more of the app's channels. Listing several
|
|
8838
|
+
* channels broadcasts the same event to all of them in a single call. Resolves
|
|
8839
|
+
* once the event is accepted — delivery to connected clients is asynchronous.
|
|
8840
|
+
*
|
|
8841
|
+
* Pass `exclude_connection_id` to skip the connection that triggered the
|
|
8842
|
+
* change, so the originating client doesn't echo its own update.
|
|
8843
|
+
*
|
|
8844
|
+
* @example Broadcast an event to a channel
|
|
8845
|
+
* const result = await bird.realtime.publish("rap_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8846
|
+
* event: "order.updated",
|
|
8847
|
+
* channels: ["orders", "presence-lobby"],
|
|
8848
|
+
* data: { order_id: "ord_123", status: "shipped" },
|
|
8084
8849
|
* });
|
|
8850
|
+
* console.log(result.data?.length); // one entry per channel
|
|
8085
8851
|
*/
|
|
8086
|
-
|
|
8087
|
-
/**
|
|
8088
|
-
* List the attachment manifest for a message.
|
|
8089
|
-
*
|
|
8090
|
-
* @example List attachments
|
|
8091
|
-
* const atts = await bird.mailboxThreadMessage.attachments("thr_01abc", "rem_01xyz");
|
|
8092
|
-
* console.log(atts.data.map(a => a.filename));
|
|
8093
|
-
*/
|
|
8094
|
-
attachments(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessageAttachmentList>;
|
|
8852
|
+
publish(appId: string, params: RealtimePublishParams, options?: RealtimeRequestOptions): APIPromise<RealtimePublishResult>;
|
|
8095
8853
|
/**
|
|
8096
|
-
*
|
|
8097
|
-
*
|
|
8854
|
+
* Publish up to 10 events in one request, each to a single channel. Use it to
|
|
8855
|
+
* fan different events out at once; to send the *same* event to many channels,
|
|
8856
|
+
* use `publish` with several `channels` instead.
|
|
8098
8857
|
*
|
|
8099
|
-
* @example
|
|
8100
|
-
*
|
|
8101
|
-
*
|
|
8102
|
-
* }
|
|
8858
|
+
* @example Publish two events in one call
|
|
8859
|
+
* await bird.realtime.publishBatch("rap_01krdgeqcxet5s7t44vh8rt9mg", {
|
|
8860
|
+
* events: [
|
|
8861
|
+
* { event: "order.created", channel: "orders", data: { id: 1 } },
|
|
8862
|
+
* { event: "order.updated", channel: "orders", data: { id: 2 } },
|
|
8863
|
+
* ],
|
|
8864
|
+
* });
|
|
8103
8865
|
*/
|
|
8104
|
-
|
|
8866
|
+
publishBatch(appId: string, params: RealtimeBatchPublishParams, options?: RealtimeRequestOptions): APIPromise<RealtimeBatchPublishResult>;
|
|
8105
8867
|
}
|
|
8106
8868
|
//#endregion
|
|
8107
8869
|
//#region src/client.d.ts
|
|
@@ -8126,6 +8888,11 @@ interface BirdClientOptions {
|
|
|
8126
8888
|
email?: EmailChannelDefaults;
|
|
8127
8889
|
/** Webhooks config — `secret` is the default used by `bird.webhooks.unwrap`. */
|
|
8128
8890
|
webhooks?: WebhookOptions;
|
|
8891
|
+
/**
|
|
8892
|
+
* Realtime app credentials. Every `bird.realtime.*` call authenticates to the
|
|
8893
|
+
* Realtime edge with this key/secret pair; a call's options can override it.
|
|
8894
|
+
*/
|
|
8895
|
+
realtime?: RealtimeOptions;
|
|
8129
8896
|
}
|
|
8130
8897
|
/** A raw request for the `bird.request` escape hatch. */
|
|
8131
8898
|
interface BirdRequest {
|
|
@@ -8185,8 +8952,6 @@ declare class BirdClient<const O extends BirdClientOptions = BirdClientOptions>
|
|
|
8185
8952
|
readonly smsTemplates: SmsTemplatesResource;
|
|
8186
8953
|
/** The WhatsApp channel — `bird.whatsapp.send(...)`, `.get(...)`, `.list(...)`, `.listEvents(...)`. */
|
|
8187
8954
|
readonly whatsapp: WhatsappResource;
|
|
8188
|
-
/** WhatsApp templates — `bird.whatsappTemplates.list(...)`. */
|
|
8189
|
-
readonly whatsappTemplates: WhatsappTemplatesResource;
|
|
8190
8955
|
/** The Verify product — `bird.verify.verifications.create(...)`, `.check(...)`. */
|
|
8191
8956
|
readonly verify: VerifyResource;
|
|
8192
8957
|
/** Contacts — `bird.contacts.create(...)`, `.list(...)`, `.get(...)`, `.batch(...)`, … */
|
|
@@ -8199,14 +8964,8 @@ declare class BirdClient<const O extends BirdClientOptions = BirdClientOptions>
|
|
|
8199
8964
|
readonly domains: DomainsResource;
|
|
8200
8965
|
/** Webhooks — `bird.webhooks.unwrap(payload, headers)` verifies an inbound delivery. */
|
|
8201
8966
|
readonly webhooks: WebhooksResource;
|
|
8202
|
-
/**
|
|
8203
|
-
readonly
|
|
8204
|
-
/** Mailbox receive rules — `bird.mailboxReceiveRule.create(...)`, `.delete(...)`, `.list(...)`. */
|
|
8205
|
-
readonly mailboxReceiveRule: MailboxReceiveRuleResource;
|
|
8206
|
-
/** Mailbox threads — `bird.mailboxThread.list(...)`, `.get(...)`, `.update(...)`, `.delete(...)`. */
|
|
8207
|
-
readonly mailboxThread: MailboxThreadResource;
|
|
8208
|
-
/** Thread messages — `bird.mailboxThreadMessage.list(...)`, `.get(...)`, `.reply(...)`, `.body(...)`, … */
|
|
8209
|
-
readonly mailboxThreadMessage: MailboxThreadMessageResource;
|
|
8967
|
+
/** Realtime — `bird.realtime.publish(...)`, `.channels.list(...)`, `.members.disconnect(...)`, … */
|
|
8968
|
+
readonly realtime: RealtimeResource;
|
|
8210
8969
|
constructor(options: O);
|
|
8211
8970
|
/**
|
|
8212
8971
|
* Escape hatch for endpoints the typed resources don't cover. Runs the full
|
|
@@ -8260,11 +9019,6 @@ declare const WebhookEventType: {
|
|
|
8260
9019
|
readonly EmailScheduled: "email.scheduled";
|
|
8261
9020
|
readonly EmailSuppressionCreated: "email_suppression.created";
|
|
8262
9021
|
readonly EmailUnsubscribed: "email.unsubscribed";
|
|
8263
|
-
readonly RealtimeCacheChannels: "realtime.cache_channels";
|
|
8264
|
-
readonly RealtimeChannelExistence: "realtime.channel_existence";
|
|
8265
|
-
readonly RealtimeClientEvents: "realtime.client_events";
|
|
8266
|
-
readonly RealtimeConnectionCount: "realtime.connection_count";
|
|
8267
|
-
readonly RealtimePresence: "realtime.presence";
|
|
8268
9022
|
readonly SmsAccepted: "sms.accepted";
|
|
8269
9023
|
readonly SmsDelivered: "sms.delivered";
|
|
8270
9024
|
readonly SmsExpired: "sms.expired";
|
|
@@ -8294,5 +9048,5 @@ declare const WebhookEventType: {
|
|
|
8294
9048
|
/** A known webhook event type value. */
|
|
8295
9049
|
type WebhookEventTypeValue = (typeof WebhookEventType)[keyof typeof WebhookEventType];
|
|
8296
9050
|
//#endregion
|
|
8297
|
-
export { type APIPromise, type Audience, type AudienceAddContactsParams, type
|
|
9051
|
+
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 EmailMailboxesCreateParams, type EmailMailboxesListQuery, type EmailMailboxesMessagesCreateParams, type EmailMailboxesReceiveRulesCreateParams, type EmailMailboxesReceiveRulesListQuery, type EmailMailboxesStatsQuery, type EmailMailboxesUpdateParams, type EmailMailboxesUpdateQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailStatsByBounceCodeQuery, type EmailStatsByBounceCodeResponse, type EmailStatsByBroadcastQuery, type EmailStatsByBroadcastResponse, type EmailStatsByCategoryQuery, type EmailStatsByCategoryResponse, type EmailStatsByClientQuery, type EmailStatsByClientResponse, type EmailStatsByComplaintTypeQuery, type EmailStatsByComplaintTypeResponse, type EmailStatsByLocationQuery, type EmailStatsByLocationResponse, type EmailStatsByMailboxProviderQuery, type EmailStatsByMailboxProviderRegionQuery, type EmailStatsByMailboxProviderRegionResponse, type EmailStatsByMailboxProviderResponse, type EmailStatsByRecipientDomainQuery, type EmailStatsByRecipientDomainResponse, type EmailStatsBySendingDomainQuery, type EmailStatsBySendingDomainResponse, type EmailStatsBySendingIpQuery, type EmailStatsBySendingIpResponse, type EmailStatsByTagQuery, type EmailStatsByTemplateQuery, type EmailStatsByTemplateResponse, type EmailStatsDailyQuery, type EmailStatsHourlyQuery, type EmailStatsResponse, type EmailStatsSummary, type EmailStatsSummaryQuery, type EmailStatsTagsResponse, type EmailThread, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadsDeleteQuery, type EmailThreadsListQuery, type EmailThreadsMessagesListQuery, type EmailThreadsMessagesReplyParams, type EmailThreadsUpdateParams, type ErrorDetail, type ErrorNextAction, type Mailbox, type MailboxStatsResponse, type PaginatedPromise, type 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 };
|
|
8298
9052
|
//# sourceMappingURL=index.d.mts.map
|