@messagebird/sdk 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -448,15 +448,32 @@ type NextAction$1 = {
448
448
  */
449
449
  url?: string;
450
450
  };
451
+ type OrganizationId = string;
451
452
  type WorkspaceId = string;
452
453
  /**
453
454
  * ISO 3166-1 alpha-2 country code.
454
455
  */
455
456
  type CountryCode = string;
457
+ type WorkspaceNotificationEmails = {
458
+ /**
459
+ * Addresses for operational notifications about this workspace (sending domain authentication failures, webhook endpoint degradation). When empty, these notifications go to the organization owners. Maximum 10 addresses.
460
+ */
461
+ operational?: Array<string>;
462
+ };
456
463
  type Timestamps = {
457
464
  readonly created_at: string;
458
465
  readonly updated_at: string;
459
466
  };
467
+ type Workspace = {
468
+ readonly id: WorkspaceId;
469
+ organization_id: OrganizationId;
470
+ name: string;
471
+ notification_emails: WorkspaceNotificationEmails;
472
+ /**
473
+ * HTTPS URL to the current workspace logo. `null` when unset.
474
+ */
475
+ readonly logo_url?: string | null;
476
+ } & Timestamps;
460
477
  type RealtimeAppId = string;
461
478
  /**
462
479
  * The event name clients bind to. Application event names are free-form; the `bird:` and `bird_internal:` prefixes are reserved for the protocol and rejected.
@@ -12855,6 +12872,18 @@ declare class PreferencesResource extends PreferencesResourceBase {
12855
12872
  delete(preferenceId: string, options?: RequestOptions): APIPromise<PreferenceWriteResult>;
12856
12873
  }
12857
12874
  //#endregion
12875
+ //#region src/resources/workspace.gen.d.ts
12876
+ declare class WorkspaceResource extends Resource {
12877
+ /**
12878
+ * Fetch the current workspace's ID, name, and the ID of the organization owning it. This is the workspace the current credentials are scoped to.
12879
+ *
12880
+ * @example Read the workspace this credential is scoped to
12881
+ * const workspace = await bird.workspace.get();
12882
+ * console.log(workspace.id, workspace.name); // "ws_…" "Production"
12883
+ */
12884
+ get(options?: RequestOptions): APIPromise<Workspace>;
12885
+ }
12886
+ //#endregion
12858
12887
  //#region src/resources/sms.gen.d.ts
12859
12888
  type SmsListQuery = NonNullable<ListSmsMessagesData["query"]>;
12860
12889
  type SmsListEventsQuery = NonNullable<ListSmsMessageEventsData["query"]>;
