@messagebird/sdk 0.23.0 → 0.24.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
@@ -292,6 +292,176 @@ interface PaginatedPromise<T> extends Promise<CursorPage<T>>, AsyncIterable<T> {
292
292
  }
293
293
  //#endregion
294
294
  //#region src/generated/types.gen.d.ts
295
+ /**
296
+ * ISO 4217 three-letter currency code.
297
+ */
298
+ type CurrencyCode = string;
299
+ type Money = {
300
+ /**
301
+ * Decimal amount as a string, in major currency units.
302
+ */
303
+ amount: string;
304
+ /**
305
+ * ISO 4217 currency code.
306
+ */
307
+ currency_code: CurrencyCode;
308
+ };
309
+ type VoiceMediaQuality = {
310
+ /**
311
+ * Mean opinion score, the single number for how the call sounded, from 1 (unintelligible) to 5 (as good as being in the same room). Anything at or above 4.0 is what most people would call a clear line, and below 3.5 is where callers start asking each other to repeat themselves. The three other fields are the impairments that move it.
312
+ *
313
+ */
314
+ readonly mos: number;
315
+ /**
316
+ * Variation in the arrival time of the audio packets, in milliseconds. Audio arriving unevenly is heard as choppiness even when no packets are lost at all.
317
+ */
318
+ readonly jitter_ms: number;
319
+ /**
320
+ * Percentage of audio packets that never arrived. Heard as brief gaps or clipped words, and the impairment that degrades a call fastest.
321
+ */
322
+ readonly packet_loss_pct: number;
323
+ /**
324
+ * Round-trip time between the two ends, in milliseconds. It does not distort the audio, but above roughly 300 ms the two parties start talking over each other.
325
+ */
326
+ readonly round_trip_time_ms: number;
327
+ };
328
+ /**
329
+ * Why Bird refused the call before dialing a carrier. Every refusal is signalled
330
+ * to your PBX as `503`, so `sip_response_code` alone cannot tell these causes
331
+ * apart. This field is where the cause lives.
332
+ *
333
+ * Most of them you can fix yourself:
334
+ *
335
+ * - `source_not_allowed`: the call came from an IP address that is not in the
336
+ * trunk's allowed-address list. Add the address your PBX sends from.
337
+ * - `caller_id_not_verified`: the number in the `From` header is not a verified
338
+ * caller ID for this workspace. Verify it, or present a number you have
339
+ * already verified.
340
+ * - `destination_not_enabled`: you have not turned on calling to this
341
+ * destination country. Enable it in your voice destination settings.
342
+ * - `insufficient_balance`: your wallet did not cover the call. Top up, or turn
343
+ * on automatic top-ups.
344
+ * - `daily_spend_exceeded`: the call would have passed your organization's daily
345
+ * voice spend limit. The limit resets at the start of the next UTC day.
346
+ * - `concurrent_calls_exceeded`: you already have as many calls in progress as
347
+ * your account allows. Wait for one to end, or ask support to raise the limit.
348
+ * - `calls_per_second_exceeded`: you placed calls faster than your account
349
+ * allows. Slow the rate you dial at, then retry.
350
+ *
351
+ * The rest need Bird to act, so contact support and quote the call `id`:
352
+ *
353
+ * - `routing_not_configured`: no dial plan is attached to this trunk yet.
354
+ * Expected on a trunk that was just created.
355
+ * - `no_route_found`: a dial plan is attached, but no rule in it covers this
356
+ * destination.
357
+ * - `destination_blocked`: the destination is blocked by Bird's routing
358
+ * configuration.
359
+ * - `call_not_permitted`: the call could not be priced for your account.
360
+ *
361
+ */
362
+ type VoiceCallRejectionReason = "source_not_allowed" | "caller_id_not_verified" | "routing_not_configured" | "no_route_found" | "destination_blocked" | "destination_not_enabled" | "insufficient_balance" | "daily_spend_exceeded" | "concurrent_calls_exceeded" | "calls_per_second_exceeded" | "call_not_permitted";
363
+ /**
364
+ * Call status.
365
+ *
366
+ * A call that has ended carries answered, no_answer, failed, rejected, or unknown. A call that is still up carries ringing before it is picked up and in_progress once it is; both are what the `status` filter on the call list selects on to show calls happening right now.
367
+ *
368
+ * busy and canceled are declared ahead of the feature that produces them, so their arrival is not a breaking contract change: they come with inbound termination, and today both outcomes are folded into failed.
369
+ *
370
+ */
371
+ type VoiceCallStatus = "answered" | "no_answer" | "busy" | "canceled" | "failed" | "rejected" | "unknown" | "ringing" | "in_progress";
372
+ type SipTrunkId = string;
373
+ type AuditLogActor = {
374
+ /**
375
+ * Actor identifier.
376
+ */
377
+ id: string;
378
+ /**
379
+ * Actor type (e.g. user, api_key, system).
380
+ */
381
+ type: string;
382
+ /**
383
+ * Display name of the actor — the user's email address for user actors, or the API key's name for API-key actors. Absent when it could not be resolved.
384
+ *
385
+ */
386
+ readonly display_name?: string | null;
387
+ };
388
+ /**
389
+ * Whether the call originated from your PBX (outbound) or arrived from a remote party (inbound).
390
+ */
391
+ type VoiceCallDirection = "inbound" | "outbound";
392
+ type WorkspaceId = string;
393
+ type VoiceSessionId = string;
394
+ type VoiceCallId = string;
395
+ type VoiceCall = {
396
+ /**
397
+ * Unique identifier for this call record.
398
+ */
399
+ readonly id: VoiceCallId;
400
+ /**
401
+ * Session identifier shared across all legs of a multi-party or transferred call. Use this to correlate related call records. Null when session correlation is not available for the call.
402
+ */
403
+ readonly session_id?: VoiceSessionId | null;
404
+ readonly workspace_id: WorkspaceId;
405
+ readonly direction: VoiceCallDirection;
406
+ /**
407
+ * Calling party number in E.164 format.
408
+ */
409
+ readonly from: string;
410
+ /**
411
+ * Called party number in E.164 format.
412
+ */
413
+ readonly to: string;
414
+ /**
415
+ * Who placed the call. Either the API key whose credentials it used, or the user who placed it from a browser or the Bird CLI. Absent when the call was admitted by its source IP address alone, since no credential identifies a caller there, and for calls placed before Bird started recording this.
416
+ */
417
+ readonly actor?: AuditLogActor;
418
+ /**
419
+ * Identifier of the SIP trunk that originated this call. Null when no trunk is associated.
420
+ */
421
+ readonly sip_trunk_id?: SipTrunkId | null;
422
+ readonly status: VoiceCallStatus;
423
+ /**
424
+ * Final SIP response code received from the carrier. Null when no SIP response was received, for example on timeout or DNS failure.
425
+ */
426
+ readonly sip_response_code?: number | null;
427
+ /**
428
+ * Why Bird refused the call before dialing a carrier. Absent when Bird did not refuse it, meaning the call either connected or it failed at the carrier, where `sip_response_code` is the whole story.
429
+ */
430
+ readonly rejection_reason?: VoiceCallRejectionReason;
431
+ /**
432
+ * When the call was initiated.
433
+ */
434
+ readonly started_at: string;
435
+ /**
436
+ * When the call was answered (200 OK received). Null for unanswered calls.
437
+ */
438
+ readonly answered_at?: string | null;
439
+ /**
440
+ * When the call ended (BYE or final non-2xx response). Null for calls that ended abnormally without a recorded end event.
441
+ */
442
+ readonly ended_at?: string | null;
443
+ /**
444
+ * Total call duration in milliseconds, measured from the first INVITE to the BYE or final response. Null while the call is still in progress and has no final duration yet.
445
+ */
446
+ readonly duration_ms?: number | null;
447
+ /**
448
+ * Post-dial delay in milliseconds: how long the caller heard nothing between dialing and the phone starting to ring at the other end. High values are what callers experience as the call "not going through". Absent when the call never rang, either because it failed first or because the carrier answered it immediately.
449
+ *
450
+ */
451
+ readonly pdd_ms?: number;
452
+ /**
453
+ * Billable duration in milliseconds, measured from answer to call end. Zero for unanswered calls, and null while the call is still in progress.
454
+ */
455
+ readonly billable_ms?: number | null;
456
+ /**
457
+ * How the audio sounded, as opposed to whether the call connected. Absent when the call carried no audio, or when the far end reported nothing to measure from.
458
+ */
459
+ media_quality?: VoiceMediaQuality;
460
+ /**
461
+ * Amount billed for this call, net of tax, at full precision. Absent until the call has been rated; unanswered or unpriced calls have no cost.
462
+ */
463
+ cost?: Money;
464
+ };
295
465
  /**
296
466
  * Payload of the whatsapp.sent event.
297
467
  */
