@getlatedev/node 0.2.310 → 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.
- package/README.md +70 -0
- package/dist/index.d.mts +2498 -467
- package/dist/index.d.ts +2498 -467
- package/dist/index.js +412 -9
- package/dist/index.mjs +412 -9
- package/package.json +1 -1
- package/src/client.ts +135 -3
- package/src/generated/sdk.gen.ts +1057 -29
- package/src/generated/types.gen.ts +2595 -475
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
2716
|
+
export type status7 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
2575
2717
|
|
|
2576
2718
|
export type visibility = 'public' | 'private' | 'unlisted';
|
|
2577
2719
|
|
|
@@ -3614,7 +3756,7 @@ export type UploadTokenResponse = {
|
|
|
3614
3756
|
status?: 'pending' | 'completed' | 'expired';
|
|
3615
3757
|
};
|
|
3616
3758
|
|
|
3617
|
-
export type
|
|
3759
|
+
export type status8 = 'pending' | 'completed' | 'expired';
|
|
3618
3760
|
|
|
3619
3761
|
export type UploadTokenStatusResponse = {
|
|
3620
3762
|
token?: string;
|
|
@@ -3893,7 +4035,7 @@ export type WebhookLog = {
|
|
|
3893
4035
|
/**
|
|
3894
4036
|
* Delivery outcome
|
|
3895
4037
|
*/
|
|
3896
|
-
export type
|
|
4038
|
+
export type status9 = 'success' | 'failed';
|
|
3897
4039
|
|
|
3898
4040
|
/**
|
|
3899
4041
|
* Webhook payload for `account.ads.initial_sync_completed` events.
|
|
@@ -4002,7 +4144,7 @@ export type event = 'account.ads.initial_sync_completed';
|
|
|
4002
4144
|
/**
|
|
4003
4145
|
* Overall outcome of the initial sync.
|
|
4004
4146
|
*/
|
|
4005
|
-
export type
|
|
4147
|
+
export type status10 = 'success' | 'failure';
|
|
4006
4148
|
|
|
4007
4149
|
/**
|
|
4008
4150
|
* Stable category for UX branching. New values may be added; existing ones are
|
|
@@ -4253,10 +4395,6 @@ export type WebhookPayloadCallEnded = {
|
|
|
4253
4395
|
|
|
4254
4396
|
export type event5 = 'call.ended';
|
|
4255
4397
|
|
|
4256
|
-
export type direction2 = 'inbound' | 'outbound';
|
|
4257
|
-
|
|
4258
|
-
export type endReason = 'hangup' | 'no_answer' | 'rejected' | 'error';
|
|
4259
|
-
|
|
4260
4398
|
/**
|
|
4261
4399
|
* Webhook payload for the `call.failed` event. Fired when a call
|
|
4262
4400
|
* setup or in-progress call fails.
|
|
@@ -5390,7 +5528,7 @@ export type platform10 = 'whatsapp';
|
|
|
5390
5528
|
* request before the template is actually removed.
|
|
5391
5529
|
*
|
|
5392
5530
|
*/
|
|
5393
|
-
export type
|
|
5531
|
+
export type status11 = 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION';
|
|
5394
5532
|
|
|
5395
5533
|
export type WhatsAppBodyComponent = {
|
|
5396
5534
|
type: 'body';
|
|
@@ -5491,7 +5629,7 @@ export type WhatsAppSandboxSession = {
|
|
|
5491
5629
|
* list responses.
|
|
5492
5630
|
*
|
|
5493
5631
|
*/
|
|
5494
|
-
export type
|
|
5632
|
+
export type status12 = 'pending' | 'active';
|
|
5495
5633
|
|
|
5496
5634
|
export type WhatsAppTemplateButton = {
|
|
5497
5635
|
type: 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'copy_code' | 'flow' | 'mpm' | 'catalog';
|
|
@@ -5610,7 +5748,7 @@ export type WorkflowExecutionEvent = {
|
|
|
5610
5748
|
|
|
5611
5749
|
export type action2 = 'execution_started' | 'execution_completed' | 'execution_exited' | 'execution_paused' | 'execution_resumed' | 'node_started' | 'node_completed' | 'node_failed' | 'node_skipped';
|
|
5612
5750
|
|
|
5613
|
-
export type
|
|
5751
|
+
export type status13 = 'success' | 'failed' | 'pending';
|
|
5614
5752
|
|
|
5615
5753
|
/**
|
|
5616
5754
|
* A node in a workflow graph. `config` shape depends on `type`.
|
|
@@ -7536,6 +7674,26 @@ export type GetXApiPricingError = ({
|
|
|
7536
7674
|
error?: string;
|
|
7537
7675
|
});
|
|
7538
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
|
+
|
|
7539
7697
|
export type GetUsageStatsData = {
|
|
7540
7698
|
query?: {
|
|
7541
7699
|
/**
|
|
@@ -7556,6 +7714,107 @@ export type GetUsageStatsError = (unknown | {
|
|
|
7556
7714
|
error?: string;
|
|
7557
7715
|
});
|
|
7558
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
|
+
|
|
7559
7818
|
export type ListPostsData = {
|
|
7560
7819
|
query?: {
|
|
7561
7820
|
/**
|
|
@@ -14977,7 +15236,7 @@ export type GetWhatsAppCallingConfigData = {
|
|
|
14977
15236
|
|
|
14978
15237
|
export type GetWhatsAppCallingConfigResponse = ({
|
|
14979
15238
|
/**
|
|
14980
|
-
*
|
|
15239
|
+
* Phone number record ID (use on /v1/phone-numbers/{id}/whatsapp/calling)
|
|
14981
15240
|
*/
|
|
14982
15241
|
phoneNumberDocId?: string;
|
|
14983
15242
|
phoneNumber?: string;
|
|
@@ -15003,7 +15262,7 @@ export type GetWhatsAppCallingConfigError = ({
|
|
|
15003
15262
|
error?: string;
|
|
15004
15263
|
} | unknown);
|
|
15005
15264
|
|
|
15006
|
-
export type
|
|
15265
|
+
export type EnableWhatsAppCallingLegacyData = {
|
|
15007
15266
|
body: {
|
|
15008
15267
|
accountId: string;
|
|
15009
15268
|
/**
|
|
@@ -15026,18 +15285,18 @@ export type EnableWhatsAppCallingData = {
|
|
|
15026
15285
|
};
|
|
15027
15286
|
};
|
|
15028
15287
|
|
|
15029
|
-
export type
|
|
15288
|
+
export type EnableWhatsAppCallingLegacyResponse = ({
|
|
15030
15289
|
success?: boolean;
|
|
15031
15290
|
callingEnabled?: boolean;
|
|
15032
15291
|
sipHostname?: string;
|
|
15033
15292
|
forwardTo?: string;
|
|
15034
15293
|
});
|
|
15035
15294
|
|
|
15036
|
-
export type
|
|
15295
|
+
export type EnableWhatsAppCallingLegacyError = ({
|
|
15037
15296
|
error?: string;
|
|
15038
15297
|
} | unknown);
|
|
15039
15298
|
|
|
15040
|
-
export type
|
|
15299
|
+
export type UpdateWhatsAppCallingLegacyData = {
|
|
15041
15300
|
body: {
|
|
15042
15301
|
accountId: string;
|
|
15043
15302
|
forwardTo?: string;
|
|
@@ -15051,13 +15310,13 @@ export type UpdateWhatsAppCallingData = {
|
|
|
15051
15310
|
};
|
|
15052
15311
|
};
|
|
15053
15312
|
|
|
15054
|
-
export type
|
|
15313
|
+
export type UpdateWhatsAppCallingLegacyResponse = (unknown);
|
|
15055
15314
|
|
|
15056
|
-
export type
|
|
15315
|
+
export type UpdateWhatsAppCallingLegacyError = ({
|
|
15057
15316
|
error?: string;
|
|
15058
15317
|
} | unknown);
|
|
15059
15318
|
|
|
15060
|
-
export type
|
|
15319
|
+
export type DisableWhatsAppCallingLegacyData = {
|
|
15061
15320
|
path: {
|
|
15062
15321
|
id: string;
|
|
15063
15322
|
};
|
|
@@ -15066,9 +15325,9 @@ export type DisableWhatsAppCallingData = {
|
|
|
15066
15325
|
};
|
|
15067
15326
|
};
|
|
15068
15327
|
|
|
15069
|
-
export type
|
|
15328
|
+
export type DisableWhatsAppCallingLegacyResponse = (unknown);
|
|
15070
15329
|
|
|
15071
|
-
export type
|
|
15330
|
+
export type DisableWhatsAppCallingLegacyError = ({
|
|
15072
15331
|
error?: string;
|
|
15073
15332
|
} | unknown);
|
|
15074
15333
|
|
|
@@ -15130,6 +15389,12 @@ export type InitiateWhatsAppCallData = {
|
|
|
15130
15389
|
*/
|
|
15131
15390
|
biz_opaque_callback_data?: string;
|
|
15132
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
|
+
};
|
|
15133
15398
|
};
|
|
15134
15399
|
|
|
15135
15400
|
export type InitiateWhatsAppCallResponse = ({
|
|
@@ -15156,6 +15421,10 @@ export type InitiateWhatsAppCallError = ({
|
|
|
15156
15421
|
export type ListWhatsAppCallsData = {
|
|
15157
15422
|
query: {
|
|
15158
15423
|
accountId: string;
|
|
15424
|
+
/**
|
|
15425
|
+
* Return calls with startedAt strictly before this instant (use the previous page's nextCursor).
|
|
15426
|
+
*/
|
|
15427
|
+
before?: string;
|
|
15159
15428
|
direction?: 'inbound' | 'outbound';
|
|
15160
15429
|
limit?: number;
|
|
15161
15430
|
since?: string;
|
|
@@ -15194,6 +15463,10 @@ export type ListWhatsAppCallsResponse = ({
|
|
|
15194
15463
|
currency?: string;
|
|
15195
15464
|
};
|
|
15196
15465
|
}>;
|
|
15466
|
+
/**
|
|
15467
|
+
* Pass as `before` for the next page; null on the last page.
|
|
15468
|
+
*/
|
|
15469
|
+
nextCursor?: (string) | null;
|
|
15197
15470
|
});
|
|
15198
15471
|
|
|
15199
15472
|
export type ListWhatsAppCallsError = ({
|
|
@@ -15219,6 +15492,27 @@ export type GetWhatsAppCallError = ({
|
|
|
15219
15492
|
error?: string;
|
|
15220
15493
|
} | unknown);
|
|
15221
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
|
+
|
|
15222
15516
|
export type GetWhatsAppCallEstimateData = {
|
|
15223
15517
|
query: {
|
|
15224
15518
|
accountId: string;
|
|
@@ -15254,491 +15548,708 @@ export type GetWhatsAppCallEstimateError = ({
|
|
|
15254
15548
|
error?: string;
|
|
15255
15549
|
});
|
|
15256
15550
|
|
|
15257
|
-
export type
|
|
15258
|
-
query
|
|
15551
|
+
export type ListCallsData = {
|
|
15552
|
+
query?: {
|
|
15259
15553
|
/**
|
|
15260
|
-
*
|
|
15554
|
+
* Return calls with startedAt strictly before this instant (use the previous page's nextCursor).
|
|
15261
15555
|
*/
|
|
15262
|
-
|
|
15556
|
+
before?: string;
|
|
15557
|
+
channel?: 'whatsapp' | 'pstn';
|
|
15558
|
+
direction?: 'inbound' | 'outbound';
|
|
15559
|
+
limit?: number;
|
|
15263
15560
|
/**
|
|
15264
|
-
* Exact
|
|
15561
|
+
* Exact filter: calls involving this number (typically one of YOUR numbers, to scope history to a single line). E.164, leading + optional.
|
|
15265
15562
|
*/
|
|
15266
|
-
|
|
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';
|
|
15267
15569
|
};
|
|
15268
15570
|
};
|
|
15269
15571
|
|
|
15270
|
-
export type
|
|
15271
|
-
|
|
15272
|
-
|
|
15273
|
-
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
|
-
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
type?: string;
|
|
15282
|
-
text?: string;
|
|
15283
|
-
}>;
|
|
15284
|
-
} | 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;
|
|
15285
15583
|
});
|
|
15286
15584
|
|
|
15287
|
-
export type
|
|
15585
|
+
export type ListCallsError = ({
|
|
15288
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
|
+
});
|
|
15289
15602
|
});
|
|
15290
15603
|
|
|
15291
|
-
export type
|
|
15292
|
-
|
|
15604
|
+
export type GetCallError = ({
|
|
15605
|
+
error?: string;
|
|
15606
|
+
} | unknown);
|
|
15607
|
+
|
|
15608
|
+
export type GetCallRecordingData = {
|
|
15609
|
+
path: {
|
|
15610
|
+
id: string;
|
|
15611
|
+
};
|
|
15612
|
+
query?: {
|
|
15293
15613
|
/**
|
|
15294
|
-
*
|
|
15614
|
+
* `json` returns `{ url }` instead of a 302 redirect.
|
|
15295
15615
|
*/
|
|
15296
|
-
|
|
15616
|
+
as?: 'json';
|
|
15297
15617
|
};
|
|
15298
15618
|
};
|
|
15299
15619
|
|
|
15300
|
-
export type
|
|
15301
|
-
|
|
15302
|
-
businessProfile?: {
|
|
15303
|
-
/**
|
|
15304
|
-
* Short description (max 139 chars)
|
|
15305
|
-
*/
|
|
15306
|
-
about?: string;
|
|
15307
|
-
address?: string;
|
|
15308
|
-
/**
|
|
15309
|
-
* Full description (max 512 chars)
|
|
15310
|
-
*/
|
|
15311
|
-
description?: string;
|
|
15312
|
-
email?: string;
|
|
15313
|
-
profilePictureUrl?: string;
|
|
15314
|
-
websites?: Array<(string)>;
|
|
15315
|
-
/**
|
|
15316
|
-
* Business category
|
|
15317
|
-
*/
|
|
15318
|
-
vertical?: string;
|
|
15319
|
-
};
|
|
15620
|
+
export type GetCallRecordingResponse = ({
|
|
15621
|
+
url?: string;
|
|
15320
15622
|
});
|
|
15321
15623
|
|
|
15322
|
-
export type
|
|
15624
|
+
export type GetCallRecordingError = (unknown | {
|
|
15323
15625
|
error?: string;
|
|
15324
15626
|
});
|
|
15325
15627
|
|
|
15326
|
-
export type
|
|
15628
|
+
export type CreateVoiceCallData = {
|
|
15327
15629
|
body: {
|
|
15328
15630
|
/**
|
|
15329
|
-
*
|
|
15631
|
+
* Destination to dial, E.164 with leading +.
|
|
15330
15632
|
*/
|
|
15331
|
-
|
|
15633
|
+
to: string;
|
|
15332
15634
|
/**
|
|
15333
|
-
*
|
|
15635
|
+
* Which of your voice-enabled numbers to dial from. Optional when you have exactly one.
|
|
15334
15636
|
*/
|
|
15335
|
-
|
|
15637
|
+
fromNumber?: string;
|
|
15336
15638
|
/**
|
|
15337
|
-
*
|
|
15639
|
+
* Per-call agent override (tel:+E164, sip:..., or wss://...); defaults to the number's stored forward destination.
|
|
15338
15640
|
*/
|
|
15339
|
-
|
|
15641
|
+
forwardTo?: string;
|
|
15340
15642
|
/**
|
|
15341
|
-
*
|
|
15643
|
+
* Spoken to the callee when they answer, before the bridge.
|
|
15342
15644
|
*/
|
|
15343
|
-
|
|
15645
|
+
greeting?: string;
|
|
15344
15646
|
/**
|
|
15345
|
-
*
|
|
15647
|
+
* Per-call recording toggle; defaults to the number's setting.
|
|
15346
15648
|
*/
|
|
15347
|
-
|
|
15649
|
+
recordOverride?: boolean;
|
|
15348
15650
|
/**
|
|
15349
|
-
*
|
|
15651
|
+
* Per-call transcription toggle; defaults to the number's setting.
|
|
15350
15652
|
*/
|
|
15351
|
-
|
|
15653
|
+
transcribeOverride?: boolean;
|
|
15352
15654
|
/**
|
|
15353
|
-
*
|
|
15655
|
+
* 'auto' derives from the callee's country; 'en'/'es' force it.
|
|
15354
15656
|
*/
|
|
15355
|
-
|
|
15657
|
+
transcriptionLanguage?: 'auto' | 'en' | 'es';
|
|
15356
15658
|
/**
|
|
15357
|
-
*
|
|
15659
|
+
* A retry with the same key returns the original call instead of dialing again.
|
|
15358
15660
|
*/
|
|
15359
|
-
|
|
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;
|
|
15360
15676
|
};
|
|
15361
15677
|
};
|
|
15362
15678
|
|
|
15363
|
-
export type
|
|
15679
|
+
export type CreateVoiceCallResponse = ({
|
|
15364
15680
|
success?: boolean;
|
|
15365
|
-
|
|
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';
|
|
15366
15695
|
});
|
|
15367
15696
|
|
|
15368
|
-
export type
|
|
15697
|
+
export type CreateVoiceCallError = ({
|
|
15369
15698
|
error?: string;
|
|
15370
|
-
});
|
|
15699
|
+
} | unknown);
|
|
15371
15700
|
|
|
15372
|
-
export type
|
|
15373
|
-
|
|
15374
|
-
|
|
15375
|
-
|
|
15376
|
-
|
|
15377
|
-
accountId: string;
|
|
15701
|
+
export type ListVoiceCallsData = {
|
|
15702
|
+
query?: {
|
|
15703
|
+
before?: string;
|
|
15704
|
+
direction?: 'inbound' | 'outbound';
|
|
15705
|
+
limit?: number;
|
|
15378
15706
|
/**
|
|
15379
|
-
*
|
|
15707
|
+
* Exact filter: calls involving this number (typically one of your DIDs). E.164, leading + optional.
|
|
15380
15708
|
*/
|
|
15381
|
-
|
|
15709
|
+
number?: string;
|
|
15710
|
+
status?: 'ringing' | 'answered' | 'ended' | 'failed';
|
|
15382
15711
|
};
|
|
15383
15712
|
};
|
|
15384
15713
|
|
|
15385
|
-
export type
|
|
15386
|
-
|
|
15387
|
-
|
|
15714
|
+
export type ListVoiceCallsResponse = ({
|
|
15715
|
+
calls?: Array<CallRecord>;
|
|
15716
|
+
nextCursor?: (string) | null;
|
|
15388
15717
|
});
|
|
15389
15718
|
|
|
15390
|
-
export type
|
|
15719
|
+
export type ListVoiceCallsError = ({
|
|
15391
15720
|
error?: string;
|
|
15392
15721
|
});
|
|
15393
15722
|
|
|
15394
|
-
export type
|
|
15395
|
-
|
|
15396
|
-
|
|
15397
|
-
* WhatsApp social account ID
|
|
15398
|
-
*/
|
|
15399
|
-
accountId: string;
|
|
15723
|
+
export type GetVoiceCallData = {
|
|
15724
|
+
path: {
|
|
15725
|
+
id: string;
|
|
15400
15726
|
};
|
|
15401
15727
|
};
|
|
15402
15728
|
|
|
15403
|
-
export type
|
|
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 = ({
|
|
15404
15744
|
success?: boolean;
|
|
15405
|
-
|
|
15406
|
-
|
|
15407
|
-
|
|
15408
|
-
|
|
15409
|
-
|
|
15410
|
-
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
|
|
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?: {
|
|
15414
15761
|
/**
|
|
15415
|
-
*
|
|
15762
|
+
* `json` returns `{ url }` instead of a 302 redirect.
|
|
15416
15763
|
*/
|
|
15417
|
-
|
|
15764
|
+
as?: 'json';
|
|
15418
15765
|
};
|
|
15766
|
+
};
|
|
15767
|
+
|
|
15768
|
+
export type GetVoiceCallRecordingResponse = ({
|
|
15769
|
+
url?: string;
|
|
15419
15770
|
});
|
|
15420
15771
|
|
|
15421
|
-
export type
|
|
15772
|
+
export type GetVoiceCallRecordingError = (unknown | {
|
|
15422
15773
|
error?: string;
|
|
15423
|
-
}
|
|
15774
|
+
});
|
|
15424
15775
|
|
|
15425
|
-
export type
|
|
15776
|
+
export type TransferVoiceCallData = {
|
|
15426
15777
|
body: {
|
|
15427
15778
|
/**
|
|
15428
|
-
*
|
|
15429
|
-
*/
|
|
15430
|
-
accountId: string;
|
|
15431
|
-
/**
|
|
15432
|
-
* 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.
|
|
15433
15780
|
*/
|
|
15434
|
-
|
|
15781
|
+
to: string;
|
|
15782
|
+
};
|
|
15783
|
+
path: {
|
|
15784
|
+
id: string;
|
|
15435
15785
|
};
|
|
15436
15786
|
};
|
|
15437
15787
|
|
|
15438
|
-
export type
|
|
15788
|
+
export type TransferVoiceCallResponse = ({
|
|
15439
15789
|
success?: boolean;
|
|
15440
|
-
|
|
15441
|
-
|
|
15442
|
-
name?: string;
|
|
15443
|
-
status?: 'PENDING_REVIEW';
|
|
15444
|
-
};
|
|
15790
|
+
callId?: string;
|
|
15791
|
+
transferredTo?: string;
|
|
15445
15792
|
});
|
|
15446
15793
|
|
|
15447
|
-
export type
|
|
15794
|
+
export type TransferVoiceCallError = ({
|
|
15448
15795
|
error?: string;
|
|
15449
|
-
});
|
|
15796
|
+
} | unknown);
|
|
15450
15797
|
|
|
15451
|
-
export type
|
|
15798
|
+
export type GetVoiceCallEstimateData = {
|
|
15452
15799
|
query: {
|
|
15800
|
+
minutes?: number;
|
|
15801
|
+
recording?: boolean;
|
|
15453
15802
|
/**
|
|
15454
|
-
*
|
|
15803
|
+
* Destination number, E.164 (leading + optional).
|
|
15455
15804
|
*/
|
|
15456
|
-
|
|
15805
|
+
to: string;
|
|
15806
|
+
transcription?: boolean;
|
|
15457
15807
|
};
|
|
15458
15808
|
};
|
|
15459
15809
|
|
|
15460
|
-
export type
|
|
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 = ({
|
|
15461
15837
|
success?: boolean;
|
|
15462
15838
|
/**
|
|
15463
|
-
*
|
|
15839
|
+
* Login token for the browser WebRTC SDK.
|
|
15464
15840
|
*/
|
|
15465
|
-
|
|
15841
|
+
token?: string;
|
|
15466
15842
|
/**
|
|
15467
|
-
*
|
|
15843
|
+
* Pass to POST /v1/voice/calls/web/dial once the browser is registered.
|
|
15468
15844
|
*/
|
|
15469
|
-
|
|
15845
|
+
credentialId?: string;
|
|
15846
|
+
expiresAt?: string;
|
|
15847
|
+
sdk?: string;
|
|
15470
15848
|
});
|
|
15471
15849
|
|
|
15472
|
-
export type
|
|
15850
|
+
export type CreateVoiceWebSessionError = ({
|
|
15473
15851
|
error?: string;
|
|
15474
15852
|
} | unknown);
|
|
15475
15853
|
|
|
15476
|
-
export type
|
|
15854
|
+
export type DialVoiceWebCallData = {
|
|
15477
15855
|
body: {
|
|
15478
15856
|
/**
|
|
15479
|
-
*
|
|
15857
|
+
* The number to call, E.164 with leading +.
|
|
15480
15858
|
*/
|
|
15481
|
-
|
|
15859
|
+
to: string;
|
|
15482
15860
|
/**
|
|
15483
|
-
*
|
|
15484
|
-
*
|
|
15861
|
+
* The WebRTC credential id returned by POST /v1/voice/calls/web (the registered browser).
|
|
15485
15862
|
*/
|
|
15486
|
-
|
|
15863
|
+
credentialId: string;
|
|
15487
15864
|
/**
|
|
15488
|
-
*
|
|
15865
|
+
* Which of your voice-enabled numbers to call from (optional when you have one).
|
|
15489
15866
|
*/
|
|
15490
|
-
|
|
15867
|
+
fromNumber?: string;
|
|
15868
|
+
recordOverride?: boolean;
|
|
15491
15869
|
};
|
|
15492
15870
|
};
|
|
15493
15871
|
|
|
15494
|
-
export type
|
|
15872
|
+
export type DialVoiceWebCallResponse = ({
|
|
15495
15873
|
success?: boolean;
|
|
15496
|
-
|
|
15497
|
-
|
|
15874
|
+
callId?: string;
|
|
15875
|
+
telnyxCallControlId?: string;
|
|
15876
|
+
status?: 'dialing';
|
|
15877
|
+
direction?: 'outbound';
|
|
15878
|
+
from?: string;
|
|
15879
|
+
to?: string;
|
|
15880
|
+
recordingEnabled?: boolean;
|
|
15498
15881
|
});
|
|
15499
15882
|
|
|
15500
|
-
export type
|
|
15883
|
+
export type DialVoiceWebCallError = ({
|
|
15501
15884
|
error?: string;
|
|
15502
|
-
});
|
|
15885
|
+
} | unknown);
|
|
15503
15886
|
|
|
15504
|
-
export type
|
|
15887
|
+
export type SendSmsData = {
|
|
15505
15888
|
body: {
|
|
15506
15889
|
/**
|
|
15507
|
-
*
|
|
15890
|
+
* One of your SMS-enabled numbers (E.164; formatting is normalized).
|
|
15508
15891
|
*/
|
|
15509
|
-
|
|
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;
|
|
15510
15911
|
};
|
|
15511
15912
|
};
|
|
15512
15913
|
|
|
15513
|
-
export type
|
|
15514
|
-
|
|
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';
|
|
15515
15924
|
});
|
|
15516
15925
|
|
|
15517
|
-
export type
|
|
15926
|
+
export type SendSmsError = ({
|
|
15518
15927
|
error?: string;
|
|
15519
15928
|
} | unknown);
|
|
15520
15929
|
|
|
15521
|
-
export type
|
|
15930
|
+
export type LookupSmsNumberData = {
|
|
15522
15931
|
query: {
|
|
15523
15932
|
/**
|
|
15524
|
-
*
|
|
15933
|
+
* Number to look up (E.164; formatting is normalized).
|
|
15525
15934
|
*/
|
|
15526
|
-
|
|
15935
|
+
number: string;
|
|
15527
15936
|
};
|
|
15528
15937
|
};
|
|
15529
15938
|
|
|
15530
|
-
export type
|
|
15531
|
-
|
|
15939
|
+
export type LookupSmsNumberResponse = ({
|
|
15940
|
+
phoneNumber?: string;
|
|
15941
|
+
carrierName?: (string) | null;
|
|
15942
|
+
lineType?: 'mobile' | 'landline' | 'voip' | 'toll-free' | 'unknown';
|
|
15532
15943
|
/**
|
|
15533
|
-
*
|
|
15944
|
+
* True when the line type can receive SMS (not a landline).
|
|
15534
15945
|
*/
|
|
15535
|
-
|
|
15946
|
+
smsReachable?: boolean;
|
|
15536
15947
|
});
|
|
15537
15948
|
|
|
15538
|
-
export type
|
|
15949
|
+
export type LookupSmsNumberError = ({
|
|
15539
15950
|
error?: string;
|
|
15540
15951
|
} | unknown);
|
|
15541
15952
|
|
|
15542
|
-
export type
|
|
15543
|
-
query
|
|
15544
|
-
|
|
15545
|
-
|
|
15546
|
-
*/
|
|
15547
|
-
accountId: string;
|
|
15953
|
+
export type ListSmsOptOutsData = {
|
|
15954
|
+
query?: {
|
|
15955
|
+
format?: 'json' | 'csv';
|
|
15956
|
+
limit?: number;
|
|
15548
15957
|
};
|
|
15549
15958
|
};
|
|
15550
15959
|
|
|
15551
|
-
export type
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15960
|
+
export type ListSmsOptOutsResponse = ({
|
|
15961
|
+
optOuts?: Array<{
|
|
15962
|
+
phoneNumber?: string;
|
|
15963
|
+
optedOutAt?: (string) | null;
|
|
15555
15964
|
/**
|
|
15556
|
-
*
|
|
15965
|
+
* The keyword they sent (e.g. STOP), when the carrier recorded one.
|
|
15557
15966
|
*/
|
|
15558
|
-
|
|
15967
|
+
keyword?: (string) | null;
|
|
15559
15968
|
/**
|
|
15560
|
-
*
|
|
15969
|
+
* Which of your numbers the recipient opted out from.
|
|
15561
15970
|
*/
|
|
15562
|
-
|
|
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';
|
|
15563
15983
|
/**
|
|
15564
|
-
*
|
|
15984
|
+
* Your numbers this registration covers.
|
|
15565
15985
|
*/
|
|
15566
|
-
|
|
15567
|
-
|
|
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;
|
|
15568
15993
|
/**
|
|
15569
|
-
*
|
|
15994
|
+
* Legal company name. Required for every entityType except SOLE_PROPRIETOR.
|
|
15570
15995
|
*/
|
|
15571
|
-
|
|
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;
|
|
15572
16018
|
};
|
|
15573
16019
|
/**
|
|
15574
|
-
*
|
|
15575
|
-
*/
|
|
15576
|
-
status?: string;
|
|
15577
|
-
is_official_business_account?: boolean;
|
|
15578
|
-
/**
|
|
15579
|
-
* e.g. CLOUD_API
|
|
16020
|
+
* Required for 10DLC. What you'll send and how recipients opt in/out.
|
|
15580
16021
|
*/
|
|
15581
|
-
|
|
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
|
+
};
|
|
15582
16043
|
/**
|
|
15583
|
-
*
|
|
16044
|
+
* Required for toll_free.
|
|
15584
16045
|
*/
|
|
15585
|
-
|
|
15586
|
-
|
|
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;
|
|
15587
16084
|
};
|
|
15588
16085
|
};
|
|
15589
|
-
|
|
15590
|
-
|
|
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';
|
|
15591
16107
|
/**
|
|
15592
|
-
*
|
|
16108
|
+
* Carrier-registry brand status (e.g. VERIFIED).
|
|
15593
16109
|
*/
|
|
15594
|
-
|
|
16110
|
+
brandStatus?: string;
|
|
16111
|
+
campaignStatus?: string;
|
|
15595
16112
|
/**
|
|
15596
|
-
*
|
|
16113
|
+
* TCR brand id, useful when referencing the brand in carrier support threads.
|
|
15597
16114
|
*/
|
|
15598
|
-
|
|
15599
|
-
|
|
15600
|
-
|
|
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;
|
|
15601
16137
|
};
|
|
15602
|
-
}
|
|
16138
|
+
}>;
|
|
15603
16139
|
});
|
|
15604
16140
|
|
|
15605
|
-
export type
|
|
16141
|
+
export type ListSmsRegistrationsError = ({
|
|
15606
16142
|
error?: string;
|
|
15607
16143
|
});
|
|
15608
16144
|
|
|
15609
|
-
export type
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
/**
|
|
15613
|
-
* Consumer wa_id or E.164 phone (leading + optional)
|
|
15614
|
-
*/
|
|
15615
|
-
user: string;
|
|
16145
|
+
export type GetSmsRegistrationData = {
|
|
16146
|
+
path: {
|
|
16147
|
+
id: string;
|
|
15616
16148
|
};
|
|
15617
16149
|
};
|
|
15618
16150
|
|
|
15619
|
-
export type
|
|
15620
|
-
|
|
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;
|
|
15621
16160
|
});
|
|
15622
16161
|
|
|
15623
|
-
export type
|
|
16162
|
+
export type GetSmsRegistrationError = ({
|
|
15624
16163
|
error?: string;
|
|
15625
16164
|
} | unknown);
|
|
15626
16165
|
|
|
15627
|
-
export type
|
|
15628
|
-
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
/**
|
|
15634
|
-
* Cursor from a previous response's `nextCursor`.
|
|
15635
|
-
*/
|
|
15636
|
-
after?: string;
|
|
15637
|
-
/**
|
|
15638
|
-
* Page size.
|
|
15639
|
-
*/
|
|
15640
|
-
limit?: number;
|
|
16166
|
+
export type VerifySmsRegistrationOtpData = {
|
|
16167
|
+
body: {
|
|
16168
|
+
otpPin: string;
|
|
16169
|
+
};
|
|
16170
|
+
path: {
|
|
16171
|
+
id: string;
|
|
15641
16172
|
};
|
|
15642
16173
|
};
|
|
15643
16174
|
|
|
15644
|
-
export type
|
|
15645
|
-
|
|
15646
|
-
/**
|
|
15647
|
-
* WhatsApp user ID (usually the phone number without `+`).
|
|
15648
|
-
*/
|
|
15649
|
-
waId?: string;
|
|
15650
|
-
}>;
|
|
15651
|
-
/**
|
|
15652
|
-
* Pass as `after` to fetch the next page. Null when there are no more pages.
|
|
15653
|
-
*/
|
|
15654
|
-
nextCursor?: (string) | null;
|
|
16175
|
+
export type VerifySmsRegistrationOtpResponse = ({
|
|
16176
|
+
verified?: boolean;
|
|
15655
16177
|
});
|
|
15656
16178
|
|
|
15657
|
-
export type
|
|
16179
|
+
export type VerifySmsRegistrationOtpError = ({
|
|
15658
16180
|
error?: string;
|
|
15659
16181
|
} | unknown);
|
|
15660
16182
|
|
|
15661
|
-
export type
|
|
16183
|
+
export type AppealSmsRegistrationData = {
|
|
15662
16184
|
body: {
|
|
15663
|
-
|
|
15664
|
-
|
|
15665
|
-
|
|
15666
|
-
|
|
15667
|
-
/**
|
|
15668
|
-
* Phone numbers (E.164, e.g. "+16505551234") or WhatsApp user IDs to block.
|
|
15669
|
-
*/
|
|
15670
|
-
users: Array<(string)>;
|
|
16185
|
+
appealReason: string;
|
|
16186
|
+
};
|
|
16187
|
+
path: {
|
|
16188
|
+
id: string;
|
|
15671
16189
|
};
|
|
15672
16190
|
};
|
|
15673
16191
|
|
|
15674
|
-
export type
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
16192
|
+
export type AppealSmsRegistrationResponse = ({
|
|
16193
|
+
status?: 'pending';
|
|
16194
|
+
});
|
|
16195
|
+
|
|
16196
|
+
export type AppealSmsRegistrationError = (unknown | {
|
|
16197
|
+
error?: string;
|
|
16198
|
+
});
|
|
16199
|
+
|
|
16200
|
+
export type ShareSmsRegistrationData = {
|
|
16201
|
+
body: {
|
|
15683
16202
|
/**
|
|
15684
|
-
*
|
|
16203
|
+
* Your phone number's ID (from GET /v1/phone-numbers).
|
|
15685
16204
|
*/
|
|
15686
|
-
|
|
15687
|
-
}
|
|
15688
|
-
|
|
15689
|
-
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
errors?: Array<(string)>;
|
|
15694
|
-
}>;
|
|
16205
|
+
numberId: string;
|
|
16206
|
+
};
|
|
16207
|
+
};
|
|
16208
|
+
|
|
16209
|
+
export type ShareSmsRegistrationResponse = ({
|
|
16210
|
+
url?: string;
|
|
16211
|
+
expiresAt?: string;
|
|
15695
16212
|
});
|
|
15696
16213
|
|
|
15697
|
-
export type
|
|
16214
|
+
export type ShareSmsRegistrationError = ({
|
|
15698
16215
|
error?: string;
|
|
15699
16216
|
} | unknown);
|
|
15700
16217
|
|
|
15701
|
-
export type
|
|
15702
|
-
|
|
16218
|
+
export type GetWhatsAppLibraryTemplateData = {
|
|
16219
|
+
query: {
|
|
15703
16220
|
/**
|
|
15704
16221
|
* WhatsApp social account ID
|
|
15705
16222
|
*/
|
|
15706
16223
|
accountId: string;
|
|
15707
16224
|
/**
|
|
15708
|
-
*
|
|
16225
|
+
* Exact library template name
|
|
15709
16226
|
*/
|
|
15710
|
-
|
|
16227
|
+
name: string;
|
|
15711
16228
|
};
|
|
15712
16229
|
};
|
|
15713
16230
|
|
|
15714
|
-
export type
|
|
15715
|
-
|
|
15716
|
-
|
|
15717
|
-
|
|
15718
|
-
|
|
15719
|
-
|
|
15720
|
-
|
|
15721
|
-
|
|
15722
|
-
|
|
15723
|
-
|
|
15724
|
-
|
|
15725
|
-
|
|
15726
|
-
|
|
15727
|
-
|
|
15728
|
-
|
|
15729
|
-
* Users that could not be unblocked, with reasons.
|
|
15730
|
-
*/
|
|
15731
|
-
failed?: Array<{
|
|
15732
|
-
input?: string;
|
|
15733
|
-
errors?: Array<(string)>;
|
|
15734
|
-
}>;
|
|
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;
|
|
15735
16246
|
});
|
|
15736
16247
|
|
|
15737
|
-
export type
|
|
16248
|
+
export type GetWhatsAppLibraryTemplateError = (unknown | {
|
|
15738
16249
|
error?: string;
|
|
15739
|
-
}
|
|
16250
|
+
});
|
|
15740
16251
|
|
|
15741
|
-
export type
|
|
16252
|
+
export type GetWhatsAppBusinessProfileData = {
|
|
15742
16253
|
query: {
|
|
15743
16254
|
/**
|
|
15744
16255
|
* WhatsApp social account ID
|
|
@@ -15747,267 +16258,1570 @@ export type GetWhatsAppDatasetData = {
|
|
|
15747
16258
|
};
|
|
15748
16259
|
};
|
|
15749
16260
|
|
|
15750
|
-
export type
|
|
15751
|
-
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
|
|
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
|
+
};
|
|
15755
16281
|
});
|
|
15756
16282
|
|
|
15757
|
-
export type
|
|
16283
|
+
export type GetWhatsAppBusinessProfileError = (unknown | {
|
|
15758
16284
|
error?: string;
|
|
15759
|
-
}
|
|
16285
|
+
});
|
|
15760
16286
|
|
|
15761
|
-
export type
|
|
16287
|
+
export type UpdateWhatsAppBusinessProfileData = {
|
|
15762
16288
|
body: {
|
|
15763
16289
|
/**
|
|
15764
16290
|
* WhatsApp social account ID
|
|
15765
16291
|
*/
|
|
15766
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;
|
|
15767
17268
|
};
|
|
15768
17269
|
};
|
|
15769
17270
|
|
|
15770
|
-
export type
|
|
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;
|
|
15771
17295
|
/**
|
|
15772
|
-
*
|
|
17296
|
+
* Whether deliverable voice inventory exists right now.
|
|
15773
17297
|
*/
|
|
15774
|
-
|
|
17298
|
+
available?: boolean;
|
|
17299
|
+
addressConstraint?: 'geo' | 'country' | 'none';
|
|
15775
17300
|
/**
|
|
15776
|
-
*
|
|
17301
|
+
* For `geo` only — the area(s) the registered address must be in.
|
|
15777
17302
|
*/
|
|
15778
|
-
|
|
17303
|
+
areas?: Array<(string)>;
|
|
15779
17304
|
});
|
|
15780
17305
|
|
|
15781
|
-
export type
|
|
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
|
+
} | {
|
|
15782
17520
|
error?: string;
|
|
15783
|
-
}
|
|
17521
|
+
});
|
|
15784
17522
|
|
|
15785
|
-
export type
|
|
15786
|
-
|
|
17523
|
+
export type CreatePhoneNumberKycLinkData = {
|
|
17524
|
+
body: {
|
|
17525
|
+
profileId: string;
|
|
15787
17526
|
/**
|
|
15788
|
-
*
|
|
17527
|
+
* ISO 3166-1 alpha-2 country code (must be a regulated/KYC country).
|
|
15789
17528
|
*/
|
|
15790
|
-
|
|
17529
|
+
country: string;
|
|
15791
17530
|
/**
|
|
15792
|
-
*
|
|
15793
|
-
|
|
15794
|
-
|
|
15795
|
-
|
|
15796
|
-
|
|
15797
|
-
|
|
15798
|
-
|
|
15799
|
-
|
|
15800
|
-
|
|
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.
|
|
15801
17552
|
*
|
|
15802
17553
|
*/
|
|
15803
|
-
|
|
17554
|
+
redirect_url?: string;
|
|
15804
17555
|
};
|
|
15805
17556
|
};
|
|
15806
17557
|
|
|
15807
|
-
export type
|
|
15808
|
-
|
|
15809
|
-
|
|
15810
|
-
|
|
15811
|
-
|
|
15812
|
-
|
|
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: {
|
|
15813
17573
|
/**
|
|
15814
|
-
*
|
|
17574
|
+
* E.164 numbers to port in.
|
|
15815
17575
|
*/
|
|
15816
|
-
|
|
17576
|
+
phoneNumbers: Array<(string)>;
|
|
15817
17577
|
/**
|
|
15818
|
-
*
|
|
17578
|
+
* End-user / current-carrier account info that authorizes the port.
|
|
15819
17579
|
*/
|
|
15820
|
-
|
|
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
|
+
};
|
|
15821
17596
|
/**
|
|
15822
|
-
*
|
|
17597
|
+
* Document id from POST /v1/phone-numbers/port-in/documents (kind=loa).
|
|
15823
17598
|
*/
|
|
15824
|
-
|
|
15825
|
-
profileId?: {
|
|
15826
|
-
[key: string]: unknown;
|
|
15827
|
-
};
|
|
15828
|
-
provisionedAt?: string;
|
|
15829
|
-
metaPreverifiedId?: string;
|
|
15830
|
-
metaVerificationStatus?: string;
|
|
17599
|
+
loaDocumentId: string;
|
|
15831
17600
|
/**
|
|
15832
|
-
*
|
|
17601
|
+
* Document id from POST /v1/phone-numbers/port-in/documents (kind=invoice).
|
|
15833
17602
|
*/
|
|
15834
|
-
|
|
15835
|
-
endUserFirstName?: (string) | null;
|
|
15836
|
-
endUserLastName?: (string) | null;
|
|
17603
|
+
invoiceDocumentId: string;
|
|
15837
17604
|
/**
|
|
15838
|
-
*
|
|
17605
|
+
* Requested port date; the carrier confirms the actual FOC later.
|
|
15839
17606
|
*/
|
|
15840
|
-
|
|
15841
|
-
|
|
15842
|
-
}
|
|
17607
|
+
focDatetimeRequested?: string;
|
|
17608
|
+
customerReference?: string;
|
|
17609
|
+
};
|
|
17610
|
+
};
|
|
17611
|
+
|
|
17612
|
+
export type CreatePhoneNumberPortInResponse = ({
|
|
15843
17613
|
/**
|
|
15844
|
-
*
|
|
15845
|
-
* numbers linked via Embedded Signup. Not provisioned or billed
|
|
15846
|
-
* by Zernio, so they are not in `numbers`; `accountId` is the
|
|
15847
|
-
* social-account id used by the messaging and inbox endpoints.
|
|
15848
|
-
* Included only on the default and `status=active` views.
|
|
15849
|
-
*
|
|
17614
|
+
* Porting order ID.
|
|
15850
17615
|
*/
|
|
15851
|
-
|
|
15852
|
-
|
|
15853
|
-
|
|
15854
|
-
|
|
15855
|
-
|
|
15856
|
-
|
|
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;
|
|
15857
17629
|
}>;
|
|
15858
|
-
/**
|
|
15859
|
-
* The shared WhatsApp sandbox (one Zernio-owned number, all users test
|
|
15860
|
-
* against it). Present when the sandbox is configured; null otherwise.
|
|
15861
|
-
* The `accountId` lets you address the sandbox in compose endpoints.
|
|
15862
|
-
* `template` is the only template a sandbox send is allowed to use.
|
|
15863
|
-
*
|
|
15864
|
-
*/
|
|
15865
|
-
sandbox?: {
|
|
15866
|
-
phoneNumber?: string;
|
|
15867
|
-
accountId?: (string) | null;
|
|
15868
|
-
template?: {
|
|
15869
|
-
name?: string;
|
|
15870
|
-
language?: string;
|
|
15871
|
-
};
|
|
15872
|
-
isSandbox?: boolean;
|
|
15873
|
-
} | null;
|
|
15874
17630
|
});
|
|
15875
17631
|
|
|
15876
|
-
export type
|
|
17632
|
+
export type CreatePhoneNumberPortInError = ({
|
|
15877
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
|
+
}>;
|
|
15878
17653
|
});
|
|
15879
17654
|
|
|
15880
|
-
export type
|
|
17655
|
+
export type ListPhoneNumberPortInsError = ({
|
|
17656
|
+
error?: string;
|
|
17657
|
+
});
|
|
17658
|
+
|
|
17659
|
+
export type CheckPhoneNumberPortabilityData = {
|
|
15881
17660
|
body: {
|
|
15882
17661
|
/**
|
|
15883
|
-
*
|
|
17662
|
+
* E.164 numbers to check, e.g. +13035550000.
|
|
15884
17663
|
*/
|
|
15885
|
-
|
|
17664
|
+
phoneNumbers: Array<(string)>;
|
|
17665
|
+
};
|
|
17666
|
+
};
|
|
17667
|
+
|
|
17668
|
+
export type CheckPhoneNumberPortabilityResponse = ({
|
|
17669
|
+
results?: Array<{
|
|
17670
|
+
phoneNumber?: string;
|
|
17671
|
+
portable?: boolean;
|
|
15886
17672
|
/**
|
|
15887
|
-
*
|
|
15888
|
-
*
|
|
17673
|
+
* Qualifies for the carrier's accelerated FastPort lane.
|
|
15889
17674
|
*/
|
|
15890
|
-
|
|
17675
|
+
fastPortable?: boolean;
|
|
15891
17676
|
/**
|
|
15892
|
-
*
|
|
15893
|
-
*
|
|
17677
|
+
* Carrier reason when not portable; null when portable.
|
|
15894
17678
|
*/
|
|
15895
|
-
|
|
17679
|
+
notPortableReason?: (string) | null;
|
|
17680
|
+
}>;
|
|
17681
|
+
});
|
|
17682
|
+
|
|
17683
|
+
export type CheckPhoneNumberPortabilityError = ({
|
|
17684
|
+
error?: string;
|
|
17685
|
+
});
|
|
17686
|
+
|
|
17687
|
+
export type UploadPhoneNumberPortInDocumentData = {
|
|
17688
|
+
body: {
|
|
15896
17689
|
/**
|
|
15897
|
-
*
|
|
15898
|
-
*
|
|
17690
|
+
* The document (PDF/JPEG/PNG, 10MB max).
|
|
15899
17691
|
*/
|
|
15900
|
-
|
|
17692
|
+
file: (Blob | File);
|
|
17693
|
+
/**
|
|
17694
|
+
* Informational; used for the stored filename.
|
|
17695
|
+
*/
|
|
17696
|
+
kind?: 'loa' | 'invoice';
|
|
15901
17697
|
};
|
|
15902
17698
|
};
|
|
15903
17699
|
|
|
15904
|
-
export type
|
|
15905
|
-
|
|
15906
|
-
checkoutUrl?: string;
|
|
15907
|
-
} | {
|
|
15908
|
-
message?: string;
|
|
15909
|
-
phoneNumber?: {
|
|
15910
|
-
id?: string;
|
|
15911
|
-
phoneNumber?: string;
|
|
15912
|
-
status?: string;
|
|
15913
|
-
country?: string;
|
|
15914
|
-
provisionedAt?: string;
|
|
15915
|
-
metaPreverifiedId?: string;
|
|
15916
|
-
metaVerificationStatus?: string;
|
|
15917
|
-
};
|
|
15918
|
-
} | {
|
|
15919
|
-
status?: 'already_purchased';
|
|
15920
|
-
numberId?: string;
|
|
15921
|
-
phoneNumber?: string;
|
|
15922
|
-
}) | {
|
|
15923
|
-
status?: 'kyc_required';
|
|
15924
|
-
country?: string;
|
|
15925
|
-
kycUrl?: string;
|
|
17700
|
+
export type UploadPhoneNumberPortInDocumentResponse = ({
|
|
17701
|
+
documentId?: string;
|
|
15926
17702
|
});
|
|
15927
17703
|
|
|
15928
|
-
export type
|
|
15929
|
-
error?: string;
|
|
15930
|
-
} | {
|
|
17704
|
+
export type UploadPhoneNumberPortInDocumentError = (unknown | {
|
|
15931
17705
|
error?: string;
|
|
15932
|
-
code?: 'PURCHASE_VELOCITY';
|
|
15933
17706
|
});
|
|
15934
17707
|
|
|
15935
|
-
export type
|
|
15936
|
-
|
|
17708
|
+
export type CancelPhoneNumberPortInData = {
|
|
17709
|
+
path: {
|
|
15937
17710
|
/**
|
|
15938
|
-
*
|
|
17711
|
+
* Porting order ID (from the port-in list).
|
|
15939
17712
|
*/
|
|
15940
|
-
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
|
|
15944
|
-
|
|
15945
|
-
|
|
17713
|
+
id: string;
|
|
17714
|
+
};
|
|
17715
|
+
};
|
|
17716
|
+
|
|
17717
|
+
export type CancelPhoneNumberPortInResponse = ({
|
|
17718
|
+
id?: string;
|
|
17719
|
+
status?: 'draft' | 'pending' | 'foc_confirmed' | 'ported' | 'exception' | 'cancelled';
|
|
15946
17720
|
});
|
|
15947
17721
|
|
|
15948
|
-
export type
|
|
17722
|
+
export type CancelPhoneNumberPortInError = ({
|
|
15949
17723
|
error?: string;
|
|
15950
|
-
});
|
|
17724
|
+
} | unknown);
|
|
15951
17725
|
|
|
15952
|
-
export type
|
|
15953
|
-
|
|
17726
|
+
export type ReviewPhoneNumberKycPacketData = {
|
|
17727
|
+
body: {
|
|
17728
|
+
country: string;
|
|
17729
|
+
numberType: string;
|
|
15954
17730
|
/**
|
|
15955
|
-
*
|
|
17731
|
+
* requirementId to declared textual value.
|
|
15956
17732
|
*/
|
|
15957
|
-
|
|
15958
|
-
|
|
15959
|
-
|
|
17733
|
+
values?: {
|
|
17734
|
+
[key: string]: (string);
|
|
17735
|
+
};
|
|
15960
17736
|
/**
|
|
15961
|
-
*
|
|
17737
|
+
* Declared address (street_address, locality, ...), so a mismatched proof-of-address can be flagged.
|
|
15962
17738
|
*/
|
|
15963
|
-
|
|
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;
|
|
15964
17755
|
/**
|
|
15965
|
-
*
|
|
17756
|
+
* One short plain-language concern about that requirement's document.
|
|
15966
17757
|
*/
|
|
15967
|
-
|
|
17758
|
+
concern?: string;
|
|
17759
|
+
}>;
|
|
17760
|
+
});
|
|
17761
|
+
|
|
17762
|
+
export type ReviewPhoneNumberKycPacketError = ({
|
|
17763
|
+
error?: string;
|
|
17764
|
+
});
|
|
17765
|
+
|
|
17766
|
+
export type GetPhoneNumberRemediationData = {
|
|
17767
|
+
path: {
|
|
15968
17768
|
/**
|
|
15969
|
-
*
|
|
17769
|
+
* Phone number record ID.
|
|
15970
17770
|
*/
|
|
15971
|
-
|
|
17771
|
+
id: string;
|
|
15972
17772
|
};
|
|
15973
17773
|
};
|
|
15974
17774
|
|
|
15975
|
-
export type
|
|
17775
|
+
export type GetPhoneNumberRemediationResponse = ({
|
|
15976
17776
|
country?: string;
|
|
15977
17777
|
numberType?: string;
|
|
15978
|
-
|
|
15979
|
-
|
|
17778
|
+
declineReason?: (string) | null;
|
|
17779
|
+
/**
|
|
17780
|
+
* Same field shape as GET /v1/phone-numbers/kyc.
|
|
17781
|
+
*/
|
|
17782
|
+
fields?: Array<{
|
|
17783
|
+
[key: string]: unknown;
|
|
15980
17784
|
}>;
|
|
15981
17785
|
});
|
|
15982
17786
|
|
|
15983
|
-
export type
|
|
17787
|
+
export type GetPhoneNumberRemediationError = (unknown | {
|
|
15984
17788
|
error?: string;
|
|
15985
17789
|
});
|
|
15986
17790
|
|
|
15987
|
-
export type
|
|
15988
|
-
|
|
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
|
+
})>;
|
|
15989
17804
|
/**
|
|
15990
|
-
*
|
|
17805
|
+
* Same shape as the KYC submit address.
|
|
15991
17806
|
*/
|
|
15992
|
-
|
|
17807
|
+
address?: {
|
|
17808
|
+
[key: string]: unknown;
|
|
17809
|
+
};
|
|
17810
|
+
};
|
|
17811
|
+
path: {
|
|
17812
|
+
id: string;
|
|
15993
17813
|
};
|
|
15994
17814
|
};
|
|
15995
17815
|
|
|
15996
|
-
export type
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16000
|
-
|
|
16001
|
-
|
|
16002
|
-
available?: boolean;
|
|
16003
|
-
addressConstraint?: 'geo' | 'country' | 'none';
|
|
16004
|
-
/**
|
|
16005
|
-
* For `geo` only — the area(s) the registered address must be in.
|
|
16006
|
-
*/
|
|
16007
|
-
areas?: Array<(string)>;
|
|
17816
|
+
export type RemediatePhoneNumberResponse = ({
|
|
17817
|
+
status?: string;
|
|
17818
|
+
phoneNumber?: {
|
|
17819
|
+
id?: string;
|
|
17820
|
+
status?: string;
|
|
17821
|
+
};
|
|
16008
17822
|
});
|
|
16009
17823
|
|
|
16010
|
-
export type
|
|
17824
|
+
export type RemediatePhoneNumberError = (unknown | {
|
|
16011
17825
|
error?: string;
|
|
16012
17826
|
});
|
|
16013
17827
|
|
|
@@ -16339,6 +18153,312 @@ export type RemediateWhatsAppNumberError = (unknown | {
|
|
|
16339
18153
|
error?: string;
|
|
16340
18154
|
});
|
|
16341
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
|
+
|
|
16342
18462
|
export type GetWhatsAppPhoneNumberData = {
|
|
16343
18463
|
path: {
|
|
16344
18464
|
/**
|