@@ -13306,7 +13335,7 @@ type VerifyVerificationsCheckParams = NonNullable<CreateVerificationCheckData["b
13306
13335
  type VerifyVerificationsNextChannelParams = NonNullable<CreateVerificationNextChannelData["body"]>;
13307
13336
  declare class VerifyVerificationsResource extends Resource {
13308
13337
  /**
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. 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.
13338
+ * 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.
13310
13339
  *
13311
13340
  * @example Start a verification over SMS
13312
13341
  * const verification = await bird.verify.verifications.create({
@@ -13316,7 +13345,7 @@ declare class VerifyVerificationsResource extends Resource {
13316
13345
  */
13317
13346
  create(params: VerifyVerificationsCreateParams, options?: RequestOptions): APIPromise<Verification>;
13318
13347
  /**
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, as does a missing verification; malformed input or rate limiting is also an error status.
13348
+ * 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.
13320
13349
  *
13321
13350
  * @example Check a submitted passcode
13322
13351
  * const result = await bird.verify.verifications.check({
@@ -13804,6 +13833,8 @@ declare class BirdClient<const O extends BirdClientOptions = BirdClientOptions>
13804
13833
  readonly contacts: ContactsResource;
13805
13834
  /** Preferences: `bird.preferences.list(...)`, `.get(...)`, `.create(...)`, `.delete(...)`. */
13806
13835
  readonly preferences: PreferencesResource;
13836
+ /** Workspace: `bird.workspace.get()` — the workspace this credential is scoped to. */
13837
+ readonly workspace: WorkspaceResource;
13807
13838
  /** Audiences: `bird.audiences.create(...)`, `.list(...)`, `.addContacts(...)`, … */
13808
13839
  readonly audiences: AudiencesResource;
13809
13840
  /** Contact properties: `bird.contactProperties.create(...)`, `.list(...)`, `.archive(...)`, … */
@@ -14270,5 +14301,5 @@ declare const WhatsAppTemplateParameterType: {
14270
14301
  /** A known WhatsAppTemplateParameterType value. */
14271
14302
  type WhatsAppTemplateParameterTypeValue = (typeof WhatsAppTemplateParameterType)[keyof typeof WhatsAppTemplateParameterType];
14272
14303
  //#endregion
14273
- export { type APIPromise, type Audience, type AudienceAddContactsParams, type AudienceCreateParams, type AudienceListContactsQuery, type AudienceListQuery, type AudienceMember, type AudienceRemoveContactsParams, type AudienceUpdateParams, BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, type BirdClientOptions, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, type BirdRequest, type BirdResponse, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, type BirdWebhookEvent, BirdWebhookVerificationError, type ChannelAuthorization, type Contact, type ContactBatchParams, type ContactCreateParams, type ContactListQuery, type ContactProperty, type ContactPropertyCreateParams, type ContactPropertyListQuery, type ContactPropertyUpdateParams, type ContactUpdateParams, type ContactUpsertResult, type ContactsPreferencesListQuery, type CursorPage, type DnsRecord, type Domain, type DomainCapabilities, type DomainCreateParams, type DomainDkim, type DomainListQuery, type DomainUpdateParams, type EmailChannelDefaults, EmailEventType, type EmailEventTypeValue, type EmailListQuery, type EmailLookup, EmailLookupFlag, type EmailLookupFlagValue, EmailLookupReason, type EmailLookupReasonValue, EmailLookupResult, type EmailLookupResultValue, type EmailMailboxLabelList, type EmailMailboxesCreateParams, type EmailMailboxesListQuery, type EmailMailboxesMessagesCreateParams, type EmailMailboxesReceiveRulesCreateParams, type EmailMailboxesReceiveRulesListQuery, type EmailMailboxesStatsQuery, type EmailMailboxesUpdateParams, type EmailMailboxesUpdateQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailStatsByBounceCodeQuery, type EmailStatsByBounceCodeResponse, type EmailStatsByBroadcastQuery, type EmailStatsByBroadcastResponse, type EmailStatsByCategoryQuery, type EmailStatsByCategoryResponse, type EmailStatsByClientQuery, type EmailStatsByClientResponse, type EmailStatsByComplaintTypeQuery, type EmailStatsByComplaintTypeResponse, type EmailStatsByLocationQuery, type EmailStatsByLocationResponse, type EmailStatsByMailboxProviderQuery, type EmailStatsByMailboxProviderRegionQuery, type EmailStatsByMailboxProviderRegionResponse, type EmailStatsByMailboxProviderResponse, type EmailStatsByRecipientDomainQuery, type EmailStatsByRecipientDomainResponse, type EmailStatsBySendingDomainQuery, type EmailStatsBySendingDomainResponse, type EmailStatsBySendingIpQuery, type EmailStatsBySendingIpResponse, type EmailStatsByTagQuery, type EmailStatsByTemplateQuery, type EmailStatsByTemplateResponse, type EmailStatsDailyQuery, type EmailStatsHourlyQuery, type EmailStatsResponse, type EmailStatsSummary, type EmailStatsSummaryQuery, type EmailStatsTagsResponse, type EmailThread, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadsDeleteQuery, type EmailThreadsListQuery, type EmailThreadsMessagesListQuery, type EmailThreadsMessagesReplyParams, type EmailThreadsUpdateParams, type ErrorDetail, type LookupEmailParams, LookupFlag, type LookupFlagValue, type LookupPhoneNumberParams, LookupPropertyStatus, type LookupPropertyStatusValue, type Mailbox, type MailboxStatsResponse, type NextAction, NumberCapability, type NumberCapabilityValue, NumberType, type NumberTypeValue, NumbersOrderStatus, type NumbersOrderStatusValue, type PaginatedPromise, type PhoneNumberLookup, type Preference, PreferenceChannel, type PreferenceChannelValue, type PreferenceCoverage, type PreferenceCreateParams, PreferenceOrigin, type PreferenceOriginValue, type PreferenceStatus, type PreferenceWriteResult, type PreferencesListQuery, type RealtimeBatchPublishResult, type RealtimeChannelGetQuery, type RealtimeChannelInclude, type RealtimeChannelInfo, type RealtimeChannelListItem, type RealtimeChannelListQuery, type RealtimeChannelMember, type RealtimeChannelMembers, type RealtimeChannelsList, type RealtimeOptions, type RealtimePublishBatchParams, type RealtimePublishParams, type RealtimePublishResult, type ReceiveRule, type RequestOptions, SMSErrorCode, type SMSErrorCodeValue, SMSKeywordOperation, type SMSKeywordOperationValue, SMSSuppressionCoverage, type SMSSuppressionCoverageValue, SMSSuppressionEndReason, type SMSSuppressionEndReasonValue, SMSSuppressionOrigin, type SMSSuppressionOriginValue, SMSSuppressionReason, type SMSSuppressionReasonValue, type SafeResult, type SmsEventList, type SmsInboundStatsByCountryResponse, type SmsInboundStatsByNumberResponse, type SmsInboundStatsByOperatorResponse, type SmsInboundStatsResponse, type SmsInboundStatsSummaryResponse, type SmsKeywordRule, type SmsKeywordRuleList, type SmsKeywordRulesCreateParams, type SmsKeywordRulesListQuery, type SmsKeywordRulesUpdateParams, type SmsListEventsQuery, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsStatsByCarrierQuery, type SmsStatsByCarrierResponse, type SmsStatsByCategoryQuery, type SmsStatsByCategoryResponse, type SmsStatsByCountryQuery, type SmsStatsByCountryResponse, type SmsStatsByErrorCodeQuery, type SmsStatsByErrorCodeResponse, type SmsStatsByOriginatorQuery, type SmsStatsByOriginatorResponse, type SmsStatsByStatusQuery, type SmsStatsByStatusResponse, type SmsStatsDailyQuery, type SmsStatsHourlyQuery, type SmsStatsInboundByCountryQuery, type SmsStatsInboundByNumberQuery, type SmsStatsInboundByOperatorQuery, type SmsStatsInboundDailyQuery, type SmsStatsInboundHourlyQuery, type SmsStatsInboundSummaryQuery, type SmsStatsResponse, type SmsStatsSummary, type SmsStatsSummaryQuery, type SmsSuppression, type SmsSuppressionsAddParams, type SmsSuppressionsListQuery, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, TemplateLanguageStatus, type TemplateLanguageStatusValue, TemplateStatus, type TemplateStatusValue, type Verification, VerificationAttemptFailureReason, type VerificationAttemptFailureReasonValue, VerificationChannel, type VerificationChannelValue, type VerificationCheckResult, VerificationTerminalReason, type VerificationTerminalReasonValue, type VerifyVerificationsCheckParams, type VerifyVerificationsCreateParams, type VerifyVerificationsNextChannelParams, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, WhatsAppErrorCode, type WhatsAppErrorCodeValue, type WhatsAppEventList, WhatsAppEventType, type WhatsAppEventTypeValue, type WhatsAppMessage, WhatsAppTemplateCategory, type WhatsAppTemplateCategoryValue, WhatsAppTemplateParameterType, type WhatsAppTemplateParameterTypeValue, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, baseUrlForRegion, regionFromApiKey };
14304
+ export { type APIPromise, type Audience, type AudienceAddContactsParams, type AudienceCreateParams, type AudienceListContactsQuery, type AudienceListQuery, type AudienceMember, type AudienceRemoveContactsParams, type AudienceUpdateParams, BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, type BirdClientOptions, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, type BirdRequest, type BirdResponse, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, type BirdWebhookEvent, BirdWebhookVerificationError, type ChannelAuthorization, type Contact, type ContactBatchParams, type ContactCreateParams, type ContactListQuery, type ContactProperty, type ContactPropertyCreateParams, type ContactPropertyListQuery, type ContactPropertyUpdateParams, type ContactUpdateParams, type ContactUpsertResult, type ContactsPreferencesListQuery, type CursorPage, type DnsRecord, type Domain, type DomainCapabilities, type DomainCreateParams, type DomainDkim, type DomainListQuery, type DomainUpdateParams, type EmailChannelDefaults, EmailEventType, type EmailEventTypeValue, type EmailListQuery, type EmailLookup, EmailLookupFlag, type EmailLookupFlagValue, EmailLookupReason, type EmailLookupReasonValue, EmailLookupResult, type EmailLookupResultValue, type EmailMailboxLabelList, type EmailMailboxesCreateParams, type EmailMailboxesListQuery, type EmailMailboxesMessagesCreateParams, type EmailMailboxesReceiveRulesCreateParams, type EmailMailboxesReceiveRulesListQuery, type EmailMailboxesStatsQuery, type EmailMailboxesUpdateParams, type EmailMailboxesUpdateQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailStatsByBounceCodeQuery, type EmailStatsByBounceCodeResponse, type EmailStatsByBroadcastQuery, type EmailStatsByBroadcastResponse, type EmailStatsByCategoryQuery, type EmailStatsByCategoryResponse, type EmailStatsByClientQuery, type EmailStatsByClientResponse, type EmailStatsByComplaintTypeQuery, type EmailStatsByComplaintTypeResponse, type EmailStatsByLocationQuery, type EmailStatsByLocationResponse, type EmailStatsByMailboxProviderQuery, type EmailStatsByMailboxProviderRegionQuery, type EmailStatsByMailboxProviderRegionResponse, type EmailStatsByMailboxProviderResponse, type EmailStatsByRecipientDomainQuery, type EmailStatsByRecipientDomainResponse, type EmailStatsBySendingDomainQuery, type EmailStatsBySendingDomainResponse, type EmailStatsBySendingIpQuery, type EmailStatsBySendingIpResponse, type EmailStatsByTagQuery, type EmailStatsByTemplateQuery, type EmailStatsByTemplateResponse, type EmailStatsDailyQuery, type EmailStatsHourlyQuery, type EmailStatsResponse, type EmailStatsSummary, type EmailStatsSummaryQuery, type EmailStatsTagsResponse, type EmailThread, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadsDeleteQuery, type EmailThreadsListQuery, type EmailThreadsMessagesListQuery, type EmailThreadsMessagesReplyParams, type EmailThreadsUpdateParams, type ErrorDetail, type LookupEmailParams, LookupFlag, type LookupFlagValue, type LookupPhoneNumberParams, LookupPropertyStatus, type LookupPropertyStatusValue, type Mailbox, type MailboxStatsResponse, type NextAction, NumberCapability, type NumberCapabilityValue, NumberType, type NumberTypeValue, NumbersOrderStatus, type NumbersOrderStatusValue, type PaginatedPromise, type PhoneNumberLookup, type Preference, PreferenceChannel, type PreferenceChannelValue, type PreferenceCoverage, type PreferenceCreateParams, PreferenceOrigin, type PreferenceOriginValue, type PreferenceStatus, type PreferenceWriteResult, type PreferencesListQuery, type RealtimeBatchPublishResult, type RealtimeChannelGetQuery, type RealtimeChannelInclude, type RealtimeChannelInfo, type RealtimeChannelListItem, type RealtimeChannelListQuery, type RealtimeChannelMember, type RealtimeChannelMembers, type RealtimeChannelsList, type RealtimeOptions, type RealtimePublishBatchParams, type RealtimePublishParams, type RealtimePublishResult, type ReceiveRule, type RequestOptions, SMSErrorCode, type SMSErrorCodeValue, SMSKeywordOperation, type SMSKeywordOperationValue, SMSSuppressionCoverage, type SMSSuppressionCoverageValue, SMSSuppressionEndReason, type SMSSuppressionEndReasonValue, SMSSuppressionOrigin, type SMSSuppressionOriginValue, SMSSuppressionReason, type SMSSuppressionReasonValue, type SafeResult, type SmsEventList, type SmsInboundStatsByCountryResponse, type SmsInboundStatsByNumberResponse, type SmsInboundStatsByOperatorResponse, type SmsInboundStatsResponse, type SmsInboundStatsSummaryResponse, type SmsKeywordRule, type SmsKeywordRuleList, type SmsKeywordRulesCreateParams, type SmsKeywordRulesListQuery, type SmsKeywordRulesUpdateParams, type SmsListEventsQuery, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsStatsByCarrierQuery, type SmsStatsByCarrierResponse, type SmsStatsByCategoryQuery, type SmsStatsByCategoryResponse, type SmsStatsByCountryQuery, type SmsStatsByCountryResponse, type SmsStatsByErrorCodeQuery, type SmsStatsByErrorCodeResponse, type SmsStatsByOriginatorQuery, type SmsStatsByOriginatorResponse, type SmsStatsByStatusQuery, type SmsStatsByStatusResponse, type SmsStatsDailyQuery, type SmsStatsHourlyQuery, type SmsStatsInboundByCountryQuery, type SmsStatsInboundByNumberQuery, type SmsStatsInboundByOperatorQuery, type SmsStatsInboundDailyQuery, type SmsStatsInboundHourlyQuery, type SmsStatsInboundSummaryQuery, type SmsStatsResponse, type SmsStatsSummary, type SmsStatsSummaryQuery, type SmsSuppression, type SmsSuppressionsAddParams, type SmsSuppressionsListQuery, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, TemplateLanguageStatus, type TemplateLanguageStatusValue, TemplateStatus, type TemplateStatusValue, type Verification, VerificationAttemptFailureReason, type VerificationAttemptFailureReasonValue, VerificationChannel, type VerificationChannelValue, type VerificationCheckResult, VerificationTerminalReason, type VerificationTerminalReasonValue, type VerifyVerificationsCheckParams, type VerifyVerificationsCreateParams, type VerifyVerificationsNextChannelParams, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, WhatsAppErrorCode, type WhatsAppErrorCodeValue, type WhatsAppEventList, WhatsAppEventType, type WhatsAppEventTypeValue, type WhatsAppMessage, WhatsAppTemplateCategory, type WhatsAppTemplateCategoryValue, WhatsAppTemplateParameterType, type WhatsAppTemplateParameterTypeValue, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, type Workspace, baseUrlForRegion, regionFromApiKey };
14274
14305
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1193,6 +1193,24 @@ const client = createClient(createConfig());
1193
1193
  //#endregion
1194
1194
  //#region src/generated/sdk.gen.ts
1195
1195
  /**
1196
+ * Get the current workspace
1197
+ *
1198
+ * Returns the workspace the current credentials are scoped to: its ID, name, the ID of the organization that owns it, and its notification and logo settings. The organization's own name and members are not included. Requires at least read access to the workspace.
1199
+ *
1200
+ */
1201
+ const getCurrentWorkspace = (options) => (options?.client ?? client).get({
1202
+ security: [{
1203
+ scheme: "bearer",
1204
+ type: "http"
1205
+ }, {
1206
+ in: "cookie",
1207
+ name: "bird_session",
1208
+ type: "apiKey"
1209
+ }],
1210
+ url: "/v1/workspace",
1211
+ ...options
1212
+ });
1213
+ /**
1196
1214
  * Publish a Realtime event
1197
1215
  *
1198
1216
  * Publishes an event to one or more channels of a Realtime app. Listing several channels broadcasts the event to all of them in one call. Connected clients subscribed to those channels receive it in real time.
@@ -2819,7 +2837,7 @@ const createEmailLookup = (options) => (options.client ?? client).post({
2819
2837
  *
2820
2838
  * 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
2839
  *
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.
2840
+ * 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
2841
  *
2824
2842
  * 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
2843
  *
@@ -2847,10 +2865,14 @@ const createVerification = (options) => (options.client ?? client).post({
2847
2865
  *
2848
2866
  * 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
2867
  *
2850
- * An error status is returned only when the check cannot be evaluated. A `404`
2851
- * means no verification matches the recipient or the matching one already
2852
- * reached its final state. A `422` indicates an invalid recipient. A `429`
2853
- * means passcodes for a recipient are being checked too quickly.
2868
+ * An error status is returned only when the check cannot be evaluated. A `404
2869
+ * E13000` means no active verification matched the recipient: either none
2870
+ * exists for it, or the most recent one is already resolved as verified,
2871
+ * expired, or out of attempts. One code covers all of those, so a `404` is not
2872
+ * evidence the recipient failed to verify. Treat your own record of an earlier
2873
+ * `success: true` as the outcome, and create a new verification only if the
2874
+ * recipient still needs to verify. A `422` indicates an invalid recipient. A
2875
+ * `429` means passcodes for a recipient are being checked too quickly.
2854
2876
  *
2855
2877
  */
2856
2878
  const createVerificationCheck = (options) => (options.client ?? client).post({
@@ -2874,9 +2896,9 @@ const createVerificationCheck = (options) => (options.client ?? client).post({
2874
2896
  *
2875
2897
  * 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
2898
  *
2877
- * The send bypasses the resend cooldown, and 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.
2899
+ * 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
2900
  *
2879
- * A missing in-progress verification returns `404`. 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`.
2901
+ * 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
2902
  *
2881
2903
  */
2882
2904
  const createVerificationNextChannel = (options) => (options.client ?? client).post({
@@ -5768,6 +5790,24 @@ var PreferencesResource = class extends PreferencesResourceBase {
5768
5790
  }
5769
5791
  };
5770
5792
  //#endregion
5793
+ //#region src/resources/workspace.gen.ts
5794
+ var WorkspaceResource = class extends Resource {
5795
+ /**
5796
+ * Fetch the current workspace's ID, name, and the ID of the organization owning it. This is the workspace the current credentials are scoped to.
5797
+ *
5798
+ * @example Read the workspace this credential is scoped to
5799
+ * const workspace = await bird.workspace.get();
5800
+ * console.log(workspace.id, workspace.name); // "ws_…" "Production"
5801
+ */
5802
+ get(options) {
5803
+ return this.call("GET", options, ({ signal, headers }) => getCurrentWorkspace({
5804
+ client: this.client,
5805
+ headers,
5806
+ signal
5807
+ }));
5808
+ }
5809
+ };
5810
+ //#endregion
5771
5811
  //#region src/resources/sms.gen.ts
5772
5812
  var SmsResourceBase = class extends Resource {
5773
5813
  /**
@@ -6465,7 +6505,7 @@ var VoiceResource = class extends Resource {
6465
6505
  //#region src/resources/verifyVerifications.gen.ts
6466
6506
  var VerifyVerificationsResource = class extends Resource {
6467
6507
  /**
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.
6508
+ * 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
6509
  *
6470
6510
  * @example Start a verification over SMS
6471
6511
  * const verification = await bird.verify.verifications.create({
@@ -6482,7 +6522,7 @@ var VerifyVerificationsResource = class extends Resource {
6482
6522
  }));
6483
6523
  }
6484
6524
  /**
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, as does a missing verification; malformed input or rate limiting is also an error status.
6525
+ * 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
6526
  *
6487
6527
  * @example Check a submitted passcode
6488
6528
  * const result = await bird.verify.verifications.check({
@@ -7357,6 +7397,8 @@ var BirdClient = class {
7357
7397
  contacts;
7358
7398
  /** Preferences: `bird.preferences.list(...)`, `.get(...)`, `.create(...)`, `.delete(...)`. */
7359
7399
  preferences;
7400
+ /** Workspace: `bird.workspace.get()` — the workspace this credential is scoped to. */
7401
+ workspace;
7360
7402
  /** Audiences: `bird.audiences.create(...)`, `.list(...)`, `.addContacts(...)`, … */
7361
7403
  audiences;
7362
7404
  /** Contact properties: `bird.contactProperties.create(...)`, `.list(...)`, `.archive(...)`, … */
@@ -7378,9 +7420,9 @@ var BirdClient = class {
7378
7420
  this.#headers = {
7379
7421
  ...opts.defaultHeaders,
7380
7422
  Authorization: `Bearer ${opts.apiKey}`,
7381
- "User-Agent": `bird-sdk-js/0.39.0`,
7423
+ "User-Agent": `bird-sdk-js/0.41.0`,
7382
7424
  "Bird-Surface": "sdk-js",
7383
- "Bird-Version": "0.39.0"
7425
+ "Bird-Version": "0.41.0"
7384
7426
  };
7385
7427
  const caller = detectCaller();
7386
7428
  if (caller) this.#headers["Bird-Caller"] = caller;
@@ -7415,6 +7457,7 @@ var BirdClient = class {
7415
7457
  this.verify = new VerifyResource(this.core, this.#client);
7416
7458
  this.contacts = new ContactsResource(this.core, this.#client);
7417
7459
  this.preferences = new PreferencesResource(this.core, this.#client);
7460
+ this.workspace = new WorkspaceResource(this.core, this.#client);
7418
7461
  this.audiences = new AudiencesResource(this.core, this.#client);
7419
7462
  this.contactProperties = new ContactPropertiesResource(this.core, this.#client);
7420
7463
  this.domains = new DomainsResource(this.core, this.#client);