@@ -327,7 +497,6 @@ type WhatsAppAddress = {
327
497
  */
328
498
  bsuid?: string;
329
499
  };
330
- type WorkspaceId = string;
331
500
  type WhatsAppMessageId = string;
332
501
  /**
333
502
  * Identity fields shared by every WhatsApp lifecycle event payload.
@@ -507,12 +676,6 @@ type EventWhatsAppAccepted = {
507
676
  * Payload of the voice_call.initiated event.
508
677
  */
509
678
  type EventVoiceCallInitiatedData = EventVoiceBase;
510
- /**
511
- * Whether the call originated from your PBX (outbound) or arrived from a remote party (inbound).
512
- */
513
- type VoiceCallDirection = "inbound" | "outbound";
514
- type VoiceSessionId = string;
515
- type VoiceCallId = string;
516
679
  /**
517
680
  * Identity fields shared by every voice call lifecycle event payload.
518
681
  */
@@ -553,15 +716,6 @@ type EventVoiceCallInitiated = {
553
716
  timestamp: string;
554
717
  data: EventVoiceCallInitiatedData;
555
718
  };
556
- /**
557
- * Call status.
558
- *
559
- * A call that has ended carries answered, no_answer, failed, rejected, or unknown. A call that is still up carries ringing before it is picked up and in_progress once it is; both are what the `status` filter on the call list selects on to show calls happening right now.
560
- *
561
- * busy and canceled are declared ahead of the feature that produces them, so their arrival is not a breaking contract change: they come with inbound termination, and today both outcomes are folded into failed.
562
- *
563
- */
564
- type VoiceCallStatus = "answered" | "no_answer" | "busy" | "canceled" | "failed" | "rejected" | "unknown" | "ringing" | "in_progress";
565
719
  /**
566
720
  * Payload of the voice_call.ended event.
567
721
  */
