@messagebird/sdk 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1191 -181
- package/dist/index.js +536 -15
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,15 @@ interface ErrorDetail {
|
|
|
78
78
|
/** What is wrong with this field. */
|
|
79
79
|
message: string;
|
|
80
80
|
}
|
|
81
|
+
/** One recovery step: an operation to call to resolve the error (ADR-0073). */
|
|
82
|
+
interface ErrorNextAction {
|
|
83
|
+
/** operationId of the follow-up operation that resolves this error. */
|
|
84
|
+
operation: string;
|
|
85
|
+
/** Short human-readable label for the recovery step. */
|
|
86
|
+
description?: string;
|
|
87
|
+
/** Permission scope the recovery operation requires, when it is scoped. */
|
|
88
|
+
scope?: string;
|
|
89
|
+
}
|
|
81
90
|
/** Constructor fields shared by every API error, mapped from the wire body. */
|
|
82
91
|
interface BirdAPIErrorFields {
|
|
83
92
|
statusCode: number;
|
|
@@ -96,6 +105,10 @@ interface BirdAPIErrorFields {
|
|
|
96
105
|
param?: string;
|
|
97
106
|
/** Verbatim code from a downstream system (SMTP reply, payment decline). */
|
|
98
107
|
vendorCode?: string;
|
|
108
|
+
/** Human recovery line for this error, when a recovery is known (ADR-0073). */
|
|
109
|
+
remediation?: string;
|
|
110
|
+
/** Operations that resolve this error, in the order to try them (ADR-0073). */
|
|
111
|
+
next?: ErrorNextAction[];
|
|
99
112
|
}
|
|
100
113
|
/** The server returned an error body. Base for every `type`-specific class. */
|
|
101
114
|
declare class BirdAPIError extends BirdError {
|
|
@@ -107,6 +120,8 @@ declare class BirdAPIError extends BirdError {
|
|
|
107
120
|
readonly requestId: string;
|
|
108
121
|
readonly param?: string;
|
|
109
122
|
readonly vendorCode?: string;
|
|
123
|
+
readonly remediation?: string;
|
|
124
|
+
readonly next?: ErrorNextAction[];
|
|
110
125
|
constructor(fields: BirdAPIErrorFields);
|
|
111
126
|
}
|
|
112
127
|
/** 401 — authentication failed or missing. */
|
|
@@ -269,11 +284,11 @@ type SmsError = {
|
|
|
269
284
|
occurred_at: string;
|
|
270
285
|
} | null;
|
|
271
286
|
/**
|
|
272
|
-
* Structured key/value
|
|
273
|
-
* Tag count and per-tag size are capped to keep per-send tag payloads small — see
|
|
287
|
+
* Structured key/value label attached to a message. Surfaces in list filters, the event log, and webhook payloads. Use tags for low-cardinality filtering dimensions (category, experiment ID, template ID). For arbitrary per-send context that does not need to be filterable, use `metadata`.
|
|
288
|
+
* Tag count and per-tag size are capped to keep per-send tag payloads small — see the send request for the array maximum. Tag names are unique within a send; supplying the same name twice is rejected.
|
|
274
289
|
*
|
|
275
290
|
*/
|
|
276
|
-
type
|
|
291
|
+
type Tag = {
|
|
277
292
|
/**
|
|
278
293
|
* Tag name. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 32 characters.
|
|
279
294
|
*
|
|
@@ -311,7 +326,7 @@ type EventSmsBase = {
|
|
|
311
326
|
* Tags provided on the send request, echoed on every event for the message so you can route and correlate without an extra lookup. Null when the message carried no tags.
|
|
312
327
|
*
|
|
313
328
|
*/
|
|
314
|
-
tags: Array<
|
|
329
|
+
tags: Array<Tag> | null;
|
|
315
330
|
/**
|
|
316
331
|
* The metadata object provided on the send request, echoed on every event for the message so you can correlate events with your own records. Null when the message carried no metadata.
|
|
317
332
|
*
|
|
@@ -493,23 +508,6 @@ type EventEmailSuppressionCreated = {
|
|
|
493
508
|
* Payload of the email.unsubscribed event.
|
|
494
509
|
*/
|
|
495
510
|
type EventEmailUnsubscribedData = EventEmailBase;
|
|
496
|
-
/**
|
|
497
|
-
* Structured key/value tag attached to an email send. Surfaces in list filters, the event log, and webhook payloads. Use tags for low-cardinality filtering dimensions (category, experiment ID, template ID). For arbitrary per-send context that does not need to be filterable, use `metadata`.
|
|
498
|
-
* Tag count and per-tag size are capped to keep per-send tag payloads small — see EmailMessageSendRequest for the array maximum.
|
|
499
|
-
*
|
|
500
|
-
*/
|
|
501
|
-
type EmailTag = {
|
|
502
|
-
/**
|
|
503
|
-
* Tag name. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 32 characters.
|
|
504
|
-
*
|
|
505
|
-
*/
|
|
506
|
-
name: string;
|
|
507
|
-
/**
|
|
508
|
-
* Tag value. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 64 characters.
|
|
509
|
-
*
|
|
510
|
-
*/
|
|
511
|
-
value: string;
|
|
512
|
-
};
|
|
513
511
|
/**
|
|
514
512
|
* Envelope position of a recipient on an outbound email event.
|
|
515
513
|
*/
|
|
@@ -544,7 +542,7 @@ type EventEmailBase = {
|
|
|
544
542
|
* Tags provided on the send request, echoed on every event for the send so you can route and correlate without an extra lookup. Null when the send carried no tags.
|
|
545
543
|
*
|
|
546
544
|
*/
|
|
547
|
-
tags: Array<
|
|
545
|
+
tags: Array<Tag> | null;
|
|
548
546
|
/**
|
|
549
547
|
* The metadata object provided on the send request, echoed on every event for the send so you can correlate events with your own records. Null when the send carried no metadata.
|
|
550
548
|
*
|
|
@@ -567,12 +565,60 @@ type EventEmailUnsubscribed = {
|
|
|
567
565
|
timestamp: string;
|
|
568
566
|
data: EventEmailUnsubscribedData;
|
|
569
567
|
};
|
|
568
|
+
/**
|
|
569
|
+
* Payload of the email.scheduled event.
|
|
570
|
+
*/
|
|
571
|
+
type EventEmailScheduledData = EventEmailMessageBase & {
|
|
572
|
+
/**
|
|
573
|
+
* When the message is scheduled to send.
|
|
574
|
+
*/
|
|
575
|
+
scheduled_at: string;
|
|
576
|
+
};
|
|
577
|
+
/**
|
|
578
|
+
* Identity fields shared by the message-level email lifecycle events (scheduled, canceled), which are not tied to a single recipient.
|
|
579
|
+
*/
|
|
580
|
+
type EventEmailMessageBase = {
|
|
581
|
+
/**
|
|
582
|
+
* ID of the email send.
|
|
583
|
+
*/
|
|
584
|
+
email_id: EmailId;
|
|
585
|
+
/**
|
|
586
|
+
* ID of the workspace.
|
|
587
|
+
*/
|
|
588
|
+
workspace_id: WorkspaceId;
|
|
589
|
+
/**
|
|
590
|
+
* Tags provided on the send request, echoed on the event so you can route and correlate without an extra lookup. Null when the send carried no tags.
|
|
591
|
+
*
|
|
592
|
+
*/
|
|
593
|
+
tags: Array<Tag> | null;
|
|
594
|
+
/**
|
|
595
|
+
* The metadata object provided on the send request, echoed on the event so you can correlate events with your own records. Null when the send carried no metadata.
|
|
596
|
+
*
|
|
597
|
+
*/
|
|
598
|
+
metadata: {
|
|
599
|
+
[key: string]: unknown;
|
|
600
|
+
} | null;
|
|
601
|
+
};
|
|
602
|
+
/**
|
|
603
|
+
* Bird accepted a send scheduled for a future time. Fires once per message when the schedule is created, not per recipient.
|
|
604
|
+
*/
|
|
605
|
+
type EventEmailScheduled = {
|
|
606
|
+
/**
|
|
607
|
+
* Event type.
|
|
608
|
+
*/
|
|
609
|
+
type: "email.scheduled";
|
|
610
|
+
/**
|
|
611
|
+
* Time the send was scheduled.
|
|
612
|
+
*/
|
|
613
|
+
timestamp: string;
|
|
614
|
+
data: EventEmailScheduledData;
|
|
615
|
+
};
|
|
570
616
|
/**
|
|
571
617
|
* Why an email was rejected before delivery.
|
|
572
|
-
* `recipient_suppressed` means the recipient is on the workspace suppression list, so Bird did not attempt delivery. `transmission_failed` means the message could not be transmitted for delivery. `generation_failure` means the message could not be built for delivery (a template or content issue). `policy_rejection` means the message was refused by sending policy.
|
|
618
|
+
* `recipient_suppressed` means the recipient is on the workspace suppression list, so Bird did not attempt delivery. `transmission_failed` means the message could not be transmitted for delivery. `generation_failure` means the message could not be built for delivery (a template or content issue). `policy_rejection` means the message was refused by sending policy. `domain_unverified` means the sending domain was not verified. `quota_exceeded` means the organization's send quota was reached. `recipient_not_allowed` means a recipient was not permitted for this send (for shared onboarding-domain sends, recipients must be verified workspace members).
|
|
573
619
|
*
|
|
574
620
|
*/
|
|
575
|
-
type EmailRejectionReason = "recipient_suppressed" | "transmission_failed" | "generation_failure" | "policy_rejection";
|
|
621
|
+
type EmailRejectionReason = "recipient_suppressed" | "transmission_failed" | "generation_failure" | "policy_rejection" | "domain_unverified" | "quota_exceeded" | "recipient_not_allowed";
|
|
576
622
|
/**
|
|
577
623
|
* Payload of the email.rejected event.
|
|
578
624
|
*/
|
|
@@ -867,6 +913,24 @@ type EventEmailClicked = {
|
|
|
867
913
|
timestamp: string;
|
|
868
914
|
data: EventEmailClickedData;
|
|
869
915
|
};
|
|
916
|
+
/**
|
|
917
|
+
* Payload of the email.canceled event.
|
|
918
|
+
*/
|
|
919
|
+
type EventEmailCanceledData = EventEmailMessageBase;
|
|
920
|
+
/**
|
|
921
|
+
* A scheduled send was canceled before it fired. Fires once per message, not per recipient.
|
|
922
|
+
*/
|
|
923
|
+
type EventEmailCanceled = {
|
|
924
|
+
/**
|
|
925
|
+
* Event type.
|
|
926
|
+
*/
|
|
927
|
+
type: "email.canceled";
|
|
928
|
+
/**
|
|
929
|
+
* Time the scheduled send was canceled.
|
|
930
|
+
*/
|
|
931
|
+
timestamp: string;
|
|
932
|
+
data: EventEmailCanceledData;
|
|
933
|
+
};
|
|
870
934
|
/**
|
|
871
935
|
* Payload of the email.bounced event.
|
|
872
936
|
*/
|
|
@@ -975,6 +1039,8 @@ type WebhookEvent = ({
|
|
|
975
1039
|
} & EventEmailAccepted) | ({
|
|
976
1040
|
type: "email.bounced";
|
|
977
1041
|
} & EventEmailBounced) | ({
|
|
1042
|
+
type: "email.canceled";
|
|
1043
|
+
} & EventEmailCanceled) | ({
|
|
978
1044
|
type: "email.clicked";
|
|
979
1045
|
} & EventEmailClicked) | ({
|
|
980
1046
|
type: "email.complained";
|
|
@@ -995,6 +1061,8 @@ type WebhookEvent = ({
|
|
|
995
1061
|
} & EventEmailReceived) | ({
|
|
996
1062
|
type: "email.rejected";
|
|
997
1063
|
} & EventEmailRejected) | ({
|
|
1064
|
+
type: "email.scheduled";
|
|
1065
|
+
} & EventEmailScheduled) | ({
|
|
998
1066
|
type: "email.unsubscribed";
|
|
999
1067
|
} & EventEmailUnsubscribed) | ({
|
|
1000
1068
|
type: "email_suppression.created";
|
|
@@ -1013,271 +1081,905 @@ type WebhookEvent = ({
|
|
|
1013
1081
|
} & EventSmsSent) | ({
|
|
1014
1082
|
type: "sms.undelivered";
|
|
1015
1083
|
} & EventSmsUndelivered);
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
data: Array<EmailMessageBatchItem>;
|
|
1021
|
-
};
|
|
1022
|
-
type EmailMessageBatchItem = {
|
|
1084
|
+
/**
|
|
1085
|
+
* An email address with an optional display name.
|
|
1086
|
+
*/
|
|
1087
|
+
type EmailAddress = {
|
|
1023
1088
|
/**
|
|
1024
|
-
*
|
|
1089
|
+
* Email address.
|
|
1025
1090
|
*/
|
|
1026
|
-
|
|
1091
|
+
email: string;
|
|
1027
1092
|
/**
|
|
1028
|
-
*
|
|
1093
|
+
* Display name shown alongside the address in mail clients.
|
|
1029
1094
|
*/
|
|
1030
|
-
|
|
1095
|
+
name?: string;
|
|
1096
|
+
};
|
|
1097
|
+
type EmailTemplateVersionList = {
|
|
1031
1098
|
/**
|
|
1032
|
-
*
|
|
1099
|
+
* All versions of the template, newest first.
|
|
1033
1100
|
*/
|
|
1034
|
-
|
|
1101
|
+
data: Array<EmailTemplateVersion>;
|
|
1035
1102
|
};
|
|
1036
1103
|
/**
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1039
|
-
*/
|
|
1040
|
-
type EmailMessageBatchRequest = Array<EmailMessageSendRequest>;
|
|
1041
|
-
/**
|
|
1042
|
-
* 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.
|
|
1043
|
-
* Inline images for `<img src="cid:..."/>` references in the HTML body use the `content_id` field together with `content`.
|
|
1044
|
-
* Bird enforces a **20 MB estimated generated message size** cap. The estimate is the HTML and text body plus all attachments and inline images measured after base64 encoding. This is not a raw file-size cap. As a rule of thumb, keep total raw attachment content at or below **15 MB** so the generated message has enough room after encoding and MIME wrapping.
|
|
1045
|
-
* Recipient-side delivery reality: downstream limits vary by product and tenant/server policy. Gmail personal and Outlook.com document 25 MB attachment limits. Exchange Online defaults to 35 MB send / 36 MB receive, but admins can configure limits; on-prem Exchange Server organizational defaults are 10 MB. Sends close to Bird's 20 MB generated-message cap may be accepted by Bird but bounce at the recipient's mail server.
|
|
1046
|
-
* Batch sends can include attachments on individual message objects. Each message still has the 20 MB estimated generated-size cap, and the serialized JSON request body for the whole batch has a hard 20 MB cap. Certain executable / script content types are rejected at validation time.
|
|
1104
|
+
* A single variable slot a template fills in from the values supplied when sending. Shared across channels (SMS, email) so template introspection reads the same everywhere.
|
|
1047
1105
|
*
|
|
1048
1106
|
*/
|
|
1049
|
-
type
|
|
1107
|
+
type TemplateVariable = {
|
|
1050
1108
|
/**
|
|
1051
|
-
*
|
|
1109
|
+
* The parameters key this slot is filled with.
|
|
1052
1110
|
*/
|
|
1053
|
-
|
|
1111
|
+
readonly key: string;
|
|
1054
1112
|
/**
|
|
1055
|
-
*
|
|
1113
|
+
* The value type this slot accepts. Open enum — treat any unrecognized value as a future type rather than an error. SMS templates use the typed slots (`code`, `amount`, …); email templates use `text`.
|
|
1056
1114
|
*
|
|
1057
1115
|
*/
|
|
1058
|
-
|
|
1116
|
+
readonly type: string;
|
|
1059
1117
|
/**
|
|
1060
|
-
*
|
|
1118
|
+
* Whether the slot must be supplied when sending. Advisory for email templates, where a missing value renders as empty rather than rejecting the send.
|
|
1061
1119
|
*
|
|
1062
1120
|
*/
|
|
1063
|
-
|
|
1121
|
+
readonly required: boolean;
|
|
1064
1122
|
/**
|
|
1065
|
-
*
|
|
1066
|
-
*
|
|
1123
|
+
* A human-readable description of the accepted values.
|
|
1067
1124
|
*/
|
|
1068
|
-
|
|
1125
|
+
readonly constraint: string;
|
|
1126
|
+
};
|
|
1127
|
+
type EmailTemplateId = string;
|
|
1128
|
+
type EmailTemplateVersionId = string;
|
|
1129
|
+
type EmailTemplateVersion = {
|
|
1069
1130
|
/**
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1131
|
+
* Template version ID.
|
|
1072
1132
|
*/
|
|
1073
|
-
|
|
1074
|
-
};
|
|
1075
|
-
/**
|
|
1076
|
-
* An email address with an optional display name.
|
|
1077
|
-
*/
|
|
1078
|
-
type EmailAddress = {
|
|
1133
|
+
readonly id: EmailTemplateVersionId;
|
|
1079
1134
|
/**
|
|
1080
|
-
*
|
|
1135
|
+
* The template this version belongs to.
|
|
1081
1136
|
*/
|
|
1082
|
-
|
|
1137
|
+
readonly template_id: EmailTemplateId;
|
|
1083
1138
|
/**
|
|
1084
|
-
*
|
|
1139
|
+
* Sequential published-version number (1, 2, 3…). Null while the version is a draft.
|
|
1085
1140
|
*/
|
|
1086
|
-
|
|
1141
|
+
readonly version_number?: number | null;
|
|
1142
|
+
/**
|
|
1143
|
+
* Lifecycle status of this version.
|
|
1144
|
+
*/
|
|
1145
|
+
readonly status: "draft" | "published";
|
|
1146
|
+
/**
|
|
1147
|
+
* The version's revision counter.
|
|
1148
|
+
*/
|
|
1149
|
+
readonly revision: number;
|
|
1150
|
+
/**
|
|
1151
|
+
* The variable slots this version's content fills in from the values you supply when sending.
|
|
1152
|
+
*/
|
|
1153
|
+
readonly variables: Array<TemplateVariable>;
|
|
1154
|
+
/**
|
|
1155
|
+
* When this version was created.
|
|
1156
|
+
*/
|
|
1157
|
+
readonly created_at: string;
|
|
1158
|
+
/**
|
|
1159
|
+
* When this version was published, or null if it has not been published.
|
|
1160
|
+
*/
|
|
1161
|
+
readonly published_at?: string | null;
|
|
1087
1162
|
};
|
|
1088
1163
|
/**
|
|
1089
|
-
*
|
|
1164
|
+
* Partial update of a template's metadata and its draft content. Only the fields you send are changed; the rest are left as-is. Include the draft `revision` you last read so concurrent edits are detected.
|
|
1090
1165
|
*
|
|
1091
1166
|
*/
|
|
1092
|
-
type
|
|
1093
|
-
type EmailMessageSendRequest = {
|
|
1167
|
+
type EmailTemplateUpdate = {
|
|
1094
1168
|
/**
|
|
1095
|
-
*
|
|
1169
|
+
* The draft revision you last read (from the template's `revision` field). A stale value returns a conflict so you can reload and retry.
|
|
1170
|
+
*
|
|
1096
1171
|
*/
|
|
1097
|
-
|
|
1172
|
+
revision: number;
|
|
1098
1173
|
/**
|
|
1099
|
-
*
|
|
1174
|
+
* New template name. Must stay unique within the workspace.
|
|
1100
1175
|
*/
|
|
1101
|
-
|
|
1176
|
+
name?: string;
|
|
1102
1177
|
/**
|
|
1103
|
-
*
|
|
1178
|
+
* New workspace-unique slug handle for send-by-template. Send null to clear it. Lowercase letters, numbers, and hyphens.
|
|
1179
|
+
*
|
|
1104
1180
|
*/
|
|
1105
|
-
|
|
1181
|
+
alias?: string | null;
|
|
1106
1182
|
/**
|
|
1107
|
-
*
|
|
1183
|
+
* New description of the template's purpose. Send null to clear it.
|
|
1108
1184
|
*/
|
|
1109
|
-
|
|
1185
|
+
description?: string | null;
|
|
1110
1186
|
/**
|
|
1111
|
-
*
|
|
1187
|
+
* New email subject line for the draft. Send null to clear it.
|
|
1112
1188
|
*/
|
|
1113
|
-
subject
|
|
1189
|
+
subject?: string | null;
|
|
1114
1190
|
/**
|
|
1115
|
-
* HTML body
|
|
1191
|
+
* New HTML body — the source markup for the template's format.
|
|
1116
1192
|
*/
|
|
1117
1193
|
html?: string;
|
|
1118
1194
|
/**
|
|
1119
|
-
*
|
|
1195
|
+
* New plain-text body for the draft. Send null to clear it.
|
|
1120
1196
|
*/
|
|
1121
|
-
text?: string;
|
|
1197
|
+
text?: string | null;
|
|
1122
1198
|
/**
|
|
1123
|
-
*
|
|
1124
|
-
*
|
|
1199
|
+
* Brand kit to apply to the draft.
|
|
1125
1200
|
*/
|
|
1126
|
-
|
|
1201
|
+
brand_kit_id?: BrandKitId;
|
|
1202
|
+
};
|
|
1203
|
+
type BrandKitId = string;
|
|
1204
|
+
type EmailTemplate = {
|
|
1127
1205
|
/**
|
|
1128
|
-
*
|
|
1206
|
+
* Template ID.
|
|
1129
1207
|
*/
|
|
1130
|
-
|
|
1131
|
-
[key: string]: string;
|
|
1132
|
-
};
|
|
1208
|
+
readonly id: EmailTemplateId;
|
|
1133
1209
|
/**
|
|
1134
|
-
*
|
|
1135
|
-
*
|
|
1210
|
+
* Workspace that owns the template.
|
|
1136
1211
|
*/
|
|
1137
|
-
|
|
1212
|
+
readonly workspace_id: WorkspaceId;
|
|
1138
1213
|
/**
|
|
1139
|
-
*
|
|
1140
|
-
*
|
|
1214
|
+
* Human-readable template name, unique within the workspace.
|
|
1141
1215
|
*/
|
|
1142
|
-
|
|
1143
|
-
[key: string]: unknown;
|
|
1144
|
-
};
|
|
1216
|
+
name: string;
|
|
1145
1217
|
/**
|
|
1146
|
-
*
|
|
1218
|
+
* The template's workspace-unique slug handle for send-by-template, or null if unset.
|
|
1147
1219
|
*/
|
|
1148
|
-
|
|
1220
|
+
alias?: string | null;
|
|
1149
1221
|
/**
|
|
1150
|
-
*
|
|
1222
|
+
* Optional description of the template's purpose. Null when unset.
|
|
1151
1223
|
*/
|
|
1152
|
-
|
|
1224
|
+
description?: string | null;
|
|
1225
|
+
scope: TemplateScope;
|
|
1226
|
+
category: EmailTemplateCategory;
|
|
1227
|
+
source: EmailTemplateSource;
|
|
1153
1228
|
/**
|
|
1154
|
-
*
|
|
1155
|
-
*
|
|
1229
|
+
* The variable slots this template's current draft fills in from the values you supply when sending.
|
|
1156
1230
|
*/
|
|
1157
|
-
|
|
1231
|
+
readonly variables: Array<TemplateVariable>;
|
|
1158
1232
|
/**
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1233
|
+
* The current editable draft version.
|
|
1161
1234
|
*/
|
|
1162
|
-
|
|
1235
|
+
readonly draft_version_id: EmailTemplateVersionId;
|
|
1163
1236
|
/**
|
|
1164
|
-
*
|
|
1237
|
+
* The currently published version, or null if the template has never been published.
|
|
1165
1238
|
*/
|
|
1166
|
-
|
|
1239
|
+
readonly published_version_id?: EmailTemplateVersionId | null;
|
|
1167
1240
|
/**
|
|
1168
|
-
*
|
|
1169
|
-
*
|
|
1241
|
+
* The draft's revision counter. Send it back on the next update to detect concurrent edits.
|
|
1170
1242
|
*/
|
|
1171
|
-
|
|
1243
|
+
readonly revision: number;
|
|
1172
1244
|
/**
|
|
1173
|
-
*
|
|
1245
|
+
* The draft's email subject line. Null when unset.
|
|
1174
1246
|
*/
|
|
1175
|
-
|
|
1247
|
+
subject?: string | null;
|
|
1176
1248
|
/**
|
|
1177
|
-
*
|
|
1249
|
+
* The draft's HTML body. Null when unset.
|
|
1178
1250
|
*/
|
|
1179
|
-
|
|
1251
|
+
html?: string | null;
|
|
1180
1252
|
/**
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1253
|
+
* The draft's plain-text body. Null when unset.
|
|
1183
1254
|
*/
|
|
1184
|
-
|
|
1185
|
-
};
|
|
1186
|
-
type EmailAttachmentId = string;
|
|
1187
|
-
/**
|
|
1188
|
-
* Attachment metadata returned on API reads. The original content is not echoed back inline — only the metadata needed for display and audit. To download the raw attachment bytes (while content storage is enabled and within the retention window), use `GET /v1/email/messages/{message_id}/attachments/{attachment_id}`, which returns the file with its own content type and a Content-Disposition filename.
|
|
1189
|
-
*
|
|
1190
|
-
*/
|
|
1191
|
-
type EmailAttachmentRef = {
|
|
1255
|
+
text?: string | null;
|
|
1192
1256
|
/**
|
|
1193
|
-
*
|
|
1257
|
+
* The brand kit applied to the draft, or null if none.
|
|
1194
1258
|
*/
|
|
1195
|
-
readonly
|
|
1259
|
+
readonly brand_kit_id?: BrandKitId | null;
|
|
1196
1260
|
/**
|
|
1197
|
-
*
|
|
1261
|
+
* When the template was created.
|
|
1198
1262
|
*/
|
|
1199
|
-
|
|
1263
|
+
readonly created_at: string;
|
|
1200
1264
|
/**
|
|
1201
|
-
*
|
|
1265
|
+
* When the template was last modified.
|
|
1202
1266
|
*/
|
|
1203
|
-
|
|
1267
|
+
readonly updated_at: string;
|
|
1268
|
+
};
|
|
1269
|
+
/**
|
|
1270
|
+
* The authoring format the template is written in. Fixed at creation.
|
|
1271
|
+
*/
|
|
1272
|
+
type EmailTemplateSource = "liquid" | "handlebars" | "html";
|
|
1273
|
+
/**
|
|
1274
|
+
* Whether the template is transactional or marketing email.
|
|
1275
|
+
*/
|
|
1276
|
+
type EmailTemplateCategory = "transactional" | "marketing";
|
|
1277
|
+
/**
|
|
1278
|
+
* Whether the template is a built-in Bird template (`system`) or one your workspace authored (`workspace`).
|
|
1279
|
+
*/
|
|
1280
|
+
type TemplateScope = "system" | "workspace";
|
|
1281
|
+
/**
|
|
1282
|
+
* Parameters for creating an email template and its initial draft.
|
|
1283
|
+
*/
|
|
1284
|
+
type EmailTemplateCreate = {
|
|
1204
1285
|
/**
|
|
1205
|
-
*
|
|
1286
|
+
* Human-readable template name, unique within the workspace.
|
|
1206
1287
|
*/
|
|
1207
|
-
|
|
1288
|
+
name: string;
|
|
1208
1289
|
/**
|
|
1209
|
-
*
|
|
1290
|
+
* Optional workspace-unique slug handle for the template — a stable alternative to the template ID when sending by template. Lowercase letters, numbers, and hyphens.
|
|
1210
1291
|
*
|
|
1211
1292
|
*/
|
|
1212
|
-
|
|
1293
|
+
alias?: string;
|
|
1213
1294
|
/**
|
|
1214
|
-
*
|
|
1295
|
+
* Optional description of the template's purpose.
|
|
1215
1296
|
*/
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
type EmailMessage = {
|
|
1297
|
+
description?: string;
|
|
1298
|
+
category: EmailTemplateCategory;
|
|
1219
1299
|
/**
|
|
1220
|
-
*
|
|
1300
|
+
* The authoring format the template is written in, fixed at creation. `liquid` currently supports variable substitution only (e.g. `{{ first_name }}`); filters, tags, and control flow are not yet supported — fuller Liquid support is coming soon.
|
|
1301
|
+
*
|
|
1221
1302
|
*/
|
|
1222
|
-
|
|
1303
|
+
source: EmailTemplateSource;
|
|
1223
1304
|
/**
|
|
1224
|
-
*
|
|
1305
|
+
* The email subject line for the initial draft.
|
|
1225
1306
|
*/
|
|
1226
|
-
|
|
1307
|
+
subject?: string;
|
|
1227
1308
|
/**
|
|
1228
|
-
*
|
|
1309
|
+
* The HTML body — the source markup for the chosen format.
|
|
1229
1310
|
*/
|
|
1230
|
-
|
|
1311
|
+
html?: string;
|
|
1231
1312
|
/**
|
|
1232
|
-
*
|
|
1313
|
+
* The optional plain-text body.
|
|
1233
1314
|
*/
|
|
1234
|
-
|
|
1315
|
+
text?: string;
|
|
1235
1316
|
/**
|
|
1236
|
-
*
|
|
1317
|
+
* Optional brand kit to apply to the draft.
|
|
1237
1318
|
*/
|
|
1238
|
-
|
|
1319
|
+
brand_kit_id?: BrandKitId;
|
|
1320
|
+
};
|
|
1321
|
+
type EmailTemplateSummary = {
|
|
1239
1322
|
/**
|
|
1240
|
-
*
|
|
1323
|
+
* Template ID.
|
|
1241
1324
|
*/
|
|
1242
|
-
|
|
1325
|
+
readonly id: EmailTemplateId;
|
|
1243
1326
|
/**
|
|
1244
|
-
*
|
|
1245
|
-
*
|
|
1327
|
+
* Workspace that owns the template.
|
|
1246
1328
|
*/
|
|
1247
|
-
|
|
1329
|
+
readonly workspace_id: WorkspaceId;
|
|
1248
1330
|
/**
|
|
1249
|
-
*
|
|
1331
|
+
* Human-readable template name, unique within the workspace.
|
|
1250
1332
|
*/
|
|
1251
|
-
|
|
1333
|
+
name: string;
|
|
1252
1334
|
/**
|
|
1253
|
-
*
|
|
1254
|
-
*
|
|
1335
|
+
* The template's workspace-unique slug handle for send-by-template, or null if unset.
|
|
1255
1336
|
*/
|
|
1256
|
-
|
|
1337
|
+
alias?: string | null;
|
|
1257
1338
|
/**
|
|
1258
|
-
*
|
|
1339
|
+
* Optional description of the template's purpose. Null when unset.
|
|
1259
1340
|
*/
|
|
1260
|
-
|
|
1341
|
+
description?: string | null;
|
|
1342
|
+
scope: TemplateScope;
|
|
1343
|
+
category: EmailTemplateCategory;
|
|
1344
|
+
source: EmailTemplateSource;
|
|
1261
1345
|
/**
|
|
1262
|
-
*
|
|
1346
|
+
* The current editable draft version.
|
|
1263
1347
|
*/
|
|
1264
|
-
readonly
|
|
1348
|
+
readonly draft_version_id: EmailTemplateVersionId;
|
|
1265
1349
|
/**
|
|
1266
|
-
*
|
|
1350
|
+
* The currently published version, or null if never published.
|
|
1267
1351
|
*/
|
|
1268
|
-
readonly
|
|
1352
|
+
readonly published_version_id?: EmailTemplateVersionId | null;
|
|
1269
1353
|
/**
|
|
1270
|
-
*
|
|
1354
|
+
* When the template was created.
|
|
1271
1355
|
*/
|
|
1272
|
-
readonly
|
|
1356
|
+
readonly created_at: string;
|
|
1273
1357
|
/**
|
|
1274
|
-
*
|
|
1358
|
+
* When the template was last modified.
|
|
1275
1359
|
*/
|
|
1276
|
-
readonly
|
|
1360
|
+
readonly updated_at: string;
|
|
1361
|
+
};
|
|
1362
|
+
type SmsTemplateList = {
|
|
1277
1363
|
/**
|
|
1278
|
-
*
|
|
1364
|
+
* The templates available to your workspace. The catalogue is small and returned in full — this list is not paginated.
|
|
1279
1365
|
*/
|
|
1280
|
-
|
|
1366
|
+
data: Array<SmsTemplate>;
|
|
1367
|
+
};
|
|
1368
|
+
type SmsTemplateVersionId = string;
|
|
1369
|
+
/**
|
|
1370
|
+
* Content classification. Drives opt-out (STOP) policy, quiet-hours, and per-country compliance.
|
|
1371
|
+
*/
|
|
1372
|
+
type SmsMessageCategory = "transactional" | "marketing" | "authentication" | "service";
|
|
1373
|
+
type SmsTemplateId = string;
|
|
1374
|
+
type SmsTemplate = {
|
|
1375
|
+
/**
|
|
1376
|
+
* Unique identifier for the template.
|
|
1377
|
+
*/
|
|
1378
|
+
readonly id: SmsTemplateId;
|
|
1379
|
+
/**
|
|
1380
|
+
* Human-readable description of what the template is for.
|
|
1381
|
+
*/
|
|
1382
|
+
readonly name: string;
|
|
1383
|
+
/**
|
|
1384
|
+
* The template's stable handle. Pass it (or the id) as the template reference when sending.
|
|
1385
|
+
*/
|
|
1386
|
+
readonly alias: string;
|
|
1387
|
+
scope: TemplateScope;
|
|
1388
|
+
/**
|
|
1389
|
+
* Content classification applied to messages sent from this template.
|
|
1390
|
+
*/
|
|
1391
|
+
readonly category: SmsMessageCategory;
|
|
1392
|
+
/**
|
|
1393
|
+
* The template body in its default language, shown for preview.
|
|
1394
|
+
*/
|
|
1395
|
+
readonly body: string;
|
|
1396
|
+
/**
|
|
1397
|
+
* The typed slots this template fills in from the values you supply when sending.
|
|
1398
|
+
*/
|
|
1399
|
+
readonly variables: Array<TemplateVariable>;
|
|
1400
|
+
/**
|
|
1401
|
+
* The languages this template is available in, as BCP-47 tags.
|
|
1402
|
+
*/
|
|
1403
|
+
readonly available_locales: Array<string>;
|
|
1404
|
+
/**
|
|
1405
|
+
* The template's lifecycle state. Built-in templates are always `active`.
|
|
1406
|
+
*/
|
|
1407
|
+
readonly status: "active" | "draft" | "pending" | "approved" | "rejected";
|
|
1408
|
+
/**
|
|
1409
|
+
* The current editable draft version. Always null today — SMS templates are not yet versioned; present for parity with email templates.
|
|
1410
|
+
*/
|
|
1411
|
+
readonly draft_version_id: SmsTemplateVersionId | null;
|
|
1412
|
+
/**
|
|
1413
|
+
* The currently published version, or null if the template has never been published. Always null today — SMS templates are not yet versioned; present for parity with email templates.
|
|
1414
|
+
*/
|
|
1415
|
+
readonly published_version_id?: SmsTemplateVersionId | null;
|
|
1416
|
+
/**
|
|
1417
|
+
* The draft's revision counter. Always null today — SMS templates are not yet versioned; present for parity with email templates.
|
|
1418
|
+
*/
|
|
1419
|
+
readonly revision: number | null;
|
|
1420
|
+
/**
|
|
1421
|
+
* When the template was created. Null for built-in templates.
|
|
1422
|
+
*/
|
|
1423
|
+
readonly created_at: string | null;
|
|
1424
|
+
/**
|
|
1425
|
+
* When the template was last updated. Null for built-in templates.
|
|
1426
|
+
*/
|
|
1427
|
+
readonly updated_at: string | null;
|
|
1428
|
+
};
|
|
1429
|
+
type SmsMessageBatchResponse = {
|
|
1430
|
+
/**
|
|
1431
|
+
* One entry per message in the batch, in submission order.
|
|
1432
|
+
*/
|
|
1433
|
+
data: Array<SmsMessage>;
|
|
1434
|
+
/**
|
|
1435
|
+
* Aggregate result for the batch.
|
|
1436
|
+
*/
|
|
1437
|
+
summary: SmsBatchSummary;
|
|
1438
|
+
};
|
|
1439
|
+
/**
|
|
1440
|
+
* Aggregate result for an SMS batch.
|
|
1441
|
+
*/
|
|
1442
|
+
type SmsBatchSummary = {
|
|
1443
|
+
/**
|
|
1444
|
+
* Number of messages accepted in the batch.
|
|
1445
|
+
*/
|
|
1446
|
+
accepted_count: number;
|
|
1447
|
+
};
|
|
1448
|
+
/**
|
|
1449
|
+
* Per-component cost breakdown. Returned on single-message reads; omitted from list rows.
|
|
1450
|
+
*/
|
|
1451
|
+
type SmsCostBreakdown = {
|
|
1452
|
+
/**
|
|
1453
|
+
* Per-segment price as a decimal string.
|
|
1454
|
+
*/
|
|
1455
|
+
per_segment: string;
|
|
1456
|
+
/**
|
|
1457
|
+
* Number of billable segments.
|
|
1458
|
+
*/
|
|
1459
|
+
segments: number;
|
|
1460
|
+
/**
|
|
1461
|
+
* ISO 3166-1 alpha-2 destination country the price was resolved for.
|
|
1462
|
+
*/
|
|
1463
|
+
country_code: string;
|
|
1464
|
+
/**
|
|
1465
|
+
* Carrier surcharge component as a decimal string (for example US 10DLC fees). `0.0000` when none applies.
|
|
1466
|
+
*/
|
|
1467
|
+
carrier_surcharge: string;
|
|
1468
|
+
};
|
|
1469
|
+
/**
|
|
1470
|
+
* ISO 4217 three-letter currency code.
|
|
1471
|
+
*/
|
|
1472
|
+
type CurrencyCode = string;
|
|
1473
|
+
/**
|
|
1474
|
+
* 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.
|
|
1475
|
+
*/
|
|
1476
|
+
type SmsCost = {
|
|
1477
|
+
/**
|
|
1478
|
+
* ISO 4217 currency code for the cost amount. Omitted when the cost is not denominated in a currency (for example a zero-priced internal send).
|
|
1479
|
+
*/
|
|
1480
|
+
readonly currency_code?: CurrencyCode;
|
|
1481
|
+
/**
|
|
1482
|
+
* Total cost as a decimal string — the per-segment rate multiplied by the segment count, plus any surcharges.
|
|
1483
|
+
*/
|
|
1484
|
+
readonly amount: string;
|
|
1485
|
+
/**
|
|
1486
|
+
* Per-component cost breakdown. Returned on single-message reads; omitted from list rows.
|
|
1487
|
+
*/
|
|
1488
|
+
breakdown?: SmsCostBreakdown;
|
|
1489
|
+
} | null;
|
|
1490
|
+
/**
|
|
1491
|
+
* Segment breakdown for the message body. Segment count drives billing.
|
|
1492
|
+
*/
|
|
1493
|
+
type SmsSegments = {
|
|
1494
|
+
/**
|
|
1495
|
+
* Number of segments the body is split into. Each segment is a billable unit.
|
|
1496
|
+
*/
|
|
1497
|
+
readonly count: number;
|
|
1498
|
+
/**
|
|
1499
|
+
* Encoding used for the body. `GSM_7BIT` fits 160 characters in a single segment (153 per part when multi-segment); `UCS2` is used when the body contains any character outside the GSM 03.38 alphabet (emoji, CJK, some accented characters) and fits 70 characters in a single segment (67 per part when multi-segment).
|
|
1500
|
+
*
|
|
1501
|
+
*/
|
|
1502
|
+
readonly encoding: "GSM_7BIT" | "UCS2";
|
|
1503
|
+
/**
|
|
1504
|
+
* Character count of the body under the selected encoding.
|
|
1505
|
+
*/
|
|
1506
|
+
readonly characters: number;
|
|
1507
|
+
};
|
|
1508
|
+
/**
|
|
1509
|
+
* Delivery status. `scheduled` means the message is queued to send at a future time and has not been dispatched yet. `accepted` means Bird accepted the request and it is awaiting handoff to the carrier network. `sent` means it was handed to the carrier and is awaiting a delivery receipt. `delivered` is confirmed delivery. `undelivered` is a non-permanent non-delivery (handset off, content blocked). `failed` is a terminal permanent failure. `rejected` means Bird refused it before reaching the carrier. `canceled` means a scheduled message was canceled before it was sent. `expired` means the validity period elapsed without a terminal receipt. `received` applies to inbound messages.
|
|
1510
|
+
*
|
|
1511
|
+
*/
|
|
1512
|
+
type SmsMessageStatus = "scheduled" | "accepted" | "sent" | "delivered" | "undelivered" | "failed" | "rejected" | "canceled" | "expired" | "received";
|
|
1513
|
+
type SmsMessage = {
|
|
1514
|
+
/**
|
|
1515
|
+
* Message ID.
|
|
1516
|
+
*/
|
|
1517
|
+
readonly id: SmsMessageId;
|
|
1518
|
+
/**
|
|
1519
|
+
* Whether the message was sent from a Bird sender (`outbound`) or received from a subscriber (`inbound`).
|
|
1520
|
+
*/
|
|
1521
|
+
readonly direction: "outbound" | "inbound";
|
|
1522
|
+
readonly status: SmsMessageStatus;
|
|
1523
|
+
/**
|
|
1524
|
+
* Recipient phone number in E.164 format.
|
|
1525
|
+
*/
|
|
1526
|
+
to: string;
|
|
1527
|
+
/**
|
|
1528
|
+
* Sender the message was sent from — an E.164 number, an alphanumeric sender ID, or a short code.
|
|
1529
|
+
*/
|
|
1530
|
+
from: string;
|
|
1531
|
+
/**
|
|
1532
|
+
* Message body.
|
|
1533
|
+
*/
|
|
1534
|
+
text: string;
|
|
1535
|
+
/**
|
|
1536
|
+
* Content classification supplied on the send. Null for inbound messages.
|
|
1537
|
+
*/
|
|
1538
|
+
category?: SmsMessageCategory | null;
|
|
1539
|
+
/**
|
|
1540
|
+
* Segment breakdown for the body.
|
|
1541
|
+
*/
|
|
1542
|
+
segments: SmsSegments;
|
|
1543
|
+
/**
|
|
1544
|
+
* Cost of the message. Null until the message has been priced.
|
|
1545
|
+
*/
|
|
1546
|
+
cost?: SmsCost;
|
|
1547
|
+
/**
|
|
1548
|
+
* Structured `{name, value}` filter labels applied to this message.
|
|
1549
|
+
*/
|
|
1550
|
+
tags?: Array<Tag>;
|
|
1551
|
+
/**
|
|
1552
|
+
* Arbitrary JSON metadata stored on the message and echoed in webhook payloads.
|
|
1553
|
+
*/
|
|
1554
|
+
metadata?: {
|
|
1555
|
+
[key: string]: unknown;
|
|
1556
|
+
};
|
|
1557
|
+
/**
|
|
1558
|
+
* How long, in seconds, Bird keeps trying to deliver before the message transitions to `expired`.
|
|
1559
|
+
*/
|
|
1560
|
+
readonly validity_period?: number;
|
|
1561
|
+
/**
|
|
1562
|
+
* Carrier that handled the message, when known. Populated once a delivery receipt identifies it.
|
|
1563
|
+
*/
|
|
1564
|
+
readonly carrier?: string | null;
|
|
1565
|
+
/**
|
|
1566
|
+
* Mobile country code and mobile network code of the carrier, when known.
|
|
1567
|
+
*/
|
|
1568
|
+
readonly mcc_mnc?: string | null;
|
|
1569
|
+
/**
|
|
1570
|
+
* Failure detail on a terminally failed or rejected message. Null otherwise.
|
|
1571
|
+
*/
|
|
1572
|
+
last_error?: SmsError;
|
|
1573
|
+
/**
|
|
1574
|
+
* When the message was accepted (outbound) or received (inbound).
|
|
1575
|
+
*/
|
|
1576
|
+
readonly created_at: string;
|
|
1577
|
+
/**
|
|
1578
|
+
* When the message was handed to the carrier. Null until then.
|
|
1579
|
+
*/
|
|
1580
|
+
readonly sent_at?: string | null;
|
|
1581
|
+
/**
|
|
1582
|
+
* When delivery was confirmed. Null until then.
|
|
1583
|
+
*/
|
|
1584
|
+
readonly delivered_at?: string | null;
|
|
1585
|
+
};
|
|
1586
|
+
/**
|
|
1587
|
+
* Batch of SMS message send requests. All items are validated before any are queued.
|
|
1588
|
+
*/
|
|
1589
|
+
type SmsMessageBatchRequest = Array<SmsMessageSendRequest>;
|
|
1590
|
+
type SmsTemplateSend = unknown & {
|
|
1591
|
+
/**
|
|
1592
|
+
* The template to send, by its id.
|
|
1593
|
+
*/
|
|
1594
|
+
id?: SmsTemplateId;
|
|
1595
|
+
/**
|
|
1596
|
+
* The template to send, by its alias handle (for example `bird_otp_verification`). Browse the available templates and their variables with the templates endpoint.
|
|
1597
|
+
*
|
|
1598
|
+
*/
|
|
1599
|
+
alias?: string;
|
|
1600
|
+
/**
|
|
1601
|
+
* Language tag (BCP 47, for example `fr` or `pt-BR`) selecting the localized body. Falls back to the closest available language, then English, when the exact tag is not stocked. Omit for English.
|
|
1602
|
+
*
|
|
1603
|
+
*/
|
|
1604
|
+
locale?: string;
|
|
1605
|
+
/**
|
|
1606
|
+
* Values for the template's variables, keyed by variable name. The accepted keys and their formats are fixed per template — see the template's `variables` on the templates endpoint. Every required variable must be supplied, and no undeclared key may be present. Cap: 16 KB serialized.
|
|
1607
|
+
*
|
|
1608
|
+
*/
|
|
1609
|
+
parameters?: {
|
|
1610
|
+
[key: string]: unknown;
|
|
1611
|
+
};
|
|
1612
|
+
};
|
|
1613
|
+
type SmsMessageSendRequest = unknown & {
|
|
1614
|
+
/**
|
|
1615
|
+
* Recipient phone number in E.164 format (for example `+15551234567`). One recipient per message.
|
|
1616
|
+
*/
|
|
1617
|
+
to: string;
|
|
1618
|
+
/**
|
|
1619
|
+
* Sender to send from: an E.164 number (`+15557654321`), an alphanumeric sender ID (up to 11 characters, for example `MyBrand`), or a short code (5–6 digits). When omitted, Bird selects an eligible sender for you.
|
|
1620
|
+
*
|
|
1621
|
+
*/
|
|
1622
|
+
from?: string;
|
|
1623
|
+
/**
|
|
1624
|
+
* Free-text message body. Required unless `template` is supplied (the two are mutually exclusive). At least 1 character, up to a 12-segment cap (roughly 1836 GSM-7 or 804 UCS-2 characters). Bird does not truncate; a body exceeding 12 segments is rejected with a 422. The limit is on segment count, not characters, because GSM-7 and UCS-2 encodings differ in characters per segment.
|
|
1625
|
+
*
|
|
1626
|
+
*/
|
|
1627
|
+
text?: string;
|
|
1628
|
+
/**
|
|
1629
|
+
* Content classification. Drives opt-out (STOP) policy, quiet-hours, and per-country compliance. Required on a free-text send; omit it on a template send, where the category is derived from the template.
|
|
1630
|
+
*
|
|
1631
|
+
*/
|
|
1632
|
+
category?: SmsMessageCategory;
|
|
1633
|
+
/**
|
|
1634
|
+
* Preview feature — how long, in seconds (60–172800), Bird keeps trying to deliver before the message transitions to `expired`. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1635
|
+
*
|
|
1636
|
+
*/
|
|
1637
|
+
validity_period?: number;
|
|
1638
|
+
/**
|
|
1639
|
+
* Structured `{name, value}` labels for filtering and analytics. Tags become first-class query dimensions: filter the list endpoint by tag name, slice analytics by tag, and surface in webhook payloads. Maximum 20 tags per send. Use tags for low-cardinality dimensions (`category`, `experiment_variant`). For arbitrary structured context you do not need as a filter dimension, use `metadata` instead.
|
|
1640
|
+
*
|
|
1641
|
+
*/
|
|
1642
|
+
tags?: Array<Tag>;
|
|
1643
|
+
/**
|
|
1644
|
+
* Arbitrary JSON object stored on the message, returned on API reads, and echoed in webhook payloads. Maximum 2 KB serialized. Use metadata for per-send context like internal IDs and foreign keys. For low-cardinality filterable labels, use `tags` instead.
|
|
1645
|
+
*
|
|
1646
|
+
*/
|
|
1647
|
+
metadata?: {
|
|
1648
|
+
[key: string]: unknown;
|
|
1649
|
+
};
|
|
1650
|
+
/**
|
|
1651
|
+
* Preview feature — multimedia (MMS) attachments. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1652
|
+
*/
|
|
1653
|
+
media_urls?: Array<string>;
|
|
1654
|
+
/**
|
|
1655
|
+
* Preview feature — sender selection from a messaging profile pool. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1656
|
+
*/
|
|
1657
|
+
messaging_profile_id?: string;
|
|
1658
|
+
/**
|
|
1659
|
+
* Preview feature — send-later scheduling. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1660
|
+
*/
|
|
1661
|
+
scheduled_at?: string;
|
|
1662
|
+
/**
|
|
1663
|
+
* Send using a stored template instead of free text. Mutually exclusive with `text`; the message category is derived from the template, so `from`, `category`, and `media_urls` are not accepted alongside it.
|
|
1664
|
+
*
|
|
1665
|
+
*/
|
|
1666
|
+
template?: SmsTemplateSend;
|
|
1667
|
+
/**
|
|
1668
|
+
* Preview feature — broadcast correlation. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1669
|
+
*/
|
|
1670
|
+
broadcast_id?: string;
|
|
1671
|
+
/**
|
|
1672
|
+
* Preview feature — campaign correlation for analytics. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1673
|
+
*/
|
|
1674
|
+
campaign_id?: string;
|
|
1675
|
+
/**
|
|
1676
|
+
* Preview feature — audience-targeted sends. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1677
|
+
*/
|
|
1678
|
+
audience_id?: string;
|
|
1679
|
+
/**
|
|
1680
|
+
* Preview feature — contact-targeted sends. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1681
|
+
*/
|
|
1682
|
+
contact_id?: string;
|
|
1683
|
+
/**
|
|
1684
|
+
* Preview feature — topic-gated sends. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1685
|
+
*/
|
|
1686
|
+
topic_id?: string;
|
|
1687
|
+
/**
|
|
1688
|
+
* Preview feature — per-segment price ceiling. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1689
|
+
*/
|
|
1690
|
+
max_price_per_segment?: number;
|
|
1691
|
+
/**
|
|
1692
|
+
* Preview feature — per-recipient substitution for batch sends. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1693
|
+
*/
|
|
1694
|
+
personalization?: {
|
|
1695
|
+
[key: string]: unknown;
|
|
1696
|
+
};
|
|
1697
|
+
/**
|
|
1698
|
+
* Preview feature — link click tracking. Defaults to `false`. Currently unavailable; setting this to `true` returns `422 unsupported_feature`.
|
|
1699
|
+
*/
|
|
1700
|
+
track_clicks?: boolean;
|
|
1701
|
+
};
|
|
1702
|
+
type EmailMessageBatchResponse = {
|
|
1703
|
+
/**
|
|
1704
|
+
* One entry per message in the batch, in submission order.
|
|
1705
|
+
*/
|
|
1706
|
+
data: Array<EmailMessageBatchItem>;
|
|
1707
|
+
};
|
|
1708
|
+
type EmailMessageBatchItem = {
|
|
1709
|
+
/**
|
|
1710
|
+
* Message ID assigned to this batch item.
|
|
1711
|
+
*/
|
|
1712
|
+
readonly id: EmailId;
|
|
1713
|
+
/**
|
|
1714
|
+
* Initial status of this message in the batch.
|
|
1715
|
+
*/
|
|
1716
|
+
readonly status: "accepted";
|
|
1717
|
+
/**
|
|
1718
|
+
* Resolved category for this batch item.
|
|
1719
|
+
*/
|
|
1720
|
+
category: "marketing" | "transactional";
|
|
1721
|
+
};
|
|
1722
|
+
/**
|
|
1723
|
+
* Batch of email message send requests. All items are validated before any are queued. Attachments are allowed on individual messages. Each message must stay within the 20 MB estimated generated message-size cap. The serialized JSON request body for the batch has a hard 20 MB cap.
|
|
1724
|
+
*
|
|
1725
|
+
*/
|
|
1726
|
+
type EmailMessageBatchRequest = Array<EmailMessageSendRequest>;
|
|
1727
|
+
/**
|
|
1728
|
+
* 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.
|
|
1729
|
+
* Inline images for `<img src="cid:..."/>` references in the HTML body use the `content_id` field together with `content`.
|
|
1730
|
+
* Bird enforces a **20 MB estimated generated message size** cap. The estimate is the HTML and text body plus all attachments and inline images measured after base64 encoding. This is not a raw file-size cap. As a rule of thumb, keep total raw attachment content at or below **15 MB** so the generated message has enough room after encoding and MIME wrapping.
|
|
1731
|
+
* Recipient-side delivery reality: downstream limits vary by product and tenant/server policy. Gmail personal and Outlook.com document 25 MB attachment limits. Exchange Online defaults to 35 MB send / 36 MB receive, but admins can configure limits; on-prem Exchange Server organizational defaults are 10 MB. Sends close to Bird's 20 MB generated-message cap may be accepted by Bird but bounce at the recipient's mail server.
|
|
1732
|
+
* Batch sends can include attachments on individual message objects. Each message still has the 20 MB estimated generated-size cap, and the serialized JSON request body for the whole batch has a hard 20 MB cap. Certain executable / script content types are rejected at validation time.
|
|
1733
|
+
*
|
|
1734
|
+
*/
|
|
1735
|
+
type EmailAttachment = {
|
|
1736
|
+
/**
|
|
1737
|
+
* Filename shown to the recipient. Required.
|
|
1738
|
+
*/
|
|
1739
|
+
filename: string;
|
|
1740
|
+
/**
|
|
1741
|
+
* Base64-encoded attachment bytes. Required. Counts toward the 20 MB estimated generated message-size cap after encoding and MIME wrapping.
|
|
1742
|
+
*
|
|
1743
|
+
*/
|
|
1744
|
+
content: string;
|
|
1745
|
+
/**
|
|
1746
|
+
* Preview feature — provide a URL and Bird fetches the attachment for you. Currently unavailable. Use `content` instead. The schema currently requires `content`, so a request with only `path` is rejected with 422 for missing `content`; a request supplying both `content` and `path` is rejected with 422 `unsupported_feature` until this preview ships. When generally available: HTTPS-only, single redirect followed and re-validated, private IP ranges blocked, request timeout enforced, fetched content counts toward the 20 MB estimated generated message-size cap after encoding and MIME wrapping.
|
|
1747
|
+
*
|
|
1748
|
+
*/
|
|
1749
|
+
path?: string;
|
|
1750
|
+
/**
|
|
1751
|
+
* MIME type. Inferred from `filename` extension when omitted. Used to enforce the blocklist of disallowed executable / script types.
|
|
1752
|
+
*
|
|
1753
|
+
*/
|
|
1754
|
+
content_type?: string;
|
|
1755
|
+
/**
|
|
1756
|
+
* RFC 2392 Content-ID. When set, the attachment is rendered inline and can be referenced from the HTML body as `<img src="cid:{content_id}"/>`. When omitted, the attachment is rendered as a regular file attachment.
|
|
1757
|
+
*
|
|
1758
|
+
*/
|
|
1759
|
+
content_id?: string;
|
|
1760
|
+
};
|
|
1761
|
+
type EmailTemplateSend = unknown & {
|
|
1762
|
+
/**
|
|
1763
|
+
* The template to send, by its id.
|
|
1764
|
+
*/
|
|
1765
|
+
id?: EmailTemplateId;
|
|
1766
|
+
/**
|
|
1767
|
+
* The template to send, by its alias handle (for example `welcome-email`).
|
|
1768
|
+
*/
|
|
1769
|
+
alias?: string;
|
|
1770
|
+
/**
|
|
1771
|
+
* Values for the template's variables, keyed by variable name. A token with no matching value renders empty. Cap: 16 KB serialized.
|
|
1772
|
+
*
|
|
1773
|
+
*/
|
|
1774
|
+
parameters?: {
|
|
1775
|
+
[key: string]: unknown;
|
|
1776
|
+
};
|
|
1777
|
+
};
|
|
1778
|
+
/**
|
|
1779
|
+
* A sender or recipient address. Accepts a plain email string (`jane@example.com`), an RFC 5322 mailbox string with an embedded display name (`Jane Doe <jane@example.com>`), or an object carrying the address and an optional display name. All forms can be mixed freely within one request; responses always return the object form.
|
|
1780
|
+
*
|
|
1781
|
+
*/
|
|
1782
|
+
type EmailAddressInput = string | EmailAddress;
|
|
1783
|
+
type EmailMessageSendRequest = {
|
|
1784
|
+
/**
|
|
1785
|
+
* Sender address, as a plain email string, an RFC 5322 mailbox string (`Jane <jane@example.com>`), or an object with an optional display name. Must be from a verified domain in this workspace.
|
|
1786
|
+
*/
|
|
1787
|
+
from: EmailAddressInput;
|
|
1788
|
+
/**
|
|
1789
|
+
* Primary recipients. Each entry is a plain email string, an RFC 5322 mailbox string (`Jane <jane@example.com>`), or an object with an optional display name.
|
|
1790
|
+
*/
|
|
1791
|
+
to: Array<EmailAddressInput>;
|
|
1792
|
+
/**
|
|
1793
|
+
* CC recipients. Each entry is a plain email string, an RFC 5322 mailbox string (`Jane <jane@example.com>`), or an object with an optional display name.
|
|
1794
|
+
*/
|
|
1795
|
+
cc?: Array<EmailAddressInput>;
|
|
1796
|
+
/**
|
|
1797
|
+
* BCC recipients. Each entry is a plain email string, an RFC 5322 mailbox string (`Jane <jane@example.com>`), or an object with an optional display name.
|
|
1798
|
+
*/
|
|
1799
|
+
bcc?: Array<EmailAddressInput>;
|
|
1800
|
+
/**
|
|
1801
|
+
* Message subject line. Required for inline sends; omit it when sending a `template` (the template supplies the subject).
|
|
1802
|
+
*/
|
|
1803
|
+
subject?: string;
|
|
1804
|
+
/**
|
|
1805
|
+
* HTML body. At least one of html or text must be provided.
|
|
1806
|
+
*/
|
|
1807
|
+
html?: string;
|
|
1808
|
+
/**
|
|
1809
|
+
* Plain-text body. At least one of html or text must be provided.
|
|
1810
|
+
*/
|
|
1811
|
+
text?: string;
|
|
1812
|
+
/**
|
|
1813
|
+
* Reply-To addresses, each a plain email string, an RFC 5322 mailbox string, or an object with an optional display name. RFC 5322 allows multiple. Every recipient reply hits all listed addresses, so 1-2 is typical; the 25 cap exists to prevent runaway header sizes that some MTAs reject.
|
|
1814
|
+
*
|
|
1815
|
+
*/
|
|
1816
|
+
reply_to?: Array<EmailAddressInput>;
|
|
1817
|
+
/**
|
|
1818
|
+
* Custom email headers as key-value pairs.
|
|
1819
|
+
*/
|
|
1820
|
+
headers?: {
|
|
1821
|
+
[key: string]: string;
|
|
1822
|
+
};
|
|
1823
|
+
/**
|
|
1824
|
+
* Structured `{name, value}` labels for **filtering and analytics**. Tags become first-class query dimensions: filter the list endpoint by tag name, slice analytics rollups by tag, and surface in webhook payloads. Cap: 20 tags per send. Use tags for low-cardinality dimensions (`category`, `experiment_variant`, `template_id`). For arbitrary structured context that you do not need as a filter dimension, use `metadata` instead.
|
|
1825
|
+
*
|
|
1826
|
+
*/
|
|
1827
|
+
tags?: Array<Tag>;
|
|
1828
|
+
/**
|
|
1829
|
+
* Arbitrary JSON object **stored, returned on API reads, and echoed in webhook payloads**. Path-queryable in analytics (e.g. filter on `metadata.order_id`) but not surfaced as a first-class dashboard filter dimension. Cap: 2 KB serialized. Use metadata for per-send context like internal IDs, foreign keys, and structured payloads you want round-tripped through events. For low-cardinality filterable labels, use `tags` instead.
|
|
1830
|
+
*
|
|
1831
|
+
*/
|
|
1832
|
+
metadata?: {
|
|
1833
|
+
[key: string]: unknown;
|
|
1834
|
+
};
|
|
1835
|
+
/**
|
|
1836
|
+
* Template variables used to personalize inline content. Tokens in the subject and body (e.g. `{{ first_name }}`) are replaced with these values at send time. Shared across all recipients of this send. A token with no matching key renders empty. Cap: 16 KB serialized. When sending a stored `template`, put the values in `template.parameters` instead.
|
|
1837
|
+
*
|
|
1838
|
+
*/
|
|
1839
|
+
parameters?: {
|
|
1840
|
+
[key: string]: unknown;
|
|
1841
|
+
};
|
|
1842
|
+
/**
|
|
1843
|
+
* Send a stored template instead of inline content. When set, omit `subject`/`html`/`text` — the template supplies them; personalize with `template.parameters`.
|
|
1844
|
+
*
|
|
1845
|
+
*/
|
|
1846
|
+
template?: EmailTemplateSend;
|
|
1847
|
+
/**
|
|
1848
|
+
* Whether to track open events for this message.
|
|
1849
|
+
*/
|
|
1850
|
+
track_opens?: boolean;
|
|
1851
|
+
/**
|
|
1852
|
+
* Whether to track click events for this message.
|
|
1853
|
+
*/
|
|
1854
|
+
track_clicks?: boolean;
|
|
1855
|
+
/**
|
|
1856
|
+
* ID of the IP pool to send from (`ipp_` prefix), or `ipp_shared` to route through the shared pool explicitly. Omit to use your organization's default pool. An unknown pool, or a pool with no dedicated IPs available to send from, is rejected with a `422`.
|
|
1857
|
+
*
|
|
1858
|
+
*/
|
|
1859
|
+
ip_pool_id?: string;
|
|
1860
|
+
/**
|
|
1861
|
+
* Content classification — independent of which endpoint you use. Controls suppression policy: `marketing` blocks on all suppression reasons (use for marketing content); `transactional` allows delivery through complaint and unsubscribe suppressions (use for receipts, password resets, and similar operational messages). Default: transactional.
|
|
1862
|
+
*
|
|
1863
|
+
*/
|
|
1864
|
+
category?: "marketing" | "transactional";
|
|
1865
|
+
/**
|
|
1866
|
+
* Preview feature — threaded replies. Currently unavailable; supplying this field returns `422 unsupported_feature`. When generally available, sets In-Reply-To and References headers automatically.
|
|
1867
|
+
*/
|
|
1868
|
+
in_reply_to_message_id?: EmailId;
|
|
1869
|
+
/**
|
|
1870
|
+
* File attachments. Bird rejects sends whose estimated generated message size exceeds 20 MB. The estimate is the HTML and text body plus all attachments and inline images measured after base64 encoding. Keep total raw attachment content at or below 15 MB for reliable headroom. In batch sends, this per-message cap still applies and the serialized JSON request body for the whole batch has a hard 20 MB cap. See the EmailAttachment schema for the full field contract.
|
|
1871
|
+
*
|
|
1872
|
+
*/
|
|
1873
|
+
attachments?: Array<EmailAttachment>;
|
|
1874
|
+
/**
|
|
1875
|
+
* Preview feature — send-later scheduling. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1876
|
+
*/
|
|
1877
|
+
scheduled_at?: string;
|
|
1878
|
+
/**
|
|
1879
|
+
* Preview feature — contact-targeted sends. Currently unavailable; supplying this field returns `422 unsupported_feature`.
|
|
1880
|
+
*/
|
|
1881
|
+
contact_id?: string;
|
|
1882
|
+
/**
|
|
1883
|
+
* Preview feature — topic-gated sends. Currently unavailable; supplying this field returns `422 unsupported_feature`. When generally available, a non-empty `topic_id` gates delivery on the recipient's opt-in state for that topic — if the recipient is opt_out, the send is silently suppressed and an `email.suppressed` event fires with `reason: topic_opt_out`.
|
|
1884
|
+
*
|
|
1885
|
+
*/
|
|
1886
|
+
topic_id?: string;
|
|
1887
|
+
};
|
|
1888
|
+
type EmailAttachmentId = string;
|
|
1889
|
+
/**
|
|
1890
|
+
* Attachment metadata returned on API reads. The original content is not echoed back inline — only the metadata needed for display and audit. To download the raw attachment bytes (while content storage is enabled and within the retention window), use `GET /v1/email/messages/{message_id}/attachments/{attachment_id}`, which returns the file with its own content type and a Content-Disposition filename.
|
|
1891
|
+
*
|
|
1892
|
+
*/
|
|
1893
|
+
type EmailAttachmentRef = {
|
|
1894
|
+
/**
|
|
1895
|
+
* Attachment ID, stable per email send.
|
|
1896
|
+
*/
|
|
1897
|
+
readonly id?: EmailAttachmentId;
|
|
1898
|
+
/**
|
|
1899
|
+
* Filename as shown to the recipient.
|
|
1900
|
+
*/
|
|
1901
|
+
filename: string;
|
|
1902
|
+
/**
|
|
1903
|
+
* Resolved MIME type at send time.
|
|
1904
|
+
*/
|
|
1905
|
+
content_type?: string;
|
|
1906
|
+
/**
|
|
1907
|
+
* Decoded size in bytes.
|
|
1908
|
+
*/
|
|
1909
|
+
size: number;
|
|
1910
|
+
/**
|
|
1911
|
+
* True when the attachment was sent inline via a `content_id` reference in the HTML body, false for regular file attachments.
|
|
1912
|
+
*
|
|
1913
|
+
*/
|
|
1914
|
+
inline?: boolean;
|
|
1915
|
+
/**
|
|
1916
|
+
* The Content-ID set at send time, when the attachment was inline.
|
|
1917
|
+
*/
|
|
1918
|
+
content_id?: string | null;
|
|
1919
|
+
};
|
|
1920
|
+
type EmailMessage = {
|
|
1921
|
+
/**
|
|
1922
|
+
* Message ID.
|
|
1923
|
+
*/
|
|
1924
|
+
readonly id: EmailId;
|
|
1925
|
+
/**
|
|
1926
|
+
* Sender address. `name` is present when a display name was provided on the send.
|
|
1927
|
+
*/
|
|
1928
|
+
from: EmailAddress;
|
|
1929
|
+
/**
|
|
1930
|
+
* Primary recipients. Length is the recipient count; use the broadcasts endpoint for audience-targeted sends. Each entry's `name` is present when a display name was provided on the send.
|
|
1931
|
+
*/
|
|
1932
|
+
to: Array<EmailAddress>;
|
|
1933
|
+
/**
|
|
1934
|
+
* CC recipients.
|
|
1935
|
+
*/
|
|
1936
|
+
cc?: Array<EmailAddress>;
|
|
1937
|
+
/**
|
|
1938
|
+
* BCC recipients.
|
|
1939
|
+
*/
|
|
1940
|
+
bcc?: Array<EmailAddress>;
|
|
1941
|
+
/**
|
|
1942
|
+
* Message subject line.
|
|
1943
|
+
*/
|
|
1944
|
+
subject: string;
|
|
1945
|
+
/**
|
|
1946
|
+
* Content classification. Controls suppression policy — `marketing` blocks on all suppression reasons; `transactional` allows delivery through complaint and unsubscribe suppressions.
|
|
1947
|
+
*
|
|
1948
|
+
*/
|
|
1949
|
+
category: "marketing" | "transactional";
|
|
1950
|
+
/**
|
|
1951
|
+
* Reply-To addresses, if set on the send. Empty/null when no Reply-To was provided.
|
|
1952
|
+
*/
|
|
1953
|
+
reply_to?: Array<EmailAddress> | null;
|
|
1954
|
+
/**
|
|
1955
|
+
* Aggregate delivery status derived from recipient states. `scheduled` means the message is queued to send at a future time and has not been dispatched yet. `accepted` means Bird has the send and is preparing to deliver. `processed` means Bird has processed the message and queued it for delivery to the recipient's mail server. `canceled` means a scheduled message was canceled before it was sent.
|
|
1956
|
+
*
|
|
1957
|
+
*/
|
|
1958
|
+
readonly status: "scheduled" | "accepted" | "processed" | "deferred" | "delivered" | "partial_failure" | "bounced" | "complained" | "rejected" | "canceled";
|
|
1959
|
+
/**
|
|
1960
|
+
* Number of recipients currently in the `accepted` state — Bird has the send and is preparing to deliver.
|
|
1961
|
+
*/
|
|
1962
|
+
readonly accepted_count: number;
|
|
1963
|
+
/**
|
|
1964
|
+
* Number of recipients for whom Bird has processed the message and queued it for delivery.
|
|
1965
|
+
*/
|
|
1966
|
+
readonly processed_count: number;
|
|
1967
|
+
/**
|
|
1968
|
+
* Number of recipients whose messages were accepted by the remote MTA.
|
|
1969
|
+
*/
|
|
1970
|
+
readonly delivered_count: number;
|
|
1971
|
+
/**
|
|
1972
|
+
* Number of recipients that resulted in a permanent delivery failure.
|
|
1973
|
+
*/
|
|
1974
|
+
readonly bounced_count: number;
|
|
1975
|
+
/**
|
|
1976
|
+
* Number of recipients that reported spam.
|
|
1977
|
+
*/
|
|
1978
|
+
readonly complained_count: number;
|
|
1979
|
+
/**
|
|
1980
|
+
* Number of recipients in transient delivery deferral; the provider is retrying.
|
|
1981
|
+
*/
|
|
1982
|
+
readonly deferred_count: number;
|
|
1281
1983
|
/**
|
|
1282
1984
|
* Number of recipients rejected before delivery. See the per-recipient `rejection_reason` field on `GET /v1/email/messages/{message_id}/recipients` for the specific cause (suppression match, transmission failure, generation failure, or policy refusal).
|
|
1283
1985
|
*
|
|
@@ -1309,7 +2011,7 @@ type EmailMessage = {
|
|
|
1309
2011
|
/**
|
|
1310
2012
|
* Structured `{name, value}` filter labels applied to this send. See EmailMessageSendRequest for the tags vs metadata distinction.
|
|
1311
2013
|
*/
|
|
1312
|
-
tags?: Array<
|
|
2014
|
+
tags?: Array<Tag>;
|
|
1313
2015
|
/**
|
|
1314
2016
|
* Arbitrary JSON metadata stored on the message object and echoed in webhook payloads. See EmailMessageSendRequest for the tags vs metadata distinction.
|
|
1315
2017
|
*/
|
|
@@ -1344,6 +2046,10 @@ type EmailMessage = {
|
|
|
1344
2046
|
* When all recipients reached a terminal delivered state, or null if not yet fully delivered.
|
|
1345
2047
|
*/
|
|
1346
2048
|
readonly delivered_at?: string | null;
|
|
2049
|
+
/**
|
|
2050
|
+
* When this message is scheduled to send, for a send created with a future send time. Null for an immediate send. Stays set after the scheduled send fires.
|
|
2051
|
+
*/
|
|
2052
|
+
readonly scheduled_at?: string | null;
|
|
1347
2053
|
};
|
|
1348
2054
|
type ListEmailMessagesData = {
|
|
1349
2055
|
body?: never;
|
|
@@ -1372,12 +2078,12 @@ type ListEmailMessagesData = {
|
|
|
1372
2078
|
/**
|
|
1373
2079
|
* Filter by aggregate delivery status.
|
|
1374
2080
|
*/
|
|
1375
|
-
status?: "accepted" | "processed" | "deferred" | "delivered" | "partial_failure" | "bounced" | "complained" | "rejected";
|
|
2081
|
+
status?: "scheduled" | "accepted" | "processed" | "deferred" | "delivered" | "partial_failure" | "bounced" | "complained" | "rejected" | "canceled";
|
|
1376
2082
|
/**
|
|
1377
|
-
* Filter by tag. Accepts `name` to match any send carrying that tag name, or `name:value` to match a specific tag pair (e.g. `category:welcome`).
|
|
2083
|
+
* Filter by tag. Accepts `name` to match any send 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.
|
|
1378
2084
|
*
|
|
1379
2085
|
*/
|
|
1380
|
-
tag?: string
|
|
2086
|
+
tag?: Array<string>;
|
|
1381
2087
|
/**
|
|
1382
2088
|
* Filter by category.
|
|
1383
2089
|
*/
|
|
@@ -1395,6 +2101,114 @@ type ListEmailMessagesData = {
|
|
|
1395
2101
|
};
|
|
1396
2102
|
url: "/v1/email/messages";
|
|
1397
2103
|
};
|
|
2104
|
+
type ListSmsMessagesData = {
|
|
2105
|
+
body?: never;
|
|
2106
|
+
path?: never;
|
|
2107
|
+
query?: {
|
|
2108
|
+
/**
|
|
2109
|
+
* Maximum number of items to return per page.
|
|
2110
|
+
*/
|
|
2111
|
+
limit?: number;
|
|
2112
|
+
/**
|
|
2113
|
+
* Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.
|
|
2114
|
+
*/
|
|
2115
|
+
starting_after?: string;
|
|
2116
|
+
/**
|
|
2117
|
+
* Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
|
|
2118
|
+
*/
|
|
2119
|
+
ending_before?: string;
|
|
2120
|
+
/**
|
|
2121
|
+
* Return only resources created strictly after this timestamp. RFC 3339 / ISO 8601 with timezone.
|
|
2122
|
+
*/
|
|
2123
|
+
created_after?: string;
|
|
2124
|
+
/**
|
|
2125
|
+
* Return only resources created strictly before this timestamp. RFC 3339 / ISO 8601 with timezone.
|
|
2126
|
+
*/
|
|
2127
|
+
created_before?: string;
|
|
2128
|
+
/**
|
|
2129
|
+
* Filter by direction. Omit for both.
|
|
2130
|
+
*/
|
|
2131
|
+
direction?: "outbound" | "inbound";
|
|
2132
|
+
/**
|
|
2133
|
+
* Filter by status; repeat the parameter to match any of several. One of scheduled, accepted, sent, delivered, undelivered, failed, rejected, canceled, expired, or received.
|
|
2134
|
+
*
|
|
2135
|
+
*/
|
|
2136
|
+
status?: Array<string>;
|
|
2137
|
+
/**
|
|
2138
|
+
* Filter to messages whose failure reason matches one of the supplied values; repeat the parameter to match any of several. One of invalid_destination, unreachable, blocked_by_carrier, blocked_by_recipient, landline_unreachable, content_rejected, sender_unregistered, recipient_opted_out, provider_unavailable, or unknown.
|
|
2139
|
+
*
|
|
2140
|
+
*/
|
|
2141
|
+
error_code?: Array<string>;
|
|
2142
|
+
/**
|
|
2143
|
+
* Filter by category.
|
|
2144
|
+
*/
|
|
2145
|
+
category?: "transactional" | "marketing" | "authentication" | "service";
|
|
2146
|
+
/**
|
|
2147
|
+
* Filter by recipient phone number (E.164 exact match).
|
|
2148
|
+
*/
|
|
2149
|
+
to?: string;
|
|
2150
|
+
/**
|
|
2151
|
+
* Filter by sender (E.164, alphanumeric, or short code — exact match).
|
|
2152
|
+
*/
|
|
2153
|
+
from?: string;
|
|
2154
|
+
/**
|
|
2155
|
+
* Filter by tag. Accepts `name` to match any message carrying that tag name, or `name:value` to match a specific tag pair. Repeat the parameter to AND-combine several tag filters.
|
|
2156
|
+
*
|
|
2157
|
+
*/
|
|
2158
|
+
tag?: Array<string>;
|
|
2159
|
+
};
|
|
2160
|
+
url: "/v1/sms/messages";
|
|
2161
|
+
};
|
|
2162
|
+
type ListSmsTemplatesData = {
|
|
2163
|
+
body?: never;
|
|
2164
|
+
path?: never;
|
|
2165
|
+
query?: {
|
|
2166
|
+
/**
|
|
2167
|
+
* Filter by scope. Omit for all.
|
|
2168
|
+
*/
|
|
2169
|
+
scope?: "system" | "workspace";
|
|
2170
|
+
/**
|
|
2171
|
+
* Filter by category.
|
|
2172
|
+
*/
|
|
2173
|
+
category?: "transactional" | "marketing" | "authentication" | "service";
|
|
2174
|
+
/**
|
|
2175
|
+
* Keep only templates available in this language, as a BCP-47 tag.
|
|
2176
|
+
*/
|
|
2177
|
+
locale?: string;
|
|
2178
|
+
};
|
|
2179
|
+
url: "/v1/sms/templates";
|
|
2180
|
+
};
|
|
2181
|
+
type ListEmailTemplatesData = {
|
|
2182
|
+
body?: never;
|
|
2183
|
+
path?: never;
|
|
2184
|
+
query?: {
|
|
2185
|
+
/**
|
|
2186
|
+
* Filter by template category.
|
|
2187
|
+
*/
|
|
2188
|
+
category?: EmailTemplateCategory;
|
|
2189
|
+
/**
|
|
2190
|
+
* Filter by authoring format.
|
|
2191
|
+
*/
|
|
2192
|
+
source?: EmailTemplateSource;
|
|
2193
|
+
/**
|
|
2194
|
+
* Filter by name prefix (case-insensitive).
|
|
2195
|
+
*/
|
|
2196
|
+
name?: string;
|
|
2197
|
+
/**
|
|
2198
|
+
* Maximum number of items to return per page.
|
|
2199
|
+
*/
|
|
2200
|
+
limit?: number;
|
|
2201
|
+
/**
|
|
2202
|
+
* Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.
|
|
2203
|
+
*/
|
|
2204
|
+
starting_after?: string;
|
|
2205
|
+
/**
|
|
2206
|
+
* Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
|
|
2207
|
+
*/
|
|
2208
|
+
ending_before?: string;
|
|
2209
|
+
};
|
|
2210
|
+
url: "/v1/email/templates";
|
|
2211
|
+
};
|
|
1398
2212
|
|
|
1399
2213
|
type AuthToken = string | undefined;
|
|
1400
2214
|
interface Auth {
|
|
@@ -1689,7 +2503,7 @@ interface ClientOptions {
|
|
|
1689
2503
|
throwOnError?: boolean;
|
|
1690
2504
|
}
|
|
1691
2505
|
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
1692
|
-
type SseFn = <TData = unknown,
|
|
2506
|
+
type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData>>;
|
|
1693
2507
|
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
1694
2508
|
type BuildUrlFn = <TData extends {
|
|
1695
2509
|
body?: unknown;
|
|
@@ -1858,6 +2672,194 @@ declare class EmailResource<D extends EmailChannelDefaults | undefined = undefin
|
|
|
1858
2672
|
list(query?: EmailListQuery, options?: RequestOptions$1): PaginatedPromise<EmailMessage>;
|
|
1859
2673
|
}
|
|
1860
2674
|
|
|
2675
|
+
/** Body for `bird.emailTemplates.create`. */
|
|
2676
|
+
type EmailTemplateCreateParams = EmailTemplateCreate;
|
|
2677
|
+
/** Body for `bird.emailTemplates.update` — a partial patch of the draft. */
|
|
2678
|
+
type EmailTemplateUpdateParams = EmailTemplateUpdate;
|
|
2679
|
+
/** Filters and cursor params for `bird.emailTemplates.list`. */
|
|
2680
|
+
type EmailTemplateListQuery = NonNullable<ListEmailTemplatesData["query"]>;
|
|
2681
|
+
declare class EmailTemplatesResource extends Resource {
|
|
2682
|
+
/**
|
|
2683
|
+
* Create a template and its initial editable draft. Pick the authoring format
|
|
2684
|
+
* with `source` (`liquid`, `handlebars`, or `html`); the name must be unique
|
|
2685
|
+
* in the workspace or the call throws a `BirdConflictError`.
|
|
2686
|
+
*
|
|
2687
|
+
* @example Create a template
|
|
2688
|
+
* const tpl = await bird.emailTemplates.create({
|
|
2689
|
+
* name: "Welcome",
|
|
2690
|
+
* category: "transactional",
|
|
2691
|
+
* source: "handlebars",
|
|
2692
|
+
* subject: "Welcome, {{ first_name }}!",
|
|
2693
|
+
* html: "<h1>Hi {{ first_name }}</h1>",
|
|
2694
|
+
* });
|
|
2695
|
+
* console.log(tpl.id, tpl.revision); // "emt_…", 0
|
|
2696
|
+
*/
|
|
2697
|
+
create(params: EmailTemplateCreateParams, options?: RequestOptions$1): APIPromise<EmailTemplate>;
|
|
2698
|
+
/**
|
|
2699
|
+
* List the workspace's templates, newest first. `await` resolves the first
|
|
2700
|
+
* page; `for await` walks every template across all pages. Filter by
|
|
2701
|
+
* `category`, `source`, or a case-insensitive `name` prefix.
|
|
2702
|
+
*
|
|
2703
|
+
* @example Iterate every template, or take one page
|
|
2704
|
+
* for await (const tpl of bird.emailTemplates.list({ category: "transactional" })) {
|
|
2705
|
+
* console.log(tpl.id, tpl.name);
|
|
2706
|
+
* }
|
|
2707
|
+
* const page = await bird.emailTemplates.list({ limit: 50 }); // page.data, page.next_cursor
|
|
2708
|
+
*/
|
|
2709
|
+
list(query?: EmailTemplateListQuery, options?: RequestOptions$1): PaginatedPromise<EmailTemplateSummary>;
|
|
2710
|
+
/**
|
|
2711
|
+
* Fetch a template with its current draft content (subject, HTML, text), the
|
|
2712
|
+
* draft `revision`, and its draft/published version ids.
|
|
2713
|
+
*
|
|
2714
|
+
* @example
|
|
2715
|
+
* const tpl = await bird.emailTemplates.get("emt_abc123");
|
|
2716
|
+
* tpl.subject;
|
|
2717
|
+
* tpl.published_version_id; // null until first publish
|
|
2718
|
+
*/
|
|
2719
|
+
get(templateId: string, options?: RequestOptions$1): APIPromise<EmailTemplate>;
|
|
2720
|
+
/**
|
|
2721
|
+
* Update a template's metadata and draft content. Only the fields you send
|
|
2722
|
+
* change. Pass the draft `revision` you last read; if another edit landed
|
|
2723
|
+
* first the call throws a `BirdConflictError` — reload and retry.
|
|
2724
|
+
*
|
|
2725
|
+
* @example Edit the draft, guarded by the revision you read
|
|
2726
|
+
* const tpl = await bird.emailTemplates.get("emt_abc123");
|
|
2727
|
+
* const updated = await bird.emailTemplates.update("emt_abc123", {
|
|
2728
|
+
* revision: tpl.revision,
|
|
2729
|
+
* subject: "Welcome aboard, {{ first_name }}!",
|
|
2730
|
+
* });
|
|
2731
|
+
*/
|
|
2732
|
+
update(templateId: string, params: EmailTemplateUpdateParams, options?: RequestOptions$1): APIPromise<EmailTemplate>;
|
|
2733
|
+
/**
|
|
2734
|
+
* Delete a template and all its versions. The name becomes available for
|
|
2735
|
+
* reuse in the workspace.
|
|
2736
|
+
*
|
|
2737
|
+
* @example
|
|
2738
|
+
* await bird.emailTemplates.delete("emt_abc123");
|
|
2739
|
+
*/
|
|
2740
|
+
delete(templateId: string, options?: RequestOptions$1): APIPromise<void>;
|
|
2741
|
+
/**
|
|
2742
|
+
* Publish the current draft as a new immutable, numbered version and make it
|
|
2743
|
+
* the live version used by sends. The draft stays editable. The draft must
|
|
2744
|
+
* have a subject and a body, or the call throws.
|
|
2745
|
+
*
|
|
2746
|
+
* @example Publish, then send by template
|
|
2747
|
+
* const version = await bird.emailTemplates.publish("emt_abc123");
|
|
2748
|
+
* console.log(version.version_number); // 1, 2, 3…
|
|
2749
|
+
* await bird.email.send({
|
|
2750
|
+
* from: "hello@acme.com",
|
|
2751
|
+
* to: ["alice@example.com"],
|
|
2752
|
+
* template: { id: "emt_abc123", parameters: { first_name: "Alice" } },
|
|
2753
|
+
* });
|
|
2754
|
+
*/
|
|
2755
|
+
publish(templateId: string, options?: RequestOptions$1): APIPromise<EmailTemplateVersion>;
|
|
2756
|
+
/**
|
|
2757
|
+
* List every version of a template — the current draft plus all published
|
|
2758
|
+
* versions — newest first. Returns the full set in one response (`.data`);
|
|
2759
|
+
* this list is not paginated.
|
|
2760
|
+
*
|
|
2761
|
+
* @example
|
|
2762
|
+
* const { data } = await bird.emailTemplates.listVersions("emt_abc123");
|
|
2763
|
+
* for (const v of data) console.log(v.version_number, v.status);
|
|
2764
|
+
*/
|
|
2765
|
+
listVersions(templateId: string, options?: RequestOptions$1): APIPromise<EmailTemplateVersionList>;
|
|
2766
|
+
/**
|
|
2767
|
+
* Fetch a single version of a template.
|
|
2768
|
+
*
|
|
2769
|
+
* @example
|
|
2770
|
+
* const version = await bird.emailTemplates.getVersion("emt_abc123", "emv_def456");
|
|
2771
|
+
* version.status; // "draft" | "published"
|
|
2772
|
+
*/
|
|
2773
|
+
getVersion(templateId: string, versionId: string, options?: RequestOptions$1): APIPromise<EmailTemplateVersion>;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
/** Body for `bird.sms.send` — supply either `text` (with `category`) or `template`. */
|
|
2777
|
+
type SmsSendParams = SmsMessageSendRequest;
|
|
2778
|
+
/** Body for `bird.sms.sendBatch` — an array of up to 100 sends. */
|
|
2779
|
+
type SmsSendBatchParams = SmsMessageBatchRequest;
|
|
2780
|
+
/** Result of `bird.sms.sendBatch`. */
|
|
2781
|
+
type SmsSendBatchResult = SmsMessageBatchResponse;
|
|
2782
|
+
/** Filters and cursor params for `bird.sms.list`. */
|
|
2783
|
+
type SmsListQuery = NonNullable<ListSmsMessagesData["query"]>;
|
|
2784
|
+
declare class SmsResource extends Resource {
|
|
2785
|
+
/**
|
|
2786
|
+
* Send one SMS to a single recipient. Supply either `text` (with a `category`)
|
|
2787
|
+
* or a stored `template` (by `id` or `alias`, with its `parameters`). The
|
|
2788
|
+
* result is `accepted`, not yet delivered — read it back with `get` to confirm.
|
|
2789
|
+
*
|
|
2790
|
+
* @example Send free text
|
|
2791
|
+
* const msg = await bird.sms.send({
|
|
2792
|
+
* to: "+15551234567",
|
|
2793
|
+
* text: "Your verification code is 123456.",
|
|
2794
|
+
* category: "authentication",
|
|
2795
|
+
* });
|
|
2796
|
+
* console.log(msg.id, msg.status);
|
|
2797
|
+
*
|
|
2798
|
+
* @example Send by template
|
|
2799
|
+
* await bird.sms.send({
|
|
2800
|
+
* to: "+15551234567",
|
|
2801
|
+
* template: { alias: "bird_otp_verification", parameters: { code: "123456" } },
|
|
2802
|
+
* });
|
|
2803
|
+
*/
|
|
2804
|
+
send(params: SmsSendParams, options?: RequestOptions$1): APIPromise<SmsMessage>;
|
|
2805
|
+
/**
|
|
2806
|
+
* Send up to 100 independent SMS messages in one call. Each item is a full send
|
|
2807
|
+
* (free text or template); all items are validated before any are queued.
|
|
2808
|
+
*
|
|
2809
|
+
* @example
|
|
2810
|
+
* const result = await bird.sms.sendBatch([
|
|
2811
|
+
* { to: "+15551111111", text: "Hi Alice!", category: "marketing" },
|
|
2812
|
+
* { to: "+15552222222", text: "Hi Bob!", category: "marketing" },
|
|
2813
|
+
* ]);
|
|
2814
|
+
*/
|
|
2815
|
+
sendBatch(params: SmsSendBatchParams, options?: RequestOptions$1): APIPromise<SmsSendBatchResult>;
|
|
2816
|
+
/**
|
|
2817
|
+
* Fetch a single SMS message: its current delivery status, segment breakdown,
|
|
2818
|
+
* cost, and failure detail if it failed.
|
|
2819
|
+
*
|
|
2820
|
+
* @example
|
|
2821
|
+
* const msg = await bird.sms.get("sms_abc123");
|
|
2822
|
+
* msg.status; // "accepted" | "delivered" | …
|
|
2823
|
+
*/
|
|
2824
|
+
get(messageId: string, options?: RequestOptions$1): APIPromise<SmsMessage>;
|
|
2825
|
+
/**
|
|
2826
|
+
* List SMS messages, newest first. `await` resolves the first page; `for await`
|
|
2827
|
+
* walks every message across all pages. Filter by direction, status, category,
|
|
2828
|
+
* recipient, sender, or tag.
|
|
2829
|
+
*
|
|
2830
|
+
* @example
|
|
2831
|
+
* for await (const msg of bird.sms.list({ direction: "outbound" })) {
|
|
2832
|
+
* console.log(msg.id, msg.status);
|
|
2833
|
+
* }
|
|
2834
|
+
*/
|
|
2835
|
+
list(query?: SmsListQuery, options?: RequestOptions$1): PaginatedPromise<SmsMessage>;
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
/** Filters for `bird.smsTemplates.list`. */
|
|
2839
|
+
type SmsTemplateListQuery = NonNullable<ListSmsTemplatesData["query"]>;
|
|
2840
|
+
declare class SmsTemplatesResource extends Resource {
|
|
2841
|
+
/**
|
|
2842
|
+
* List the SMS templates available to the workspace — Bird's built-in
|
|
2843
|
+
* templates plus any the workspace authored. The catalogue is small and
|
|
2844
|
+
* returned in full (`.data`); this list is not paginated. Filter by `scope`,
|
|
2845
|
+
* `category`, or `locale` (a BCP-47 language tag).
|
|
2846
|
+
*
|
|
2847
|
+
* @example List the built-in templates
|
|
2848
|
+
* const { data } = await bird.smsTemplates.list({ scope: "system" });
|
|
2849
|
+
* for (const tpl of data) console.log(tpl.id, tpl.name);
|
|
2850
|
+
*/
|
|
2851
|
+
list(query?: SmsTemplateListQuery, options?: RequestOptions$1): APIPromise<SmsTemplateList>;
|
|
2852
|
+
/**
|
|
2853
|
+
* Fetch a single SMS template by its alias or id, including its body and the
|
|
2854
|
+
* variables it expects.
|
|
2855
|
+
*
|
|
2856
|
+
* @example
|
|
2857
|
+
* const tpl = await bird.smsTemplates.get("bird_otp_verification");
|
|
2858
|
+
* console.log(tpl.body, tpl.variables);
|
|
2859
|
+
*/
|
|
2860
|
+
get(templateRef: string, options?: RequestOptions$1): APIPromise<SmsTemplate>;
|
|
2861
|
+
}
|
|
2862
|
+
|
|
1861
2863
|
/** A verified webhook event — discriminated on `type` (ADR-0028 wire contract). */
|
|
1862
2864
|
type BirdWebhookEvent = WebhookEvent;
|
|
1863
2865
|
/** Inbound request headers, as a `Headers` object or a plain record. */
|
|
@@ -1985,6 +2987,12 @@ declare class BirdClient<const O extends BirdClientOptions = BirdClientOptions>
|
|
|
1985
2987
|
protected readonly core: BirdHTTPClient;
|
|
1986
2988
|
/** The email channel — `bird.email.send(...)`, `.get(...)`, `.list(...)`. */
|
|
1987
2989
|
readonly email: EmailResource<EmailDefaultsOf<O>>;
|
|
2990
|
+
/** Email templates — `bird.emailTemplates.create(...)`, `.list(...)`, `.publish(...)`, … */
|
|
2991
|
+
readonly emailTemplates: EmailTemplatesResource;
|
|
2992
|
+
/** The SMS channel — `bird.sms.send(...)`, `.get(...)`, `.list(...)`. */
|
|
2993
|
+
readonly sms: SmsResource;
|
|
2994
|
+
/** SMS templates — `bird.smsTemplates.list(...)`, `.get(...)`. */
|
|
2995
|
+
readonly smsTemplates: SmsTemplatesResource;
|
|
1988
2996
|
/** Webhooks — `bird.webhooks.unwrap(payload, headers)` verifies an inbound delivery. */
|
|
1989
2997
|
readonly webhooks: WebhooksResource;
|
|
1990
2998
|
constructor(options: O);
|
|
@@ -2018,6 +3026,7 @@ declare const WebhookEventType: {
|
|
|
2018
3026
|
readonly DomainVerified: "domain.verified";
|
|
2019
3027
|
readonly EmailAccepted: "email.accepted";
|
|
2020
3028
|
readonly EmailBounced: "email.bounced";
|
|
3029
|
+
readonly EmailCanceled: "email.canceled";
|
|
2021
3030
|
readonly EmailClicked: "email.clicked";
|
|
2022
3031
|
readonly EmailComplained: "email.complained";
|
|
2023
3032
|
readonly EmailDeferred: "email.deferred";
|
|
@@ -2028,6 +3037,7 @@ declare const WebhookEventType: {
|
|
|
2028
3037
|
readonly EmailProcessed: "email.processed";
|
|
2029
3038
|
readonly EmailReceived: "email.received";
|
|
2030
3039
|
readonly EmailRejected: "email.rejected";
|
|
3040
|
+
readonly EmailScheduled: "email.scheduled";
|
|
2031
3041
|
readonly EmailSuppressionCreated: "email_suppression.created";
|
|
2032
3042
|
readonly EmailUnsubscribed: "email.unsubscribed";
|
|
2033
3043
|
readonly SmsAccepted: "sms.accepted";
|
|
@@ -2041,4 +3051,4 @@ declare const WebhookEventType: {
|
|
|
2041
3051
|
/** A known webhook event type value. */
|
|
2042
3052
|
type WebhookEventTypeValue = (typeof WebhookEventType)[keyof typeof WebhookEventType];
|
|
2043
3053
|
|
|
2044
|
-
export { type APIPromise, 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 CursorPage, type EmailChannelDefaults, type EmailListQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type ErrorDetail, type PaginatedPromise, type RequestOptions$1 as RequestOptions, type SafeResult, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, baseUrlForRegion, regionFromApiKey };
|
|
3054
|
+
export { type APIPromise, 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 CursorPage, type EmailChannelDefaults, type EmailListQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailTemplate, type EmailTemplateCreateParams, type EmailTemplateListQuery, type EmailTemplateSummary, type EmailTemplateUpdateParams, type EmailTemplateVersion, type ErrorDetail, type ErrorNextAction, type PaginatedPromise, type RequestOptions$1 as RequestOptions, type SafeResult, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, baseUrlForRegion, regionFromApiKey };
|