@messagebird/sdk 0.38.2 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +148 -14
- package/dist/index.mjs +15 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1497,24 +1497,26 @@ type AudienceContactsRemoveRequest = {
|
|
|
1497
1497
|
*/
|
|
1498
1498
|
type MessageDirection = "outbound" | "inbound";
|
|
1499
1499
|
/**
|
|
1500
|
-
* Content classification.
|
|
1500
|
+
* Content classification: why you are sending. Carriers see it, and where a destination country requires the sender to be registered, that registration is approved for a category: a send outside what it covers returns a `422` `SenderCategoryNotPermitted`. A registration approved for `marketing` covers all four values; one approved for `transactional`, `authentication`, or `service` covers those three and not `marketing`. Use `authentication` for a one-time passcode and `marketing` for a promotion; otherwise pick the value matching the message's purpose.
|
|
1501
1501
|
*/
|
|
1502
1502
|
type SmsMessageCategory = "transactional" | "marketing" | "authentication" | "service";
|
|
1503
1503
|
type SmsMessageId = string;
|
|
1504
1504
|
/**
|
|
1505
1505
|
* Delivery status:
|
|
1506
1506
|
*
|
|
1507
|
-
* - `scheduled`: Queued for a future send time.
|
|
1508
1507
|
* - `accepted`: Accepted and awaiting carrier handoff.
|
|
1509
1508
|
* - `sent`: Handed to the carrier and awaiting a delivery receipt.
|
|
1510
1509
|
* - `delivered`: Confirmed as delivered.
|
|
1511
|
-
* - `undelivered`:
|
|
1512
|
-
* - `failed`:
|
|
1510
|
+
* - `undelivered`: The carrier reported delivery as failed for a reason that may clear later, such as a handset out of coverage or a carrier at capacity. Final all the same: the message is not retried, so reaching the recipient means sending again.
|
|
1511
|
+
* - `failed`: The carrier reported delivery as failed for a reason that will not clear, such as an unassigned number, a recipient who has opted out, or content the carrier refused.
|
|
1513
1512
|
* - `rejected`: Refused before carrier handoff.
|
|
1514
|
-
* - `canceled`: Canceled before a scheduled send.
|
|
1515
1513
|
* - `expired`: Reached its validity limit without a final receipt.
|
|
1516
1514
|
* - `received`: Received as an inbound message.
|
|
1517
1515
|
*
|
|
1516
|
+
* `scheduled` and `canceled` are declared ahead of the send-later scheduling
|
|
1517
|
+
* feature that produces them, so their arrival is not a breaking change. No
|
|
1518
|
+
* message carries either status today.
|
|
1519
|
+
*
|
|
1518
1520
|
*/
|
|
1519
1521
|
type SmsMessageStatus = "scheduled" | "accepted" | "sent" | "delivered" | "undelivered" | "failed" | "rejected" | "canceled" | "expired" | "received";
|
|
1520
1522
|
/**
|
|
@@ -1600,7 +1602,7 @@ type SmsErrorCode = "invalid_destination" | "unreachable" | "blocked_by_carrier"
|
|
|
1600
1602
|
type SmsError = {
|
|
1601
1603
|
code: SmsErrorCode;
|
|
1602
1604
|
/**
|
|
1603
|
-
*
|
|
1605
|
+
* The failure in words, from whatever refused the message: the carrier's own reason text on a delivery receipt, or ours on a message stopped before a carrier saw it. Free-form, so branch on `code` and show this to a human.
|
|
1604
1606
|
*/
|
|
1605
1607
|
description: string;
|
|
1606
1608
|
/**
|
|
@@ -1661,12 +1663,12 @@ type SmsMessage = {
|
|
|
1661
1663
|
[key: string]: unknown;
|
|
1662
1664
|
};
|
|
1663
1665
|
/**
|
|
1664
|
-
*
|
|
1666
|
+
* The settings applied to this message, with any option you omitted filled in with the default in force when you sent it. Absent on inbound messages, and on any outbound message for which no settings were recorded.
|
|
1665
1667
|
*
|
|
1666
1668
|
*/
|
|
1667
1669
|
readonly options?: SmsMessageEffectiveOptions;
|
|
1668
1670
|
/**
|
|
1669
|
-
*
|
|
1671
|
+
* Preview feature: how long, in seconds, the carrier may keep attempting delivery before the message is marked `expired`. Not returned yet.
|
|
1670
1672
|
*/
|
|
1671
1673
|
readonly validity_period?: number;
|
|
1672
1674
|
/**
|
|
@@ -1765,12 +1767,12 @@ type SmsMessageSendRequest = unknown & {
|
|
|
1765
1767
|
*/
|
|
1766
1768
|
text?: string;
|
|
1767
1769
|
/**
|
|
1768
|
-
* Content classification
|
|
1770
|
+
* Content classification: why you are sending. Required on a free-text send; omit it on a template send, where the category is derived from the template. Where the destination country requires the sender to be registered, a category outside what that registration covers returns a `422` `SenderCategoryNotPermitted`.
|
|
1769
1771
|
*
|
|
1770
1772
|
*/
|
|
1771
1773
|
category?: SmsMessageCategory;
|
|
1772
1774
|
/**
|
|
1773
|
-
* Preview feature: how long, in seconds (60-172800),
|
|
1775
|
+
* Preview feature: how long, in seconds (60-172800), the carrier may keep attempting delivery before the message is marked `expired`. Currently unavailable; supplying this field returns `422 SMSUnsupportedFeature`.
|
|
1774
1776
|
*
|
|
1775
1777
|
*/
|
|
1776
1778
|
validity_period?: number;
|
|
@@ -1996,7 +1998,7 @@ type SmsTemplateVersionId = string;
|
|
|
1996
1998
|
*/
|
|
1997
1999
|
type SmsTemplate = {
|
|
1998
2000
|
/**
|
|
1999
|
-
*
|
|
2001
|
+
* The template's generated identifier. Accepted anywhere a template is referenced: the `{template_ref}` path segment, and `template.id` on a send. The `slug` works in the same places and is more readable.
|
|
2000
2002
|
*/
|
|
2001
2003
|
readonly id: SmsTemplateId;
|
|
2002
2004
|
/**
|
|
@@ -3846,6 +3848,128 @@ type WhatsAppLocation = {
|
|
|
3846
3848
|
*/
|
|
3847
3849
|
url?: string;
|
|
3848
3850
|
};
|
|
3851
|
+
/**
|
|
3852
|
+
* The contact's name, in the parts their device supplied. Every part is optional: WhatsApp sends what the card holds and omits the rest.
|
|
3853
|
+
*
|
|
3854
|
+
*/
|
|
3855
|
+
type WhatsAppContactName = {
|
|
3856
|
+
/**
|
|
3857
|
+
* The whole name as the contact's device renders it.
|
|
3858
|
+
*/
|
|
3859
|
+
formatted_name?: string;
|
|
3860
|
+
first_name?: string;
|
|
3861
|
+
middle_name?: string;
|
|
3862
|
+
last_name?: string;
|
|
3863
|
+
prefix?: string;
|
|
3864
|
+
suffix?: string;
|
|
3865
|
+
};
|
|
3866
|
+
/**
|
|
3867
|
+
* Where the contact works, as their card records it.
|
|
3868
|
+
*/
|
|
3869
|
+
type WhatsAppContactOrg = {
|
|
3870
|
+
company?: string;
|
|
3871
|
+
department?: string;
|
|
3872
|
+
title?: string;
|
|
3873
|
+
};
|
|
3874
|
+
/**
|
|
3875
|
+
* One phone number on a shared contact card.
|
|
3876
|
+
*/
|
|
3877
|
+
type WhatsAppContactPhone = {
|
|
3878
|
+
/**
|
|
3879
|
+
* The number as the card holds it, normalized to E.164 where we can parse it. A card is whatever the contact's device stored, so a number that no country's numbering plan accepts, an extension among them, is passed through exactly as it arrived rather than dropped. Parse defensively: most values are E.164 and none is guaranteed to be.
|
|
3880
|
+
*
|
|
3881
|
+
*/
|
|
3882
|
+
phone_number?: string;
|
|
3883
|
+
/**
|
|
3884
|
+
* The label the contact's device attached, for example `CELL`, `Home` or `iPhone`. Free text passed through verbatim: WhatsApp declares no vocabulary here and does not normalize the casing, so neither do we.
|
|
3885
|
+
*
|
|
3886
|
+
*/
|
|
3887
|
+
type?: string;
|
|
3888
|
+
};
|
|
3889
|
+
/**
|
|
3890
|
+
* One email address on a shared contact card.
|
|
3891
|
+
*/
|
|
3892
|
+
type WhatsAppContactEmail = {
|
|
3893
|
+
email?: string;
|
|
3894
|
+
/**
|
|
3895
|
+
* The label the contact's device attached, for example `Personal` or `Work`. Free text passed through verbatim.
|
|
3896
|
+
*
|
|
3897
|
+
*/
|
|
3898
|
+
type?: string;
|
|
3899
|
+
};
|
|
3900
|
+
/**
|
|
3901
|
+
* One website on a shared contact card.
|
|
3902
|
+
*/
|
|
3903
|
+
type WhatsAppContactUrl = {
|
|
3904
|
+
/**
|
|
3905
|
+
* The address as the card holds it, which is often bare rather than a full URL, so it is passed through as text rather than validated.
|
|
3906
|
+
*
|
|
3907
|
+
*/
|
|
3908
|
+
url?: string;
|
|
3909
|
+
/**
|
|
3910
|
+
* The label the contact's device attached, for example `Company`. Free text passed through verbatim.
|
|
3911
|
+
*
|
|
3912
|
+
*/
|
|
3913
|
+
type?: string;
|
|
3914
|
+
};
|
|
3915
|
+
/**
|
|
3916
|
+
* One postal address on a shared contact card.
|
|
3917
|
+
*/
|
|
3918
|
+
type WhatsAppContactAddress = {
|
|
3919
|
+
street?: string;
|
|
3920
|
+
city?: string;
|
|
3921
|
+
state?: string;
|
|
3922
|
+
zip?: string;
|
|
3923
|
+
country?: string;
|
|
3924
|
+
/**
|
|
3925
|
+
* The country as the card holds it, left exactly as WhatsApp sent it: it describes a postal address rather than a routing destination.
|
|
3926
|
+
*
|
|
3927
|
+
*/
|
|
3928
|
+
country_code?: string;
|
|
3929
|
+
/**
|
|
3930
|
+
* The label the contact's device attached, for example `Home`. Free text passed through verbatim.
|
|
3931
|
+
*
|
|
3932
|
+
*/
|
|
3933
|
+
type?: string;
|
|
3934
|
+
};
|
|
3935
|
+
/**
|
|
3936
|
+
* A contact card the contact shared, either by tapping a button that asked for their number or by sending a card from their address book. Inbound only.
|
|
3937
|
+
* Nothing here is required. WhatsApp sends the parts the card holds and omits the rest, and a card that arrives with only an `origin` is still meaningful, so an empty card reads back empty rather than being dropped.
|
|
3938
|
+
*
|
|
3939
|
+
*/
|
|
3940
|
+
type WhatsAppContactCard = {
|
|
3941
|
+
/**
|
|
3942
|
+
* Why the card arrived. `contact_request` means the contact tapped a button this workspace sent asking for their number, which is the only signal that the message answers that ask; `other` means they shared a card in the chat. Open enum: treat an unrecognized value as a way of sharing added since.
|
|
3943
|
+
*
|
|
3944
|
+
*/
|
|
3945
|
+
origin?: string;
|
|
3946
|
+
/**
|
|
3947
|
+
* The contact's card in vCard format. WhatsApp sends it on a card shared in the chat and omits it on a button tap, which carries the number alone.
|
|
3948
|
+
*
|
|
3949
|
+
*/
|
|
3950
|
+
vcard?: string;
|
|
3951
|
+
/**
|
|
3952
|
+
* The contact's name, when the card carries one.
|
|
3953
|
+
*/
|
|
3954
|
+
name?: WhatsAppContactName;
|
|
3955
|
+
/**
|
|
3956
|
+
* Where the contact works, when the card carries it.
|
|
3957
|
+
*/
|
|
3958
|
+
org?: WhatsAppContactOrg;
|
|
3959
|
+
/**
|
|
3960
|
+
* The contact's birthday, which WhatsApp sends as `YYYY-MM-DD`. Passed through as text rather than typed as a date: the value comes off the contact's own device unvalidated, and a card we could not parse would otherwise have to lose the field or fail the whole read.
|
|
3961
|
+
*
|
|
3962
|
+
*/
|
|
3963
|
+
birthday?: string;
|
|
3964
|
+
/**
|
|
3965
|
+
* The numbers on the card. A button tap carries the contact's own number here, which is the point of asking.
|
|
3966
|
+
*
|
|
3967
|
+
*/
|
|
3968
|
+
phone_numbers?: Array<WhatsAppContactPhone>;
|
|
3969
|
+
emails?: Array<WhatsAppContactEmail>;
|
|
3970
|
+
urls?: Array<WhatsAppContactUrl>;
|
|
3971
|
+
addresses?: Array<WhatsAppContactAddress>;
|
|
3972
|
+
};
|
|
3849
3973
|
/**
|
|
3850
3974
|
* A message whose content we do not model, named so it is visible in the message log rather than arriving empty. Inbound only.
|
|
3851
3975
|
*
|
|
@@ -3941,6 +4065,11 @@ type WhatsAppMessage = {
|
|
|
3941
4065
|
* Location the message carried.
|
|
3942
4066
|
*/
|
|
3943
4067
|
readonly location?: WhatsAppLocation;
|
|
4068
|
+
/**
|
|
4069
|
+
* Contact cards the contact shared, either by tapping a button that asked for their number or by sending a card from their address book. Inbound only: sending a contact card is not supported.
|
|
4070
|
+
*
|
|
4071
|
+
*/
|
|
4072
|
+
readonly contact_cards?: Array<WhatsAppContactCard>;
|
|
3944
4073
|
/**
|
|
3945
4074
|
* Set when the contact sent content we do not model, naming the WhatsApp content type so the message is not silently empty. Inbound only.
|
|
3946
4075
|
*
|
|
@@ -8126,6 +8255,11 @@ type EventWhatsAppReceivedData = EventWhatsAppBase & {
|
|
|
8126
8255
|
* Location the contact sent.
|
|
8127
8256
|
*/
|
|
8128
8257
|
location?: WhatsAppLocation;
|
|
8258
|
+
/**
|
|
8259
|
+
* Contact cards the contact shared, either by tapping a button that asked for their number or by sending a card from their address book.
|
|
8260
|
+
*
|
|
8261
|
+
*/
|
|
8262
|
+
contact_cards?: Array<WhatsAppContactCard>;
|
|
8129
8263
|
/**
|
|
8130
8264
|
* Set when the contact sent content the API does not model, naming the WhatsApp content type.
|
|
8131
8265
|
*
|
|
@@ -9147,7 +9281,7 @@ type ListSmsMessagesData = {
|
|
|
9147
9281
|
*/
|
|
9148
9282
|
direction?: MessageDirection;
|
|
9149
9283
|
/**
|
|
9150
|
-
* 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`.
|
|
9284
|
+
* 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`. `scheduled` and `canceled` are accepted but match nothing until send-later scheduling ships.
|
|
9151
9285
|
*
|
|
9152
9286
|
*/
|
|
9153
9287
|
status?: Array<string>;
|
|
@@ -13172,7 +13306,7 @@ type VerifyVerificationsCheckParams = NonNullable<CreateVerificationCheckData["b
|
|
|
13172
13306
|
type VerifyVerificationsNextChannelParams = NonNullable<CreateVerificationNextChannelData["body"]>;
|
|
13173
13307
|
declare class VerifyVerificationsResource extends Resource {
|
|
13174
13308
|
/**
|
|
13175
|
-
* Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.
|
|
13309
|
+
* Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown; each send past the cooldown spends one of the recipient's hourly send slots, so repeated resends can hit the cap and return 429. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.
|
|
13176
13310
|
*
|
|
13177
13311
|
* @example Start a verification over SMS
|
|
13178
13312
|
* const verification = await bird.verify.verifications.create({
|
|
@@ -13182,7 +13316,7 @@ declare class VerifyVerificationsResource extends Resource {
|
|
|
13182
13316
|
*/
|
|
13183
13317
|
create(params: VerifyVerificationsCreateParams, options?: RequestOptions): APIPromise<Verification>;
|
|
13184
13318
|
/**
|
|
13185
|
-
* Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404
|
|
13319
|
+
* Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404 `E13000`, as does a missing verification, so a 404 does not tell you the recipient failed: treat an earlier `success: true` as the outcome rather than re-checking. Malformed input or rate limiting is also an error status.
|
|
13186
13320
|
*
|
|
13187
13321
|
* @example Check a submitted passcode
|
|
13188
13322
|
* const result = await bird.verify.verifications.check({
|
package/dist/index.mjs
CHANGED
|
@@ -2819,7 +2819,7 @@ const createEmailLookup = (options) => (options.client ?? client).post({
|
|
|
2819
2819
|
*
|
|
2820
2820
|
* Creates a verification and sends the recipient a one-time passcode. Provide an email address, a phone number, or both in `to`. The service sends over one channel at a time and moves to the next planned channel if delivery fails.
|
|
2821
2821
|
*
|
|
2822
|
-
* Calling this again for the same recipient reuses the verification in progress. During the resend cooldown, it returns the current state without sending. After the cooldown, it sends a fresh passcode.
|
|
2822
|
+
* Calling this again for the same recipient reuses the verification in progress. During the resend cooldown, it returns the current state without sending, so nothing is charged and no send budget is spent. After the cooldown, it sends a fresh passcode, and that send draws on the recipient's hourly send cap exactly as a new verification does, so repeated resends can exhaust the cap and return `429` for the rest of that rolling hour. [Abuse guardrails](/docs/guides/verify/sending-verifications#abuse-guardrails) gives the figures.
|
|
2823
2823
|
*
|
|
2824
2824
|
* The `200` response contains the current state, never the passcode. Submit the recipient's passcode with [Check a verification](/docs/api/reference/create-verification-check) before `expires_at`. An invalid recipient returns `422`; exceeding the send rate limit returns `429`.
|
|
2825
2825
|
*
|
|
@@ -2847,10 +2847,14 @@ const createVerification = (options) => (options.client ?? client).post({
|
|
|
2847
2847
|
*
|
|
2848
2848
|
* A wrong or expired passcode returns `200 OK` with `success: false` and a `reason` such as `incorrect_code` or `expired`. `success: true` means the verification is complete. Each verification reports its final outcome once and cannot be checked again.
|
|
2849
2849
|
*
|
|
2850
|
-
* An error status is returned only when the check cannot be evaluated. A `404
|
|
2851
|
-
* means no verification
|
|
2852
|
-
*
|
|
2853
|
-
*
|
|
2850
|
+
* An error status is returned only when the check cannot be evaluated. A `404
|
|
2851
|
+
* E13000` means no active verification matched the recipient: either none
|
|
2852
|
+
* exists for it, or the most recent one is already resolved as verified,
|
|
2853
|
+
* expired, or out of attempts. One code covers all of those, so a `404` is not
|
|
2854
|
+
* evidence the recipient failed to verify. Treat your own record of an earlier
|
|
2855
|
+
* `success: true` as the outcome, and create a new verification only if the
|
|
2856
|
+
* recipient still needs to verify. A `422` indicates an invalid recipient. A
|
|
2857
|
+
* `429` means passcodes for a recipient are being checked too quickly.
|
|
2854
2858
|
*
|
|
2855
2859
|
*/
|
|
2856
2860
|
const createVerificationCheck = (options) => (options.client ?? client).post({
|
|
@@ -2874,9 +2878,9 @@ const createVerificationCheck = (options) => (options.client ?? client).post({
|
|
|
2874
2878
|
*
|
|
2875
2879
|
* Advances an in-progress verification to the next channel in its plan and sends a fresh passcode there. Identify the verification by the same `to` recipient used to create it; no verification ID is required.
|
|
2876
2880
|
*
|
|
2877
|
-
* The send bypasses the resend cooldown
|
|
2881
|
+
* The send bypasses the resend cooldown and does not draw on the recipient's hourly send cap; what bounds it is the channel plan, since each call advances by at most one channel. Passcodes sent earlier remain valid. The response sets `last_channel` to the most recent completed send. Concurrent requests each advance the plan by at most one channel and return committed state.
|
|
2878
2882
|
*
|
|
2879
|
-
* A
|
|
2883
|
+
* A recipient with no in-progress verification returns `404 E13000`, whether none was ever created or the most recent one is already resolved. A recipient who has already verified is in that set, so a `404` here is not evidence they still need verifying, and creating another verification would send a passcode they no longer need. A plan with no further channel returns `422 NoNextChannel`; create the verification again to resend on the current channel. If every remaining channel fails, the operation returns `422 NoAvailableChannel`. Requests that exceed the send rate limit return `429`.
|
|
2880
2884
|
*
|
|
2881
2885
|
*/
|
|
2882
2886
|
const createVerificationNextChannel = (options) => (options.client ?? client).post({
|
|
@@ -6465,7 +6469,7 @@ var VoiceResource = class extends Resource {
|
|
|
6465
6469
|
//#region src/resources/verifyVerifications.gen.ts
|
|
6466
6470
|
var VerifyVerificationsResource = class extends Resource {
|
|
6467
6471
|
/**
|
|
6468
|
-
* Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.
|
|
6472
|
+
* Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown; each send past the cooldown spends one of the recipient's hourly send slots, so repeated resends can hit the cap and return 429. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.
|
|
6469
6473
|
*
|
|
6470
6474
|
* @example Start a verification over SMS
|
|
6471
6475
|
* const verification = await bird.verify.verifications.create({
|
|
@@ -6482,7 +6486,7 @@ var VerifyVerificationsResource = class extends Resource {
|
|
|
6482
6486
|
}));
|
|
6483
6487
|
}
|
|
6484
6488
|
/**
|
|
6485
|
-
* Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404
|
|
6489
|
+
* Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404 `E13000`, as does a missing verification, so a 404 does not tell you the recipient failed: treat an earlier `success: true` as the outcome rather than re-checking. Malformed input or rate limiting is also an error status.
|
|
6486
6490
|
*
|
|
6487
6491
|
* @example Check a submitted passcode
|
|
6488
6492
|
* const result = await bird.verify.verifications.check({
|
|
@@ -7378,9 +7382,9 @@ var BirdClient = class {
|
|
|
7378
7382
|
this.#headers = {
|
|
7379
7383
|
...opts.defaultHeaders,
|
|
7380
7384
|
Authorization: `Bearer ${opts.apiKey}`,
|
|
7381
|
-
"User-Agent": `bird-sdk-js/0.
|
|
7385
|
+
"User-Agent": `bird-sdk-js/0.40.0`,
|
|
7382
7386
|
"Bird-Surface": "sdk-js",
|
|
7383
|
-
"Bird-Version": "0.
|
|
7387
|
+
"Bird-Version": "0.40.0"
|
|
7384
7388
|
};
|
|
7385
7389
|
const caller = detectCaller();
|
|
7386
7390
|
if (caller) this.#headers["Bird-Caller"] = caller;
|