@@ -866,6 +1020,31 @@ type SmsError = {
866
1020
  */
867
1021
  occurred_at: string;
868
1022
  } | null;
1023
+ /**
1024
+ * What was charged for a message, split into the components that make it up. Null until at least one component has been priced.
1025
+ *
1026
+ */
1027
+ type MessageCost = {
1028
+ /**
1029
+ * Total charged, as a decimal string: the sum of the components below. Net of tax, which applies to your wallet balance rather than to an individual charge.
1030
+ *
1031
+ */
1032
+ readonly amount: string;
1033
+ /**
1034
+ * ISO 4217 currency code. Every component is denominated in this currency.
1035
+ */
1036
+ readonly currency_code: CurrencyCode;
1037
+ /**
1038
+ * What Bird charged to carry the message, as a decimal string. Null when this component was not priced; `"0.00000"` when it priced at zero.
1039
+ *
1040
+ */
1041
+ readonly transaction_amount: string | null;
1042
+ /**
1043
+ * Third-party fees Bird passes on, as a decimal string, such as US 10DLC carrier surcharges. Null when this component was not priced; `"0.00000"` when it priced at zero.
1044
+ *
1045
+ */
1046
+ readonly passthrough_amount: string | null;
1047
+ } | null;
869
1048
  type SmsMessageId = string;
870
1049
  /**
871
1050
  * Identity fields shared by every SMS lifecycle event payload.
@@ -880,11 +1059,13 @@ type EventSmsBase = {
880
1059
  */
881
1060
  workspace_id: WorkspaceId;
882
1061
  /**
883
- * Recipient phone number in E.164 format.
1062
+ * Where the message went. On an outbound message this is the recipient's phone number in E.164 format; on an inbound one it is your own number that received it.
1063
+ *
884
1064
  */
885
1065
  to: string;
886
1066
  /**
887
- * Sender the message was sent from an E.164 number, an alphanumeric sender ID, or a short code.
1067
+ * Where the message came from. On an outbound message this is the sender you sent it from: an E.164 number, an alphanumeric sender ID, or a short code. On an inbound one it is the phone number that sent it to you.
1068
+ *
888
1069
  */
889
1070
  from: string;
890
1071
  /**
@@ -899,6 +1080,13 @@ type EventSmsBase = {
899
1080
  metadata: {
900
1081
  [key: string]: unknown;
901
1082
  } | null;
1083
+ /**
1084
+ * What the message had cost as of this event, split into Bird's charge and any third-party fees passed through. Null on an event that priced nothing.
1085
+ *
1086
+ * Components are named so you can merge them per component rather than replacing the object: webhook delivery is not ordered, so an older event arriving late would otherwise overwrite a newer figure. Take the latest `occurred_at` you have seen for each component. `amount` is the sum of the components in THIS payload, not a settled total.
1087
+ *
1088
+ */
1089
+ cost?: MessageCost;
902
1090
  };
903
1091
  /**
904
1092
  * The carrier reported a non-permanent failure to deliver the message.
@@ -4188,20 +4376,6 @@ type WhatsAppTemplateSend = unknown & {
4188
4376
  */
4189
4377
  components?: Array<WhatsAppMessageTemplateComponent>;
4190
4378
  };
4191
- /**
4192
- * ISO 4217 three-letter currency code.
4193
- */
4194
- type CurrencyCode = string;
4195
- type Money = {
4196
- /**
4197
- * Decimal amount as a string, in major currency units.
4198
- */
4199
- amount: string;
4200
- /**
4201
- * ISO 4217 currency code.
4202
- */
4203
- currency_code: CurrencyCode;
4204
- };
4205
4379
  /**
4206
4380
  * Delivery status. `accepted` (the initial status of an outbound send) means Bird accepted the request and it is queued for sending. `sent` means it was handed to the WhatsApp network. `delivered` is confirmed delivery to the recipient's device. `failed` is a terminal permanent failure. `rejected` means Bird refused the message before sending it to WhatsApp, because the recipient is on the workspace's suppression list, the wallet had insufficient balance, or the destination is unpriced. A rejected message was not sent and not charged. There is no `read` status: a read receipt is reported as `read_at` and a `whatsapp.read` event, not a status value. The remaining values are reserved and not returned today: `scheduled` (queued to send at a future time), `canceled` (a scheduled message canceled before sending), and `received` (a message a contact sent you).
4207
4381
  *
@@ -4278,7 +4452,10 @@ type WhatsAppMessage = {
4278
4452
  * When the message was read by the recipient. Null until then.
4279
4453
  */
