@kirimdev/sdk 3.1.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +4 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +8 -1
- package/dist/client.js.map +1 -1
- package/dist/errors.js +16 -0
- package/dist/errors.js.map +1 -1
- package/dist/generated/schema.d.ts +1164 -102
- package/dist/generated/version.d.ts +2 -0
- package/dist/generated/version.d.ts.map +1 -0
- package/dist/generated/version.js +6 -0
- package/dist/generated/version.js.map +1 -0
- package/dist/generated/version.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/customers.d.ts +148 -0
- package/dist/resources/customers.d.ts.map +1 -0
- package/dist/resources/customers.js +96 -0
- package/dist/resources/customers.js.map +1 -0
- package/dist/resources/templates.d.ts +18 -0
- package/dist/resources/templates.d.ts.map +1 -1
- package/dist/resources/templates.js +16 -0
- package/dist/resources/templates.js.map +1 -1
- package/openapi.json +1754 -76
- package/package.json +1 -1
|
@@ -130,6 +130,7 @@ export interface paths {
|
|
|
130
130
|
parameters: {
|
|
131
131
|
query?: {
|
|
132
132
|
status?: "connected" | "all";
|
|
133
|
+
customer_id?: string;
|
|
133
134
|
};
|
|
134
135
|
header?: never;
|
|
135
136
|
path?: never;
|
|
@@ -297,7 +298,7 @@ export interface paths {
|
|
|
297
298
|
*
|
|
298
299
|
* **Read receipt** — body has `status: "read"` + `message_id` (the inbound wamid from your webhook). Sends a read receipt back to the sender so the double-tick turns blue on their phone. Optional `typing_indicator: { type: "text" }` shows a typing bubble alongside the receipt; Meta auto-dismisses after ~25 seconds or on first outbound message.
|
|
299
300
|
*
|
|
300
|
-
* **Pre-send validation** — the API performs compliance checks before queuing the send. A 422 response with `error.code` set to `marketing_opted_out` indicates the recipient has stopped marketing messages from your business (the customer did this via the WhatsApp app menu — webhook `user_preferences` notifies you of the change). `account_restricted` indicates Meta has restricted your WhatsApp account; check the account status via the dashboard. `consent_required` indicates the recipient has not opted in. `upstream_error` indicates the WhatsApp account is disconnected. None of these are retryable until the underlying condition changes.
|
|
301
|
+
* **Pre-send validation** — the API performs compliance checks before queuing the send. A 422 response with `error.code` set to `marketing_opted_out` indicates the recipient has stopped marketing messages from your business (the customer did this via the WhatsApp app menu — webhook `user_preferences` notifies you of the change). `account_restricted` indicates Meta has restricted your WhatsApp account; check the account status via the dashboard. `consent_required` indicates the recipient has not opted in. `customer_suspended` indicates the operator has suspended (or archived) the customer that owns this WhatsApp account; sends are blocked until the customer is unsuspended via the dashboard. `upstream_error` indicates the WhatsApp account is disconnected. None of these are retryable until the underlying condition changes.
|
|
301
302
|
*/
|
|
302
303
|
post: {
|
|
303
304
|
parameters: {
|
|
@@ -946,6 +947,111 @@ export interface paths {
|
|
|
946
947
|
patch?: never;
|
|
947
948
|
trace?: never;
|
|
948
949
|
};
|
|
950
|
+
"/{phone_number_id}/templates/sync": {
|
|
951
|
+
parameters: {
|
|
952
|
+
query?: never;
|
|
953
|
+
header?: never;
|
|
954
|
+
path?: never;
|
|
955
|
+
cookie?: never;
|
|
956
|
+
};
|
|
957
|
+
get?: never;
|
|
958
|
+
put?: never;
|
|
959
|
+
/**
|
|
960
|
+
* Sync templates from Meta
|
|
961
|
+
* @description Pull the latest template inventory from Meta and upsert into the Kirim DB for this WhatsApp account. Idempotent — call any time, returns a `{ created, updated, synced }` summary. Useful for platform integrations (multi-tenant Customers) so they don't need to wait for an operator to click "Sync" in the dashboard.
|
|
962
|
+
*/
|
|
963
|
+
post: {
|
|
964
|
+
parameters: {
|
|
965
|
+
query?: never;
|
|
966
|
+
header?: never;
|
|
967
|
+
path: {
|
|
968
|
+
/** @description Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). */
|
|
969
|
+
phone_number_id: string;
|
|
970
|
+
};
|
|
971
|
+
cookie?: never;
|
|
972
|
+
};
|
|
973
|
+
requestBody?: never;
|
|
974
|
+
responses: {
|
|
975
|
+
/** @description Sync summary */
|
|
976
|
+
200: {
|
|
977
|
+
headers: {
|
|
978
|
+
[name: string]: unknown;
|
|
979
|
+
};
|
|
980
|
+
content: {
|
|
981
|
+
"application/json": components["schemas"]["SyncTemplatesResponse"];
|
|
982
|
+
};
|
|
983
|
+
};
|
|
984
|
+
/** @description Validation failure */
|
|
985
|
+
400: {
|
|
986
|
+
headers: {
|
|
987
|
+
[name: string]: unknown;
|
|
988
|
+
};
|
|
989
|
+
content: {
|
|
990
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
991
|
+
};
|
|
992
|
+
};
|
|
993
|
+
/** @description Authentication failure */
|
|
994
|
+
401: {
|
|
995
|
+
headers: {
|
|
996
|
+
[name: string]: unknown;
|
|
997
|
+
};
|
|
998
|
+
content: {
|
|
999
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1000
|
+
};
|
|
1001
|
+
};
|
|
1002
|
+
/** @description Resource not found */
|
|
1003
|
+
404: {
|
|
1004
|
+
headers: {
|
|
1005
|
+
[name: string]: unknown;
|
|
1006
|
+
};
|
|
1007
|
+
content: {
|
|
1008
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
/** @description Semantic failure (e.g. idempotency key reuse) */
|
|
1012
|
+
422: {
|
|
1013
|
+
headers: {
|
|
1014
|
+
[name: string]: unknown;
|
|
1015
|
+
};
|
|
1016
|
+
content: {
|
|
1017
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1018
|
+
};
|
|
1019
|
+
};
|
|
1020
|
+
/** @description Rate limit exceeded */
|
|
1021
|
+
429: {
|
|
1022
|
+
headers: {
|
|
1023
|
+
[name: string]: unknown;
|
|
1024
|
+
};
|
|
1025
|
+
content: {
|
|
1026
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1027
|
+
};
|
|
1028
|
+
};
|
|
1029
|
+
/** @description Internal server error */
|
|
1030
|
+
500: {
|
|
1031
|
+
headers: {
|
|
1032
|
+
[name: string]: unknown;
|
|
1033
|
+
};
|
|
1034
|
+
content: {
|
|
1035
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1036
|
+
};
|
|
1037
|
+
};
|
|
1038
|
+
/** @description Upstream WhatsApp error */
|
|
1039
|
+
502: {
|
|
1040
|
+
headers: {
|
|
1041
|
+
[name: string]: unknown;
|
|
1042
|
+
};
|
|
1043
|
+
content: {
|
|
1044
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1045
|
+
};
|
|
1046
|
+
};
|
|
1047
|
+
};
|
|
1048
|
+
};
|
|
1049
|
+
delete?: never;
|
|
1050
|
+
options?: never;
|
|
1051
|
+
head?: never;
|
|
1052
|
+
patch?: never;
|
|
1053
|
+
trace?: never;
|
|
1054
|
+
};
|
|
949
1055
|
"/webhook_subscriptions": {
|
|
950
1056
|
parameters: {
|
|
951
1057
|
query?: never;
|
|
@@ -1032,7 +1138,7 @@ export interface paths {
|
|
|
1032
1138
|
/** Format: uri */
|
|
1033
1139
|
url: string;
|
|
1034
1140
|
description?: string;
|
|
1035
|
-
events: ("message.received" | "message.status" | "conversation.assigned" | "conversation.closed" | "contact.created" | "contact.updated")[];
|
|
1141
|
+
events: ("message.received" | "message.status" | "conversation.assigned" | "conversation.closed" | "contact.created" | "contact.updated" | "customer.created" | "customer.updated" | "customer.archived" | "customer.onboarded" | "customer.setup_link.created" | "customer.setup_link.consumed")[];
|
|
1036
1142
|
};
|
|
1037
1143
|
};
|
|
1038
1144
|
};
|
|
@@ -1265,7 +1371,7 @@ export interface paths {
|
|
|
1265
1371
|
/** Format: uri */
|
|
1266
1372
|
url?: string;
|
|
1267
1373
|
description?: string | null;
|
|
1268
|
-
events?: ("message.received" | "message.status" | "conversation.assigned" | "conversation.closed" | "contact.created" | "contact.updated")[];
|
|
1374
|
+
events?: ("message.received" | "message.status" | "conversation.assigned" | "conversation.closed" | "contact.created" | "contact.updated" | "customer.created" | "customer.updated" | "customer.archived" | "customer.onboarded" | "customer.setup_link.created" | "customer.setup_link.consumed")[];
|
|
1269
1375
|
/** @enum {string} */
|
|
1270
1376
|
status?: "active" | "paused";
|
|
1271
1377
|
};
|
|
@@ -1396,7 +1502,7 @@ export interface paths {
|
|
|
1396
1502
|
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1397
1503
|
};
|
|
1398
1504
|
};
|
|
1399
|
-
/** @description Conflict (e.g. webhook subscription disabled) */
|
|
1505
|
+
/** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
|
|
1400
1506
|
409: {
|
|
1401
1507
|
headers: {
|
|
1402
1508
|
[name: string]: unknown;
|
|
@@ -1756,7 +1862,7 @@ export interface paths {
|
|
|
1756
1862
|
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1757
1863
|
};
|
|
1758
1864
|
};
|
|
1759
|
-
/** @description Conflict (e.g. webhook subscription disabled) */
|
|
1865
|
+
/** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
|
|
1760
1866
|
409: {
|
|
1761
1867
|
headers: {
|
|
1762
1868
|
[name: string]: unknown;
|
|
@@ -1865,7 +1971,7 @@ export interface paths {
|
|
|
1865
1971
|
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
1866
1972
|
};
|
|
1867
1973
|
};
|
|
1868
|
-
/** @description Conflict (e.g. webhook subscription disabled) */
|
|
1974
|
+
/** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
|
|
1869
1975
|
409: {
|
|
1870
1976
|
headers: {
|
|
1871
1977
|
[name: string]: unknown;
|
|
@@ -3615,99 +3721,932 @@ export interface paths {
|
|
|
3615
3721
|
};
|
|
3616
3722
|
trace?: never;
|
|
3617
3723
|
};
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
/** @example invalid_request_error */
|
|
3625
|
-
type: string;
|
|
3626
|
-
/** @example invalid_phone_number */
|
|
3627
|
-
code: string;
|
|
3628
|
-
message: string;
|
|
3629
|
-
param?: string;
|
|
3630
|
-
/** @example req_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
3631
|
-
request_id: string;
|
|
3632
|
-
};
|
|
3724
|
+
"/customers": {
|
|
3725
|
+
parameters: {
|
|
3726
|
+
query?: never;
|
|
3727
|
+
header?: never;
|
|
3728
|
+
path?: never;
|
|
3729
|
+
cookie?: never;
|
|
3633
3730
|
};
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
code: string;
|
|
3650
|
-
message: string;
|
|
3651
|
-
provider_code: number | null;
|
|
3731
|
+
/**
|
|
3732
|
+
* List customers
|
|
3733
|
+
* @description List end-customers (tenant-of-tenant) attached to the organization. Each customer can own one or more WhatsApp accounts via setup links. NOTE: a customer here is NOT a WhatsApp contact — see the `/{phone_number_id}/contacts` resource for those.
|
|
3734
|
+
*/
|
|
3735
|
+
get: {
|
|
3736
|
+
parameters: {
|
|
3737
|
+
query?: {
|
|
3738
|
+
status?: "pending" | "active" | "suspended" | "archived";
|
|
3739
|
+
search?: string;
|
|
3740
|
+
limit?: string;
|
|
3741
|
+
cursor?: string;
|
|
3742
|
+
};
|
|
3743
|
+
header?: never;
|
|
3744
|
+
path?: never;
|
|
3745
|
+
cookie?: never;
|
|
3652
3746
|
};
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3747
|
+
requestBody?: never;
|
|
3748
|
+
responses: {
|
|
3749
|
+
/** @description Customer list */
|
|
3750
|
+
200: {
|
|
3751
|
+
headers: {
|
|
3752
|
+
[name: string]: unknown;
|
|
3753
|
+
};
|
|
3754
|
+
content: {
|
|
3755
|
+
"application/json": components["schemas"]["ListCustomersResponse"];
|
|
3756
|
+
};
|
|
3757
|
+
};
|
|
3758
|
+
/** @description Validation failure */
|
|
3759
|
+
400: {
|
|
3760
|
+
headers: {
|
|
3761
|
+
[name: string]: unknown;
|
|
3762
|
+
};
|
|
3763
|
+
content: {
|
|
3764
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3765
|
+
};
|
|
3766
|
+
};
|
|
3767
|
+
/** @description Authentication failure */
|
|
3768
|
+
401: {
|
|
3769
|
+
headers: {
|
|
3770
|
+
[name: string]: unknown;
|
|
3771
|
+
};
|
|
3772
|
+
content: {
|
|
3773
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3774
|
+
};
|
|
3775
|
+
};
|
|
3776
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
3777
|
+
402: {
|
|
3778
|
+
headers: {
|
|
3779
|
+
[name: string]: unknown;
|
|
3780
|
+
};
|
|
3781
|
+
content: {
|
|
3782
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3783
|
+
};
|
|
3784
|
+
};
|
|
3785
|
+
/** @description Rate limit exceeded */
|
|
3786
|
+
429: {
|
|
3787
|
+
headers: {
|
|
3788
|
+
[name: string]: unknown;
|
|
3789
|
+
};
|
|
3790
|
+
content: {
|
|
3791
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3792
|
+
};
|
|
3793
|
+
};
|
|
3794
|
+
/** @description Internal server error */
|
|
3795
|
+
500: {
|
|
3796
|
+
headers: {
|
|
3797
|
+
[name: string]: unknown;
|
|
3798
|
+
};
|
|
3799
|
+
content: {
|
|
3800
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3801
|
+
};
|
|
3802
|
+
};
|
|
3668
3803
|
};
|
|
3669
|
-
provider_template_id: string | null;
|
|
3670
|
-
/** Format: date-time */
|
|
3671
|
-
created_at: string;
|
|
3672
|
-
/** Format: date-time */
|
|
3673
|
-
updated_at: string;
|
|
3674
|
-
};
|
|
3675
|
-
Account: {
|
|
3676
|
-
/** @enum {string} */
|
|
3677
|
-
object: "account";
|
|
3678
|
-
/**
|
|
3679
|
-
* @description Meta WhatsApp Business `phone_number_id`. Use as the `{phone_number_id}` path parameter in `/v1/{phone_number_id}/...` endpoints. Nullable while onboarding is in flight.
|
|
3680
|
-
* @example 106540352242922
|
|
3681
|
-
*/
|
|
3682
|
-
phone_number_id: string | null;
|
|
3683
|
-
/** @example +628111222333 */
|
|
3684
|
-
phone_number: string | null;
|
|
3685
|
-
/** @example Customer Support */
|
|
3686
|
-
name: string | null;
|
|
3687
|
-
/**
|
|
3688
|
-
* @description Lifecycle state of the account (e.g. `connected`, `disconnected`, `degraded`, `onboarding`).
|
|
3689
|
-
* @example connected
|
|
3690
|
-
*/
|
|
3691
|
-
status: string;
|
|
3692
3804
|
};
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3805
|
+
put?: never;
|
|
3806
|
+
/**
|
|
3807
|
+
* Create a customer
|
|
3808
|
+
* @description Create a new end-customer. Starts in `pending` status; transitions to `active` when the first WhatsApp account is connected via a setup link.
|
|
3809
|
+
*/
|
|
3810
|
+
post: {
|
|
3811
|
+
parameters: {
|
|
3812
|
+
query?: never;
|
|
3813
|
+
header?: never;
|
|
3814
|
+
path?: never;
|
|
3815
|
+
cookie?: never;
|
|
3816
|
+
};
|
|
3817
|
+
requestBody?: {
|
|
3818
|
+
content: {
|
|
3819
|
+
"application/json": {
|
|
3820
|
+
team_id?: string;
|
|
3821
|
+
name: string;
|
|
3822
|
+
/** Format: email */
|
|
3823
|
+
email?: string;
|
|
3824
|
+
metadata?: {
|
|
3825
|
+
[key: string]: unknown;
|
|
3826
|
+
};
|
|
3827
|
+
};
|
|
3828
|
+
};
|
|
3829
|
+
};
|
|
3830
|
+
responses: {
|
|
3831
|
+
/** @description Customer created */
|
|
3832
|
+
200: {
|
|
3833
|
+
headers: {
|
|
3834
|
+
[name: string]: unknown;
|
|
3835
|
+
};
|
|
3836
|
+
content: {
|
|
3837
|
+
"application/json": components["schemas"]["CreateCustomerResponse"];
|
|
3838
|
+
};
|
|
3839
|
+
};
|
|
3840
|
+
/** @description Validation failure */
|
|
3841
|
+
400: {
|
|
3842
|
+
headers: {
|
|
3843
|
+
[name: string]: unknown;
|
|
3844
|
+
};
|
|
3845
|
+
content: {
|
|
3846
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3847
|
+
};
|
|
3848
|
+
};
|
|
3849
|
+
/** @description Authentication failure */
|
|
3850
|
+
401: {
|
|
3851
|
+
headers: {
|
|
3852
|
+
[name: string]: unknown;
|
|
3853
|
+
};
|
|
3854
|
+
content: {
|
|
3855
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3856
|
+
};
|
|
3857
|
+
};
|
|
3858
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
3859
|
+
402: {
|
|
3860
|
+
headers: {
|
|
3861
|
+
[name: string]: unknown;
|
|
3862
|
+
};
|
|
3863
|
+
content: {
|
|
3864
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3865
|
+
};
|
|
3866
|
+
};
|
|
3867
|
+
/** @description Rate limit exceeded */
|
|
3868
|
+
429: {
|
|
3869
|
+
headers: {
|
|
3870
|
+
[name: string]: unknown;
|
|
3871
|
+
};
|
|
3872
|
+
content: {
|
|
3873
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3874
|
+
};
|
|
3875
|
+
};
|
|
3876
|
+
/** @description Internal server error */
|
|
3877
|
+
500: {
|
|
3878
|
+
headers: {
|
|
3879
|
+
[name: string]: unknown;
|
|
3880
|
+
};
|
|
3881
|
+
content: {
|
|
3882
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3883
|
+
};
|
|
3884
|
+
};
|
|
3885
|
+
};
|
|
3886
|
+
};
|
|
3887
|
+
delete?: never;
|
|
3888
|
+
options?: never;
|
|
3889
|
+
head?: never;
|
|
3890
|
+
patch?: never;
|
|
3891
|
+
trace?: never;
|
|
3892
|
+
};
|
|
3893
|
+
"/customers/{id}": {
|
|
3894
|
+
parameters: {
|
|
3895
|
+
query?: never;
|
|
3896
|
+
header?: never;
|
|
3897
|
+
path?: never;
|
|
3898
|
+
cookie?: never;
|
|
3899
|
+
};
|
|
3900
|
+
/** Fetch a customer by id */
|
|
3901
|
+
get: {
|
|
3902
|
+
parameters: {
|
|
3903
|
+
query?: never;
|
|
3904
|
+
header?: never;
|
|
3905
|
+
path: {
|
|
3906
|
+
id: string;
|
|
3907
|
+
};
|
|
3908
|
+
cookie?: never;
|
|
3909
|
+
};
|
|
3910
|
+
requestBody?: never;
|
|
3911
|
+
responses: {
|
|
3912
|
+
/** @description Customer resource (includes attached WhatsApp accounts) */
|
|
3913
|
+
200: {
|
|
3914
|
+
headers: {
|
|
3915
|
+
[name: string]: unknown;
|
|
3916
|
+
};
|
|
3917
|
+
content: {
|
|
3918
|
+
"application/json": components["schemas"]["GetCustomerResponse"];
|
|
3919
|
+
};
|
|
3920
|
+
};
|
|
3921
|
+
/** @description Validation failure */
|
|
3922
|
+
400: {
|
|
3923
|
+
headers: {
|
|
3924
|
+
[name: string]: unknown;
|
|
3925
|
+
};
|
|
3926
|
+
content: {
|
|
3927
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3928
|
+
};
|
|
3929
|
+
};
|
|
3930
|
+
/** @description Authentication failure */
|
|
3931
|
+
401: {
|
|
3932
|
+
headers: {
|
|
3933
|
+
[name: string]: unknown;
|
|
3934
|
+
};
|
|
3935
|
+
content: {
|
|
3936
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3937
|
+
};
|
|
3938
|
+
};
|
|
3939
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
3940
|
+
402: {
|
|
3941
|
+
headers: {
|
|
3942
|
+
[name: string]: unknown;
|
|
3943
|
+
};
|
|
3944
|
+
content: {
|
|
3945
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3946
|
+
};
|
|
3947
|
+
};
|
|
3948
|
+
/** @description Resource not found */
|
|
3949
|
+
404: {
|
|
3950
|
+
headers: {
|
|
3951
|
+
[name: string]: unknown;
|
|
3952
|
+
};
|
|
3953
|
+
content: {
|
|
3954
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3955
|
+
};
|
|
3956
|
+
};
|
|
3957
|
+
/** @description Rate limit exceeded */
|
|
3958
|
+
429: {
|
|
3959
|
+
headers: {
|
|
3960
|
+
[name: string]: unknown;
|
|
3961
|
+
};
|
|
3962
|
+
content: {
|
|
3963
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3964
|
+
};
|
|
3965
|
+
};
|
|
3966
|
+
/** @description Internal server error */
|
|
3967
|
+
500: {
|
|
3968
|
+
headers: {
|
|
3969
|
+
[name: string]: unknown;
|
|
3970
|
+
};
|
|
3971
|
+
content: {
|
|
3972
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
3973
|
+
};
|
|
3974
|
+
};
|
|
3975
|
+
};
|
|
3976
|
+
};
|
|
3977
|
+
put?: never;
|
|
3978
|
+
post?: never;
|
|
3979
|
+
/**
|
|
3980
|
+
* Archive a customer
|
|
3981
|
+
* @description Soft-archives the customer. WhatsApp accounts previously assigned remain in the database with `customer_id` unchanged — message history is never destroyed.
|
|
3982
|
+
*/
|
|
3983
|
+
delete: {
|
|
3984
|
+
parameters: {
|
|
3985
|
+
query?: never;
|
|
3986
|
+
header?: never;
|
|
3987
|
+
path: {
|
|
3988
|
+
id: string;
|
|
3989
|
+
};
|
|
3990
|
+
cookie?: never;
|
|
3991
|
+
};
|
|
3992
|
+
requestBody?: never;
|
|
3993
|
+
responses: {
|
|
3994
|
+
/** @description Archived */
|
|
3995
|
+
200: {
|
|
3996
|
+
headers: {
|
|
3997
|
+
[name: string]: unknown;
|
|
3998
|
+
};
|
|
3999
|
+
content: {
|
|
4000
|
+
"application/json": components["schemas"]["ArchiveCustomerResponse"];
|
|
4001
|
+
};
|
|
4002
|
+
};
|
|
4003
|
+
/** @description Validation failure */
|
|
4004
|
+
400: {
|
|
4005
|
+
headers: {
|
|
4006
|
+
[name: string]: unknown;
|
|
4007
|
+
};
|
|
4008
|
+
content: {
|
|
4009
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4010
|
+
};
|
|
4011
|
+
};
|
|
4012
|
+
/** @description Authentication failure */
|
|
4013
|
+
401: {
|
|
4014
|
+
headers: {
|
|
4015
|
+
[name: string]: unknown;
|
|
4016
|
+
};
|
|
4017
|
+
content: {
|
|
4018
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4019
|
+
};
|
|
4020
|
+
};
|
|
4021
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
4022
|
+
402: {
|
|
4023
|
+
headers: {
|
|
4024
|
+
[name: string]: unknown;
|
|
4025
|
+
};
|
|
4026
|
+
content: {
|
|
4027
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4028
|
+
};
|
|
4029
|
+
};
|
|
4030
|
+
/** @description Resource not found */
|
|
4031
|
+
404: {
|
|
4032
|
+
headers: {
|
|
4033
|
+
[name: string]: unknown;
|
|
4034
|
+
};
|
|
4035
|
+
content: {
|
|
4036
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4037
|
+
};
|
|
4038
|
+
};
|
|
4039
|
+
/** @description Rate limit exceeded */
|
|
4040
|
+
429: {
|
|
4041
|
+
headers: {
|
|
4042
|
+
[name: string]: unknown;
|
|
4043
|
+
};
|
|
4044
|
+
content: {
|
|
4045
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4046
|
+
};
|
|
4047
|
+
};
|
|
4048
|
+
/** @description Internal server error */
|
|
4049
|
+
500: {
|
|
4050
|
+
headers: {
|
|
4051
|
+
[name: string]: unknown;
|
|
4052
|
+
};
|
|
4053
|
+
content: {
|
|
4054
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4055
|
+
};
|
|
4056
|
+
};
|
|
4057
|
+
};
|
|
4058
|
+
};
|
|
4059
|
+
options?: never;
|
|
4060
|
+
head?: never;
|
|
4061
|
+
/** Update a customer */
|
|
4062
|
+
patch: {
|
|
4063
|
+
parameters: {
|
|
4064
|
+
query?: never;
|
|
4065
|
+
header?: never;
|
|
4066
|
+
path: {
|
|
4067
|
+
id: string;
|
|
4068
|
+
};
|
|
4069
|
+
cookie?: never;
|
|
4070
|
+
};
|
|
4071
|
+
requestBody?: {
|
|
4072
|
+
content: {
|
|
4073
|
+
"application/json": {
|
|
4074
|
+
name?: string;
|
|
4075
|
+
/** Format: email */
|
|
4076
|
+
email?: string | null;
|
|
4077
|
+
metadata?: {
|
|
4078
|
+
[key: string]: unknown;
|
|
4079
|
+
} | null;
|
|
4080
|
+
/** @enum {string} */
|
|
4081
|
+
status?: "pending" | "active" | "suspended";
|
|
4082
|
+
};
|
|
4083
|
+
};
|
|
4084
|
+
};
|
|
4085
|
+
responses: {
|
|
4086
|
+
/** @description Updated customer */
|
|
4087
|
+
200: {
|
|
4088
|
+
headers: {
|
|
4089
|
+
[name: string]: unknown;
|
|
4090
|
+
};
|
|
4091
|
+
content: {
|
|
4092
|
+
"application/json": components["schemas"]["UpdateCustomerResponse"];
|
|
4093
|
+
};
|
|
4094
|
+
};
|
|
4095
|
+
/** @description Validation failure */
|
|
4096
|
+
400: {
|
|
4097
|
+
headers: {
|
|
4098
|
+
[name: string]: unknown;
|
|
4099
|
+
};
|
|
4100
|
+
content: {
|
|
4101
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4102
|
+
};
|
|
4103
|
+
};
|
|
4104
|
+
/** @description Authentication failure */
|
|
4105
|
+
401: {
|
|
4106
|
+
headers: {
|
|
4107
|
+
[name: string]: unknown;
|
|
4108
|
+
};
|
|
4109
|
+
content: {
|
|
4110
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4111
|
+
};
|
|
4112
|
+
};
|
|
4113
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
4114
|
+
402: {
|
|
4115
|
+
headers: {
|
|
4116
|
+
[name: string]: unknown;
|
|
4117
|
+
};
|
|
4118
|
+
content: {
|
|
4119
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4120
|
+
};
|
|
4121
|
+
};
|
|
4122
|
+
/** @description Resource not found */
|
|
4123
|
+
404: {
|
|
4124
|
+
headers: {
|
|
4125
|
+
[name: string]: unknown;
|
|
4126
|
+
};
|
|
4127
|
+
content: {
|
|
4128
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4129
|
+
};
|
|
4130
|
+
};
|
|
4131
|
+
/** @description Rate limit exceeded */
|
|
4132
|
+
429: {
|
|
4133
|
+
headers: {
|
|
4134
|
+
[name: string]: unknown;
|
|
4135
|
+
};
|
|
4136
|
+
content: {
|
|
4137
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4138
|
+
};
|
|
4139
|
+
};
|
|
4140
|
+
/** @description Internal server error */
|
|
4141
|
+
500: {
|
|
4142
|
+
headers: {
|
|
4143
|
+
[name: string]: unknown;
|
|
4144
|
+
};
|
|
4145
|
+
content: {
|
|
4146
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4147
|
+
};
|
|
4148
|
+
};
|
|
4149
|
+
};
|
|
4150
|
+
};
|
|
4151
|
+
trace?: never;
|
|
4152
|
+
};
|
|
4153
|
+
"/customers/{id}/setup_links": {
|
|
4154
|
+
parameters: {
|
|
4155
|
+
query?: never;
|
|
4156
|
+
header?: never;
|
|
4157
|
+
path?: never;
|
|
4158
|
+
cookie?: never;
|
|
4159
|
+
};
|
|
4160
|
+
/**
|
|
4161
|
+
* List setup links for a customer
|
|
4162
|
+
* @description Returns up to the 50 most-recent setup links — token plaintext is NEVER returned here (only at create time). Optional `status` query filters to `active` / `consumed` / `expired` / `revoked`.
|
|
4163
|
+
*/
|
|
4164
|
+
get: {
|
|
4165
|
+
parameters: {
|
|
4166
|
+
query?: {
|
|
4167
|
+
status?: "active" | "consumed" | "expired" | "revoked";
|
|
4168
|
+
};
|
|
4169
|
+
header?: never;
|
|
4170
|
+
path: {
|
|
4171
|
+
id: string;
|
|
4172
|
+
};
|
|
4173
|
+
cookie?: never;
|
|
4174
|
+
};
|
|
4175
|
+
requestBody?: never;
|
|
4176
|
+
responses: {
|
|
4177
|
+
/** @description Setup link list */
|
|
4178
|
+
200: {
|
|
4179
|
+
headers: {
|
|
4180
|
+
[name: string]: unknown;
|
|
4181
|
+
};
|
|
4182
|
+
content: {
|
|
4183
|
+
"application/json": components["schemas"]["ListCustomerSetupLinksResponse"];
|
|
4184
|
+
};
|
|
4185
|
+
};
|
|
4186
|
+
/** @description Validation failure */
|
|
4187
|
+
400: {
|
|
4188
|
+
headers: {
|
|
4189
|
+
[name: string]: unknown;
|
|
4190
|
+
};
|
|
4191
|
+
content: {
|
|
4192
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4193
|
+
};
|
|
4194
|
+
};
|
|
4195
|
+
/** @description Authentication failure */
|
|
4196
|
+
401: {
|
|
4197
|
+
headers: {
|
|
4198
|
+
[name: string]: unknown;
|
|
4199
|
+
};
|
|
4200
|
+
content: {
|
|
4201
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4202
|
+
};
|
|
4203
|
+
};
|
|
4204
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
4205
|
+
402: {
|
|
4206
|
+
headers: {
|
|
4207
|
+
[name: string]: unknown;
|
|
4208
|
+
};
|
|
4209
|
+
content: {
|
|
4210
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4211
|
+
};
|
|
4212
|
+
};
|
|
4213
|
+
/** @description Resource not found */
|
|
4214
|
+
404: {
|
|
4215
|
+
headers: {
|
|
4216
|
+
[name: string]: unknown;
|
|
4217
|
+
};
|
|
4218
|
+
content: {
|
|
4219
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4220
|
+
};
|
|
4221
|
+
};
|
|
4222
|
+
/** @description Rate limit exceeded */
|
|
4223
|
+
429: {
|
|
4224
|
+
headers: {
|
|
4225
|
+
[name: string]: unknown;
|
|
4226
|
+
};
|
|
4227
|
+
content: {
|
|
4228
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4229
|
+
};
|
|
4230
|
+
};
|
|
4231
|
+
/** @description Internal server error */
|
|
4232
|
+
500: {
|
|
4233
|
+
headers: {
|
|
4234
|
+
[name: string]: unknown;
|
|
4235
|
+
};
|
|
4236
|
+
content: {
|
|
4237
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4238
|
+
};
|
|
4239
|
+
};
|
|
4240
|
+
};
|
|
4241
|
+
};
|
|
4242
|
+
put?: never;
|
|
4243
|
+
/**
|
|
4244
|
+
* Generate a setup link
|
|
4245
|
+
* @description Creates a one-time setup link the end-customer can use to complete Meta Embedded Signup. The plaintext token and full setup URL are returned EXACTLY ONCE — store them immediately.
|
|
4246
|
+
*/
|
|
4247
|
+
post: {
|
|
4248
|
+
parameters: {
|
|
4249
|
+
query?: never;
|
|
4250
|
+
header?: never;
|
|
4251
|
+
path: {
|
|
4252
|
+
id: string;
|
|
4253
|
+
};
|
|
4254
|
+
cookie?: never;
|
|
4255
|
+
};
|
|
4256
|
+
requestBody?: {
|
|
4257
|
+
content: {
|
|
4258
|
+
"application/json": {
|
|
4259
|
+
expires_in_hours?: number;
|
|
4260
|
+
/** Format: uri */
|
|
4261
|
+
success_redirect_url?: string;
|
|
4262
|
+
/** Format: uri */
|
|
4263
|
+
failure_redirect_url?: string;
|
|
4264
|
+
};
|
|
4265
|
+
};
|
|
4266
|
+
};
|
|
4267
|
+
responses: {
|
|
4268
|
+
/** @description Setup link created (token returned ONCE) */
|
|
4269
|
+
200: {
|
|
4270
|
+
headers: {
|
|
4271
|
+
[name: string]: unknown;
|
|
4272
|
+
};
|
|
4273
|
+
content: {
|
|
4274
|
+
"application/json": components["schemas"]["CreateCustomerSetupLinkResponse"];
|
|
4275
|
+
};
|
|
4276
|
+
};
|
|
4277
|
+
/** @description Validation failure */
|
|
4278
|
+
400: {
|
|
4279
|
+
headers: {
|
|
4280
|
+
[name: string]: unknown;
|
|
4281
|
+
};
|
|
4282
|
+
content: {
|
|
4283
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4284
|
+
};
|
|
4285
|
+
};
|
|
4286
|
+
/** @description Authentication failure */
|
|
4287
|
+
401: {
|
|
4288
|
+
headers: {
|
|
4289
|
+
[name: string]: unknown;
|
|
4290
|
+
};
|
|
4291
|
+
content: {
|
|
4292
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4293
|
+
};
|
|
4294
|
+
};
|
|
4295
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
4296
|
+
402: {
|
|
4297
|
+
headers: {
|
|
4298
|
+
[name: string]: unknown;
|
|
4299
|
+
};
|
|
4300
|
+
content: {
|
|
4301
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4302
|
+
};
|
|
4303
|
+
};
|
|
4304
|
+
/** @description Resource not found */
|
|
4305
|
+
404: {
|
|
4306
|
+
headers: {
|
|
4307
|
+
[name: string]: unknown;
|
|
4308
|
+
};
|
|
4309
|
+
content: {
|
|
4310
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4311
|
+
};
|
|
4312
|
+
};
|
|
4313
|
+
/** @description Rate limit exceeded */
|
|
4314
|
+
429: {
|
|
4315
|
+
headers: {
|
|
4316
|
+
[name: string]: unknown;
|
|
4317
|
+
};
|
|
4318
|
+
content: {
|
|
4319
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4320
|
+
};
|
|
4321
|
+
};
|
|
4322
|
+
/** @description Internal server error */
|
|
4323
|
+
500: {
|
|
4324
|
+
headers: {
|
|
4325
|
+
[name: string]: unknown;
|
|
4326
|
+
};
|
|
4327
|
+
content: {
|
|
4328
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4329
|
+
};
|
|
4330
|
+
};
|
|
4331
|
+
};
|
|
4332
|
+
};
|
|
4333
|
+
delete?: never;
|
|
4334
|
+
options?: never;
|
|
4335
|
+
head?: never;
|
|
4336
|
+
patch?: never;
|
|
4337
|
+
trace?: never;
|
|
4338
|
+
};
|
|
4339
|
+
"/customers/{id}/setup_links/{link_id}": {
|
|
4340
|
+
parameters: {
|
|
4341
|
+
query?: never;
|
|
4342
|
+
header?: never;
|
|
4343
|
+
path?: never;
|
|
4344
|
+
cookie?: never;
|
|
4345
|
+
};
|
|
4346
|
+
get?: never;
|
|
4347
|
+
put?: never;
|
|
4348
|
+
post?: never;
|
|
4349
|
+
/**
|
|
4350
|
+
* Revoke a setup link
|
|
4351
|
+
* @description Revoke a still-active link. Already-consumed or already-revoked links return `409`.
|
|
4352
|
+
*/
|
|
4353
|
+
delete: {
|
|
4354
|
+
parameters: {
|
|
4355
|
+
query?: never;
|
|
4356
|
+
header?: never;
|
|
4357
|
+
path: {
|
|
4358
|
+
id: string;
|
|
4359
|
+
link_id: string;
|
|
4360
|
+
};
|
|
4361
|
+
cookie?: never;
|
|
4362
|
+
};
|
|
4363
|
+
requestBody?: never;
|
|
4364
|
+
responses: {
|
|
4365
|
+
/** @description Revoked */
|
|
4366
|
+
200: {
|
|
4367
|
+
headers: {
|
|
4368
|
+
[name: string]: unknown;
|
|
4369
|
+
};
|
|
4370
|
+
content: {
|
|
4371
|
+
"application/json": components["schemas"]["RevokeCustomerSetupLinkResponse"];
|
|
4372
|
+
};
|
|
4373
|
+
};
|
|
4374
|
+
/** @description Validation failure */
|
|
4375
|
+
400: {
|
|
4376
|
+
headers: {
|
|
4377
|
+
[name: string]: unknown;
|
|
4378
|
+
};
|
|
4379
|
+
content: {
|
|
4380
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4381
|
+
};
|
|
4382
|
+
};
|
|
4383
|
+
/** @description Authentication failure */
|
|
4384
|
+
401: {
|
|
4385
|
+
headers: {
|
|
4386
|
+
[name: string]: unknown;
|
|
4387
|
+
};
|
|
4388
|
+
content: {
|
|
4389
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4390
|
+
};
|
|
4391
|
+
};
|
|
4392
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
4393
|
+
402: {
|
|
4394
|
+
headers: {
|
|
4395
|
+
[name: string]: unknown;
|
|
4396
|
+
};
|
|
4397
|
+
content: {
|
|
4398
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4399
|
+
};
|
|
4400
|
+
};
|
|
4401
|
+
/** @description Resource not found */
|
|
4402
|
+
404: {
|
|
4403
|
+
headers: {
|
|
4404
|
+
[name: string]: unknown;
|
|
4405
|
+
};
|
|
4406
|
+
content: {
|
|
4407
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4408
|
+
};
|
|
4409
|
+
};
|
|
4410
|
+
/** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
|
|
4411
|
+
409: {
|
|
4412
|
+
headers: {
|
|
4413
|
+
[name: string]: unknown;
|
|
4414
|
+
};
|
|
4415
|
+
content: {
|
|
4416
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4417
|
+
};
|
|
4418
|
+
};
|
|
4419
|
+
/** @description Rate limit exceeded */
|
|
4420
|
+
429: {
|
|
4421
|
+
headers: {
|
|
4422
|
+
[name: string]: unknown;
|
|
4423
|
+
};
|
|
4424
|
+
content: {
|
|
4425
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4426
|
+
};
|
|
4427
|
+
};
|
|
4428
|
+
/** @description Internal server error */
|
|
4429
|
+
500: {
|
|
4430
|
+
headers: {
|
|
4431
|
+
[name: string]: unknown;
|
|
4432
|
+
};
|
|
4433
|
+
content: {
|
|
4434
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4435
|
+
};
|
|
4436
|
+
};
|
|
4437
|
+
};
|
|
4438
|
+
};
|
|
4439
|
+
options?: never;
|
|
4440
|
+
head?: never;
|
|
4441
|
+
/**
|
|
4442
|
+
* Update redirect URLs on an active setup link
|
|
4443
|
+
* @description Recover from a typo in `success_redirect_url` / `failure_redirect_url` without revoking and regenerating the link. Only works while `status = active`; pass `null` to clear a redirect.
|
|
4444
|
+
*/
|
|
4445
|
+
patch: {
|
|
4446
|
+
parameters: {
|
|
4447
|
+
query?: never;
|
|
4448
|
+
header?: never;
|
|
4449
|
+
path: {
|
|
4450
|
+
id: string;
|
|
4451
|
+
link_id: string;
|
|
4452
|
+
};
|
|
4453
|
+
cookie?: never;
|
|
4454
|
+
};
|
|
4455
|
+
requestBody?: {
|
|
4456
|
+
content: {
|
|
4457
|
+
"application/json": {
|
|
4458
|
+
success_redirect_url?: string | null;
|
|
4459
|
+
failure_redirect_url?: string | null;
|
|
4460
|
+
};
|
|
4461
|
+
};
|
|
4462
|
+
};
|
|
4463
|
+
responses: {
|
|
4464
|
+
/** @description Updated setup link */
|
|
4465
|
+
200: {
|
|
4466
|
+
headers: {
|
|
4467
|
+
[name: string]: unknown;
|
|
4468
|
+
};
|
|
4469
|
+
content: {
|
|
4470
|
+
"application/json": components["schemas"]["UpdateCustomerSetupLinkResponse"];
|
|
4471
|
+
};
|
|
4472
|
+
};
|
|
4473
|
+
/** @description Validation failure */
|
|
4474
|
+
400: {
|
|
4475
|
+
headers: {
|
|
4476
|
+
[name: string]: unknown;
|
|
4477
|
+
};
|
|
4478
|
+
content: {
|
|
4479
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4480
|
+
};
|
|
4481
|
+
};
|
|
4482
|
+
/** @description Authentication failure */
|
|
4483
|
+
401: {
|
|
4484
|
+
headers: {
|
|
4485
|
+
[name: string]: unknown;
|
|
4486
|
+
};
|
|
4487
|
+
content: {
|
|
4488
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4489
|
+
};
|
|
4490
|
+
};
|
|
4491
|
+
/** @description Plan / quota / subscription gate (e.g. feature_not_entitled, quota_exceeded, subscription_inactive) */
|
|
4492
|
+
402: {
|
|
4493
|
+
headers: {
|
|
4494
|
+
[name: string]: unknown;
|
|
4495
|
+
};
|
|
4496
|
+
content: {
|
|
4497
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4498
|
+
};
|
|
4499
|
+
};
|
|
4500
|
+
/** @description Resource not found */
|
|
4501
|
+
404: {
|
|
4502
|
+
headers: {
|
|
4503
|
+
[name: string]: unknown;
|
|
4504
|
+
};
|
|
4505
|
+
content: {
|
|
4506
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4507
|
+
};
|
|
4508
|
+
};
|
|
4509
|
+
/** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
|
|
4510
|
+
409: {
|
|
4511
|
+
headers: {
|
|
4512
|
+
[name: string]: unknown;
|
|
4513
|
+
};
|
|
4514
|
+
content: {
|
|
4515
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4516
|
+
};
|
|
4517
|
+
};
|
|
4518
|
+
/** @description Rate limit exceeded */
|
|
4519
|
+
429: {
|
|
4520
|
+
headers: {
|
|
4521
|
+
[name: string]: unknown;
|
|
4522
|
+
};
|
|
4523
|
+
content: {
|
|
4524
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4525
|
+
};
|
|
4526
|
+
};
|
|
4527
|
+
/** @description Internal server error */
|
|
4528
|
+
500: {
|
|
4529
|
+
headers: {
|
|
4530
|
+
[name: string]: unknown;
|
|
4531
|
+
};
|
|
4532
|
+
content: {
|
|
4533
|
+
"application/json": components["schemas"]["ApiErrorEnvelope"];
|
|
4534
|
+
};
|
|
4535
|
+
};
|
|
4536
|
+
};
|
|
4537
|
+
};
|
|
4538
|
+
trace?: never;
|
|
4539
|
+
};
|
|
4540
|
+
}
|
|
4541
|
+
export type webhooks = Record<string, never>;
|
|
4542
|
+
export interface components {
|
|
4543
|
+
schemas: {
|
|
4544
|
+
ApiErrorEnvelope: {
|
|
4545
|
+
error: {
|
|
4546
|
+
/** @example invalid_request_error */
|
|
4547
|
+
type: string;
|
|
4548
|
+
/** @example invalid_phone_number */
|
|
4549
|
+
code: string;
|
|
4550
|
+
message: string;
|
|
4551
|
+
param?: string;
|
|
4552
|
+
/** @example req_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
4553
|
+
request_id: string;
|
|
4554
|
+
};
|
|
4555
|
+
};
|
|
4556
|
+
WhatsappAccountEmbedded: {
|
|
4557
|
+
phone_number: string | null;
|
|
4558
|
+
/**
|
|
4559
|
+
* @description Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints.
|
|
4560
|
+
* @example 106540352242922
|
|
4561
|
+
*/
|
|
4562
|
+
phone_number_id: string | null;
|
|
4563
|
+
/** @description End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. */
|
|
4564
|
+
customer: {
|
|
4565
|
+
/** @example cus_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
4566
|
+
id: string;
|
|
4567
|
+
name: string;
|
|
4568
|
+
} | null;
|
|
4569
|
+
};
|
|
4570
|
+
Message: {
|
|
4571
|
+
/** @example msg_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
4572
|
+
id: string;
|
|
4573
|
+
/** @enum {string} */
|
|
4574
|
+
object: "message";
|
|
4575
|
+
to?: string;
|
|
4576
|
+
type?: string;
|
|
4577
|
+
/** @enum {string} */
|
|
4578
|
+
status: "queued" | "pending" | "sent" | "delivered" | "read" | "failed";
|
|
4579
|
+
/** Format: date-time */
|
|
4580
|
+
created_at?: string;
|
|
4581
|
+
conversation_id?: string;
|
|
4582
|
+
message_id?: string;
|
|
4583
|
+
error?: {
|
|
4584
|
+
/** @description Stable Kirim error code. Known values include `outside_24h_window`, `marketing_opted_out`, `marketing_blocked_by_user`, `recipient_unavailable`, `unsupported_message_type`, `account_restricted`, `account_locked`, `consent_required`, `customer_suspended`, `permission_revoked`, `auth_expired`, `app_rate_limited`, `account_rate_limited`, `template_not_found`, `template_paused`, `template_policy_violation`, `flow_blocked`, `media_upload_failed`, `media_download_failed`, `undeliverable`, `policy_violation`, `upstream_error`. */
|
|
4585
|
+
code: string;
|
|
4586
|
+
message: string;
|
|
4587
|
+
provider_code: number | null;
|
|
4588
|
+
};
|
|
4589
|
+
};
|
|
4590
|
+
Template: {
|
|
4591
|
+
/** @example tmpl_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
4592
|
+
id: string;
|
|
4593
|
+
/** @enum {string} */
|
|
4594
|
+
object: "template";
|
|
4595
|
+
name: string;
|
|
4596
|
+
language: string;
|
|
4597
|
+
/** @enum {string} */
|
|
4598
|
+
status: "pending" | "approved" | "rejected";
|
|
4599
|
+
content: string;
|
|
4600
|
+
variables: string[];
|
|
4601
|
+
components?: unknown;
|
|
4602
|
+
whatsapp_account: components["schemas"]["WhatsappAccountEmbedded"];
|
|
4603
|
+
provider_template_id: string | null;
|
|
4604
|
+
/** Format: date-time */
|
|
4605
|
+
created_at: string;
|
|
4606
|
+
/** Format: date-time */
|
|
4607
|
+
updated_at: string;
|
|
4608
|
+
};
|
|
4609
|
+
Account: {
|
|
4610
|
+
/** @enum {string} */
|
|
4611
|
+
object: "account";
|
|
4612
|
+
/**
|
|
4613
|
+
* @description Meta WhatsApp Business `phone_number_id`. Use as the `{phone_number_id}` path parameter in `/v1/{phone_number_id}/...` endpoints. Nullable while onboarding is in flight.
|
|
4614
|
+
* @example 106540352242922
|
|
4615
|
+
*/
|
|
4616
|
+
phone_number_id: string | null;
|
|
4617
|
+
/** @example +628111222333 */
|
|
4618
|
+
phone_number: string | null;
|
|
4619
|
+
/** @example Customer Support */
|
|
4620
|
+
name: string | null;
|
|
4621
|
+
/**
|
|
4622
|
+
* @description Lifecycle state of the account (e.g. `connected`, `disconnected`, `degraded`, `onboarding`).
|
|
4623
|
+
* @example connected
|
|
4624
|
+
*/
|
|
4625
|
+
status: string;
|
|
4626
|
+
/**
|
|
4627
|
+
* @description Public id of the end-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. Filter the list endpoint via `?customer_id=cus_...`.
|
|
4628
|
+
* @example cus_01HXYZABCDEFGHJKMNPQRSTVWX
|
|
4629
|
+
*/
|
|
4630
|
+
customer_id: string | null;
|
|
4631
|
+
};
|
|
4632
|
+
WebhookSubscription: {
|
|
4633
|
+
/** @example wbs_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
4634
|
+
id: string;
|
|
4635
|
+
/** @enum {string} */
|
|
4636
|
+
object: "webhook_subscription";
|
|
4637
|
+
/** Format: uri */
|
|
4638
|
+
url: string;
|
|
4639
|
+
description: string | null;
|
|
4640
|
+
events: string[];
|
|
4641
|
+
/** @enum {string} */
|
|
4642
|
+
status: "active" | "paused" | "disabled";
|
|
4643
|
+
disabled_reason: string | null;
|
|
4644
|
+
consecutive_failures: number;
|
|
4645
|
+
secrets: {
|
|
4646
|
+
/** @example sec_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
4647
|
+
id: string;
|
|
4648
|
+
/** Format: date-time */
|
|
4649
|
+
created_at: string;
|
|
3711
4650
|
/** Format: date-time */
|
|
3712
4651
|
expires_at: string | null;
|
|
3713
4652
|
}[];
|
|
@@ -3752,9 +4691,7 @@ export interface components {
|
|
|
3752
4691
|
phone_number: string | null;
|
|
3753
4692
|
name: string | null;
|
|
3754
4693
|
};
|
|
3755
|
-
whatsapp_account:
|
|
3756
|
-
phone_number: string | null;
|
|
3757
|
-
};
|
|
4694
|
+
whatsapp_account: components["schemas"]["WhatsappAccountEmbedded"];
|
|
3758
4695
|
assignee: {
|
|
3759
4696
|
id: string;
|
|
3760
4697
|
name: string | null;
|
|
@@ -3781,9 +4718,7 @@ export interface components {
|
|
|
3781
4718
|
metadata: {
|
|
3782
4719
|
[key: string]: unknown;
|
|
3783
4720
|
} | null;
|
|
3784
|
-
whatsapp_account:
|
|
3785
|
-
phone_number: string | null;
|
|
3786
|
-
};
|
|
4721
|
+
whatsapp_account: components["schemas"]["WhatsappAccountEmbedded"];
|
|
3787
4722
|
/** Format: date-time */
|
|
3788
4723
|
created_at: string;
|
|
3789
4724
|
/** Format: date-time */
|
|
@@ -3803,6 +4738,56 @@ export interface components {
|
|
|
3803
4738
|
/** Format: date-time */
|
|
3804
4739
|
updated_at: string;
|
|
3805
4740
|
};
|
|
4741
|
+
Customer: {
|
|
4742
|
+
/** @example cus_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
4743
|
+
id: string;
|
|
4744
|
+
/** @enum {string} */
|
|
4745
|
+
object: "customer";
|
|
4746
|
+
name: string;
|
|
4747
|
+
email: string | null;
|
|
4748
|
+
/** @enum {string} */
|
|
4749
|
+
status: "pending" | "active" | "suspended" | "archived";
|
|
4750
|
+
metadata: {
|
|
4751
|
+
[key: string]: unknown;
|
|
4752
|
+
} | null;
|
|
4753
|
+
/** Format: date-time */
|
|
4754
|
+
archived_at: string | null;
|
|
4755
|
+
team_id: string;
|
|
4756
|
+
/** Format: date-time */
|
|
4757
|
+
created_at: string;
|
|
4758
|
+
/** Format: date-time */
|
|
4759
|
+
updated_at: string;
|
|
4760
|
+
};
|
|
4761
|
+
CustomerSetupLink: {
|
|
4762
|
+
/** @example csl_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
4763
|
+
id: string;
|
|
4764
|
+
/** @enum {string} */
|
|
4765
|
+
object: "customer_setup_link";
|
|
4766
|
+
customer_id: string;
|
|
4767
|
+
/** @enum {string} */
|
|
4768
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
4769
|
+
token_last4: string;
|
|
4770
|
+
/** Format: date-time */
|
|
4771
|
+
expires_at: string;
|
|
4772
|
+
/** Format: date-time */
|
|
4773
|
+
consumed_at: string | null;
|
|
4774
|
+
/**
|
|
4775
|
+
* Format: uri
|
|
4776
|
+
* @description Where the tenant is redirected after successful Embedded Signup. We append `?customer_id=&account_id=&status=success` on the redirect.
|
|
4777
|
+
*/
|
|
4778
|
+
success_redirect_url: string | null;
|
|
4779
|
+
/**
|
|
4780
|
+
* Format: uri
|
|
4781
|
+
* @description Where the tenant is redirected on failure (link error, Meta signup cancelled, etc.). We append `?customer_id=&status=failed&reason=<code>`.
|
|
4782
|
+
*/
|
|
4783
|
+
failure_redirect_url: string | null;
|
|
4784
|
+
/** Format: date-time */
|
|
4785
|
+
created_at: string;
|
|
4786
|
+
};
|
|
4787
|
+
CustomerSetupLinkWithToken: components["schemas"]["CustomerSetupLink"] & {
|
|
4788
|
+
/** Format: uri */
|
|
4789
|
+
setup_url: string;
|
|
4790
|
+
};
|
|
3806
4791
|
MessageListItem: {
|
|
3807
4792
|
/** @example msg_01HXYZABCDEFGHJKMNPQRSTVWX */
|
|
3808
4793
|
id: string;
|
|
@@ -3820,7 +4805,7 @@ export interface components {
|
|
|
3820
4805
|
/** Format: date-time */
|
|
3821
4806
|
created_at: string;
|
|
3822
4807
|
error?: {
|
|
3823
|
-
/** @description Stable Kirim error code. Known values include `outside_24h_window`, `marketing_opted_out`, `marketing_blocked_by_user`, `recipient_unavailable`, `unsupported_message_type`, `account_restricted`, `account_locked`, `consent_required`, `permission_revoked`, `auth_expired`, `app_rate_limited`, `account_rate_limited`, `template_not_found`, `template_paused`, `template_policy_violation`, `flow_blocked`, `media_upload_failed`, `media_download_failed`, `undeliverable`, `policy_violation`, `upstream_error`. */
|
|
4808
|
+
/** @description Stable Kirim error code. Known values include `outside_24h_window`, `marketing_opted_out`, `marketing_blocked_by_user`, `recipient_unavailable`, `unsupported_message_type`, `account_restricted`, `account_locked`, `consent_required`, `customer_suspended`, `permission_revoked`, `auth_expired`, `app_rate_limited`, `account_rate_limited`, `template_not_found`, `template_paused`, `template_policy_violation`, `flow_blocked`, `media_upload_failed`, `media_download_failed`, `undeliverable`, `policy_violation`, `upstream_error`. */
|
|
3824
4809
|
code: string;
|
|
3825
4810
|
message: string;
|
|
3826
4811
|
provider_code: number | null;
|
|
@@ -3875,6 +4860,19 @@ export interface components {
|
|
|
3875
4860
|
data: components["schemas"]["Template"];
|
|
3876
4861
|
request_id: string;
|
|
3877
4862
|
};
|
|
4863
|
+
SyncTemplatesResponse: {
|
|
4864
|
+
data: {
|
|
4865
|
+
/** @enum {string} */
|
|
4866
|
+
object: "template_sync_result";
|
|
4867
|
+
/** @example 12 */
|
|
4868
|
+
synced: number;
|
|
4869
|
+
/** @example 2 */
|
|
4870
|
+
created: number;
|
|
4871
|
+
/** @example 10 */
|
|
4872
|
+
updated: number;
|
|
4873
|
+
};
|
|
4874
|
+
request_id: string;
|
|
4875
|
+
};
|
|
3878
4876
|
CreateWebhookSubscriptionResponse: {
|
|
3879
4877
|
data: components["schemas"]["WebhookSubscription"];
|
|
3880
4878
|
request_id: string;
|
|
@@ -4070,6 +5068,70 @@ export interface components {
|
|
|
4070
5068
|
};
|
|
4071
5069
|
request_id: string;
|
|
4072
5070
|
};
|
|
5071
|
+
ListCustomersResponse: {
|
|
5072
|
+
data: components["schemas"]["Customer"][];
|
|
5073
|
+
has_more: boolean;
|
|
5074
|
+
next_cursor: string | null;
|
|
5075
|
+
request_id: string;
|
|
5076
|
+
};
|
|
5077
|
+
CreateCustomerResponse: {
|
|
5078
|
+
data: components["schemas"]["Customer"];
|
|
5079
|
+
request_id: string;
|
|
5080
|
+
};
|
|
5081
|
+
GetCustomerResponse: {
|
|
5082
|
+
data: components["schemas"]["Customer"] & {
|
|
5083
|
+
/** @description WhatsApp accounts currently assigned to this customer. */
|
|
5084
|
+
whatsapp_accounts: {
|
|
5085
|
+
phone_number_id: string | null;
|
|
5086
|
+
phone_number: string | null;
|
|
5087
|
+
name: string | null;
|
|
5088
|
+
status: string;
|
|
5089
|
+
/** Format: date-time */
|
|
5090
|
+
onboarded_at: string | null;
|
|
5091
|
+
}[];
|
|
5092
|
+
};
|
|
5093
|
+
request_id: string;
|
|
5094
|
+
};
|
|
5095
|
+
UpdateCustomerResponse: {
|
|
5096
|
+
data: components["schemas"]["Customer"];
|
|
5097
|
+
request_id: string;
|
|
5098
|
+
};
|
|
5099
|
+
ArchiveCustomerResponse: {
|
|
5100
|
+
data: {
|
|
5101
|
+
id: string;
|
|
5102
|
+
/** @enum {string} */
|
|
5103
|
+
object: "customer";
|
|
5104
|
+
/** @enum {boolean} */
|
|
5105
|
+
archived: true;
|
|
5106
|
+
};
|
|
5107
|
+
request_id: string;
|
|
5108
|
+
};
|
|
5109
|
+
ListCustomerSetupLinksResponse: {
|
|
5110
|
+
data: components["schemas"]["CustomerSetupLink"][];
|
|
5111
|
+
has_more: boolean;
|
|
5112
|
+
next_cursor: string | null;
|
|
5113
|
+
request_id: string;
|
|
5114
|
+
};
|
|
5115
|
+
CreateCustomerSetupLinkResponse: {
|
|
5116
|
+
data: components["schemas"]["CustomerSetupLinkWithToken"];
|
|
5117
|
+
request_id: string;
|
|
5118
|
+
};
|
|
5119
|
+
UpdateCustomerSetupLinkResponse: {
|
|
5120
|
+
data: components["schemas"]["CustomerSetupLink"];
|
|
5121
|
+
request_id: string;
|
|
5122
|
+
};
|
|
5123
|
+
RevokeCustomerSetupLinkResponse: {
|
|
5124
|
+
data: {
|
|
5125
|
+
id: string;
|
|
5126
|
+
/** @enum {string} */
|
|
5127
|
+
object: "customer_setup_link";
|
|
5128
|
+
/** @enum {boolean} */
|
|
5129
|
+
revoked: true;
|
|
5130
|
+
/** @enum {string} */
|
|
5131
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
5132
|
+
};
|
|
5133
|
+
request_id: string;
|
|
5134
|
+
};
|
|
4073
5135
|
};
|
|
4074
5136
|
responses: never;
|
|
4075
5137
|
parameters: never;
|