@getlatedev/node 0.2.309 → 0.2.311

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.
@@ -911,6 +911,148 @@ export type BusinessCenter = {
911
911
  advertiserCount?: (number) | null;
912
912
  };
913
913
 
914
+ /**
915
+ * One call on a number you own, either channel. `channel` tells you which
916
+ * lane it took: `whatsapp` (WhatsApp Business Calling) or `pstn` (a regular
917
+ * phone call). List endpoints omit `transcript`; use `lastTranscriptSnippet`
918
+ * for a preview and the detail endpoint for the full transcript.
919
+ *
920
+ */
921
+ export type CallRecord = {
922
+ _id?: string;
923
+ /**
924
+ * Owning social account. The unified /v1/calls/{id} detail + recording endpoints work for any channel; the channel-specific endpoints remain for account-scoped access.
925
+ */
926
+ accountId?: string;
927
+ /**
928
+ * Inbox conversation with the counterparty, when one exists.
929
+ */
930
+ conversationId?: (string) | null;
931
+ /**
932
+ * CRM Contact for the counterparty, when resolved.
933
+ */
934
+ contactId?: (string) | null;
935
+ channel?: 'whatsapp' | 'pstn';
936
+ direction?: 'inbound' | 'outbound';
937
+ /**
938
+ * Caller number (E.164).
939
+ */
940
+ from?: string;
941
+ /**
942
+ * Callee number (E.164).
943
+ */
944
+ to?: string;
945
+ /**
946
+ * Destination the call was routed to (tel:/sip:/wss:), snapshotted at routing time.
947
+ */
948
+ forwardTo?: (string) | null;
949
+ /**
950
+ * Outbound PSTN only. Message spoken to the callee on answer, before the bridge.
951
+ */
952
+ greeting?: (string) | null;
953
+ status?: 'ringing' | 'answered' | 'ended' | 'failed';
954
+ /**
955
+ * True when an inbound call went to voicemail.
956
+ */
957
+ isVoicemail?: boolean;
958
+ /**
959
+ * Outbound answering-machine detection was requested for this call.
960
+ */
961
+ amd?: boolean;
962
+ /**
963
+ * With `amd`, whether a machine (vs a human) answered.
964
+ */
965
+ answeredMachine?: (boolean) | null;
966
+ /**
967
+ * Caller ID presented on the forwarded leg.
968
+ */
969
+ forwardCallerId?: 'business' | 'caller';
970
+ /**
971
+ * Effective flag for THIS call (number default + per-call override, resolved at create time).
972
+ */
973
+ recordingEnabled?: boolean;
974
+ transcriptionEnabled?: boolean;
975
+ transcriptionLanguage?: 'auto' | 'en' | 'es';
976
+ startedAt?: string;
977
+ answeredAt?: (string) | null;
978
+ endedAt?: (string) | null;
979
+ /**
980
+ * When the call was blind-transferred (POST /v1/voice/calls/{id}/transfer).
981
+ */
982
+ transferredAt?: (string) | null;
983
+ durationSeconds?: number;
984
+ endReason?: 'hangup' | 'no_answer' | 'rejected' | 'error';
985
+ /**
986
+ * Raw carrier hangup cause behind endReason (e.g. normal_clearing, not_found, time_limit) — the actual motive when endReason is a coarse bucket.
987
+ */
988
+ hangupCause?: (string) | null;
989
+ /**
990
+ * SIP response code that ended the call, when SIP-signalled (e.g. '403', '488'). The real failure reason for SIP legs.
991
+ */
992
+ sipHangupCause?: (string) | null;
993
+ /**
994
+ * Per-call failure log (dial failed, bridge failed, recording error).
995
+ */
996
+ callErrors?: Array<{
997
+ code?: number;
998
+ message?: string;
999
+ }>;
1000
+ /**
1001
+ * May be expired. Resolve a fresh playable URL via GET /v1/calls/{id}/recording (any channel).
1002
+ */
1003
+ recordingUrl?: (string) | null;
1004
+ /**
1005
+ * Most recent transcript segment, for list previews.
1006
+ */
1007
+ lastTranscriptSnippet?: (string) | null;
1008
+ /**
1009
+ * Full transcript segments (detail endpoint only; omitted from lists).
1010
+ */
1011
+ transcript?: Array<{
1012
+ text?: string;
1013
+ confidence?: number;
1014
+ at?: string;
1015
+ }>;
1016
+ billing?: {
1017
+ metaMinutes?: number;
1018
+ telnyxSeconds?: number;
1019
+ transcriptionSeconds?: number;
1020
+ transcriptionCostUSD?: number;
1021
+ /**
1022
+ * WhatsApp channel only. Meta per-minute charge, billed by Meta directly to your WABA. Display only; not billed by Zernio.
1023
+ */
1024
+ metaCostUSD?: number;
1025
+ telnyxCostUSD?: number;
1026
+ recordingCostUSD?: number;
1027
+ /**
1028
+ * Amount Zernio bills you = telephony leg + recording + transcription (excludes any Meta portion).
1029
+ */
1030
+ billableCostUSD?: number;
1031
+ /**
1032
+ * Full cost incl. any Meta portion you pay directly. Display only.
1033
+ */
1034
+ totalCostUSD?: number;
1035
+ currency?: string;
1036
+ };
1037
+ createdAt?: string;
1038
+ updatedAt?: string;
1039
+ };
1040
+
1041
+ export type channel = 'whatsapp' | 'pstn';
1042
+
1043
+ export type direction = 'inbound' | 'outbound';
1044
+
1045
+ export type status2 = 'ringing' | 'answered' | 'ended' | 'failed';
1046
+
1047
+ /**
1048
+ * Caller ID presented on the forwarded leg.
1049
+ */
1050
+ export type forwardCallerId = 'business' | 'caller';
1051
+
1052
+ export type transcriptionLanguage = 'auto' | 'en' | 'es';
1053
+
1054
+ export type endReason = 'hangup' | 'no_answer' | 'rejected' | 'error';
1055
+
914
1056
  /**
915
1057
  * A discoverable conversion destination on an ad platform — a Meta pixel,
916
1058
  * Google conversion action, or LinkedIn conversion rule. Returned by
@@ -951,7 +1093,7 @@ export type ConversionDestination = {
951
1093
  * For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`).
952
1094
  *
953
1095
  */
954
- export type status2 = 'active' | 'inactive';
1096
+ export type status3 = 'active' | 'inactive';
955
1097
 
956
1098
  /**
957
1099
  * A single conversion event to relay to the ad platform. All PII fields
@@ -1372,7 +1514,7 @@ export type privacy_level = 2;
1372
1514
  /**
1373
1515
  * 1=SCHEDULED, 2=ACTIVE, 3=COMPLETED, 4=CANCELED
1374
1516
  */
1375
- export type status3 = 1 | 2 | 3 | 4;
1517
+ export type status4 = 1 | 2 | 3 | 4;
1376
1518
 
1377
1519
  /**
1378
1520
  * 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL
@@ -1896,7 +2038,7 @@ export type InboxWebhookConversation = {
1896
2038
  contactId?: string;
1897
2039
  };
1898
2040
 
1899
- export type status4 = 'active' | 'archived';
2041
+ export type status5 = 'active' | 'archived';
1900
2042
 
1901
2043
  /**
1902
2044
  * The message object included in inbox webhook payloads.
@@ -2005,7 +2147,7 @@ export type InboxWebhookMessage = {
2005
2147
 
2006
2148
  export type platform2 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
2007
2149
 
2008
- export type direction = 'incoming' | 'outgoing';
2150
+ export type direction2 = 'incoming' | 'outgoing';
2009
2151
 
2010
2152
  /**
2011
2153
  * Shared account-insights response envelope used by every platform-level
@@ -2448,7 +2590,7 @@ export type PlatformAnalytics = {
2448
2590
  errorMessage?: (string) | null;
2449
2591
  };
2450
2592
 
2451
- export type status5 = 'published' | 'failed';
2593
+ export type status6 = 'published' | 'failed';
2452
2594
 
2453
2595
  /**
2454
2596
  * Sync state of analytics for this platform
@@ -2571,7 +2713,7 @@ export type Post = {
2571
2713
  updatedAt?: string;
2572
2714
  };
2573
2715
 
2574
- export type status6 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
2716
+ export type status7 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
2575
2717
 
2576
2718
  export type visibility = 'public' | 'private' | 'unlisted';
2577
2719
 
@@ -3377,15 +3519,27 @@ export type TikTokPlatformData = {
3377
3519
  */
3378
3520
  allowStitch?: boolean;
3379
3521
  /**
3380
- * Type of commercial content disclosure
3522
+ * Type of commercial content disclosure. Sufficient on its own: "brand_organic"
3523
+ * ("Your Brand") implies isBrandOrganicPost and "brand_content" ("Branded Content",
3524
+ * paid partnership) implies brandPartnerPromote, so you don't need to send the
3525
+ * boolean flags separately. Branded content cannot be posted with privacyLevel
3526
+ * SELF_ONLY.
3527
+ *
3381
3528
  */
3382
3529
  commercialContentType?: 'none' | 'brand_organic' | 'brand_content';
3383
3530
  /**
3384
- * Whether the post promotes a brand partner
3531
+ * Whether the post promotes a brand partner (branded content / paid partnership).
3532
+ * Only needed to disclose BOTH types at once (set it alongside
3533
+ * commercialContentType "brand_organic"), or to override the value implied by
3534
+ * commercialContentType.
3535
+ *
3385
3536
  */
3386
3537
  brandPartnerPromote?: boolean;
3387
3538
  /**
3388
- * Whether the post is a brand organic post
3539
+ * Whether the post promotes the creator's own brand (brand organic). Only needed
3540
+ * to disclose BOTH types at once (set it alongside commercialContentType
3541
+ * "brand_content"), or to override the value implied by commercialContentType.
3542
+ *
3389
3543
  */
3390
3544
  isBrandOrganicPost?: boolean;
3391
3545
  /**
@@ -3427,7 +3581,12 @@ export type TikTokPlatformData = {
3427
3581
  };
3428
3582
 
3429
3583
  /**
3430
- * Type of commercial content disclosure
3584
+ * Type of commercial content disclosure. Sufficient on its own: "brand_organic"
3585
+ * ("Your Brand") implies isBrandOrganicPost and "brand_content" ("Branded Content",
3586
+ * paid partnership) implies brandPartnerPromote, so you don't need to send the
3587
+ * boolean flags separately. Branded content cannot be posted with privacyLevel
3588
+ * SELF_ONLY.
3589
+ *
3431
3590
  */
3432
3591
  export type commercialContentType = 'none' | 'brand_organic' | 'brand_content';
3433
3592
 
@@ -3597,7 +3756,7 @@ export type UploadTokenResponse = {
3597
3756
  status?: 'pending' | 'completed' | 'expired';
3598
3757
  };
3599
3758
 
3600
- export type status7 = 'pending' | 'completed' | 'expired';
3759
+ export type status8 = 'pending' | 'completed' | 'expired';
3601
3760
 