4280
4454
  readonly read_at?: string | null;
4281
- cost?: Money | null;
4455
+ /**
4456
+ * What the message cost, split into Bird's charge and any third-party fees passed through. Null until the message has been priced, and on messages that were rejected before pricing. The rate depends on the message category and the recipient's country.
4457
+ */
4458
+ readonly cost?: MessageCost;
4282
4459
  /**
4283
4460
  * Structured `{name, value}` filter labels applied to this message.
4284
4461
  */
@@ -4290,6 +4467,9 @@ type WhatsAppMessage = {
4290
4467
  [key: string]: unknown;
4291
4468
  };
4292
4469
  };
4470
+ type VerificationNextChannelRequest = {
4471
+ to: VerificationTo;
4472
+ };
4293
4473
  type VerificationCheckResult = {
4294
4474
  /**
4295
4475
  * Whether the submitted passcode verified this verification. `true` means the passcode was correct and the verification is now complete; `false` means it did not verify, and `reason` says why. A verification that has already reached a final state is no longer checkable and returns `404`.
@@ -4324,7 +4504,7 @@ type Verification = {
4324
4504
  readonly reason?: VerificationTerminalReason$1 | null;
4325
4505
  readonly to: VerificationTo;
4326
4506
  /**
4327
- * The channels this verification uses to deliver the passcode, in attempt order: the first entry is tried first and later entries are fallbacks. An email recipient is verified over email; a phone recipient is verified over SMS.
4507
+ * The channels this verification uses to deliver the passcode, in attempt order: the first entry is tried first and later entries are fallbacks. An email recipient is verified over email; a phone recipient is verified over the phone channels enabled for its destination country, in the order that country's configuration sets.
4328
4508
  */
4329
4509
  readonly channels: Array<VerificationChannelEntry>;
4330
4510
  /**
@@ -4507,31 +4687,6 @@ type SmsBatchSummary = {
4507
4687
  */
4508
4688
  accepted_count: number;
4509
4689
  };
4510
- /**
4511
- * What was charged for a message, split into the components that make it up. Null until at least one component has been priced.
4512
- *
4513
- */
4514
- type MessageCost = {
4515
- /**
4516
- * Total charged, as a decimal string: the sum of the components below. Net of tax, which applies to your wallet balance rather than to an individual charge.
4517
- *
4518
- */
4519
- readonly amount: string;
4520
- /**
4521
- * ISO 4217 currency code. Every component is denominated in this currency.
4522
- */
4523
- readonly currency_code: CurrencyCode;
4524
- /**
4525
- * What Bird charged to carry the message, as a decimal string. Null when this component was not priced; `"0.00000"` when it priced at zero.
4526
- *
4527
- */
4528
- readonly transaction_amount: string | null;
4529
- /**
4530
- * Third-party fees Bird passes on, as a decimal string, such as US 10DLC carrier surcharges. Null when this component was not priced; `"0.00000"` when it priced at zero.
4531
- *
4532
- */
4533
- readonly passthrough_amount: string | null;
4534
- } | null;
4535
4690
  /**
4536
4691
  * Segment breakdown for the message body. Segment count drives billing.
4537
4692
  */