3602
3761
  export type UploadTokenStatusResponse = {
3603
3762
  token?: string;
@@ -3876,7 +4035,7 @@ export type WebhookLog = {
3876
4035
  /**
3877
4036
  * Delivery outcome
3878
4037
  */
3879
- export type status8 = 'success' | 'failed';
4038
+ export type status9 = 'success' | 'failed';
3880
4039
 
3881
4040
  /**
3882
4041
  * Webhook payload for `account.ads.initial_sync_completed` events.
@@ -3985,7 +4144,7 @@ export type event = 'account.ads.initial_sync_completed';
3985
4144
  /**
3986
4145
  * Overall outcome of the initial sync.
3987
4146
  */
3988
- export type status9 = 'success' | 'failure';
4147
+ export type status10 = 'success' | 'failure';
3989
4148
 
3990
4149
  /**
3991
4150
  * Stable category for UX branching. New values may be added; existing ones are
@@ -4236,10 +4395,6 @@ export type WebhookPayloadCallEnded = {
4236
4395
 
4237
4396
  export type event5 = 'call.ended';
4238
4397
 
4239
- export type direction2 = 'inbound' | 'outbound';
4240
-
4241
- export type endReason = 'hangup' | 'no_answer' | 'rejected' | 'error';
4242
-
4243
4398
  /**
4244
4399
  * Webhook payload for the `call.failed` event. Fired when a call
4245
4400
  * setup or in-progress call fails.
@@ -5373,7 +5528,7 @@ export type platform10 = 'whatsapp';
5373
5528
  * request before the template is actually removed.
5374
5529
  *
5375
5530
  */
5376
- export type status10 = 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION';
5531
+ export type status11 = 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION';
5377
5532
 
5378
5533
  export type WhatsAppBodyComponent = {
5379
5534
  type: 'body';
@@ -5474,7 +5629,7 @@ export type WhatsAppSandboxSession = {
5474
5629
  * list responses.
5475
5630
  *
5476
5631
  */
5477
- export type status11 = 'pending' | 'active';
5632
+ export type status12 = 'pending' | 'active';
5478
5633
 
5479
5634
  export type WhatsAppTemplateButton = {
5480
5635
  type: 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'copy_code' | 'flow' | 'mpm' | 'catalog';
@@ -5593,7 +5748,7 @@ export type WorkflowExecutionEvent = {
5593
5748
 
5594
5749
  export type action2 = 'execution_started' | 'execution_completed' | 'execution_exited' | 'execution_paused' | 'execution_resumed' | 'node_started' | 'node_completed' | 'node_failed' | 'node_skipped';
5595
5750
 
5596
- export type status12 = 'success' | 'failed' | 'pending';
5751
+ export type status13 = 'success' | 'failed' | 'pending';
5597
5752
 
5598
5753
  /**
5599
5754
  * A node in a workflow graph. `config` shape depends on `type`.
@@ -7519,6 +7674,26 @@ export type GetXApiPricingError = ({
7519
7674
  error?: string;
7520
7675
  });
7521
7676
 
7677
+ export type GetUsageData = {
7678
+ query?: {
7679
+ /**
7680
+ * For Stripe subscription users, `true` forces a subscription
7681
+ * reconciliation pass even when cached plan data looks complete.
7682
+ * Omit the parameter, or pass `false`, to use the default
7683
+ * first-time-only reconciliation behavior. Invalid boolean values are
7684
+ * rejected.
7685
+ *
7686
+ */
7687
+ reconcile?: boolean;
7688
+ };
7689
+ };
7690
+
7691
+ export type GetUsageResponse = (UsageStats);
7692
+
7693
+ export type GetUsageError = (unknown | {
7694
+ error?: string;
7695
+ });
7696
+
7522
7697
  export type GetUsageStatsData = {
7523
7698
  query?: {
7524
7699
  /**
@@ -7539,6 +7714,107 @@ export type GetUsageStatsError = (unknown | {
7539
7714
  error?: string;
7540
7715
  });
7541
7716
 
7717
+ export type GetCallsUsageData = {
7718
+ query?: {
7719
+ channel?: 'whatsapp' | 'pstn';
7720
+ groupBy?: 'day' | 'number' | 'channel';
7721
+ /**
7722
+ * Scope to calls involving this number (typically one of YOUR numbers). E.164, leading + optional.
7723
+ */
7724
+ number?: string;
7725
+ /**
7726
+ * Start of the window (inclusive). Default 30 days before `until`.
7727
+ */
7728
+ since?: string;
7729
+ /**
7730
+ * End of the window (exclusive). Default now.
7731
+ */
7732
+ until?: string;
7733
+ };
7734
+ };
7735
+
7736
+ export type GetCallsUsageResponse = ({
7737
+ since?: string;
7738
+ until?: string;
7739
+ groupBy?: ('day' | 'number' | 'channel') | null;
7740
+ totals?: {
7741
+ calls?: number;
7742
+ answered?: number;
7743
+ minutes?: number;
7744
+ /**
7745
+ * What Zernio bills for these calls.
7746
+ */
7747
+ billableUSD?: number;
7748
+ /**
7749
+ * WhatsApp only: Meta's per-minute charge, billed by Meta directly to your WABA. Display only.
7750
+ */
7751
+ metaUSD?: number;
7752
+ };
7753
+ /**
7754
+ * Present (possibly empty) when `groupBy` is set.
7755
+ */
7756
+ groups?: Array<{
7757
+ /**
7758
+ * The group key: a `YYYY-MM-DD` UTC day, one of your numbers, or a channel.
7759
+ */
7760
+ key?: string;
7761
+ calls?: number;
7762
+ answered?: number;
7763
+ minutes?: number;
7764
+ billableUSD?: number;
7765
+ metaUSD?: number;
7766
+ }>;
7767
+ });
7768
+
7769
+ export type GetCallsUsageError = (unknown | {
7770
+ error?: string;
7771
+ });
7772
+
7773
+ export type GetSmsUsageData = {
7774
+ query?: {
7775
+ groupBy?: 'day' | 'number';
7776
+ /**
7777
+ * Scope to one of YOUR SMS-enabled numbers (E.164, leading + optional).
7778
+ */
7779
+ number?: string;
7780
+ /**
7781
+ * Start of the window (inclusive). Default 30 days before `until`.
7782
+ */
7783
+ since?: string;
7784
+ /**
7785
+ * End of the window (exclusive). Default now.
7786
+ */
7787
+ until?: string;
7788
+ };
7789
+ };
7790
+
7791
+ export type GetSmsUsageResponse = ({
7792
+ since?: string;
7793
+ until?: string;
7794
+ groupBy?: ('day' | 'number') | null;
7795
+ totals?: {
7796
+ sent?: number;
7797
+ received?: number;
7798
+ total?: number;
7799
+ };
7800
+ /**
7801
+ * Present (possibly empty) when `groupBy` is set.
7802
+ */
7803
+ groups?: Array<{
7804
+ /**
7805
+ * A `YYYY-MM-DD` UTC day or one of your numbers.
7806
+ */
7807
+ key?: string;
7808
+ sent?: number;
7809
+ received?: number;
7810
+ total?: number;
7811
+ }>;
7812
+ });
7813
+
7814
+ export type GetSmsUsageError = (unknown | {
7815
+ error?: string;
7816
+ });
7817
+
7542
7818
  export type ListPostsData = {
7543
7819
  query?: {
7544
7820
  /**
@@ -14960,7 +15236,7 @@ export type GetWhatsAppCallingConfigData = {
14960
15236
 
14961
15237
  export type GetWhatsAppCallingConfigResponse = ({
14962
15238
  /**
14963
- * WhatsAppPhoneNumber Mongo ID (use on /v1/whatsapp/phone-numbers/{id}/calling)
15239
+ * Phone number record ID (use on /v1/phone-numbers/{id}/whatsapp/calling)
14964
15240
  */
14965
15241
  phoneNumberDocId?: string;
14966
15242
  phoneNumber?: string;
@@ -14986,7 +15262,7 @@ export type GetWhatsAppCallingConfigError = ({
14986
15262
  error?: string;
14987
15263
  } | unknown);
14988
15264
 
14989
- export type EnableWhatsAppCallingData = {
15265
+ export type EnableWhatsAppCallingLegacyData = {
14990
15266
  body: {
14991
15267
  accountId: string;
14992
15268
  /**
@@ -15009,18 +15285,18 @@ export type EnableWhatsAppCallingData = {
15009
15285
  };
15010
15286
  };
15011
15287
 
15012
- export type EnableWhatsAppCallingResponse = ({
15288
+ export type EnableWhatsAppCallingLegacyResponse = ({
15013
15289
  success?: boolean;
15014
15290
  callingEnabled?: boolean;
15015
15291
  sipHostname?: string;
15016
15292
  forwardTo?: string;
15017
15293
  });
15018
15294
 
15019
- export type EnableWhatsAppCallingError = ({
15295
+ export type EnableWhatsAppCallingLegacyError = ({
15020
15296
  error?: string;
15021
15297
  } | unknown);
15022
15298
 
15023
- export type UpdateWhatsAppCallingData = {
15299
+ export type UpdateWhatsAppCallingLegacyData = {
15024
15300
  body: {
15025
15301
  accountId: string;
15026
15302
  forwardTo?: string;
@@ -15034,13 +15310,13 @@ export type UpdateWhatsAppCallingData = {
15034
15310
  };
15035
15311
  };
15036
15312
 
15037
- export type UpdateWhatsAppCallingResponse = (unknown);
15313
+ export type UpdateWhatsAppCallingLegacyResponse = (unknown);
15038
15314
 
15039
- export type UpdateWhatsAppCallingError = ({
15315
+ export type UpdateWhatsAppCallingLegacyError = ({
15040
15316
  error?: string;
15041
15317
  } | unknown);
15042
15318
 
15043
- export type DisableWhatsAppCallingData = {
15319
+ export type DisableWhatsAppCallingLegacyData = {
15044
15320
  path: {
15045
15321
  id: string;
15046
15322
  };
@@ -15049,9 +15325,9 @@ export type DisableWhatsAppCallingData = {
15049
15325
  };
15050
15326
  };
15051
15327
 
15052
- export type DisableWhatsAppCallingResponse = (unknown);
15328
+ export type DisableWhatsAppCallingLegacyResponse = (unknown);
15053
15329
 
15054
- export type DisableWhatsAppCallingError = ({
15330
+ export type DisableWhatsAppCallingLegacyError = ({
15055
15331
  error?: string;
15056
15332
  } | unknown);
15057
15333
 
@@ -15113,6 +15389,12 @@ export type InitiateWhatsAppCallData = {
15113
15389
  */
15114
15390
  biz_opaque_callback_data?: string;
15115
15391
  };
15392
+ headers?: {
15393
+ /**
15394
+ * Optional client-generated unique key (e.g. a UUID) that makes dial retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
15395
+ */
15396
+ 'Idempotency-Key'?: string;
15397
+ };
15116
15398
  };
15117
15399
 
15118
15400
  export type InitiateWhatsAppCallResponse = ({
@@ -15139,6 +15421,10 @@ export type InitiateWhatsAppCallError = ({
15139
15421
  export type ListWhatsAppCallsData = {
15140
15422
  query: {
15141
15423
  accountId: string;
15424
+ /**
15425
+ * Return calls with startedAt strictly before this instant (use the previous page's nextCursor).
15426
+ */
15427
+ before?: string;
15142
15428
  direction?: 'inbound' | 'outbound';
15143
15429
  limit?: number;
15144
15430
  since?: string;
@@ -15177,6 +15463,10 @@ export type ListWhatsAppCallsResponse = ({
15177
15463
  currency?: string;
15178
15464
  };
15179
15465
  }>;
15466
+ /**
15467
+ * Pass as `before` for the next page; null on the last page.
15468
+ */
15469
+ nextCursor?: (string) | null;
15180
15470
  });
15181
15471
 
15182
15472
  export type ListWhatsAppCallsError = ({
@@ -15202,6 +15492,27 @@ export type GetWhatsAppCallError = ({
15202
15492
  error?: string;
15203
15493
  } | unknown);
15204
15494
 
15495
+ export type GetWhatsAppCallRecordingData = {
15496
+ path: {
15497
+ callId: string;
15498
+ };
15499
+ query: {
15500
+ accountId: string;
15501
+ /**
15502
+ * `json` returns `{ url }` instead of a 302 redirect.
15503
+ */
15504
+ as?: 'json';
15505
+ };
15506
+ };
15507
+
15508
+ export type GetWhatsAppCallRecordingResponse = ({
15509
+ url?: string;
15510
+ });
15511
+
15512
+ export type GetWhatsAppCallRecordingError = (unknown | {
15513
+ error?: string;
15514
+ });
15515
+
15205
15516
  export type GetWhatsAppCallEstimateData = {
15206
15517
  query: {
15207
15518
  accountId: string;
@@ -15237,512 +15548,709 @@ export type GetWhatsAppCallEstimateError = ({
15237
15548
  error?: string;
15238
15549
  });
15239
15550
 
15240
- export type GetWhatsAppLibraryTemplateData = {
15241
- query: {
15551
+ export type ListCallsData = {
15552
+ query?: {
15242
15553
  /**
15243
- * WhatsApp social account ID
15554
+ * Return calls with startedAt strictly before this instant (use the previous page's nextCursor).
15244
15555
  */
15245
- accountId: string;
15556
+ before?: string;
15557
+ channel?: 'whatsapp' | 'pstn';
15558
+ direction?: 'inbound' | 'outbound';
15559
+ limit?: number;
15246
15560
  /**
15247
- * Exact library template name
15561
+ * Exact filter: calls involving this number (typically one of YOUR numbers, to scope history to a single line). E.164, leading + optional.
15248
15562
  */
15249
- name: string;
15563
+ number?: string;
15564
+ /**
15565
+ * Free-text match on the from/to numbers. Non-digits are stripped, so partial queries like `302` or `+1 302` work.
15566
+ */
15567
+ search?: string;
15568
+ status?: 'ringing' | 'answered' | 'ended' | 'failed';
15250
15569
  };
15251
15570
  };
15252
15571
 
15253
- export type GetWhatsAppLibraryTemplateResponse = ({
15254
- template?: {
15255
- name?: string;
15256
- language?: string;
15257
- category?: string;
15258
- body?: string;
15259
- body_params?: Array<(string)>;
15260
- buttons?: Array<{
15261
- /**
15262
- * QUICK_REPLY, URL, PHONE_NUMBER, OTP, FLOW, ...
15263
- */
15264
- type?: string;
15265
- text?: string;
15266
- }>;
15267
- } | null;
15572
+ export type ListCallsResponse = ({
15573
+ calls?: Array<(CallRecord & {
15574
+ /**
15575
+ * CRM contact name for the counterparty, when resolved.
15576
+ */
15577
+ contactName?: string;
15578
+ })>;
15579
+ /**
15580
+ * Pass as `before` for the next page; null on the last page.
15581
+ */
15582
+ nextCursor?: (string) | null;
15268
15583
  });
15269
15584
 
15270
- export type GetWhatsAppLibraryTemplateError = (unknown | {
15585
+ export type ListCallsError = ({
15271
15586
  error?: string;
15587
+ } | unknown);
15588
+
15589
+ export type GetCallData = {
15590
+ path: {
15591
+ id: string;
15592
+ };
15593
+ };
15594
+
15595
+ export type GetCallResponse = ({
15596
+ call?: (CallRecord & {
15597
+ /**
15598
+ * CRM contact name for the counterparty, when resolved.
15599
+ */
15600
+ contactName?: string;
15601
+ });
15272
15602
  });
15273
15603
 
15274
- export type GetWhatsAppBusinessProfileData = {
15275
- query: {
15604
+ export type GetCallError = ({
15605
+ error?: string;
15606
+ } | unknown);
15607
+
15608
+ export type GetCallRecordingData = {
15609
+ path: {
15610
+ id: string;
15611
+ };
15612
+ query?: {
15276
15613
  /**
15277
- * WhatsApp social account ID
15614
+ * `json` returns `{ url }` instead of a 302 redirect.
15278
15615
  */
15279
- accountId: string;
15616
+ as?: 'json';
15280
15617
  };
15281
15618
  };
15282
15619
 
15283
- export type GetWhatsAppBusinessProfileResponse = ({
15284
- success?: boolean;
15285
- businessProfile?: {
15286
- /**
15287
- * Short description (max 139 chars)
15288
- */
15289
- about?: string;
15290
- address?: string;
15291
- /**
15292
- * Full description (max 512 chars)
15293
- */
15294
- description?: string;
15295
- email?: string;
15296
- profilePictureUrl?: string;
15297
- websites?: Array<(string)>;
15298
- /**
15299
- * Business category
15300
- */
15301
- vertical?: string;
15302
- };
15620
+ export type GetCallRecordingResponse = ({
15621
+ url?: string;
15303
15622
  });
15304
15623
 
15305
- export type GetWhatsAppBusinessProfileError = (unknown | {
15624
+ export type GetCallRecordingError = (unknown | {
15306
15625
  error?: string;
15307
15626
  });
15308
15627
 
15309
- export type UpdateWhatsAppBusinessProfileData = {
15628
+ export type CreateVoiceCallData = {
15310
15629
  body: {
15311
15630
  /**
15312
- * WhatsApp social account ID
15631
+ * Destination to dial, E.164 with leading +.
15313
15632
  */
15314
- accountId: string;
15633
+ to: string;
15315
15634
  /**
15316
- * Short business description (max 139 characters)
15635
+ * Which of your voice-enabled numbers to dial from. Optional when you have exactly one.
15317
15636
  */
15318
- about?: string;
15637
+ fromNumber?: string;
15319
15638
  /**
15320
- * Business address
15639
+ * Per-call agent override (tel:+E164, sip:..., or wss://...); defaults to the number's stored forward destination.
15321
15640
  */
15322
- address?: string;
15641
+ forwardTo?: string;
15323
15642
  /**
15324
- * Full business description (max 512 characters)
15643
+ * Spoken to the callee when they answer, before the bridge.
15325
15644
  */
15326
- description?: string;
15645
+ greeting?: string;
15327
15646
  /**
15328
- * Business email
15647
+ * Per-call recording toggle; defaults to the number's setting.
15329
15648
  */
15330
- email?: string;
15649
+ recordOverride?: boolean;
15331
15650
  /**
15332
- * Business websites (max 2)
15651
+ * Per-call transcription toggle; defaults to the number's setting.
15333
15652
  */
15334
- websites?: Array<(string)>;
15653
+ transcribeOverride?: boolean;
15335
15654
  /**
15336
- * Business category (e.g., RETAIL, ENTERTAINMENT, etc.)
15655
+ * 'auto' derives from the callee's country; 'en'/'es' force it.
15337
15656
  */
15338
- vertical?: string;
15657
+ transcriptionLanguage?: 'auto' | 'en' | 'es';
15339
15658
  /**
15340
- * Handle from resumable upload for profile picture
15659
+ * A retry with the same key returns the original call instead of dialing again.
15341
15660
  */
15342
- profilePictureHandle?: string;
15661
+ idempotencyKey?: string;
15662
+ /**
15663
+ * Answering-machine detection; defers the bridge until human vs machine is known.
15664
+ */
15665
+ amd?: boolean;
15666
+ /**
15667
+ * Spoken to a detected machine, then hang up (implies `amd`). For outbound voicemail drops.
15668
+ */
15669
+ voicemailDropMessage?: string;
15670
+ };
15671
+ headers?: {
15672
+ /**
15673
+ * Optional client-generated unique key (e.g. a UUID) that makes dial retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
15674
+ */
15675
+ 'Idempotency-Key'?: string;
15343
15676
  };
15344
15677
  };
15345
15678
 
15346
- export type UpdateWhatsAppBusinessProfileResponse = ({
15679
+ export type CreateVoiceCallResponse = ({
15347
15680
  success?: boolean;
15348
- message?: string;
15681
+ /**
15682
+ * Internal Call doc ID
15683
+ */
15684
+ callId?: string;
15685
+ telnyxCallControlId?: string;
15686
+ status?: 'dialing';
15687
+ direction?: 'outbound';
15688
+ from?: string;
15689
+ to?: string;
15690
+ forwardTo?: string;
15691
+ greeting?: (string) | null;
15692
+ recordingEnabled?: boolean;
15693
+ transcriptionEnabled?: boolean;
15694
+ transcriptionLanguage?: 'auto' | 'en' | 'es';
15349
15695
  });
15350
15696
 
15351
- export type UpdateWhatsAppBusinessProfileError = (unknown | {
15697
+ export type CreateVoiceCallError = ({
15352
15698
  error?: string;
15353
- });
15699
+ } | unknown);
15354
15700
 
15355
- export type UploadWhatsAppProfilePhotoData = {
15356
- body: {
15357
- /**
15358
- * WhatsApp social account ID
15359
- */
15360
- accountId: string;
15701
+ export type ListVoiceCallsData = {
15702
+ query?: {
15703
+ before?: string;
15704
+ direction?: 'inbound' | 'outbound';
15705
+ limit?: number;
15361
15706
  /**
15362
- * Image file (JPEG or PNG, max 5MB, recommended 640x640)
15707
+ * Exact filter: calls involving this number (typically one of your DIDs). E.164, leading + optional.
15363
15708
  */
15364
- file: (Blob | File);
15709
+ number?: string;
15710
+ status?: 'ringing' | 'answered' | 'ended' | 'failed';
15365
15711
  };
15366
15712
  };
15367
15713
 
15368
- export type UploadWhatsAppProfilePhotoResponse = ({
15369
- success?: boolean;
15370
- message?: string;
15714
+ export type ListVoiceCallsResponse = ({
15715
+ calls?: Array<CallRecord>;
15716
+ nextCursor?: (string) | null;
15371
15717
  });
15372
15718
 
15373
- export type UploadWhatsAppProfilePhotoError = (unknown | {
15719
+ export type ListVoiceCallsError = ({
15374
15720
  error?: string;
15375
15721
  });
15376
15722
 
15377
- export type GetWhatsAppDisplayNameData = {
15378
- query: {
15379
- /**
15380
- * WhatsApp social account ID
15381
- */
15382
- accountId: string;
15723
+ export type GetVoiceCallData = {
15724
+ path: {
15725
+ id: string;
15383
15726
  };
15384
15727
  };
15385
15728
 
15386
- export type GetWhatsAppDisplayNameResponse = ({
15729
+ export type GetVoiceCallResponse = ({
15730
+ call?: CallRecord;
15731
+ });
15732
+
15733
+ export type GetVoiceCallError = ({
15734
+ error?: string;
15735
+ } | unknown);
15736
+
15737
+ export type EndVoiceCallData = {
15738
+ path: {
15739
+ id: string;
15740
+ };
15741
+ };
15742
+
15743
+ export type EndVoiceCallResponse = ({
15387
15744
  success?: boolean;
15388
- displayName?: {
15389
- /**
15390
- * Current verified display name
15391
- */
15392
- name?: string;
15393
- /**
15394
- * Meta review status for the display name
15395
- */
15396
- status?: 'APPROVED' | 'PENDING_REVIEW' | 'DECLINED' | 'NONE';
15745
+ callId?: string;
15746
+ /**
15747
+ * `ending` when a hangup was issued; otherwise the call's current status.
15748
+ */
15749
+ status?: string;
15750
+ });
15751
+
15752
+ export type EndVoiceCallError = ({
15753
+ error?: string;
15754
+ } | unknown);
15755
+
15756
+ export type GetVoiceCallRecordingData = {
15757
+ path: {
15758
+ id: string;
15759
+ };
15760
+ query?: {
15397
15761
  /**
15398
- * Display phone number
15762
+ * `json` returns `{ url }` instead of a 302 redirect.
15399
15763
  */
15400
- phoneNumber?: string;
15764
+ as?: 'json';
15401
15765
  };
15766
+ };
15767
+
15768
+ export type GetVoiceCallRecordingResponse = ({
15769
+ url?: string;
15402
15770
  });
15403
15771
 
15404
- export type GetWhatsAppDisplayNameError = ({
15772
+ export type GetVoiceCallRecordingError = (unknown | {
15405
15773
  error?: string;
15406
- } | unknown);
15774
+ });
15407
15775
 
15408
- export type UpdateWhatsAppDisplayNameData = {
15776
+ export type TransferVoiceCallData = {
15409
15777
  body: {
15410
15778
  /**
15411
- * WhatsApp social account ID
15412
- */
15413
- accountId: string;
15414
- /**
15415
- * New display name (must follow WhatsApp naming guidelines)
15779
+ * +E164 phone number (tel: prefix optional) or a sip: URI. wss:// is not a valid transfer target.
15416
15780
  */
15417
- displayName: string;
15781
+ to: string;
15782
+ };
15783
+ path: {
15784
+ id: string;
15418
15785
  };
15419
15786
  };
15420
15787
 
15421
- export type UpdateWhatsAppDisplayNameResponse = ({
15788
+ export type TransferVoiceCallResponse = ({
15422
15789
  success?: boolean;
15423
- message?: string;
15424
- displayName?: {
15425
- name?: string;
15426
- status?: 'PENDING_REVIEW';
15427
- };
15790
+ callId?: string;
15791
+ transferredTo?: string;
15428
15792
  });
15429
15793
 
15430
- export type UpdateWhatsAppDisplayNameError = (unknown | {
15794
+ export type TransferVoiceCallError = ({
15431
15795
  error?: string;
15432
- });
15796
+ } | unknown);
15433
15797
 
15434
- export type GetWhatsappBusinessUsernameData = {
15798
+ export type GetVoiceCallEstimateData = {
15435
15799
  query: {
15800
+ minutes?: number;
15801
+ recording?: boolean;
15436
15802
  /**
15437
- * WhatsApp social account ID
15803
+ * Destination number, E.164 (leading + optional).
15438
15804
  */
15439
- accountId: string;
15805
+ to: string;
15806
+ transcription?: boolean;
15440
15807
  };
15441
15808
  };
15442
15809
 
15443
- export type GetWhatsappBusinessUsernameResponse = ({
15810
+ export type GetVoiceCallEstimateResponse = ({
15811
+ destinationCountry?: (string) | null;
15812
+ minutes?: number;
15813
+ /**
15814
+ * Billable cost per minute for the requested options.
15815
+ */
15816
+ perMinuteUsd?: number;
15817
+ breakdown?: {
15818
+ telnyxCostUSD?: number;
15819
+ recordingCostUSD?: number;
15820
+ transcriptionCostUSD?: number;
15821
+ /**
15822
+ * What Zernio bills for the call.
15823
+ */
15824
+ billableCostUSD?: number;
15825
+ /**
15826
+ * Equals billableCostUSD (no separate Meta bill on PSTN); kept for shape parity with the WhatsApp estimate.
15827
+ */
15828
+ totalCostUSD?: number;
15829
+ };
15830
+ });
15831
+
15832
+ export type GetVoiceCallEstimateError = ({
15833
+ error?: string;
15834
+ });
15835
+
15836
+ export type CreateVoiceWebSessionResponse = ({
15444
15837
  success?: boolean;
15445
15838
  /**
15446
- * The current username, or null if none is set
15839
+ * Login token for the browser WebRTC SDK.
15447
15840
  */
15448
- username?: (string) | null;
15841
+ token?: string;
15449
15842
  /**
15450
- * Approval state of the username
15843
+ * Pass to POST /v1/voice/calls/web/dial once the browser is registered.
15451
15844
  */
15452
- status?: 'approved' | 'reserved' | 'none';
15845
+ credentialId?: string;
15846
+ expiresAt?: string;
15847
+ sdk?: string;
15453
15848
  });
15454
15849
 
15455
- export type GetWhatsappBusinessUsernameError = ({
15850
+ export type CreateVoiceWebSessionError = ({
15456
15851
  error?: string;
15457
15852
  } | unknown);
15458
15853
 
15459
- export type SetWhatsappBusinessUsernameData = {
15854
+ export type DialVoiceWebCallData = {
15460
15855
  body: {
15461
15856
  /**
15462
- * WhatsApp social account ID
15857
+ * The number to call, E.164 with leading +.
15463
15858
  */
15464
- accountId: string;
15859
+ to: string;
15465
15860
  /**
15466
- * Desired username. Letters, digits, period, and underscore only. Must contain at least one letter. No leading, trailing, or consecutive periods. No www prefix. No domain TLD suffix.
15467
- *
15861
+ * The WebRTC credential id returned by POST /v1/voice/calls/web (the registered browser).
15468
15862
  */
15469
- username: string;
15863
+ credentialId: string;
15470
15864
  /**
15471
- * Pass `force_transfer` to request a transfer if the username is held by another account
15865
+ * Which of your voice-enabled numbers to call from (optional when you have one).
15472
15866
  */
15473
- transferAction?: 'none' | 'force_transfer';
15867
+ fromNumber?: string;
15868
+ recordOverride?: boolean;
15474
15869
  };
15475
15870
  };
15476
15871
 
15477
- export type SetWhatsappBusinessUsernameResponse = ({
15872
+ export type DialVoiceWebCallResponse = ({
15478
15873
  success?: boolean;
15479
- username?: string;
15480
- status?: 'approved' | 'reserved' | 'none';
15874
+ callId?: string;
15875
+ telnyxCallControlId?: string;
15876
+ status?: 'dialing';
15877
+ direction?: 'outbound';
15878
+ from?: string;
15879
+ to?: string;
15880
+ recordingEnabled?: boolean;
15481
15881
  });
15482
15882
 
15483
- export type SetWhatsappBusinessUsernameError = (unknown | {
15883
+ export type DialVoiceWebCallError = ({
15484
15884
  error?: string;
15485
- });
15885
+ } | unknown);
15486
15886
 
15487
- export type DeleteWhatsappBusinessUsernameData = {
15887
+ export type SendSmsData = {
15488
15888
  body: {
15489
15889
  /**
15490
- * WhatsApp social account ID
15890
+ * One of your SMS-enabled numbers (E.164; formatting is normalized).
15491
15891
  */
15492
- accountId: string;
15892
+ from: string;
15893
+ /**
15894
+ * Recipient number (E.164).
15895
+ */
15896
+ to: string;
15897
+ /**
15898
+ * Message body. Required unless `mediaUrls` is set. Max 10 SMS segments (1530 GSM-7 or 670 unicode characters).
15899
+ */
15900
+ text?: string;
15901
+ /**
15902
+ * Public media URLs to attach (sends as MMS). Max 10.
15903
+ */
15904
+ mediaUrls?: Array<(string)>;
15905
+ };
15906
+ headers?: {
15907
+ /**
15908
+ * Optional client-generated unique key (e.g. a UUID) that makes send retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
15909
+ */
15910
+ 'Idempotency-Key'?: string;
15493
15911
  };
15494
15912
  };
15495
15913
 
15496
- export type DeleteWhatsappBusinessUsernameResponse = ({
15497
- success?: boolean;
15914
+ export type SendSmsResponse = ({
15915
+ /**
15916
+ * Message ID
15917
+ */
15918
+ id?: string;
15919
+ /**
15920
+ * Inbox conversation the message was threaded into.
15921
+ */
15922
+ conversationId?: string;
15923
+ status?: 'sent';
15498
15924
  });
15499
15925
 
15500
- export type DeleteWhatsappBusinessUsernameError = ({
15926
+ export type SendSmsError = ({
15501
15927
  error?: string;
15502
15928
  } | unknown);
15503
15929
 
15504
- export type GetWhatsappBusinessUsernameSuggestionsData = {
15930
+ export type LookupSmsNumberData = {
15505
15931
  query: {
15506
15932
  /**
15507
- * WhatsApp social account ID
15933
+ * Number to look up (E.164; formatting is normalized).
15508
15934
  */
15509
- accountId: string;
15935
+ number: string;
15510
15936
  };
15511
15937
  };
15512
15938
 
15513
- export type GetWhatsappBusinessUsernameSuggestionsResponse = ({
15514
- success?: boolean;
15939
+ export type LookupSmsNumberResponse = ({
15940
+ phoneNumber?: string;
15941
+ carrierName?: (string) | null;
15942
+ lineType?: 'mobile' | 'landline' | 'voip' | 'toll-free' | 'unknown';
15515
15943
  /**
15516
- * List of available username suggestions
15944
+ * True when the line type can receive SMS (not a landline).
15517
15945
  */
15518
- suggestions?: Array<(string)>;
15946
+ smsReachable?: boolean;
15519
15947
  });
15520
15948
 
15521
- export type GetWhatsappBusinessUsernameSuggestionsError = ({
15949
+ export type LookupSmsNumberError = ({
15522
15950
  error?: string;
15523
15951
  } | unknown);
15524
15952
 
15525
- export type GetWhatsAppNumberInfoData = {
15526
- query: {
15527
- /**
15528
- * WhatsApp social account ID
15529
- */
15530
- accountId: string;
15953
+ export type ListSmsOptOutsData = {
15954
+ query?: {
15955
+ format?: 'json' | 'csv';
15956
+ limit?: number;
15531
15957
  };
15532
15958
  };
15533
15959
 
15534
- export type GetWhatsAppNumberInfoResponse = ({
15535
- phone?: {
15536
- display_phone_number?: string;
15537
- verified_name?: string;
15960
+ export type ListSmsOptOutsResponse = ({
15961
+ optOuts?: Array<{
15962
+ phoneNumber?: string;
15963
+ optedOutAt?: (string) | null;
15538
15964
  /**
15539
- * APPROVED, AVAILABLE_WITHOUT_REVIEW, PENDING_REVIEW, DECLINED, EXPIRED, NONE
15965
+ * The keyword they sent (e.g. STOP), when the carrier recorded one.
15540
15966
  */
15541
- name_status?: string;
15967
+ keyword?: (string) | null;
15542
15968
  /**
15543
- * GREEN, YELLOW, RED, UNKNOWN
15969
+ * Which of your numbers the recipient opted out from.
15544
15970
  */
15545
- quality_rating?: string;
15971
+ from?: (string) | null;
15972
+ }>;
15973
+ count?: number;
15974
+ });
15975
+
15976
+ export type ListSmsOptOutsError = ({
15977
+ error?: string;
15978
+ });
15979
+
15980
+ export type StartSmsRegistrationData = {
15981
+ body: {
15982
+ registrationType: 'standard_10dlc' | 'sole_prop_10dlc' | 'toll_free';
15546
15983
  /**
15547
- * e.g. TIER_250, TIER_1K, TIER_UNLIMITED
15984
+ * Your numbers this registration covers.
15548
15985
  */
15549
- messaging_limit_tier?: string;
15550
- throughput?: {
15986
+ phoneNumbers: Array<(string)>;
15987
+ /**
15988
+ * Required for 10DLC. The legal entity behind the traffic (TCR brand).
15989
+ */
15990
+ brand?: {
15991
+ entityType: 'PRIVATE_PROFIT' | 'PUBLIC_PROFIT' | 'NON_PROFIT' | 'GOVERNMENT' | 'SOLE_PROPRIETOR';
15992
+ displayName: string;
15551
15993
  /**
15552
- * STANDARD or HIGH
15994
+ * Legal company name. Required for every entityType except SOLE_PROPRIETOR.
15553
15995
  */
15554
- level?: string;
15996
+ companyName?: string;
15997
+ /**
15998
+ * Required for every entityType except SOLE_PROPRIETOR.
15999
+ */
16000
+ ein?: string;
16001
+ phone?: string;
16002
+ /**
16003
+ * Required for SOLE_PROPRIETOR; the verification OTP is texted there (US/CA mobile).
16004
+ */
16005
+ mobilePhone?: string;
16006
+ street?: string;
16007
+ city?: string;
16008
+ state?: string;
16009
+ postalCode?: string;
16010
+ country: 'US' | 'CA';
16011
+ /**
16012
+ * Brand contact email; defaults to your account email when omitted.
16013
+ */
16014
+ email?: string;
16015
+ website?: string;
16016
+ vertical: 'AGRICULTURE' | 'COMMUNICATION' | 'CONSTRUCTION' | 'EDUCATION' | 'ENERGY' | 'ENTERTAINMENT' | 'FINANCIAL' | 'GAMBLING' | 'GOVERNMENT' | 'HEALTHCARE' | 'HOSPITALITY' | 'HUMAN_RESOURCES' | 'INSURANCE' | 'LEGAL' | 'MANUFACTURING' | 'NGO' | 'POLITICAL' | 'POSTAL' | 'PROFESSIONAL' | 'REAL_ESTATE' | 'RETAIL' | 'TECHNOLOGY' | 'TRANSPORTATION';
16017
+ stockSymbol?: string;
15555
16018
  };
15556
16019
  /**
15557
- * e.g. CONNECTED
15558
- */
15559
- status?: string;
15560
- is_official_business_account?: boolean;
15561
- /**
15562
- * e.g. CLOUD_API
16020
+ * Required for 10DLC. What you'll send and how recipients opt in/out.
15563
16021
  */
15564
- platform_type?: string;
16022
+ campaign?: {
16023
+ usecase: string;
16024
+ description: string;
16025
+ /**
16026
+ * How a recipient ends up receiving your messages (the opt-in flow).
16027
+ */
16028
+ messageFlow: string;
16029
+ sample1: string;
16030
+ sample2?: string;
16031
+ helpMessage: string;
16032
+ optinKeywords: string;
16033
+ optinMessage: string;
16034
+ optoutKeywords: string;
16035
+ optoutMessage: string;
16036
+ helpKeywords: string;
16037
+ embeddedLink?: boolean;
16038
+ embeddedPhone?: boolean;
16039
+ numberPool?: boolean;
16040
+ ageGated?: boolean;
16041
+ directLending?: boolean;
16042
+ };
15565
16043
  /**
15566
- * Meta's can_send_message health object (messaging + calling signals)
16044
+ * Required for toll_free.
15567
16045
  */
15568
- health_status?: {
15569
- [key: string]: unknown;
16046
+ tollFree?: {
16047
+ businessName: string;
16048
+ corporateWebsite: string;
16049
+ phoneNumbers: Array<(string)>;
16050
+ useCase: string;
16051
+ useCaseSummary: string;
16052
+ productionMessageContent: string;
16053
+ /**
16054
+ * How recipients opt in to your messages.
16055
+ */
16056
+ optInWorkflow: string;
16057
+ /**
16058
+ * Screenshot URL(s) showing the opt-in flow (at least one).
16059
+ */
16060
+ optInWorkflowImageUrls: Array<(string)>;
16061
+ /**
16062
+ * Expected monthly message volume tier.
16063
+ */
16064
+ messageVolume: '10' | '100' | '1,000' | '10,000' | '100,000' | '250,000' | '500,000' | '750,000' | '1,000,000' | '5,000,000' | '10,000,000+';
16065
+ additionalInformation: string;
16066
+ businessAddr1: string;
16067
+ businessAddr2?: string;
16068
+ businessCity: string;
16069
+ businessState: string;
16070
+ businessZip: string;
16071
+ businessContactFirstName: string;
16072
+ businessContactLastName: string;
16073
+ businessContactEmail: string;
16074
+ businessContactPhone: string;
16075
+ businessRegistrationNumber: string;
16076
+ /**
16077
+ * e.g. EIN (US), Companies House (UK), ABN (AU).
16078
+ */
16079
+ businessRegistrationType: string;
16080
+ /**
16081
+ * ISO 3166-1 alpha-2.
16082
+ */
16083
+ businessRegistrationCountry: string;
15570
16084
  };
15571
16085
  };
15572
- waba?: {
15573
- name?: string;
16086
+ };
16087
+
16088
+ export type StartSmsRegistrationResponse = ({
16089
+ registrationId?: string;
16090
+ status?: 'pending';
16091
+ /**
16092
+ * True for sole-prop 10DLC: an OTP was texted to the brand's mobile; submit it via /verify-otp.
16093
+ */
16094
+ awaitingOtp?: boolean;
16095
+ });
16096
+
16097
+ export type StartSmsRegistrationError = ({
16098
+ error?: string;
16099
+ } | unknown);
16100
+
16101
+ export type ListSmsRegistrationsResponse = ({
16102
+ registrations?: Array<{
16103
+ id?: string;
16104
+ registrationType?: 'standard_10dlc' | 'sole_prop_10dlc' | 'toll_free';
16105
+ displayName?: (string) | null;
16106
+ status?: 'pending' | 'approved' | 'rejected';
15574
16107
  /**
15575
- * verified, not_verified, pending, ...
16108
+ * Carrier-registry brand status (e.g. VERIFIED).
15576
16109
  */
15577
- business_verification_status?: string;
16110
+ brandStatus?: string;
16111
+ campaignStatus?: string;
15578
16112
  /**
15579
- * Meta integer timezone-enum id
16113
+ * TCR brand id, useful when referencing the brand in carrier support threads.
15580
16114
  */
15581
- timezone_id?: string;
15582
- health_status?: {
15583
- [key: string]: unknown;
16115
+ brandId?: (string) | null;
16116
+ /**
16117
+ * TCR campaign id.
16118
+ */
16119
+ campaignId?: (string) | null;
16120
+ declineReason?: (string) | null;
16121
+ phoneNumbers?: Array<(string)>;
16122
+ /**
16123
+ * Sole-prop 10DLC only; the OTP step is still pending.
16124
+ */
16125
+ awaitingOtp?: boolean;
16126
+ /**
16127
+ * Carrier-assigned brand trust score; drives throughput.
16128
+ */
16129
+ trustScore?: (number) | null;
16130
+ /**
16131
+ * Carrier throughput tier derived from the trust score.
16132
+ */
16133
+ throughput?: {
16134
+ label?: string;
16135
+ smsPerMinute?: number;
16136
+ smsPerDay?: number;
15584
16137
  };
15585
- } | null;
16138
+ }>;
15586
16139
  });
15587
16140
 
15588
- export type GetWhatsAppNumberInfoError = (unknown | {
16141
+ export type ListSmsRegistrationsError = ({
15589
16142
  error?: string;
15590
16143
  });
15591
16144
 
15592
- export type GetWhatsAppBlockStatusData = {
15593
- query: {
15594
- accountId: string;
15595
- /**
15596
- * Consumer wa_id or E.164 phone (leading + optional)
15597
- */
15598
- user: string;
16145
+ export type GetSmsRegistrationData = {
16146
+ path: {
16147
+ id: string;
15599
16148
  };
15600
16149
  };
15601
16150
 
15602
- export type GetWhatsAppBlockStatusResponse = ({
15603
- blocked?: boolean;
16151
+ export type GetSmsRegistrationResponse = ({
16152
+ id?: string;
16153
+ registrationType?: 'standard_10dlc' | 'sole_prop_10dlc' | 'toll_free';
16154
+ status?: 'pending' | 'approved' | 'rejected';
16155
+ brandStatus?: string;
16156
+ campaignStatus?: string;
16157
+ declineReason?: (string) | null;
16158
+ phoneNumbers?: Array<(string)>;
16159
+ awaitingOtp?: boolean;
15604
16160
  });
15605
16161
 
15606
- export type GetWhatsAppBlockStatusError = ({
16162
+ export type GetSmsRegistrationError = ({
15607
16163
  error?: string;
15608
16164
  } | unknown);
15609
16165
 
15610
- export type GetWhatsAppBlockedUsersData = {
15611
- query: {
15612
- /**
15613
- * WhatsApp social account ID
15614
- */
15615
- accountId: string;
15616
- /**
15617
- * Cursor from a previous response's `nextCursor`.
15618
- */
15619
- after?: string;
15620
- /**
15621
- * Page size.
15622
- */
15623
- limit?: number;
16166
+ export type VerifySmsRegistrationOtpData = {
16167
+ body: {
16168
+ otpPin: string;
16169
+ };
16170
+ path: {
16171
+ id: string;
15624
16172
  };
15625
16173
  };
15626
16174
 
15627
- export type GetWhatsAppBlockedUsersResponse = ({
15628
- blockedUsers?: Array<{
15629
- /**
15630
- * WhatsApp user ID (usually the phone number without `+`).
15631
- */
15632
- waId?: string;
15633
- }>;
15634
- /**
15635
- * Pass as `after` to fetch the next page. Null when there are no more pages.
15636
- */
15637
- nextCursor?: (string) | null;
16175
+ export type VerifySmsRegistrationOtpResponse = ({
16176
+ verified?: boolean;
15638
16177
  });
15639
16178
 
15640
- export type GetWhatsAppBlockedUsersError = ({
16179
+ export type VerifySmsRegistrationOtpError = ({
15641
16180
  error?: string;
15642
16181
  } | unknown);
15643
16182
 
15644
- export type BlockWhatsAppUsersData = {
16183
+ export type AppealSmsRegistrationData = {
15645
16184
  body: {
15646
- /**
15647
- * WhatsApp social account ID
15648
- */
15649
- accountId: string;
15650
- /**
15651
- * Phone numbers (E.164, e.g. "+16505551234") or WhatsApp user IDs to block.
15652
- */
15653
- users: Array<(string)>;
16185
+ appealReason: string;
16186
+ };
16187
+ path: {
16188
+ id: string;
15654
16189
  };
15655
16190
  };
15656
16191
 
15657
- export type BlockWhatsAppUsersResponse = ({
15658
- /**
15659
- * Users successfully blocked.
15660
- */
15661
- blocked?: Array<{
15662
- /**
15663
- * The value you sent.
15664
- */
15665
- input?: string;
15666
- /**
15667
- * Resolved WhatsApp user ID.
15668
- */
15669
- waId?: string;
15670
- }>;
15671
- /**
15672
- * Users that could not be blocked, with reasons.
15673
- */
15674
- failed?: Array<{
15675
- input?: string;
15676
- errors?: Array<(string)>;
15677
- }>;
16192
+ export type AppealSmsRegistrationResponse = ({
16193
+ status?: 'pending';
15678
16194
  });
15679
16195
 
15680
- export type BlockWhatsAppUsersError = ({
16196
+ export type AppealSmsRegistrationError = (unknown | {
15681
16197
  error?: string;
15682
- } | unknown);
16198
+ });
15683
16199
 
15684
- export type UnblockWhatsAppUsersData = {
16200
+ export type ShareSmsRegistrationData = {
15685
16201
  body: {
15686
16202
  /**
15687
- * WhatsApp social account ID
15688
- */
15689
- accountId: string;
15690
- /**
15691
- * Phone numbers (E.164) or WhatsApp user IDs to unblock.
16203
+ * Your phone number's ID (from GET /v1/phone-numbers).
15692
16204
  */
15693
- users: Array<(string)>;
16205
+ numberId: string;
15694
16206
  };
15695
16207
  };
15696
16208
 
15697
- export type UnblockWhatsAppUsersResponse = ({
15698
- /**
15699
- * Users successfully unblocked.
15700
- */
15701
- unblocked?: Array<{
15702
- /**
15703
- * The value you sent.
15704
- */
15705
- input?: string;
15706
- /**
15707
- * Resolved WhatsApp user ID.
15708
- */
15709
- waId?: string;
15710
- }>;
15711
- /**
15712
- * Users that could not be unblocked, with reasons.
15713
- */
15714
- failed?: Array<{
15715
- input?: string;
15716
- errors?: Array<(string)>;
15717
- }>;
16209
+ export type ShareSmsRegistrationResponse = ({
16210
+ url?: string;
16211
+ expiresAt?: string;
15718
16212
  });
15719
16213
 
15720
- export type UnblockWhatsAppUsersError = ({
16214
+ export type ShareSmsRegistrationError = ({
15721
16215
  error?: string;
15722
16216
  } | unknown);
15723
16217
 
15724
- export type GetWhatsAppDatasetData = {
16218
+ export type GetWhatsAppLibraryTemplateData = {
15725
16219
  query: {
15726
16220
  /**
15727
16221
  * WhatsApp social account ID
15728
16222
  */
15729
16223
  accountId: string;
16224
+ /**
16225
+ * Exact library template name
16226
+ */
16227
+ name: string;
15730
16228
  };
15731
16229
  };
15732
16230
 
15733
- export type GetWhatsAppDatasetResponse = ({
15734
- /**
15735
- * Meta dataset ID linked to the WABA, or null if not provisioned yet
15736
- */
15737
- datasetId?: (string) | null;
16231
+ export type GetWhatsAppLibraryTemplateResponse = ({
16232
+ template?: {
16233
+ name?: string;
16234
+ language?: string;
16235
+ category?: string;
16236
+ body?: string;
16237
+ body_params?: Array<(string)>;
16238
+ buttons?: Array<{
16239
+ /**
16240
+ * QUICK_REPLY, URL, PHONE_NUMBER, OTP, FLOW, ...
16241
+ */
16242
+ type?: string;
16243
+ text?: string;
16244
+ }>;
16245
+ } | null;
15738
16246
  });
15739
16247
 
15740
- export type GetWhatsAppDatasetError = ({
16248
+ export type GetWhatsAppLibraryTemplateError = (unknown | {
15741
16249
  error?: string;
15742
- } | unknown);
16250
+ });
15743
16251
 
15744
- export type CreateWhatsAppDatasetData = {
15745
- body: {
16252
+ export type GetWhatsAppBusinessProfileData = {
16253
+ query: {
15746
16254
  /**
15747
16255
  * WhatsApp social account ID
15748
16256
  */
@@ -15750,247 +16258,1570 @@ export type CreateWhatsAppDatasetData = {
15750
16258
  };
15751
16259
  };
15752
16260
 
15753
- export type CreateWhatsAppDatasetResponse = ({
15754
- /**
15755
- * Meta dataset ID linked to the WABA
15756
- */
15757
- datasetId?: string;
15758
- /**
15759
- * True if Meta created a new dataset on this call; false if one already existed
15760
- */
15761
- created?: boolean;
15762
- });
15763
-
15764
- export type CreateWhatsAppDatasetError = ({
15765
- error?: string;
15766
- } | unknown);
15767
-
15768
- export type GetWhatsAppPhoneNumbersData = {
15769
- query?: {
15770
- /**
15771
- * Filter by profile
16261
+ export type GetWhatsAppBusinessProfileResponse = ({
16262
+ success?: boolean;
16263
+ businessProfile?: {
16264
+ /**
16265
+ * Short description (max 139 chars)
16266
+ */
16267
+ about?: string;
16268
+ address?: string;
16269
+ /**
16270
+ * Full description (max 512 chars)
16271
+ */
16272
+ description?: string;
16273
+ email?: string;
16274
+ profilePictureUrl?: string;
16275
+ websites?: Array<(string)>;
16276
+ /**
16277
+ * Business category
16278
+ */
16279
+ vertical?: string;
16280
+ };
16281
+ });
16282
+
16283
+ export type GetWhatsAppBusinessProfileError = (unknown | {
16284
+ error?: string;
16285
+ });
16286
+
16287
+ export type UpdateWhatsAppBusinessProfileData = {
16288
+ body: {
16289
+ /**
16290
+ * WhatsApp social account ID
16291
+ */
16292
+ accountId: string;
16293
+ /**
16294
+ * Short business description (max 139 characters)
16295
+ */
16296
+ about?: string;
16297
+ /**
16298
+ * Business address
16299
+ */
16300
+ address?: string;
16301
+ /**
16302
+ * Full business description (max 512 characters)
16303
+ */
16304
+ description?: string;
16305
+ /**
16306
+ * Business email
16307
+ */
16308
+ email?: string;
16309
+ /**
16310
+ * Business websites (max 2)
16311
+ */
16312
+ websites?: Array<(string)>;
16313
+ /**
16314
+ * Business category (e.g., RETAIL, ENTERTAINMENT, etc.)
16315
+ */
16316
+ vertical?: string;
16317
+ /**
16318
+ * Handle from resumable upload for profile picture
16319
+ */
16320
+ profilePictureHandle?: string;
16321
+ };
16322
+ };
16323
+
16324
+ export type UpdateWhatsAppBusinessProfileResponse = ({
16325
+ success?: boolean;
16326
+ message?: string;
16327
+ });
16328
+
16329
+ export type UpdateWhatsAppBusinessProfileError = (unknown | {
16330
+ error?: string;
16331
+ });
16332
+
16333
+ export type UploadWhatsAppProfilePhotoData = {
16334
+ body: {
16335
+ /**
16336
+ * WhatsApp social account ID
16337
+ */
16338
+ accountId: string;
16339
+ /**
16340
+ * Image file (JPEG or PNG, max 5MB, recommended 640x640)
16341
+ */
16342
+ file: (Blob | File);
16343
+ };
16344
+ };
16345
+
16346
+ export type UploadWhatsAppProfilePhotoResponse = ({
16347
+ success?: boolean;
16348
+ message?: string;
16349
+ });
16350
+
16351
+ export type UploadWhatsAppProfilePhotoError = (unknown | {
16352
+ error?: string;
16353
+ });
16354
+
16355
+ export type GetWhatsAppDisplayNameData = {
16356
+ query: {
16357
+ /**
16358
+ * WhatsApp social account ID
16359
+ */
16360
+ accountId: string;
16361
+ };
16362
+ };
16363
+
16364
+ export type GetWhatsAppDisplayNameResponse = ({
16365
+ success?: boolean;
16366
+ displayName?: {
16367
+ /**
16368
+ * Current verified display name
16369
+ */
16370
+ name?: string;
16371
+ /**
16372
+ * Meta review status for the display name
16373
+ */
16374
+ status?: 'APPROVED' | 'PENDING_REVIEW' | 'DECLINED' | 'NONE';
16375
+ /**
16376
+ * Display phone number
16377
+ */
16378
+ phoneNumber?: string;
16379
+ };
16380
+ });
16381
+
16382
+ export type GetWhatsAppDisplayNameError = ({
16383
+ error?: string;
16384
+ } | unknown);
16385
+
16386
+ export type UpdateWhatsAppDisplayNameData = {
16387
+ body: {
16388
+ /**
16389
+ * WhatsApp social account ID
16390
+ */
16391
+ accountId: string;
16392
+ /**
16393
+ * New display name (must follow WhatsApp naming guidelines)
16394
+ */
16395
+ displayName: string;
16396
+ };
16397
+ };
16398
+
16399
+ export type UpdateWhatsAppDisplayNameResponse = ({
16400
+ success?: boolean;
16401
+ message?: string;
16402
+ displayName?: {
16403
+ name?: string;
16404
+ status?: 'PENDING_REVIEW';
16405
+ };
16406
+ });
16407
+
16408
+ export type UpdateWhatsAppDisplayNameError = (unknown | {
16409
+ error?: string;
16410
+ });
16411
+
16412
+ export type GetWhatsappBusinessUsernameData = {
16413
+ query: {
16414
+ /**
16415
+ * WhatsApp social account ID
16416
+ */
16417
+ accountId: string;
16418
+ };
16419
+ };
16420
+
16421
+ export type GetWhatsappBusinessUsernameResponse = ({
16422
+ success?: boolean;
16423
+ /**
16424
+ * The current username, or null if none is set
16425
+ */
16426
+ username?: (string) | null;
16427
+ /**
16428
+ * Approval state of the username
16429
+ */
16430
+ status?: 'approved' | 'reserved' | 'none';
16431
+ });
16432
+
16433
+ export type GetWhatsappBusinessUsernameError = ({
16434
+ error?: string;
16435
+ } | unknown);
16436
+
16437
+ export type SetWhatsappBusinessUsernameData = {
16438
+ body: {
16439
+ /**
16440
+ * WhatsApp social account ID
16441
+ */
16442
+ accountId: string;
16443
+ /**
16444
+ * Desired username. Letters, digits, period, and underscore only. Must contain at least one letter. No leading, trailing, or consecutive periods. No www prefix. No domain TLD suffix.
16445
+ *
16446
+ */
16447
+ username: string;
16448
+ /**
16449
+ * Pass `force_transfer` to request a transfer if the username is held by another account
16450
+ */
16451
+ transferAction?: 'none' | 'force_transfer';
16452
+ };
16453
+ };
16454
+
16455
+ export type SetWhatsappBusinessUsernameResponse = ({
16456
+ success?: boolean;
16457
+ username?: string;
16458
+ status?: 'approved' | 'reserved' | 'none';
16459
+ });
16460
+
16461
+ export type SetWhatsappBusinessUsernameError = (unknown | {
16462
+ error?: string;
16463
+ });
16464
+
16465
+ export type DeleteWhatsappBusinessUsernameData = {
16466
+ body: {
16467
+ /**
16468
+ * WhatsApp social account ID
16469
+ */
16470
+ accountId: string;
16471
+ };
16472
+ };
16473
+
16474
+ export type DeleteWhatsappBusinessUsernameResponse = ({
16475
+ success?: boolean;
16476
+ });
16477
+
16478
+ export type DeleteWhatsappBusinessUsernameError = ({
16479
+ error?: string;
16480
+ } | unknown);
16481
+
16482
+ export type GetWhatsappBusinessUsernameSuggestionsData = {
16483
+ query: {
16484
+ /**
16485
+ * WhatsApp social account ID
16486
+ */
16487
+ accountId: string;
16488
+ };
16489
+ };
16490
+
16491
+ export type GetWhatsappBusinessUsernameSuggestionsResponse = ({
16492
+ success?: boolean;
16493
+ /**
16494
+ * List of available username suggestions
16495
+ */
16496
+ suggestions?: Array<(string)>;
16497
+ });
16498
+
16499
+ export type GetWhatsappBusinessUsernameSuggestionsError = ({
16500
+ error?: string;
16501
+ } | unknown);
16502
+
16503
+ export type GetWhatsAppNumberInfoData = {
16504
+ query: {
16505
+ /**
16506
+ * WhatsApp social account ID
16507
+ */
16508
+ accountId: string;
16509
+ };
16510
+ };
16511
+
16512
+ export type GetWhatsAppNumberInfoResponse = ({
16513
+ phone?: {
16514
+ display_phone_number?: string;
16515
+ verified_name?: string;
16516
+ /**
16517
+ * APPROVED, AVAILABLE_WITHOUT_REVIEW, PENDING_REVIEW, DECLINED, EXPIRED, NONE
16518
+ */
16519
+ name_status?: string;
16520
+ /**
16521
+ * GREEN, YELLOW, RED, UNKNOWN
16522
+ */
16523
+ quality_rating?: string;
16524
+ /**
16525
+ * e.g. TIER_250, TIER_1K, TIER_UNLIMITED
16526
+ */
16527
+ messaging_limit_tier?: string;
16528
+ throughput?: {
16529
+ /**
16530
+ * STANDARD or HIGH
16531
+ */
16532
+ level?: string;
16533
+ };
16534
+ /**
16535
+ * e.g. CONNECTED
16536
+ */
16537
+ status?: string;
16538
+ is_official_business_account?: boolean;
16539
+ /**
16540
+ * e.g. CLOUD_API
16541
+ */
16542
+ platform_type?: string;
16543
+ /**
16544
+ * Meta's can_send_message health object (messaging + calling signals)
16545
+ */
16546
+ health_status?: {
16547
+ [key: string]: unknown;
16548
+ };
16549
+ };
16550
+ waba?: {
16551
+ name?: string;
16552
+ /**
16553
+ * verified, not_verified, pending, ...
16554
+ */
16555
+ business_verification_status?: string;
16556
+ /**
16557
+ * Meta integer timezone-enum id
16558
+ */
16559
+ timezone_id?: string;
16560
+ health_status?: {
16561
+ [key: string]: unknown;
16562
+ };
16563
+ } | null;
16564
+ });
16565
+
16566
+ export type GetWhatsAppNumberInfoError = (unknown | {
16567
+ error?: string;
16568
+ });
16569
+
16570
+ export type GetWhatsAppBlockStatusData = {
16571
+ query: {
16572
+ accountId: string;
16573
+ /**
16574
+ * Consumer wa_id or E.164 phone (leading + optional)
16575
+ */
16576
+ user: string;
16577
+ };
16578
+ };
16579
+
16580
+ export type GetWhatsAppBlockStatusResponse = ({
16581
+ blocked?: boolean;
16582
+ });
16583
+
16584
+ export type GetWhatsAppBlockStatusError = ({
16585
+ error?: string;
16586
+ } | unknown);
16587
+
16588
+ export type GetWhatsAppBlockedUsersData = {
16589
+ query: {
16590
+ /**
16591
+ * WhatsApp social account ID
16592
+ */
16593
+ accountId: string;
16594
+ /**
16595
+ * Cursor from a previous response's `nextCursor`.
16596
+ */
16597
+ after?: string;
16598
+ /**
16599
+ * Page size.
16600
+ */
16601
+ limit?: number;
16602
+ };
16603
+ };
16604
+
16605
+ export type GetWhatsAppBlockedUsersResponse = ({
16606
+ blockedUsers?: Array<{
16607
+ /**
16608
+ * WhatsApp user ID (usually the phone number without `+`).
16609
+ */
16610
+ waId?: string;
16611
+ }>;
16612
+ /**
16613
+ * Pass as `after` to fetch the next page. Null when there are no more pages.
16614
+ */
16615
+ nextCursor?: (string) | null;
16616
+ });
16617
+
16618
+ export type GetWhatsAppBlockedUsersError = ({
16619
+ error?: string;
16620
+ } | unknown);
16621
+
16622
+ export type BlockWhatsAppUsersData = {
16623
+ body: {
16624
+ /**
16625
+ * WhatsApp social account ID
16626
+ */
16627
+ accountId: string;
16628
+ /**
16629
+ * Phone numbers (E.164, e.g. "+16505551234") or WhatsApp user IDs to block.
16630
+ */
16631
+ users: Array<(string)>;
16632
+ };
16633
+ };
16634
+
16635
+ export type BlockWhatsAppUsersResponse = ({
16636
+ /**
16637
+ * Users successfully blocked.
16638
+ */
16639
+ blocked?: Array<{
16640
+ /**
16641
+ * The value you sent.
16642
+ */
16643
+ input?: string;
16644
+ /**
16645
+ * Resolved WhatsApp user ID.
16646
+ */
16647
+ waId?: string;
16648
+ }>;
16649
+ /**
16650
+ * Users that could not be blocked, with reasons.
16651
+ */
16652
+ failed?: Array<{
16653
+ input?: string;
16654
+ errors?: Array<(string)>;
16655
+ }>;
16656
+ });
16657
+
16658
+ export type BlockWhatsAppUsersError = ({
16659
+ error?: string;
16660
+ } | unknown);
16661
+
16662
+ export type UnblockWhatsAppUsersData = {
16663
+ body: {
16664
+ /**
16665
+ * WhatsApp social account ID
16666
+ */
16667
+ accountId: string;
16668
+ /**
16669
+ * Phone numbers (E.164) or WhatsApp user IDs to unblock.
16670
+ */
16671
+ users: Array<(string)>;
16672
+ };
16673
+ };
16674
+
16675
+ export type UnblockWhatsAppUsersResponse = ({
16676
+ /**
16677
+ * Users successfully unblocked.
16678
+ */
16679
+ unblocked?: Array<{
16680
+ /**
16681
+ * The value you sent.
16682
+ */
16683
+ input?: string;
16684
+ /**
16685
+ * Resolved WhatsApp user ID.
16686
+ */
16687
+ waId?: string;
16688
+ }>;
16689
+ /**
16690
+ * Users that could not be unblocked, with reasons.
16691
+ */
16692
+ failed?: Array<{
16693
+ input?: string;
16694
+ errors?: Array<(string)>;
16695
+ }>;
16696
+ });
16697
+
16698
+ export type UnblockWhatsAppUsersError = ({
16699
+ error?: string;
16700
+ } | unknown);
16701
+
16702
+ export type GetWhatsAppDatasetData = {
16703
+ query: {
16704
+ /**
16705
+ * WhatsApp social account ID
16706
+ */
16707
+ accountId: string;
16708
+ };
16709
+ };
16710
+
16711
+ export type GetWhatsAppDatasetResponse = ({
16712
+ /**
16713
+ * Meta dataset ID linked to the WABA, or null if not provisioned yet
16714
+ */
16715
+ datasetId?: (string) | null;
16716
+ });
16717
+
16718
+ export type GetWhatsAppDatasetError = ({
16719
+ error?: string;
16720
+ } | unknown);
16721
+
16722
+ export type CreateWhatsAppDatasetData = {
16723
+ body: {
16724
+ /**
16725
+ * WhatsApp social account ID
16726
+ */
16727
+ accountId: string;
16728
+ };
16729
+ };
16730
+
16731
+ export type CreateWhatsAppDatasetResponse = ({
16732
+ /**
16733
+ * Meta dataset ID linked to the WABA
16734
+ */
16735
+ datasetId?: string;
16736
+ /**
16737
+ * True if Meta created a new dataset on this call; false if one already existed
16738
+ */
16739
+ created?: boolean;
16740
+ });
16741
+
16742
+ export type CreateWhatsAppDatasetError = ({
16743
+ error?: string;
16744
+ } | unknown);
16745
+
16746
+ export type ListPhoneNumbersData = {
16747
+ query?: {
16748
+ /**
16749
+ * Filter by profile
16750
+ */
16751
+ profileId?: string;
16752
+ /**
16753
+ * Filter by status (by default excludes released numbers). NOTE:
16754
+ * `status=pending_regulatory` returns the "provisioning" view — numbers
16755
+ * still in review PLUS recently-declined (last 30 days) ones, so a
16756
+ * failed registration surfaces (with `regulatoryDeclineReason`) instead
16757
+ * of silently disappearing. Declined numbers can be re-submitted via
16758
+ * POST /v1/phone-numbers/{id}/remediate. `verifying` is the
16759
+ * short-lived state after the number is provisioned on our side while
16760
+ * WhatsApp confirms the activation code; the number is not billed until
16761
+ * it reaches `active`.
16762
+ *
16763
+ */
16764
+ status?: 'provisioning' | 'verifying' | 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'active' | 'suspended' | 'releasing' | 'released';
16765
+ };
16766
+ };
16767
+
16768
+ export type ListPhoneNumbersResponse = ({
16769
+ numbers?: Array<{
16770
+ _id?: string;
16771
+ phoneNumber?: string;
16772
+ country?: string;
16773
+ status?: 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'provisioning' | 'verifying' | 'active' | 'suspended' | 'releasing' | 'released';
16774
+ /**
16775
+ * For regulated numbers, who it's registered for (company or person) — set from the submitted KYC.
16776
+ */
16777
+ registrantName?: (string) | null;
16778
+ /**
16779
+ * Present once the number order has been placed (i.e. the requirement group was approved). Absent while still in identity review.
16780
+ */
16781
+ telnyxOrderId?: (string) | null;
16782
+ /**
16783
+ * Per-country monthly price in cents ($2..$25).
16784
+ */
16785
+ monthlyCents?: number;
16786
+ /**
16787
+ * False for numbers you brought yourself (connected via Meta embedded signup) — they live on your own carrier, so SMS/Calls can't be enabled on them.
16788
+ */
16789
+ hostedByZernio?: boolean;
16790
+ profileId?: {
16791
+ [key: string]: unknown;
16792
+ };
16793
+ provisionedAt?: string;
16794
+ metaPreverifiedId?: string;
16795
+ metaVerificationStatus?: string;
16796
+ /**
16797
+ * For regulated (Tier 3/4) numbers with an Onfido ID-verification step — the link to forward to the end user. Set once the order is placed; null otherwise. Poll this field after submitting KYC.
16798
+ */
16799
+ onfidoVerificationUrl?: (string) | null;
16800
+ endUserFirstName?: (string) | null;
16801
+ endUserLastName?: (string) | null;
16802
+ /**
16803
+ * Reviewer rejection reason when status is regulatory_declined.
16804
+ */
16805
+ regulatoryDeclineReason?: (string) | null;
16806
+ createdAt?: string;
16807
+ }>;
16808
+ /**
16809
+ * Connected (bring-your-own) WhatsApp numbers — your own WABA
16810
+ * numbers linked via Embedded Signup. Not provisioned or billed
16811
+ * by Zernio, so they are not in `numbers`; `accountId` is the
16812
+ * social-account id used by the messaging and inbox endpoints.
16813
+ * Included only on the default and `status=active` views.
16814
+ *
16815
+ */
16816
+ connected?: Array<{
16817
+ accountId?: string;
16818
+ phoneNumber?: (string) | null;
16819
+ displayName?: (string) | null;
16820
+ profileId?: (string) | null;
16821
+ connectedAt?: (string) | null;
16822
+ }>;
16823
+ /**
16824
+ * The shared WhatsApp sandbox (one Zernio-owned number, all users test
16825
+ * against it). Present when the sandbox is configured; null otherwise.
16826
+ * The `accountId` lets you address the sandbox in compose endpoints.
16827
+ * `template` is the only template a sandbox send is allowed to use.
16828
+ *
16829
+ */
16830
+ sandbox?: {
16831
+ phoneNumber?: string;
16832
+ accountId?: (string) | null;
16833
+ template?: {
16834
+ name?: string;
16835
+ language?: string;
16836
+ };
16837
+ isSandbox?: boolean;
16838
+ } | null;
16839
+ });
16840
+
16841
+ export type ListPhoneNumbersError = ({
16842
+ error?: string;
16843
+ });
16844
+
16845
+ export type GetPhoneNumberData = {
16846
+ path: {
16847
+ /**
16848
+ * Phone number record ID
16849
+ */
16850
+ id: string;
16851
+ };
16852
+ };
16853
+
16854
+ export type GetPhoneNumberResponse = ({
16855
+ phoneNumber?: {
16856
+ id?: string;
16857
+ phoneNumber?: string;
16858
+ status?: 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'provisioning' | 'verifying' | 'active' | 'suspended' | 'releasing' | 'released';
16859
+ country?: string;
16860
+ metaPreverifiedId?: string;
16861
+ metaVerificationStatus?: string;
16862
+ /**
16863
+ * For a regulated number with an Onfido ID step — the link to forward to the end user. Appears once the order is placed; null otherwise.
16864
+ */
16865
+ onfidoVerificationUrl?: (string) | null;
16866
+ endUserFirstName?: (string) | null;
16867
+ endUserLastName?: (string) | null;
16868
+ /**
16869
+ * Reviewer rejection reason when status is regulatory_declined.
16870
+ */
16871
+ regulatoryDeclineReason?: (string) | null;
16872
+ provisionedAt?: string;
16873
+ };
16874
+ });
16875
+
16876
+ export type GetPhoneNumberError = ({
16877
+ error?: string;
16878
+ });
16879
+
16880
+ export type ReleasePhoneNumberData = {
16881
+ path: {
16882
+ /**
16883
+ * Phone number record ID
16884
+ */
16885
+ id: string;
16886
+ };
16887
+ };
16888
+
16889
+ export type ReleasePhoneNumberResponse = ({
16890
+ message?: string;
16891
+ phoneNumber?: {
16892
+ id?: string;
16893
+ phoneNumber?: string;
16894
+ /**
16895
+ * "released"
16896
+ */
16897
+ status?: string;
16898
+ releasedAt?: string;
16899
+ };
16900
+ });
16901
+
16902
+ export type ReleasePhoneNumberError = (unknown | {
16903
+ error?: string;
16904
+ });
16905
+
16906
+ export type PurchasePhoneNumberData = {
16907
+ body: {
16908
+ /**
16909
+ * Profile to associate the number with
16910
+ */
16911
+ profileId: string;
16912
+ /**
16913
+ * ISO 3166-1 alpha-2 country for the number (default US). International numbers require usage-based billing. Tier 3/4 countries return 202 { status: "kyc_required", kycUrl } — the customer must complete KYC at that URL before the number is ordered. See GET /v1/phone-numbers/countries.
16914
+ *
16915
+ */
16916
+ country?: string;
16917
+ /**
16918
+ * A phone number is the unit; WhatsApp is one optional feature. Pass false to buy a STANDALONE number (Calls/SMS only): provisioning skips the Meta pre-verify/OTP steps and the number activates immediately. Omitted defaults to the WhatsApp provisioning path. WhatsApp can be connected to a standalone number later from the connect flow.
16919
+ *
16920
+ */
16921
+ connectWhatsapp?: boolean;
16922
+ /**
16923
+ * SMS capability is per-number, not per-country. Pass true to provision from the SMS-capable inventory pool so the number can actually text (see also GET /v1/phone-numbers/available with sms=true, and smsAvailable on GET /v1/phone-numbers/countries).
16924
+ *
16925
+ */
16926
+ wantsSms?: boolean;
16927
+ /**
16928
+ * Optional idempotency key. Send the same value when retrying a purchase: if a number was already bought under this key, the API returns { status: "already_purchased", numberId, phoneNumber } instead of provisioning a second number. Generate a fresh key for each genuinely new purchase.
16929
+ *
16930
+ */
16931
+ purchaseIntentId?: string;
16932
+ /**
16933
+ * Any second purchase within 10 minutes of a previous one is rejected with 409 code PURCHASE_VELOCITY as duplicate protection. Pass true to confirm the additional purchase is intentional (e.g. bulk provisioning).
16934
+ *
16935
+ */
16936
+ allowMultiple?: boolean;
16937
+ };
16938
+ };
16939
+
16940
+ export type PurchasePhoneNumberResponse = (({
16941
+ message?: string;
16942
+ checkoutUrl?: string;
16943
+ } | {
16944
+ message?: string;
16945
+ phoneNumber?: {
16946
+ id?: string;
16947
+ phoneNumber?: string;
16948
+ status?: string;
16949
+ country?: string;
16950
+ provisionedAt?: string;
16951
+ metaPreverifiedId?: string;
16952
+ metaVerificationStatus?: string;
16953
+ };
16954
+ } | {
16955
+ status?: 'already_purchased';
16956
+ numberId?: string;
16957
+ phoneNumber?: string;
16958
+ }) | {
16959
+ status?: 'kyc_required';
16960
+ country?: string;
16961
+ kycUrl?: string;
16962
+ });
16963
+
16964
+ export type PurchasePhoneNumberError = (unknown | {
16965
+ error?: string;
16966
+ } | {
16967
+ error?: string;
16968
+ code?: 'PURCHASE_VELOCITY';
16969
+ });
16970
+
16971
+ export type ListPhoneNumberCountriesResponse = ({
16972
+ countries?: Array<{
16973
+ /**
16974
+ * ISO 3166-1 alpha-2
16975
+ */
16976
+ code?: string;
16977
+ tier?: 1 | 2 | 3 | 4;
16978
+ monthlyCents?: number;
16979
+ needsKyc?: boolean;
16980
+ /**
16981
+ * Regular phone (PSTN) calling on the number, inbound + outbound. Available on every offerable country.
16982
+ */
16983
+ callsAvailable?: boolean;
16984
+ /**
16985
+ * WhatsApp can be enabled on numbers from this country.
16986
+ */
16987
+ whatsappAvailable?: boolean;
16988
+ /**
16989
+ * Whether this country's number type can do SMS. Use it to filter the picker when the buyer wants SMS (pair with `wantsSms` on purchase).
16990
+ */
16991
+ smsAvailable?: boolean;
16992
+ /**
16993
+ * WhatsApp Business Calling (BIC) outbound availability, a Meta feature blocked in some countries. NOT the PSTN Calls feature (`callsAvailable`).
16994
+ */
16995
+ outboundCallingAvailable?: boolean;
16996
+ }>;
16997
+ });
16998
+
16999
+ export type ListPhoneNumberCountriesError = ({
17000
+ error?: string;
17001
+ });
17002
+
17003
+ export type SearchAvailablePhoneNumbersData = {
17004
+ query?: {
17005
+ /**
17006
+ * Pattern to match within the number
17007
+ */
17008
+ contains?: string;
17009
+ country?: string;
17010
+ limit?: number;
17011
+ /**
17012
+ * City
17013
+ */
17014
+ locality?: string;
17015
+ /**
17016
+ * Area code
17017
+ */
17018
+ prefix?: string;
17019
+ /**
17020
+ * true narrows the pool to SMS-capable numbers. Each result still carries its full `features` list for per-number capability badging.
17021
+ */
17022
+ sms?: boolean;
17023
+ /**
17024
+ * Number type; defaults to the country's WhatsApp-safe type
17025
+ */
17026
+ type?: string;
17027
+ };
17028
+ };
17029
+
17030
+ export type SearchAvailablePhoneNumbersResponse = ({
17031
+ country?: string;
17032
+ numberType?: string;
17033
+ /**
17034
+ * Echo of the `sms` filter applied to this search.
17035
+ */
17036
+ requireSms?: boolean;
17037
+ numbers?: Array<{
17038
+ phoneNumber?: string;
17039
+ /**
17040
+ * Provider capability list for this number (e.g. voice, sms, mms).
17041
+ */
17042
+ features?: Array<(string)>;
17043
+ }>;
17044
+ });
17045
+
17046
+ export type SearchAvailablePhoneNumbersError = (unknown | {
17047
+ error?: string;
17048
+ });
17049
+
17050
+ export type CheckPhoneNumberAvailabilityData = {
17051
+ query: {
17052
+ /**
17053
+ * ISO-2 country code.
17054
+ */
17055
+ country: string;
17056
+ };
17057
+ };
17058
+
17059
+ export type CheckPhoneNumberAvailabilityResponse = ({
17060
+ country?: string;
17061
+ numberType?: string;
17062
+ /**
17063
+ * Whether deliverable voice inventory exists right now.
17064
+ */
17065
+ available?: boolean;
17066
+ addressConstraint?: 'geo' | 'country' | 'none';
17067
+ /**
17068
+ * For `geo` only — the area(s) the registered address must be in.
17069
+ */
17070
+ areas?: Array<(string)>;
17071
+ });
17072
+
17073
+ export type CheckPhoneNumberAvailabilityError = (unknown | {
17074
+ error?: string;
17075
+ });
17076
+
17077
+ export type GetWhatsAppPhoneNumbersData = {
17078
+ query?: {
17079
+ /**
17080
+ * Filter by profile
17081
+ */
17082
+ profileId?: string;
17083
+ /**
17084
+ * Filter by status (by default excludes released numbers). NOTE:
17085
+ * `status=pending_regulatory` returns the "provisioning" view — numbers
17086
+ * still in review PLUS recently-declined (last 30 days) ones, so a
17087
+ * failed registration surfaces (with `regulatoryDeclineReason`) instead
17088
+ * of silently disappearing. Declined numbers can be re-submitted via
17089
+ * POST /v1/whatsapp/phone-numbers/{id}/remediate. `verifying` is the
17090
+ * short-lived state after the number is provisioned on our side while
17091
+ * WhatsApp confirms the activation code; the number is not billed until
17092
+ * it reaches `active`.
17093
+ *
17094
+ */
17095
+ status?: 'provisioning' | 'verifying' | 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'active' | 'suspended' | 'releasing' | 'released';
17096
+ };
17097
+ };
17098
+
17099
+ export type GetWhatsAppPhoneNumbersResponse = ({
17100
+ numbers?: Array<{
17101
+ _id?: string;
17102
+ phoneNumber?: string;
17103
+ country?: string;
17104
+ status?: 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'provisioning' | 'verifying' | 'active' | 'suspended' | 'releasing' | 'released';
17105
+ /**
17106
+ * For regulated numbers, who it's registered for (company or person) — set from the submitted KYC.
17107
+ */
17108
+ registrantName?: (string) | null;
17109
+ /**
17110
+ * Present once the number order has been placed (i.e. the requirement group was approved). Absent while still in identity review.
17111
+ */
17112
+ telnyxOrderId?: (string) | null;
17113
+ /**
17114
+ * Per-country monthly price in cents ($2..$25).
17115
+ */
17116
+ monthlyCents?: number;
17117
+ /**
17118
+ * False for numbers you brought yourself (connected via Meta embedded signup) — they live on your own carrier, so SMS/Calls can't be enabled on them.
17119
+ */
17120
+ hostedByZernio?: boolean;
17121
+ profileId?: {
17122
+ [key: string]: unknown;
17123
+ };
17124
+ provisionedAt?: string;
17125
+ metaPreverifiedId?: string;
17126
+ metaVerificationStatus?: string;
17127
+ /**
17128
+ * For regulated (Tier 3/4) numbers with an Onfido ID-verification step — the link to forward to the end user. Set once the order is placed; null otherwise. Poll this field after submitting KYC.
17129
+ */
17130
+ onfidoVerificationUrl?: (string) | null;
17131
+ endUserFirstName?: (string) | null;
17132
+ endUserLastName?: (string) | null;
17133
+ /**
17134
+ * Reviewer rejection reason when status is regulatory_declined.
17135
+ */
17136
+ regulatoryDeclineReason?: (string) | null;
17137
+ createdAt?: string;
17138
+ }>;
17139
+ /**
17140
+ * Connected (bring-your-own) WhatsApp numbers — your own WABA
17141
+ * numbers linked via Embedded Signup. Not provisioned or billed
17142
+ * by Zernio, so they are not in `numbers`; `accountId` is the
17143
+ * social-account id used by the messaging and inbox endpoints.
17144
+ * Included only on the default and `status=active` views.
17145
+ *
17146
+ */
17147
+ connected?: Array<{
17148
+ accountId?: string;
17149
+ phoneNumber?: (string) | null;
17150
+ displayName?: (string) | null;
17151
+ profileId?: (string) | null;
17152
+ connectedAt?: (string) | null;
17153
+ }>;
17154
+ /**
17155
+ * The shared WhatsApp sandbox (one Zernio-owned number, all users test
17156
+ * against it). Present when the sandbox is configured; null otherwise.
17157
+ * The `accountId` lets you address the sandbox in compose endpoints.
17158
+ * `template` is the only template a sandbox send is allowed to use.
17159
+ *
17160
+ */
17161
+ sandbox?: {
17162
+ phoneNumber?: string;
17163
+ accountId?: (string) | null;
17164
+ template?: {
17165
+ name?: string;
17166
+ language?: string;
17167
+ };
17168
+ isSandbox?: boolean;
17169
+ } | null;
17170
+ });
17171
+
17172
+ export type GetWhatsAppPhoneNumbersError = ({
17173
+ error?: string;
17174
+ });
17175
+
17176
+ export type PurchaseWhatsAppPhoneNumberData = {
17177
+ body: {
17178
+ /**
17179
+ * Profile to associate the number with
17180
+ */
17181
+ profileId: string;
17182
+ /**
17183
+ * ISO 3166-1 alpha-2 country for the number (default US). International numbers require usage-based billing. Tier 3/4 countries return 202 { status: "kyc_required", kycUrl } — the customer must complete KYC at that URL before the number is ordered. See GET /v1/whatsapp/phone-numbers/countries.
17184
+ *
17185
+ */
17186
+ country?: string;
17187
+ /**
17188
+ * Optional idempotency key. Send the same value when retrying a purchase: if a number was already bought under this key, the API returns { status: "already_purchased", numberId, phoneNumber } instead of provisioning a second number. Generate a fresh key for each genuinely new purchase.
17189
+ *
17190
+ */
17191
+ purchaseIntentId?: string;
17192
+ /**
17193
+ * Any second purchase within 10 minutes of a previous one is rejected with 409 code PURCHASE_VELOCITY as duplicate protection. Pass true to confirm the additional purchase is intentional (e.g. bulk provisioning).
17194
+ *
17195
+ */
17196
+ allowMultiple?: boolean;
17197
+ };
17198
+ };
17199
+
17200
+ export type PurchaseWhatsAppPhoneNumberResponse = (({
17201
+ message?: string;
17202
+ checkoutUrl?: string;
17203
+ } | {
17204
+ message?: string;
17205
+ phoneNumber?: {
17206
+ id?: string;
17207
+ phoneNumber?: string;
17208
+ status?: string;
17209
+ country?: string;
17210
+ provisionedAt?: string;
17211
+ metaPreverifiedId?: string;
17212
+ metaVerificationStatus?: string;
17213
+ };
17214
+ } | {
17215
+ status?: 'already_purchased';
17216
+ numberId?: string;
17217
+ phoneNumber?: string;
17218
+ }) | {
17219
+ status?: 'kyc_required';
17220
+ country?: string;
17221
+ kycUrl?: string;
17222
+ });
17223
+
17224
+ export type PurchaseWhatsAppPhoneNumberError = (unknown | {
17225
+ error?: string;
17226
+ } | {
17227
+ error?: string;
17228
+ code?: 'PURCHASE_VELOCITY';
17229
+ });
17230
+
17231
+ export type ListWhatsAppNumberCountriesResponse = ({
17232
+ countries?: Array<{
17233
+ /**
17234
+ * ISO 3166-1 alpha-2
17235
+ */
17236
+ code?: string;
17237
+ tier?: 1 | 2 | 3 | 4;
17238
+ monthlyCents?: number;
17239
+ needsKyc?: boolean;
17240
+ outboundCallingAvailable?: boolean;
17241
+ }>;
17242
+ });
17243
+
17244
+ export type ListWhatsAppNumberCountriesError = ({
17245
+ error?: string;
17246
+ });
17247
+
17248
+ export type SearchAvailableWhatsAppNumbersData = {
17249
+ query?: {
17250
+ /**
17251
+ * Pattern to match within the number
17252
+ */
17253
+ contains?: string;
17254
+ country?: string;
17255
+ limit?: number;
17256
+ /**
17257
+ * City
17258
+ */
17259
+ locality?: string;
17260
+ /**
17261
+ * Area code
17262
+ */
17263
+ prefix?: string;
17264
+ /**
17265
+ * Number type; defaults to the country's WhatsApp-safe type
17266
+ */
17267
+ type?: string;
17268
+ };
17269
+ };
17270
+
17271
+ export type SearchAvailableWhatsAppNumbersResponse = ({
17272
+ country?: string;
17273
+ numberType?: string;
17274
+ numbers?: Array<{
17275
+ phoneNumber?: string;
17276
+ }>;
17277
+ });
17278
+
17279
+ export type SearchAvailableWhatsAppNumbersError = (unknown | {
17280
+ error?: string;
17281
+ });
17282
+
17283
+ export type CheckWhatsAppNumberAvailabilityData = {
17284
+ query: {
17285
+ /**
17286
+ * ISO-2 country code.
17287
+ */
17288
+ country: string;
17289
+ };
17290
+ };
17291
+
17292
+ export type CheckWhatsAppNumberAvailabilityResponse = ({
17293
+ country?: string;
17294
+ numberType?: string;
17295
+ /**
17296
+ * Whether deliverable voice inventory exists right now.
17297
+ */
17298
+ available?: boolean;
17299
+ addressConstraint?: 'geo' | 'country' | 'none';
17300
+ /**
17301
+ * For `geo` only — the area(s) the registered address must be in.
17302
+ */
17303
+ areas?: Array<(string)>;
17304
+ });
17305
+
17306
+ export type CheckWhatsAppNumberAvailabilityError = (unknown | {
17307
+ error?: string;
17308
+ });
17309
+
17310
+ export type GetPhoneNumberKycFormData = {
17311
+ query: {
17312
+ country: string;
17313
+ };
17314
+ };
17315
+
17316
+ export type GetPhoneNumberKycFormResponse = ({
17317
+ country?: string;
17318
+ numberType?: string;
17319
+ fields?: Array<{
17320
+ requirementId?: string;
17321
+ label?: string;
17322
+ /**
17323
+ * "action" = an out-of-band verification (e.g. Onfido); not filled here, fulfilled after the order via a link.
17324
+ */
17325
+ kind?: 'text' | 'date' | 'address' | 'file' | 'action';
17326
+ /**
17327
+ * Plain-English explanation of what to provide.
17328
+ */
17329
+ description?: (string) | null;
17330
+ /**
17331
+ * Concrete example value.
17332
+ */
17333
+ example?: (string) | null;
17334
+ /**
17335
+ * ISO country the value must be local to
17336
+ */
17337
+ localTo?: (string) | null;
17338
+ }>;
17339
+ /**
17340
+ * Present when this account already has an approved verification for the country that can be reused (skip the form). `fromPhoneNumber`/`details` mirror the newest option; `options` lists ALL approved verifications (agencies hold one per end client) — pass the chosen option's `fromPhoneNumber` as `reuseFrom` on POST.
17341
+ */
17342
+ reusable?: {
17343
+ available?: boolean;
17344
+ fromPhoneNumber?: string;
17345
+ /**
17346
+ * Human-readable summary of the verification on file (field labels + values, plus the address as one line). Best-effort — may be empty if the provider lookup fails.
17347
+ */
17348
+ details?: Array<{
17349
+ label?: string;
17350
+ value?: string;
17351
+ }>;
17352
+ /**
17353
+ * One entry per distinct approved verification, newest first.
17354
+ */
17355
+ options?: Array<{
17356
+ fromPhoneNumber?: string;
17357
+ details?: Array<{
17358
+ label?: string;
17359
+ value?: string;
17360
+ }>;
17361
+ }>;
17362
+ } | null;
17363
+ });
17364
+
17365
+ export type GetPhoneNumberKycFormError = (unknown | {
17366
+ error?: string;
17367
+ });
17368
+
17369
+ export type SubmitPhoneNumberKycData = {
17370
+ body: {
17371
+ profileId: string;
17372
+ country: string;
17373
+ /**
17374
+ * Idempotency token for this submission attempt. A retry/double-submit with the same token returns the same number; omit and each call creates a new number.
17375
+ */
17376
+ submissionId?: string;
17377
+ /**
17378
+ * Provision several same-country numbers from one submission (1-5). The single verification covers all of them; each number is billed only when it activates. Numbers that fail to order are skipped (best-effort).
17379
+ */
17380
+ quantity?: number;
17381
+ /**
17382
+ * Reuse a prior approved verification for this country (skips document/field collection; places the order immediately).
17383
+ */
17384
+ reuse?: boolean;
17385
+ /**
17386
+ * Which approved verification to reuse when several exist: the phone number it was originally approved for (GET reusable.options[].fromPhoneNumber). Omitted = newest. No match = 409.
17387
+ */
17388
+ reuseFrom?: string;
17389
+ /**
17390
+ * End user's legal first name. Required when the country has an action/ID-verification (Onfido) requirement.
17391
+ */
17392
+ endUserFirstName?: string;
17393
+ /**
17394
+ * End user's legal last name. Same condition as endUserFirstName.
17395
+ */
17396
+ endUserLastName?: string;
17397
+ /**
17398
+ * requirementId → textual value
17399
+ */
17400
+ values?: {
17401
+ [key: string]: (string);
17402
+ };
17403
+ /**
17404
+ * One per document requirement. Each is EITHER inline base64 OR a `documentId` returned by POST /v1/phone-numbers/kyc/upload-document (use the upload endpoint for large files to stay under the request-size limit).
17405
+ */
17406
+ documents?: Array<({
17407
+ requirementId: string;
17408
+ filename: string;
17409
+ base64: string;
17410
+ } | {
17411
+ requirementId: string;
17412
+ /**
17413
+ * Id from POST /v1/phone-numbers/kyc/upload-document.
17414
+ */
17415
+ documentId: string;
17416
+ })>;
17417
+ address?: {
17418
+ requirementId?: string;
17419
+ country_code?: string;
17420
+ business_name?: string;
17421
+ first_name?: string;
17422
+ last_name?: string;
17423
+ street_address?: string;
17424
+ locality?: string;
17425
+ administrative_area?: string;
17426
+ postal_code?: string;
17427
+ };
17428
+ };
17429
+ };
17430
+
17431
+ export type SubmitPhoneNumberKycResponse = ({
17432
+ status?: 'kyc_submitted' | 'kyc_reused' | 'kyc_already_submitted';
17433
+ /**
17434
+ * The first/primary number, kept at the top level for backward compatibility. See `numbers` for the full set when `quantity` > 1.
17435
+ */
17436
+ phoneNumber?: {
17437
+ id?: string;
17438
+ status?: string;
17439
+ country?: string;
17440
+ };
17441
+ /**
17442
+ * Every number provisioned from this submission. Length equals the requested `quantity` on full success (fewer if some orders failed; best-effort). The first element mirrors `phoneNumber`.
17443
+ */
17444
+ numbers?: Array<{
17445
+ id?: string;
17446
+ status?: string;
17447
+ phoneNumber?: string;
17448
+ country?: string;
17449
+ }>;
17450
+ });
17451
+
17452
+ export type SubmitPhoneNumberKycError = (unknown | {
17453
+ error?: string;
17454
+ });
17455
+
17456
+ export type UploadPhoneNumberKycDocumentData = {
17457
+ body: (Blob | File);
17458
+ headers: {
17459
+ /**
17460
+ * URL-encoded original filename.
17461
+ */
17462
+ 'X-Filename': string;
17463
+ };
17464
+ };
17465
+
17466
+ export type UploadPhoneNumberKycDocumentResponse = ({
17467
+ /**
17468
+ * Reference this id in the KYC submit's documents[].documentId.
17469
+ */
17470
+ documentId?: string;
17471
+ });
17472
+
17473
+ export type UploadPhoneNumberKycDocumentError = (unknown | {
17474
+ error?: string;
17475
+ });
17476
+
17477
+ export type ValidatePhoneNumberKycAddressData = {
17478
+ body: {
17479
+ /**
17480
+ * ISO 3166-1 alpha-2 country code.
17481
+ */
17482
+ country: string;
17483
+ street_address: string;
17484
+ /**
17485
+ * City / town.
17486
+ */
17487
+ locality: string;
17488
+ /**
17489
+ * State / province / region. When omitted, the pre-check is skipped (the final submit still validates).
17490
+ */
17491
+ administrative_area?: string;
17492
+ postal_code: string;
17493
+ };
17494
+ };
17495
+
17496
+ export type ValidatePhoneNumberKycAddressResponse = ({
17497
+ ok?: boolean;
17498
+ /**
17499
+ * true when no `administrative_area` was supplied, so no pre-check ran.
17500
+ */
17501
+ skipped?: boolean;
17502
+ });
17503
+
17504
+ export type ValidatePhoneNumberKycAddressError = ({
17505
+ /**
17506
+ * Human-readable message.
17507
+ */
17508
+ error?: string;
17509
+ type?: string;
17510
+ code?: string;
17511
+ param?: string;
17512
+ details?: {
17513
+ addressSuggestions?: Array<{
17514
+ field?: string;
17515
+ label?: string;
17516
+ value?: string;
17517
+ }>;
17518
+ };
17519
+ } | {
17520
+ error?: string;
17521
+ });
17522
+
17523
+ export type CreatePhoneNumberKycLinkData = {
17524
+ body: {
17525
+ profileId: string;
17526
+ /**
17527
+ * ISO 3166-1 alpha-2 country code (must be a regulated/KYC country).
15772
17528
  */
15773
- profileId?: string;
17529
+ country: string;
15774
17530
  /**
15775
- * Filter by status (by default excludes released numbers). NOTE:
15776
- * `status=pending_regulatory` returns the "provisioning" view — numbers
15777
- * still in review PLUS recently-declined (last 30 days) ones, so a
15778
- * failed registration surfaces (with `regulatoryDeclineReason`) instead
15779
- * of silently disappearing. Declined numbers can be re-submitted via
15780
- * POST /v1/whatsapp/phone-numbers/{id}/remediate. `verifying` is the
15781
- * short-lived state after the number is provisioned on our side while
15782
- * WhatsApp confirms the activation code; the number is not billed until
15783
- * it reaches `active`.
17531
+ * Optional white-label of the hosted page the end customer sees.
17532
+ */
17533
+ branding?: {
17534
+ /**
17535
+ * Your company name, shown on the hosted page.
17536
+ */
17537
+ companyName?: string;
17538
+ /**
17539
+ * Logo shown above the form.
17540
+ */
17541
+ logoUrl?: string;
17542
+ /**
17543
+ * Hex color (e.g. #1a73e8) used as a brand accent on the page.
17544
+ */
17545
+ brandColor?: string;
17546
+ };
17547
+ /**
17548
+ * Where to send the end customer's browser after a successful
17549
+ * submit. On completion Zernio appends `kyc=submitted` and
17550
+ * `country=<ISO-2>` as query params. When omitted, the hosted
17551
+ * page shows a built-in confirmation screen instead.
15784
17552
  *
15785
17553
  */
15786
- status?: 'provisioning' | 'verifying' | 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'active' | 'suspended' | 'releasing' | 'released';
17554
+ redirect_url?: string;
15787
17555
  };
15788
17556
  };
15789
17557
 
15790
- export type GetWhatsAppPhoneNumbersResponse = ({
15791
- numbers?: Array<{
15792
- _id?: string;
15793
- phoneNumber?: string;
15794
- country?: string;
15795
- status?: 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'provisioning' | 'verifying' | 'active' | 'suspended' | 'releasing' | 'released';
17558
+ export type CreatePhoneNumberKycLinkResponse = ({
17559
+ /**
17560
+ * The hosted link to send your end customer.
17561
+ */
17562
+ url?: string;
17563
+ token?: string;
17564
+ expiresAt?: string;
17565
+ });
17566
+
17567
+ export type CreatePhoneNumberKycLinkError = (unknown | {
17568
+ error?: string;
17569
+ });
17570
+
17571
+ export type CreatePhoneNumberPortInData = {
17572
+ body: {
15796
17573
  /**
15797
- * For regulated numbers, who it's registered for (company or person) — set from the submitted KYC.
17574
+ * E.164 numbers to port in.
15798
17575
  */
15799
- registrantName?: (string) | null;
17576
+ phoneNumbers: Array<(string)>;
15800
17577
  /**
15801
- * Present once the number order has been placed (i.e. the requirement group was approved). Absent while still in identity review.
17578
+ * End-user / current-carrier account info that authorizes the port.
15802
17579
  */
15803
- telnyxOrderId?: (string) | null;
17580
+ endUser: {
17581
+ entityName: string;
17582
+ authPersonName: string;
17583
+ billingPhoneNumber?: string;
17584
+ accountNumber?: string;
17585
+ /**
17586
+ * Transfer PIN. Forwarded to the carrier, never stored.
17587
+ */
17588
+ pinPasscode?: string;
17589
+ streetAddress: string;
17590
+ extendedAddress?: string;
17591
+ locality: string;
17592
+ administrativeArea: string;
17593
+ postalCode: string;
17594
+ countryCode: string;
17595
+ };
15804
17596
  /**
15805
- * Per-country monthly price in cents ($2..$25).
17597
+ * Document id from POST /v1/phone-numbers/port-in/documents (kind=loa).
15806
17598
  */
15807
- monthlyCents?: number;
15808
- profileId?: {
15809
- [key: string]: unknown;
15810
- };
15811
- provisionedAt?: string;
15812
- metaPreverifiedId?: string;
15813
- metaVerificationStatus?: string;
17599
+ loaDocumentId: string;
15814
17600
  /**
15815
- * For regulated (Tier 3/4) numbers with an Onfido ID-verification step — the link to forward to the end user. Set once the order is placed; null otherwise. Poll this field after submitting KYC.
17601
+ * Document id from POST /v1/phone-numbers/port-in/documents (kind=invoice).
15816
17602
  */
15817
- onfidoVerificationUrl?: (string) | null;
15818
- endUserFirstName?: (string) | null;
15819
- endUserLastName?: (string) | null;
17603
+ invoiceDocumentId: string;
15820
17604
  /**
15821
- * Reviewer rejection reason when status is regulatory_declined.
17605
+ * Requested port date; the carrier confirms the actual FOC later.
15822
17606
  */
15823
- regulatoryDeclineReason?: (string) | null;
15824
- createdAt?: string;
15825
- }>;
17607
+ focDatetimeRequested?: string;
17608
+ customerReference?: string;
17609
+ };
17610
+ };
17611
+
17612
+ export type CreatePhoneNumberPortInResponse = ({
15826
17613
  /**
15827
- * Connected (bring-your-own) WhatsApp numbers — your own WABA
15828
- * numbers linked via Embedded Signup. Not provisioned or billed
15829
- * by Zernio, so they are not in `numbers`; `accountId` is the
15830
- * social-account id used by the messaging and inbox endpoints.
15831
- * Included only on the default and `status=active` views.
15832
- *
17614
+ * Porting order ID.
15833
17615
  */
15834
- connected?: Array<{
15835
- accountId?: string;
15836
- phoneNumber?: (string) | null;
15837
- displayName?: (string) | null;
15838
- profileId?: (string) | null;
15839
- connectedAt?: (string) | null;
17616
+ id?: string;
17617
+ telnyxPortingOrderId?: string;
17618
+ status?: 'draft' | 'pending' | 'foc_confirmed' | 'ported' | 'exception' | 'cancelled';
17619
+ phoneNumbers?: Array<(string)>;
17620
+ orders?: Array<{
17621
+ id?: string;
17622
+ telnyxPortingOrderId?: string;
17623
+ status?: string;
17624
+ phoneNumbers?: Array<(string)>;
17625
+ /**
17626
+ * Present when this split order failed to submit (it stays as a cancellable draft).
17627
+ */
17628
+ error?: string;
15840
17629
  }>;
15841
- /**
15842
- * The shared WhatsApp sandbox (one Zernio-owned number, all users test
15843
- * against it). Present when the sandbox is configured; null otherwise.
15844
- * The `accountId` lets you address the sandbox in compose endpoints.
15845
- * `template` is the only template a sandbox send is allowed to use.
15846
- *
15847
- */
15848
- sandbox?: {
15849
- phoneNumber?: string;
15850
- accountId?: (string) | null;
15851
- template?: {
15852
- name?: string;
15853
- language?: string;
15854
- };
15855
- isSandbox?: boolean;
15856
- } | null;
15857
17630
  });
15858
17631
 
15859
- export type GetWhatsAppPhoneNumbersError = ({
17632
+ export type CreatePhoneNumberPortInError = ({
15860
17633
  error?: string;
17634
+ } | unknown);
17635
+
17636
+ export type ListPhoneNumberPortInsResponse = ({
17637
+ orders?: Array<{
17638
+ id?: string;
17639
+ status?: 'draft' | 'pending' | 'foc_confirmed' | 'ported' | 'exception' | 'cancelled';
17640
+ /**
17641
+ * Raw carrier status string.
17642
+ */
17643
+ telnyxStatusValue?: (string) | null;
17644
+ phoneNumbers?: Array<(string)>;
17645
+ fastPortEligible?: (boolean) | null;
17646
+ focDatetimeRequested?: (string) | null;
17647
+ focDatetimeActual?: (string) | null;
17648
+ declineReason?: (string) | null;
17649
+ submittedAt?: (string) | null;
17650
+ portedAt?: (string) | null;
17651
+ createdAt?: string;
17652
+ }>;
15861
17653
  });
15862
17654
 
15863
- export type PurchaseWhatsAppPhoneNumberData = {
17655
+ export type ListPhoneNumberPortInsError = ({
17656
+ error?: string;
17657
+ });
17658
+
17659
+ export type CheckPhoneNumberPortabilityData = {
15864
17660
  body: {
15865
17661
  /**
15866
- * Profile to associate the number with
17662
+ * E.164 numbers to check, e.g. +13035550000.
15867
17663
  */
15868
- profileId: string;
17664
+ phoneNumbers: Array<(string)>;
17665
+ };
17666
+ };
17667
+
17668
+ export type CheckPhoneNumberPortabilityResponse = ({
17669
+ results?: Array<{
17670
+ phoneNumber?: string;
17671
+ portable?: boolean;
15869
17672
  /**
15870
- * ISO 3166-1 alpha-2 country for the number (default US). International numbers require usage-based billing. Tier 3/4 countries return 202 { status: "kyc_required", kycUrl } — the customer must complete KYC at that URL before the number is ordered. See GET /v1/whatsapp/phone-numbers/countries.
15871
- *
17673
+ * Qualifies for the carrier's accelerated FastPort lane.
15872
17674
  */
15873
- country?: string;
17675
+ fastPortable?: boolean;
15874
17676
  /**
15875
- * Optional idempotency key. Send the same value when retrying a purchase: if a number was already bought under this key, the API returns { status: "already_purchased", numberId, phoneNumber } instead of provisioning a second number. Generate a fresh key for each genuinely new purchase.
15876
- *
17677
+ * Carrier reason when not portable; null when portable.
15877
17678
  */
15878
- purchaseIntentId?: string;
17679
+ notPortableReason?: (string) | null;
17680
+ }>;
17681
+ });
17682
+
17683
+ export type CheckPhoneNumberPortabilityError = ({
17684
+ error?: string;
17685
+ });
17686
+
17687
+ export type UploadPhoneNumberPortInDocumentData = {
17688
+ body: {
15879
17689
  /**
15880
- * Any second purchase within 10 minutes of a previous one is rejected with 409 code PURCHASE_VELOCITY as duplicate protection. Pass true to confirm the additional purchase is intentional (e.g. bulk provisioning).
15881
- *
17690
+ * The document (PDF/JPEG/PNG, 10MB max).
15882
17691
  */
15883
- allowMultiple?: boolean;
17692
+ file: (Blob | File);
17693
+ /**
17694
+ * Informational; used for the stored filename.
17695
+ */
17696
+ kind?: 'loa' | 'invoice';
15884
17697
  };
15885
17698
  };
15886
17699
 
15887
- export type PurchaseWhatsAppPhoneNumberResponse = (({
15888
- message?: string;
15889
- checkoutUrl?: string;
15890
- } | {
15891
- message?: string;
15892
- phoneNumber?: {
15893
- id?: string;
15894
- phoneNumber?: string;
15895
- status?: string;
15896
- country?: string;
15897
- provisionedAt?: string;
15898
- metaPreverifiedId?: string;
15899
- metaVerificationStatus?: string;
15900
- };
15901
- } | {
15902
- status?: 'already_purchased';
15903
- numberId?: string;
15904
- phoneNumber?: string;
15905
- }) | {
15906
- status?: 'kyc_required';
15907
- country?: string;
15908
- kycUrl?: string;
17700
+ export type UploadPhoneNumberPortInDocumentResponse = ({
17701
+ documentId?: string;
15909
17702
  });
15910
17703
 
15911
- export type PurchaseWhatsAppPhoneNumberError = (unknown | {
15912
- error?: string;
15913
- } | {
17704
+ export type UploadPhoneNumberPortInDocumentError = (unknown | {
15914
17705
  error?: string;
15915
- code?: 'PURCHASE_VELOCITY';
15916
17706
  });
15917
17707
 
15918
- export type ListWhatsAppNumberCountriesResponse = ({
15919
- countries?: Array<{
17708
+ export type CancelPhoneNumberPortInData = {
17709
+ path: {
15920
17710
  /**
15921
- * ISO 3166-1 alpha-2
17711
+ * Porting order ID (from the port-in list).
15922
17712
  */
15923
- code?: string;
15924
- tier?: 1 | 2 | 3 | 4;
15925
- monthlyCents?: number;
15926
- needsKyc?: boolean;
15927
- outboundCallingAvailable?: boolean;
15928
- }>;
17713
+ id: string;
17714
+ };
17715
+ };
17716
+
17717
+ export type CancelPhoneNumberPortInResponse = ({
17718
+ id?: string;
17719
+ status?: 'draft' | 'pending' | 'foc_confirmed' | 'ported' | 'exception' | 'cancelled';
15929
17720
  });
15930
17721
 
15931
- export type ListWhatsAppNumberCountriesError = ({
17722
+ export type CancelPhoneNumberPortInError = ({
15932
17723
  error?: string;
15933
- });
17724
+ } | unknown);
15934
17725
 
15935
- export type SearchAvailableWhatsAppNumbersData = {
15936
- query?: {
17726
+ export type ReviewPhoneNumberKycPacketData = {
17727
+ body: {
17728
+ country: string;
17729
+ numberType: string;
15937
17730
  /**
15938
- * Pattern to match within the number
17731
+ * requirementId to declared textual value.
15939
17732
  */
15940
- contains?: string;
15941
- country?: string;
15942
- limit?: number;
17733
+ values?: {
17734
+ [key: string]: (string);
17735
+ };
15943
17736
  /**
15944
- * City
17737
+ * Declared address (street_address, locality, ...), so a mismatched proof-of-address can be flagged.
15945
17738
  */
15946
- locality?: string;
17739
+ address?: {
17740
+ [key: string]: (string);
17741
+ };
17742
+ docs: Array<{
17743
+ requirementId: string;
17744
+ /**
17745
+ * Id from POST /v1/phone-numbers/kyc/upload-document.
17746
+ */
17747
+ documentId: string;
17748
+ }>;
17749
+ };
17750
+ };
17751
+
17752
+ export type ReviewPhoneNumberKycPacketResponse = ({
17753
+ advisories?: Array<{
17754
+ requirementId?: string;
15947
17755
  /**
15948
- * Area code
17756
+ * One short plain-language concern about that requirement's document.
15949
17757
  */
15950
- prefix?: string;
17758
+ concern?: string;
17759
+ }>;
17760
+ });
17761
+
17762
+ export type ReviewPhoneNumberKycPacketError = ({
17763
+ error?: string;
17764
+ });
17765
+
17766
+ export type GetPhoneNumberRemediationData = {
17767
+ path: {
15951
17768
  /**
15952
- * Number type; defaults to the country's WhatsApp-safe type
17769
+ * Phone number record ID.
15953
17770
  */
15954
- type?: string;
17771
+ id: string;
15955
17772
  };
15956
17773
  };
15957
17774
 
15958
- export type SearchAvailableWhatsAppNumbersResponse = ({
17775
+ export type GetPhoneNumberRemediationResponse = ({
15959
17776
  country?: string;
15960
17777
  numberType?: string;
15961
- numbers?: Array<{
15962
- phoneNumber?: string;
17778
+ declineReason?: (string) | null;
17779
+ /**
17780
+ * Same field shape as GET /v1/phone-numbers/kyc.
17781
+ */
17782
+ fields?: Array<{
17783
+ [key: string]: unknown;
15963
17784
  }>;
15964
17785
  });
15965
17786
 
15966
- export type SearchAvailableWhatsAppNumbersError = (unknown | {
17787
+ export type GetPhoneNumberRemediationError = (unknown | {
15967
17788
  error?: string;
15968
17789
  });
15969
17790
 
15970
- export type CheckWhatsAppNumberAvailabilityData = {
15971
- query: {
17791
+ export type RemediatePhoneNumberData = {
17792
+ body: {
17793
+ values?: {
17794
+ [key: string]: (string);
17795
+ };
17796
+ documents?: Array<({
17797
+ requirementId: string;
17798
+ filename: string;
17799
+ base64: string;
17800
+ } | {
17801
+ requirementId: string;
17802
+ documentId: string;
17803
+ })>;
15972
17804
  /**
15973
- * ISO-2 country code.
17805
+ * Same shape as the KYC submit address.
15974
17806
  */
15975
- country: string;
17807
+ address?: {
17808
+ [key: string]: unknown;
17809
+ };
17810
+ };
17811
+ path: {
17812
+ id: string;
15976
17813
  };
15977
17814
  };
15978
17815
 
15979
- export type CheckWhatsAppNumberAvailabilityResponse = ({
15980
- country?: string;
15981
- numberType?: string;
15982
- /**
15983
- * Whether deliverable voice inventory exists right now.
15984
- */
15985
- available?: boolean;
15986
- addressConstraint?: 'geo' | 'country' | 'none';
15987
- /**
15988
- * For `geo` only — the area(s) the registered address must be in.
15989
- */
15990
- areas?: Array<(string)>;
17816
+ export type RemediatePhoneNumberResponse = ({
17817
+ status?: string;
17818
+ phoneNumber?: {
17819
+ id?: string;
17820
+ status?: string;
17821
+ };
15991
17822
  });
15992
17823
 
15993
- export type CheckWhatsAppNumberAvailabilityError = (unknown | {
17824
+ export type RemediatePhoneNumberError = (unknown | {
15994
17825
  error?: string;
15995
17826
  });
15996
17827
 
@@ -16322,6 +18153,312 @@ export type RemediateWhatsAppNumberError = (unknown | {
16322
18153
  error?: string;
16323
18154
  });
16324
18155
 
18156
+ export type EnableVoiceOnNumberData = {
18157
+ body?: {
18158
+ /**
18159
+ * tel:+E164, sip:..., or wss://... destination for inbound calls. Empty string clears the forward (outbound-only); omitted preserves the current one.
18160
+ */
18161
+ forwardTo?: string;
18162
+ recordingEnabled?: boolean;
18163
+ transcriptionEnabled?: boolean;
18164
+ transcriptionLanguage?: 'auto' | 'en' | 'es';
18165
+ /**
18166
+ * Voicemail is taken when there's no live destination. Default on.
18167
+ */
18168
+ voicemailEnabled?: boolean;
18169
+ /**
18170
+ * Custom spoken greeting; empty string restores the default.
18171
+ */
18172
+ voicemailGreeting?: string;
18173
+ /**
18174
+ * Outside the windows, inbound skips the forward and goes to voicemail. Off = 24/7.
18175
+ */
18176
+ businessHoursEnabled?: boolean;
18177
+ /**
18178
+ * IANA timezone the windows are evaluated in.
18179
+ */
18180
+ businessHoursTimezone?: string;
18181
+ businessHours?: Array<{
18182
+ /**
18183
+ * 0 = Sunday.
18184
+ */
18185
+ day: number;
18186
+ open: string;
18187
+ close: string;
18188
+ }>;
18189
+ /**
18190
+ * E.164 numbers rejected before answer. Replaces the whole list; bare 10-digit values are normalized as US numbers.
18191
+ */
18192
+ blockedCallers?: Array<(string)>;
18193
+ /**
18194
+ * Caller ID on the forwarded leg: your number (`business`) or the original caller's (`caller`).
18195
+ */
18196
+ forwardCallerId?: 'business' | 'caller';
18197
+ /**
18198
+ * IVR menu (supersedes the plain forward within business hours).
18199
+ */
18200
+ ivrEnabled?: boolean;
18201
+ ivrPrompt?: string;
18202
+ ivrOptions?: Array<{
18203
+ digit: string;
18204
+ /**
18205
+ * tel:+E164, sip:..., or wss://... destination for this digit.
18206
+ */
18207
+ forwardTo: string;
18208
+ label?: string;
18209
+ }>;
18210
+ };
18211
+ path: {
18212
+ /**
18213
+ * Phone number record ID (from GET /v1/phone-numbers).
18214
+ */
18215
+ id: string;
18216
+ };
18217
+ };
18218
+
18219
+ export type EnableVoiceOnNumberResponse = ({
18220
+ enabled?: boolean;
18221
+ phoneNumber?: string;
18222
+ pstnForwardTo?: (string) | null;
18223
+ recordingEnabled?: boolean;
18224
+ transcriptionEnabled?: boolean;
18225
+ transcriptionLanguage?: 'auto' | 'en' | 'es';
18226
+ voicemailEnabled?: boolean;
18227
+ voicemailGreeting?: (string) | null;
18228
+ businessHoursEnabled?: boolean;
18229
+ businessHoursTimezone?: (string) | null;
18230
+ businessHours?: Array<{
18231
+ day?: number;
18232
+ open?: string;
18233
+ close?: string;
18234
+ }>;
18235
+ blockedCallers?: Array<(string)>;
18236
+ forwardCallerId?: 'business' | 'caller';
18237
+ ivrEnabled?: boolean;
18238
+ ivrPrompt?: (string) | null;
18239
+ ivrOptions?: Array<{
18240
+ digit?: string;
18241
+ forwardTo?: string;
18242
+ label?: string;
18243
+ }>;
18244
+ });
18245
+
18246
+ export type EnableVoiceOnNumberError = ({
18247
+ error?: string;
18248
+ } | unknown);
18249
+
18250
+ export type DisableVoiceOnNumberData = {
18251
+ path: {
18252
+ id: string;
18253
+ };
18254
+ };
18255
+
18256
+ export type DisableVoiceOnNumberResponse = ({
18257
+ enabled?: boolean;
18258
+ phoneNumber?: string;
18259
+ });
18260
+
18261
+ export type DisableVoiceOnNumberError = ({
18262
+ error?: string;
18263
+ } | unknown);
18264
+
18265
+ export type EnableSmsOnNumberData = {
18266
+ path: {
18267
+ /**
18268
+ * Phone number record ID (from GET /v1/phone-numbers).
18269
+ */
18270
+ id: string;
18271
+ };
18272
+ };
18273
+
18274
+ export type EnableSmsOnNumberResponse = ({
18275
+ enabled?: boolean;
18276
+ /**
18277
+ * The SMS social account ID (present when enabled).
18278
+ */
18279
+ id?: string;
18280
+ phoneNumber?: string;
18281
+ /**
18282
+ * False for US numbers until their registration is approved.
18283
+ */
18284
+ isActive?: boolean;
18285
+ country?: string;
18286
+ /**
18287
+ * Null when capability can't be read yet (still provisioning).
18288
+ */
18289
+ smsCapable?: (boolean) | null;
18290
+ mmsCapable?: boolean;
18291
+ domesticOnly?: boolean;
18292
+ /**
18293
+ * Number is still provisioning at the carrier; retry shortly.
18294
+ */
18295
+ notReady?: boolean;
18296
+ /**
18297
+ * US only; a carrier registration is required before delivery.
18298
+ */
18299
+ needsRegistration?: boolean;
18300
+ /**
18301
+ * A prior non-rejected registration already covers this number; no re-submit needed.
18302
+ */
18303
+ alreadyRegistered?: boolean;
18304
+ registrationStatus?: ('pending' | 'approved' | 'rejected') | null;
18305
+ /**
18306
+ * Present when an existing approved registration can cover this number via /sms/reuse-registration.
18307
+ */
18308
+ reusable?: {
18309
+ registrationId?: string;
18310
+ status?: string;
18311
+ } | null;
18312
+ /**
18313
+ * Human-readable explanation when `enabled` is false.
18314
+ */
18315
+ message?: string;
18316
+ });
18317
+
18318
+ export type EnableSmsOnNumberError = ({
18319
+ error?: string;
18320
+ } | unknown);
18321
+
18322
+ export type DisableSmsOnNumberData = {
18323
+ path: {
18324
+ id: string;
18325
+ };
18326
+ };
18327
+
18328
+ export type DisableSmsOnNumberResponse = ({
18329
+ enabled?: boolean;
18330
+ phoneNumber?: string;
18331
+ /**
18332
+ * False when SMS was already off. Legacy field; prefer `enabled`.
18333
+ */
18334
+ disabled?: boolean;
18335
+ });
18336
+
18337
+ export type DisableSmsOnNumberError = ({
18338
+ error?: string;
18339
+ } | unknown);
18340
+
18341
+ export type ReuseSmsRegistrationForNumberData = {
18342
+ path: {
18343
+ id: string;
18344
+ };
18345
+ };
18346
+
18347
+ export type ReuseSmsRegistrationForNumberResponse = ({
18348
+ registrationId?: string;
18349
+ status?: 'pending' | 'approved' | 'rejected';
18350
+ });
18351
+
18352
+ export type ReuseSmsRegistrationForNumberError = ({
18353
+ error?: string;
18354
+ } | unknown);
18355
+
18356
+ export type GetWhatsAppCallingData = {
18357
+ path: {
18358
+ /**
18359
+ * Phone number record ID (from GET /v1/phone-numbers).
18360
+ */
18361
+ id: string;
18362
+ };
18363
+ };
18364
+
18365
+ export type GetWhatsAppCallingResponse = ({
18366
+ phoneNumber?: string;
18367
+ callingEnabled?: boolean;
18368
+ /**
18369
+ * Public calling deep link (https://wa.me/call/<number>). Null while calling is disabled.
18370
+ */
18371
+ callDeepLink?: (string) | null;
18372
+ /**
18373
+ * tel:+E164 / sip:... / wss://... destination
18374
+ */
18375
+ forwardTo?: (string) | null;
18376
+ recordingEnabled?: boolean;
18377
+ sipAuthUsername?: (string) | null;
18378
+ /**
18379
+ * True when a SIP digest password is stored. The plaintext is never returned.
18380
+ */
18381
+ sipAuthPasswordConfigured?: boolean;
18382
+ callIconCountries?: Array<(string)> | null;
18383
+ /**
18384
+ * True when the number's country blocks business-initiated (outbound) WhatsApp calling; inbound still works.
18385
+ */
18386
+ outboundDisabled?: boolean;
18387
+ });
18388
+
18389
+ export type GetWhatsAppCallingError = ({
18390
+ error?: string;
18391
+ } | unknown);
18392
+
18393
+ export type EnableWhatsAppCallingData = {
18394
+ body: {
18395
+ accountId: string;
18396
+ /**
18397
+ * tel:+E164 / sip:... / wss://... destination
18398
+ */
18399
+ forwardTo: string;
18400
+ sipAuthUsername?: string;
18401
+ /**
18402
+ * Stored encrypted, never returned by any endpoint.
18403
+ */
18404
+ sipAuthPassword?: string;
18405
+ recordingEnabled?: boolean;
18406
+ callIconCountries?: Array<(string)>;
18407
+ };
18408
+ path: {
18409
+ /**
18410
+ * Phone number record ID (from GET /v1/phone-numbers).
18411
+ */
18412
+ id: string;
18413
+ };
18414
+ };
18415
+
18416
+ export type EnableWhatsAppCallingResponse = ({
18417
+ success?: boolean;
18418
+ callingEnabled?: boolean;
18419
+ sipHostname?: string;
18420
+ forwardTo?: string;
18421
+ });
18422
+
18423
+ export type EnableWhatsAppCallingError = ({
18424
+ error?: string;
18425
+ } | unknown);
18426
+
18427
+ export type UpdateWhatsAppCallingData = {
18428
+ body: {
18429
+ accountId: string;
18430
+ forwardTo?: string;
18431
+ sipAuthUsername?: (string) | null;
18432
+ sipAuthPassword?: (string) | null;
18433
+ recordingEnabled?: boolean;
18434
+ callIconCountries?: Array<(string)> | null;
18435
+ };
18436
+ path: {
18437
+ id: string;
18438
+ };
18439
+ };
18440
+
18441
+ export type UpdateWhatsAppCallingResponse = (unknown);
18442
+
18443
+ export type UpdateWhatsAppCallingError = ({
18444
+ error?: string;
18445
+ } | unknown);
18446
+
18447
+ export type DisableWhatsAppCallingData = {
18448
+ path: {
18449
+ id: string;
18450
+ };
18451
+ query: {
18452
+ accountId: string;
18453
+ };
18454
+ };
18455
+
18456
+ export type DisableWhatsAppCallingResponse = (unknown);
18457
+
18458
+ export type DisableWhatsAppCallingError = ({
18459
+ error?: string;
18460
+ } | unknown);
18461
+
16325
18462
  export type GetWhatsAppPhoneNumberData = {
16326
18463
  path: {
16327
18464
  /**