@@ -4567,18 +4722,20 @@ type SmsMessage = {
4567
4722
  readonly direction: "outbound" | "inbound";
4568
4723
  readonly status: SmsMessageStatus;
4569
4724
  /**
4570
- * Recipient phone number in E.164 format.
4725
+ * Where the message went. On an outbound message this is the recipient's phone number in E.164 format; on an inbound one it is your own number that received it.
4726
+ *
4571
4727
  */
4572
4728
  to: string;
4573
4729
  /**
4574
- * Sender the message was sent from: an E.164 number, an alphanumeric sender ID, or a short code.
4730
+ * Where the message came from. On an outbound message this is the sender you sent it from (an E.164 number, an alphanumeric sender ID, or a short code); on an inbound one it is the phone number that sent it to you.
4731
+ *
4575
4732
  */
4576
4733
  from: string;
4577
4734
  /**
4578
- * The message body as sent. For a template send, this is the rendered text after parameter substitution. When `category` is `authentication` (a message carrying a one-time code), this is `**REDACTED**`: the code still reaches the recipient, Bird just does not persist it for later reads.
4735
+ * The message body. Every message carries body text, attachments, or both, so this is absent only on a received message that carried attachments and no text. For a template send, this is the rendered text after parameter substitution. When `category` is `authentication` (a message carrying a one-time code), this is `**REDACTED**`: the code still reaches the recipient, Bird just does not persist it for later reads.
4579
4736
  *
4580
4737
  */
4581
- text: string;
4738
+ text?: string;
4582
4739
  /**
4583
4740
  * Content classification supplied on the send. Null for inbound messages.
4584
4741
  */
@@ -4606,13 +4763,13 @@ type SmsMessage = {
4606
4763
  */
4607
4764
  readonly validity_period?: number;
4608
4765
  /**
4609
- * Carrier that handled the message, when known. Populated once a delivery receipt identifies it.
4766
+ * Carrier that handled the message. Absent until a delivery receipt identifies it, and on a received message the carrier reports it only where a carrier fee applies.
4610
4767
  */
4611
- readonly carrier?: string | null;
4768
+ readonly carrier?: string;
4612
4769
  /**
4613
- * Mobile country code and mobile network code of the carrier, when known.
4770
+ * Mobile country code and mobile network code of the carrier. Absent until the carrier is identified.
4614
4771
  */
4615
- readonly mcc_mnc?: string | null;
4772
+ readonly mcc_mnc?: string;
4616
4773
  /**
4617
4774
  * Failure detail on a terminally failed or rejected message. Present only when the message failed.
4618
4775
  */
@@ -4808,6 +4965,10 @@ type Contact = {
4808
4965
  data?: {
4809
4966
  [key: string]: unknown;
4810
4967
  };
4968
+ /**
4969
+ * The audiences this contact belongs to, most-recently-joined first. Only present when listing contacts; omitted from every other contact operation.
4970
+ */
4971
+ readonly audiences?: Array<AudienceRef>;
4811
4972
  } & Timestamps;
4812
4973
  type AudienceMember = {
4813
4974
  contact: Contact;
@@ -5050,6 +5211,10 @@ type ContactCreateRequest = {
5050
5211
  [key: string]: unknown;
5051
5212
  };
5052
5213
  };
5214
+ /**
5215
+ * Which identifier a contact has on file, `email` for an email address or `phone` for a phone number.
5216
+ */
5217
+ type ContactIdentifierFilter = "email" | "phone";
5053
5218
  type EmailMessageBatchResponse = {
5054
5219
  /**
5055
5220
  * One entry per message in the batch, in submission order.
@@ -5791,6 +5956,10 @@ type ListContactsData = {
5791
5956
  * Case-insensitive substring match against the contact's email address, first name, last name, or phone number. Phone matching is over the digits of the international form, so a full pasted number, a formatted number, or trailing digits all match; a national form with a leading trunk zero does not.
5792
5957
  */
5793
5958
  q?: string;
5959
+ /**
5960
+ * Filter to contacts that have a specific identifier on file.
5961
+ */
5962
+ identifier?: ContactIdentifierFilter;
5794
5963
  /**
5795
5964
  * Maximum number of items to return per page.
5796
5965
  */
@@ -6223,6 +6392,31 @@ type CreateVerificationCheckData = {
6223
6392
  query?: never;
6224
6393
  url: "/v1/verify/verifications/check";
6225
6394
  };
6395
+ type CreateVerificationNextChannelData = {
6396
+ body: VerificationNextChannelRequest;
6397
+ headers?: {
6398
+ /**
6399
+ * Workspace context. Required for session auth; derived from API key otherwise.
6400
+ */
6401
+ "X-Workspace-Id"?: string;
6402
+ /**
6403
+ * Client-supplied deduplication key. When present, the server replays the original response for any duplicate request with the same key within the idempotency TTL window (3 hours by default).
6404
+ * Two distinct 409 errors signal misuse:
6405
+ * - `request_in_progress` (E01004): the same key is currently being
6406
+ * processed by a concurrent request. Wait briefly and retry; the lock
6407
+ * expires within 30 seconds.
6408
+ * - `idempotency_key_reuse` (E01005): the same key has already completed
6409
+ * against a different request body or method. Generate a new key.
6410
+ *
6411
+ * Recommended key format is `<event-type>/<entity-id>` (e.g. `welcome-user/usr_abc123`).
6412
+ *
6413
+ */
6414
+ "Idempotency-Key"?: string;
6415
+ };
6416
+ path?: never;
6417
+ query?: never;
6418
+ url: "/v1/verify/verifications/next-channel";
6419
+ };
6226
6420
  type ListWhatsAppMessagesData = {
6227
6421
  body?: never;
6228
6422
  path?: never;
@@ -7384,6 +7578,64 @@ type ReplyEmailThreadMessageData = {
7384
7578
  query?: never;
7385
7579
  url: "/v1/email/threads/{thread_id}/messages/{message_id}/reply";
7386
7580
  };
7581
+ type ListVoiceCallsData = {
7582
+ body?: never;
7583
+ path?: never;
7584
+ query?: {
7585
+ /**
7586
+ * Return only calls in this direction.
7587
+ */
7588
+ direction?: VoiceCallDirection;
7589
+ /**
7590
+ * Return only calls with one of these statuses, comma-separated. The in-flight statuses (`ringing`, `in_progress`) cannot be combined with final ones in the same request.
7591
+ *
7592
+ */
7593
+ status?: Array<VoiceCallStatus>;
7594
+ /**
7595
+ * Return only calls belonging to this session, which is how the legs of one multi-party or transferred call are correlated.
7596
+ */
7597
+ session_id?: VoiceSessionId;
7598
+ /**
7599
+ * Return only calls carried by this SIP trunk.
7600
+ */
7601
+ sip_trunk_id?: SipTrunkId;
7602
+ /**
7603
+ * Return only calls placed from this calling party number, matched as a whole number rather than as a fragment. Give it in international form: `+14155551234`, `14155551234`, and `0014155551234` all select the same calls, because a call record keeps the number exactly as the calling equipment presented it. A number given without a country code matches only calls recorded in that same form, since it names a different number in every country. Use `number` instead to match part of a number, or either side of the call.
7604
+ *
7605
+ */
7606
+ from?: string;
7607
+ /**
7608
+ * Return only calls placed to this called party number, matched as a whole number rather than as a fragment. Give it in international form: `+16505559876`, `16505559876`, and `0016505559876` all select the same calls, because a call record keeps the number exactly as the calling equipment presented it. A number given without a country code matches only calls recorded in that same form, since it names a different number in every country. Use `number` instead to match part of a number, or either side of the call.
7609
+ *
7610
+ */
7611
+ to?: string;
7612
+ /**
7613
+ * Return only calls where the calling or called number contains this value. Matches a partial number, so a country or area-code prefix returns every call to or from it. Combines with `from`/`to`, which match one side exactly.
7614
+ */
7615
+ number?: string;
7616
+ /**
7617
+ * Return only calls that started at or after this instant, inclusive. RFC 3339 timestamp.
7618
+ */
7619
+ started_after?: string;
7620
+ /**
7621
+ * Return only calls that started at or before this instant, inclusive. RFC 3339 timestamp.
7622
+ */
7623
+ started_before?: string;
7624
+ /**
7625
+ * Maximum number of items to return per page.
7626
+ */
7627
+ limit?: number;
7628
+ /**
7629
+ * Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.
7630
+ */
7631
+ starting_after?: string;
7632
+ /**
7633
+ * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
7634
+ */
7635
+ ending_before?: string;
7636
+ };
7637
+ url: "/v1/voice/calls";
7638
+ };
7387
7639
  //#endregion
7388
7640
  //#region src/generated/core/auth.gen.d.ts
7389
7641
  type AuthToken = string | undefined;
@@ -8710,12 +8962,36 @@ declare class WhatsappResource extends WhatsappResourceBase {
8710
8962
  send(params: WhatsappSendParams, options?: RequestOptions): APIPromise<WhatsAppMessage>;
8711
8963
  }
8712
8964
  //#endregion
8965
+ //#region src/resources/voice.gen.d.ts
8966
+ type VoiceListQuery = NonNullable<ListVoiceCallsData["query"]>;
8967
+ declare class VoiceResource extends Resource {
8968
+ /**
8969
+ * List the workspace's calls, newest first. Filter to `ringing`/`in_progress` for the calls in progress right now, or to final statuses for completed records. The two cannot be combined in one request. Use `from`/`to` for one known party number in international form, and `number` to search either side by fragment. These are per-call records: for rates and totals over a period use voice_stats_summary rather than summing them here, and voice_get to follow one call to settlement.
8970
+ *
8971
+ * @example Iterate the calls happening right now
8972
+ * for await (const call of bird.voice.list({ status: ["ringing", "in_progress"] })) {
8973
+ * console.log(call.id, call.status);
8974
+ * }
8975
+ */
8976
+ list(query?: VoiceListQuery, options?: RequestOptions): PaginatedPromise<VoiceCall>;
8977
+ /**
8978
+ * Fetch one call by id, at any point in its lifecycle. A call still ringing or connected carries no economics yet: `duration_ms`, `billable_ms`, `ended_at`, and `cost` are null until it ends, and this same id then answers with the settled record. Poll here to watch one known call; use voice_list to find calls in the first place. When a call was refused, `rejection_reason` names the gate that turned it away.
8979
+ *
8980
+ * @example Read one call back
8981
+ * const call = await bird.voice.get("vcl_01k0p3v9wera3v6q6xw3e9y2mh");
8982
+ * // A call still ringing or connected carries no economics yet.
8983
+ * call.status; // "answered" | "no_answer" | "ringing" | …
8984
+ */
8985
+ get(callId: string, options?: RequestOptions): APIPromise<VoiceCall>;
8986
+ }
8987
+ //#endregion
8713
8988
  //#region src/resources/verifyVerifications.gen.d.ts
8714
8989
  type VerifyVerificationsCreateParams = NonNullable<CreateVerificationData["body"]>;
8715
8990
  type VerifyVerificationsCheckParams = NonNullable<CreateVerificationCheckData["body"]>;
8991
+ type VerifyVerificationsNextChannelParams = NonNullable<CreateVerificationNextChannelData["body"]>;
8716
8992
  declare class VerifyVerificationsResource extends Resource {
8717
8993
  /**
8718
- * Start a verification: generate a one-time passcode and send it to the recipient in `to` (a phone number over SMS, an email address over email, or both; with both, it is sent over one channel and fails over to the other, not to both at once). Calling again for the same recipient reuses the in-progress verification and sends a fresh code after the resend cooldown; it does not start a second one, so use this both to send and to resend. The passcode is never returned; submit what the recipient enters with verify_verifications_check. SMS delivery draws on the workspace's SMS balance.
8994
+ * Start a verification: generate a one-time passcode and send it to the recipient in `to` (a phone number over the phone channels enabled for its destination country; an email address over email; or both). It is sent over one channel at a time and fails over to the next in the plan, never over two at once. Calling again for the same recipient reuses the in-progress verification and sends a fresh code after the resend cooldown; it does not start a second one, so use this both to send and to resend. The passcode is never returned; submit what the recipient enters with verify_verifications_check. SMS delivery draws on the workspace's SMS balance.
8719
8995
  *
8720
8996
  * @example Start a verification over SMS
8721
8997
  * const verification = await bird.verify.verifications.create({
@@ -8735,6 +9011,16 @@ declare class VerifyVerificationsResource extends Resource {
8735
9011
  * console.log(result.success);
8736
9012
  */
8737
9013
  check(params: VerifyVerificationsCheckParams, options?: RequestOptions): APIPromise<VerificationCheckResult>;
9014
+ /**
9015
+ * Advance an in-progress verification to the next channel in its plan and send a fresh passcode there: the "I didn't receive my code" action. The verification is identified by the same `to` recipient used to start it, with no verification id needed. The send bypasses the resend cooldown, and earlier passcodes stay valid. Returns the verification with `last_channel` set to the channel the new code went to; when concurrent advances race for the same recipient, the response reflects committed state: `last_channel` names the most recent completed send, and the racing call that completed the newer send is authoritative. A plan with no further channel returns a 422 named NoNextChannel, after which only re-creating the verification will resend.
9016
+ *
9017
+ * @example Send the code again on the next channel
9018
+ * const verification = await bird.verify.verifications.nextChannel({
9019
+ * to: { phone_number: "+15551234567" },
9020
+ * });
9021
+ * console.log(verification.last_channel);
9022
+ */
9023
+ nextChannel(params: VerifyVerificationsNextChannelParams, options?: RequestOptions): APIPromise<Verification>;
8738
9024
  }
8739
9025
  //#endregion
8740
9026
  //#region src/resources/verify.d.ts
@@ -8981,6 +9267,8 @@ declare class BirdClient<const O extends BirdClientOptions = BirdClientOptions>
8981
9267
  readonly smsTemplates: SmsTemplatesResource;
8982
9268
  /** The WhatsApp channel — `bird.whatsapp.send(...)`, `.get(...)`, `.list(...)`, `.listEvents(...)`. */
8983
9269
  readonly whatsapp: WhatsappResource;
9270
+ /** The Voice call log — `bird.voice.list(...)`, `.get(...)`. Calls are placed by your own SIP equipment, so this is a read surface. */
9271
+ readonly voice: VoiceResource;
8984
9272
  /** The Verify product — `bird.verify.verifications.create(...)`, `.check(...)`. */
8985
9273
  readonly verify: VerifyResource;
8986
9274
  /** Contacts — `bird.contacts.create(...)`, `.list(...)`, `.get(...)`, `.batch(...)`, … */
@@ -9174,5 +9462,5 @@ declare const WhatsAppTemplateParameterType: {
9174
9462
  /** A known WhatsAppTemplateParameterType value. */
9175
9463
  type WhatsAppTemplateParameterTypeValue = (typeof WhatsAppTemplateParameterType)[keyof typeof WhatsAppTemplateParameterType];
9176
9464
  //#endregion
9177
- export { type APIPromise, type Audience, type AudienceAddContactsParams, type AudienceCreateParams, type AudienceListContactsQuery, type AudienceListQuery, type AudienceMember, type AudienceRemoveContactsParams, type AudienceUpdateParams, BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, type BirdClientOptions, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, type BirdRequest, type BirdResponse, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, type BirdWebhookEvent, BirdWebhookVerificationError, type Contact, type ContactBatchParams, type ContactCreateParams, type ContactListQuery, type ContactProperty, type ContactPropertyCreateParams, type ContactPropertyListQuery, type ContactPropertyUpdateParams, type ContactUpdateParams, type ContactUpsertResult, type CursorPage, type DnsRecord, type Domain, type DomainCapabilities, type DomainCreateParams, type DomainDkim, type DomainListQuery, type DomainUpdateParams, type EmailChannelDefaults, EmailEventType, type EmailEventTypeValue, type EmailListQuery, type EmailMailboxLabelList, type EmailMailboxesCreateParams, type EmailMailboxesListQuery, type EmailMailboxesMessagesCreateParams, type EmailMailboxesReceiveRulesCreateParams, type EmailMailboxesReceiveRulesListQuery, type EmailMailboxesStatsQuery, type EmailMailboxesUpdateParams, type EmailMailboxesUpdateQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailStatsByBounceCodeQuery, type EmailStatsByBounceCodeResponse, type EmailStatsByBroadcastQuery, type EmailStatsByBroadcastResponse, type EmailStatsByCategoryQuery, type EmailStatsByCategoryResponse, type EmailStatsByClientQuery, type EmailStatsByClientResponse, type EmailStatsByComplaintTypeQuery, type EmailStatsByComplaintTypeResponse, type EmailStatsByLocationQuery, type EmailStatsByLocationResponse, type EmailStatsByMailboxProviderQuery, type EmailStatsByMailboxProviderRegionQuery, type EmailStatsByMailboxProviderRegionResponse, type EmailStatsByMailboxProviderResponse, type EmailStatsByRecipientDomainQuery, type EmailStatsByRecipientDomainResponse, type EmailStatsBySendingDomainQuery, type EmailStatsBySendingDomainResponse, type EmailStatsBySendingIpQuery, type EmailStatsBySendingIpResponse, type EmailStatsByTagQuery, type EmailStatsByTemplateQuery, type EmailStatsByTemplateResponse, type EmailStatsDailyQuery, type EmailStatsHourlyQuery, type EmailStatsResponse, type EmailStatsSummary, type EmailStatsSummaryQuery, type EmailStatsTagsResponse, type EmailThread, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadsDeleteQuery, type EmailThreadsListQuery, type EmailThreadsMessagesListQuery, type EmailThreadsMessagesReplyParams, type EmailThreadsUpdateParams, type ErrorDetail, type ErrorNextAction, type Mailbox, type MailboxStatsResponse, type PaginatedPromise, type 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, type SafeResult, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, type UnmetGate, type Verification, VerificationAttemptFailureReason, type VerificationAttemptFailureReasonValue, VerificationChannel, type VerificationChannelValue, type VerificationCheckResult, VerificationTerminalReason, type VerificationTerminalReasonValue, type VerifyVerificationsCheckParams, type VerifyVerificationsCreateParams, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, WhatsAppErrorCode, type WhatsAppErrorCodeValue, type WhatsAppEventList, type WhatsAppMessage, WhatsAppTemplateCategory, type WhatsAppTemplateCategoryValue, WhatsAppTemplateParameterType, type WhatsAppTemplateParameterTypeValue, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, baseUrlForRegion, regionFromApiKey };
9465
+ export { type APIPromise, type Audience, type AudienceAddContactsParams, type AudienceCreateParams, type AudienceListContactsQuery, type AudienceListQuery, type AudienceMember, type AudienceRemoveContactsParams, type AudienceUpdateParams, BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, type BirdClientOptions, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, type BirdRequest, type BirdResponse, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, type BirdWebhookEvent, BirdWebhookVerificationError, type Contact, type ContactBatchParams, type ContactCreateParams, type ContactListQuery, type ContactProperty, type ContactPropertyCreateParams, type ContactPropertyListQuery, type ContactPropertyUpdateParams, type ContactUpdateParams, type ContactUpsertResult, type CursorPage, type DnsRecord, type Domain, type DomainCapabilities, type DomainCreateParams, type DomainDkim, type DomainListQuery, type DomainUpdateParams, type EmailChannelDefaults, EmailEventType, type EmailEventTypeValue, type EmailListQuery, type EmailMailboxLabelList, type EmailMailboxesCreateParams, type EmailMailboxesListQuery, type EmailMailboxesMessagesCreateParams, type EmailMailboxesReceiveRulesCreateParams, type EmailMailboxesReceiveRulesListQuery, type EmailMailboxesStatsQuery, type EmailMailboxesUpdateParams, type EmailMailboxesUpdateQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailStatsByBounceCodeQuery, type EmailStatsByBounceCodeResponse, type EmailStatsByBroadcastQuery, type EmailStatsByBroadcastResponse, type EmailStatsByCategoryQuery, type EmailStatsByCategoryResponse, type EmailStatsByClientQuery, type EmailStatsByClientResponse, type EmailStatsByComplaintTypeQuery, type EmailStatsByComplaintTypeResponse, type EmailStatsByLocationQuery, type EmailStatsByLocationResponse, type EmailStatsByMailboxProviderQuery, type EmailStatsByMailboxProviderRegionQuery, type EmailStatsByMailboxProviderRegionResponse, type EmailStatsByMailboxProviderResponse, type EmailStatsByRecipientDomainQuery, type EmailStatsByRecipientDomainResponse, type EmailStatsBySendingDomainQuery, type EmailStatsBySendingDomainResponse, type EmailStatsBySendingIpQuery, type EmailStatsBySendingIpResponse, type EmailStatsByTagQuery, type EmailStatsByTemplateQuery, type EmailStatsByTemplateResponse, type EmailStatsDailyQuery, type EmailStatsHourlyQuery, type EmailStatsResponse, type EmailStatsSummary, type EmailStatsSummaryQuery, type EmailStatsTagsResponse, type EmailThread, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadsDeleteQuery, type EmailThreadsListQuery, type EmailThreadsMessagesListQuery, type EmailThreadsMessagesReplyParams, type EmailThreadsUpdateParams, type ErrorDetail, type ErrorNextAction, type Mailbox, type MailboxStatsResponse, type PaginatedPromise, type 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, type SafeResult, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, type UnmetGate, 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, type WhatsAppMessage, WhatsAppTemplateCategory, type WhatsAppTemplateCategoryValue, WhatsAppTemplateParameterType, type WhatsAppTemplateParameterTypeValue, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, baseUrlForRegion, regionFromApiKey };
9178
9466
  //# sourceMappingURL=index.d.mts.map