@kirimdev/sdk 3.0.0 → 3.0.2

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.
@@ -0,0 +1,4010 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+
6
+ export interface paths {
7
+ "/health": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ /**
15
+ * Liveness probe
16
+ * @description Unauthenticated health check. Returns 200 if the API is up.
17
+ */
18
+ get: {
19
+ parameters: {
20
+ query?: never;
21
+ header?: never;
22
+ path?: never;
23
+ cookie?: never;
24
+ };
25
+ requestBody?: never;
26
+ responses: {
27
+ /** @description API is healthy */
28
+ 200: {
29
+ headers: {
30
+ [name: string]: unknown;
31
+ };
32
+ content: {
33
+ "application/json": {
34
+ data: {
35
+ /** @enum {string} */
36
+ status: "ok";
37
+ };
38
+ request_id: string;
39
+ };
40
+ };
41
+ };
42
+ };
43
+ };
44
+ put?: never;
45
+ post?: never;
46
+ delete?: never;
47
+ options?: never;
48
+ head?: never;
49
+ patch?: never;
50
+ trace?: never;
51
+ };
52
+ "/me": {
53
+ parameters: {
54
+ query?: never;
55
+ header?: never;
56
+ path?: never;
57
+ cookie?: never;
58
+ };
59
+ /**
60
+ * Introspect the calling API key
61
+ * @description Returns the organization, API key, and rate-limit tier associated with the bearer token. Use to verify key validity from automation scripts.
62
+ */
63
+ get: {
64
+ parameters: {
65
+ query?: never;
66
+ header?: never;
67
+ path?: never;
68
+ cookie?: never;
69
+ };
70
+ requestBody?: never;
71
+ responses: {
72
+ /** @description API key context */
73
+ 200: {
74
+ headers: {
75
+ [name: string]: unknown;
76
+ };
77
+ content: {
78
+ "application/json": components["schemas"]["MeResponse"];
79
+ };
80
+ };
81
+ /** @description Authentication failure */
82
+ 401: {
83
+ headers: {
84
+ [name: string]: unknown;
85
+ };
86
+ content: {
87
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
88
+ };
89
+ };
90
+ /** @description Rate limit exceeded */
91
+ 429: {
92
+ headers: {
93
+ [name: string]: unknown;
94
+ };
95
+ content: {
96
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
97
+ };
98
+ };
99
+ /** @description Internal server error */
100
+ 500: {
101
+ headers: {
102
+ [name: string]: unknown;
103
+ };
104
+ content: {
105
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
106
+ };
107
+ };
108
+ };
109
+ };
110
+ put?: never;
111
+ post?: never;
112
+ delete?: never;
113
+ options?: never;
114
+ head?: never;
115
+ patch?: never;
116
+ trace?: never;
117
+ };
118
+ "/accounts": {
119
+ parameters: {
120
+ query?: never;
121
+ header?: never;
122
+ path?: never;
123
+ cookie?: never;
124
+ };
125
+ /**
126
+ * List connected WhatsApp accounts
127
+ * @description List the WhatsApp accounts attached to the calling organization. The returned `business_phone_number_id` is the value to use in `/{phone_number_id}/...` path-based endpoints (Meta-style — sender comes from the URL, not the body). Defaults to `status=connected` because that's the only state in which sends are accepted; pass `status=all` to inspect onboarding-in-progress or disconnected accounts. Response is intentionally not paginated.
128
+ */
129
+ get: {
130
+ parameters: {
131
+ query?: {
132
+ status?: "connected" | "all";
133
+ };
134
+ header?: never;
135
+ path?: never;
136
+ cookie?: never;
137
+ };
138
+ requestBody?: never;
139
+ responses: {
140
+ /** @description Account list */
141
+ 200: {
142
+ headers: {
143
+ [name: string]: unknown;
144
+ };
145
+ content: {
146
+ "application/json": components["schemas"]["ListAccountsResponse"];
147
+ };
148
+ };
149
+ /** @description Validation failure */
150
+ 400: {
151
+ headers: {
152
+ [name: string]: unknown;
153
+ };
154
+ content: {
155
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
156
+ };
157
+ };
158
+ /** @description Authentication failure */
159
+ 401: {
160
+ headers: {
161
+ [name: string]: unknown;
162
+ };
163
+ content: {
164
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
165
+ };
166
+ };
167
+ /** @description Rate limit exceeded */
168
+ 429: {
169
+ headers: {
170
+ [name: string]: unknown;
171
+ };
172
+ content: {
173
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
174
+ };
175
+ };
176
+ /** @description Internal server error */
177
+ 500: {
178
+ headers: {
179
+ [name: string]: unknown;
180
+ };
181
+ content: {
182
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
183
+ };
184
+ };
185
+ };
186
+ };
187
+ put?: never;
188
+ post?: never;
189
+ delete?: never;
190
+ options?: never;
191
+ head?: never;
192
+ patch?: never;
193
+ trace?: never;
194
+ };
195
+ "/{phone_number_id}/messages": {
196
+ parameters: {
197
+ query?: never;
198
+ header?: never;
199
+ path?: never;
200
+ cookie?: never;
201
+ };
202
+ /**
203
+ * List messages
204
+ * @description List messages for the WhatsApp account identified by `phone_number_id`. Filter by `conversation_id`, `direction`, `status`, or a `created_after`/`created_before` window.
205
+ */
206
+ get: {
207
+ parameters: {
208
+ query?: {
209
+ conversation_id?: string;
210
+ direction?: "inbound" | "outbound";
211
+ status?: "pending" | "sent" | "delivered" | "read" | "failed";
212
+ created_after?: string;
213
+ created_before?: string;
214
+ limit?: string;
215
+ cursor?: string;
216
+ };
217
+ header?: never;
218
+ path: {
219
+ phone_number_id: string;
220
+ };
221
+ cookie?: never;
222
+ };
223
+ requestBody?: never;
224
+ responses: {
225
+ /** @description Message list */
226
+ 200: {
227
+ headers: {
228
+ [name: string]: unknown;
229
+ };
230
+ content: {
231
+ "application/json": components["schemas"]["ListMessagesResponse"];
232
+ };
233
+ };
234
+ /** @description Validation failure */
235
+ 400: {
236
+ headers: {
237
+ [name: string]: unknown;
238
+ };
239
+ content: {
240
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
241
+ };
242
+ };
243
+ /** @description Authentication failure */
244
+ 401: {
245
+ headers: {
246
+ [name: string]: unknown;
247
+ };
248
+ content: {
249
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
250
+ };
251
+ };
252
+ /** @description Resource not found */
253
+ 404: {
254
+ headers: {
255
+ [name: string]: unknown;
256
+ };
257
+ content: {
258
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
259
+ };
260
+ };
261
+ /** @description Semantic failure (e.g. idempotency key reuse) */
262
+ 422: {
263
+ headers: {
264
+ [name: string]: unknown;
265
+ };
266
+ content: {
267
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
268
+ };
269
+ };
270
+ /** @description Rate limit exceeded */
271
+ 429: {
272
+ headers: {
273
+ [name: string]: unknown;
274
+ };
275
+ content: {
276
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
277
+ };
278
+ };
279
+ /** @description Internal server error */
280
+ 500: {
281
+ headers: {
282
+ [name: string]: unknown;
283
+ };
284
+ content: {
285
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
286
+ };
287
+ };
288
+ };
289
+ };
290
+ put?: never;
291
+ /**
292
+ * Send a WhatsApp message or mark inbound as read
293
+ * @description Meta-style messages endpoint. Two operations share the same path, distinguished by the request body:
294
+ *
295
+ * **Outbound send** — body has a `type` field (`text`, `image`, `document`, `video`, `audio`, `template`, `interactive`). Body shape mirrors the Meta WhatsApp Cloud API; media variants accept either `link` (hosted URL) or `id` (Meta uploaded media). The sender is the WhatsApp account identified by `phone_number_id` in the URL path; there is no `from` field in the body. Pass `Idempotency-Key` to safely retry on network failure.
296
+ *
297
+ * **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.
298
+ */
299
+ post: {
300
+ parameters: {
301
+ query?: never;
302
+ header?: {
303
+ "idempotency-key"?: string;
304
+ };
305
+ path: {
306
+ phone_number_id: string;
307
+ };
308
+ cookie?: never;
309
+ };
310
+ requestBody?: {
311
+ content: {
312
+ "application/json": {
313
+ /** @enum {string} */
314
+ messaging_product: "whatsapp";
315
+ /** @enum {string} */
316
+ recipient_type?: "individual";
317
+ to: string;
318
+ /** @enum {string} */
319
+ type: "text";
320
+ text: {
321
+ body: string;
322
+ preview_url?: boolean;
323
+ };
324
+ } | {
325
+ /** @enum {string} */
326
+ messaging_product: "whatsapp";
327
+ /** @enum {string} */
328
+ recipient_type?: "individual";
329
+ to: string;
330
+ /** @enum {string} */
331
+ type: "image";
332
+ image: {
333
+ /** Format: uri */
334
+ link?: string;
335
+ id?: string;
336
+ caption?: string;
337
+ filename?: string;
338
+ };
339
+ } | {
340
+ /** @enum {string} */
341
+ messaging_product: "whatsapp";
342
+ /** @enum {string} */
343
+ recipient_type?: "individual";
344
+ to: string;
345
+ /** @enum {string} */
346
+ type: "document";
347
+ document: {
348
+ /** Format: uri */
349
+ link?: string;
350
+ id?: string;
351
+ caption?: string;
352
+ filename?: string;
353
+ };
354
+ } | {
355
+ /** @enum {string} */
356
+ messaging_product: "whatsapp";
357
+ /** @enum {string} */
358
+ recipient_type?: "individual";
359
+ to: string;
360
+ /** @enum {string} */
361
+ type: "video";
362
+ video: {
363
+ /** Format: uri */
364
+ link?: string;
365
+ id?: string;
366
+ caption?: string;
367
+ filename?: string;
368
+ };
369
+ } | {
370
+ /** @enum {string} */
371
+ messaging_product: "whatsapp";
372
+ /** @enum {string} */
373
+ recipient_type?: "individual";
374
+ to: string;
375
+ /** @enum {string} */
376
+ type: "audio";
377
+ audio: {
378
+ /** Format: uri */
379
+ link?: string;
380
+ id?: string;
381
+ caption?: string;
382
+ filename?: string;
383
+ };
384
+ } | {
385
+ /** @enum {string} */
386
+ messaging_product: "whatsapp";
387
+ /** @enum {string} */
388
+ recipient_type?: "individual";
389
+ to: string;
390
+ /** @enum {string} */
391
+ type: "template";
392
+ template: {
393
+ name: string;
394
+ language: string | {
395
+ code: string;
396
+ policy?: string;
397
+ };
398
+ components?: {
399
+ /** @enum {string} */
400
+ type: "header" | "body" | "button";
401
+ /** @enum {string} */
402
+ sub_type?: "url" | "quick_reply" | "copy_code" | "flow";
403
+ index?: number;
404
+ parameters?: {
405
+ [key: string]: unknown;
406
+ }[];
407
+ }[];
408
+ };
409
+ } | {
410
+ /** @enum {string} */
411
+ messaging_product: "whatsapp";
412
+ /** @enum {string} */
413
+ recipient_type?: "individual";
414
+ to: string;
415
+ /** @enum {string} */
416
+ type: "interactive";
417
+ interactive: {
418
+ /** @enum {string} */
419
+ type: "cta_url";
420
+ body: {
421
+ text: string;
422
+ };
423
+ action: {
424
+ /** @enum {string} */
425
+ name: "cta_url";
426
+ parameters: {
427
+ display_text: string;
428
+ /** Format: uri */
429
+ url: string;
430
+ };
431
+ };
432
+ } | {
433
+ /** @enum {string} */
434
+ type: "list";
435
+ header?: {
436
+ /** @enum {string} */
437
+ type: "text";
438
+ text: string;
439
+ };
440
+ body: {
441
+ text: string;
442
+ };
443
+ footer?: {
444
+ text: string;
445
+ };
446
+ action: {
447
+ button: string;
448
+ sections: {
449
+ title?: string;
450
+ rows: {
451
+ id: string;
452
+ title: string;
453
+ description?: string;
454
+ }[];
455
+ }[];
456
+ };
457
+ } | {
458
+ /** @enum {string} */
459
+ type: "carousel";
460
+ body: {
461
+ text: string;
462
+ };
463
+ action: {
464
+ cards: {
465
+ card_index?: number;
466
+ /** @enum {string} */
467
+ type?: "cta_url";
468
+ header: {
469
+ /** @enum {string} */
470
+ type: "image";
471
+ image: {
472
+ /** Format: uri */
473
+ link: string;
474
+ };
475
+ } | {
476
+ /** @enum {string} */
477
+ type: "video";
478
+ video: {
479
+ /** Format: uri */
480
+ link: string;
481
+ };
482
+ };
483
+ body?: {
484
+ text: string;
485
+ };
486
+ action: {
487
+ /** @enum {string} */
488
+ name: "cta_url";
489
+ parameters: {
490
+ display_text: string;
491
+ /** Format: uri */
492
+ url: string;
493
+ };
494
+ } | {
495
+ buttons: {
496
+ /** @enum {string} */
497
+ type: "quick_reply";
498
+ quick_reply: {
499
+ id: string;
500
+ title: string;
501
+ };
502
+ }[];
503
+ };
504
+ }[];
505
+ };
506
+ };
507
+ } | {
508
+ /** @enum {string} */
509
+ messaging_product: "whatsapp";
510
+ /** @enum {string} */
511
+ status: "read";
512
+ /**
513
+ * @description Meta WhatsApp message id (wamid) of the inbound message to mark as read. Get it from the inbound webhook payload — NOT a Kirim `msg_*` external id.
514
+ * @example wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA
515
+ */
516
+ message_id: string;
517
+ /** @description Optional. When present, Meta also shows a typing indicator to the recipient that auto-dismisses on response or after ~25 seconds. Only include if you intend to respond — leaving the indicator hanging produces a poor UX. */
518
+ typing_indicator?: {
519
+ /** @enum {string} */
520
+ type: "text";
521
+ };
522
+ };
523
+ };
524
+ };
525
+ responses: {
526
+ /** @description Message accepted for delivery, or read receipt sent. */
527
+ 200: {
528
+ headers: {
529
+ [name: string]: unknown;
530
+ };
531
+ content: {
532
+ "application/json": components["schemas"]["SendMessageResponse"];
533
+ };
534
+ };
535
+ /** @description Validation failure */
536
+ 400: {
537
+ headers: {
538
+ [name: string]: unknown;
539
+ };
540
+ content: {
541
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
542
+ };
543
+ };
544
+ /** @description Authentication failure */
545
+ 401: {
546
+ headers: {
547
+ [name: string]: unknown;
548
+ };
549
+ content: {
550
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
551
+ };
552
+ };
553
+ /** @description Resource not found */
554
+ 404: {
555
+ headers: {
556
+ [name: string]: unknown;
557
+ };
558
+ content: {
559
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
560
+ };
561
+ };
562
+ /** @description Semantic failure (e.g. idempotency key reuse) */
563
+ 422: {
564
+ headers: {
565
+ [name: string]: unknown;
566
+ };
567
+ content: {
568
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
569
+ };
570
+ };
571
+ /** @description Rate limit exceeded */
572
+ 429: {
573
+ headers: {
574
+ [name: string]: unknown;
575
+ };
576
+ content: {
577
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
578
+ };
579
+ };
580
+ /** @description Upstream WhatsApp error */
581
+ 502: {
582
+ headers: {
583
+ [name: string]: unknown;
584
+ };
585
+ content: {
586
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
587
+ };
588
+ };
589
+ /** @description Service unavailable */
590
+ 503: {
591
+ headers: {
592
+ [name: string]: unknown;
593
+ };
594
+ content: {
595
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
596
+ };
597
+ };
598
+ };
599
+ };
600
+ delete?: never;
601
+ options?: never;
602
+ head?: never;
603
+ patch?: never;
604
+ trace?: never;
605
+ };
606
+ "/{phone_number_id}/messages/{id}": {
607
+ parameters: {
608
+ query?: never;
609
+ header?: never;
610
+ path?: never;
611
+ cookie?: never;
612
+ };
613
+ /** Fetch a sent message by id */
614
+ get: {
615
+ parameters: {
616
+ query?: never;
617
+ header?: never;
618
+ path: {
619
+ phone_number_id: string;
620
+ id: string;
621
+ };
622
+ cookie?: never;
623
+ };
624
+ requestBody?: never;
625
+ responses: {
626
+ /** @description Message resource */
627
+ 200: {
628
+ headers: {
629
+ [name: string]: unknown;
630
+ };
631
+ content: {
632
+ "application/json": components["schemas"]["GetMessageResponse"];
633
+ };
634
+ };
635
+ /** @description Validation failure */
636
+ 400: {
637
+ headers: {
638
+ [name: string]: unknown;
639
+ };
640
+ content: {
641
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
642
+ };
643
+ };
644
+ /** @description Authentication failure */
645
+ 401: {
646
+ headers: {
647
+ [name: string]: unknown;
648
+ };
649
+ content: {
650
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
651
+ };
652
+ };
653
+ /** @description Resource not found */
654
+ 404: {
655
+ headers: {
656
+ [name: string]: unknown;
657
+ };
658
+ content: {
659
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
660
+ };
661
+ };
662
+ /** @description Semantic failure (e.g. idempotency key reuse) */
663
+ 422: {
664
+ headers: {
665
+ [name: string]: unknown;
666
+ };
667
+ content: {
668
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
669
+ };
670
+ };
671
+ /** @description Rate limit exceeded */
672
+ 429: {
673
+ headers: {
674
+ [name: string]: unknown;
675
+ };
676
+ content: {
677
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
678
+ };
679
+ };
680
+ /** @description Internal server error */
681
+ 500: {
682
+ headers: {
683
+ [name: string]: unknown;
684
+ };
685
+ content: {
686
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
687
+ };
688
+ };
689
+ };
690
+ };
691
+ put?: never;
692
+ post?: never;
693
+ delete?: never;
694
+ options?: never;
695
+ head?: never;
696
+ patch?: never;
697
+ trace?: never;
698
+ };
699
+ "/{phone_number_id}/templates": {
700
+ parameters: {
701
+ query?: never;
702
+ header?: never;
703
+ path?: never;
704
+ cookie?: never;
705
+ };
706
+ /**
707
+ * List approved templates
708
+ * @description List templates synced from Meta for the WhatsApp account identified by `phone_number_id`. Default filter is `status=approved`.
709
+ */
710
+ get: {
711
+ parameters: {
712
+ query?: {
713
+ status?: "approved" | "pending" | "rejected" | "all";
714
+ language?: string;
715
+ limit?: string;
716
+ cursor?: string;
717
+ };
718
+ header?: never;
719
+ path: {
720
+ phone_number_id: string;
721
+ };
722
+ cookie?: never;
723
+ };
724
+ requestBody?: never;
725
+ responses: {
726
+ /** @description Template list */
727
+ 200: {
728
+ headers: {
729
+ [name: string]: unknown;
730
+ };
731
+ content: {
732
+ "application/json": components["schemas"]["ListTemplatesResponse"];
733
+ };
734
+ };
735
+ /** @description Validation failure */
736
+ 400: {
737
+ headers: {
738
+ [name: string]: unknown;
739
+ };
740
+ content: {
741
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
742
+ };
743
+ };
744
+ /** @description Authentication failure */
745
+ 401: {
746
+ headers: {
747
+ [name: string]: unknown;
748
+ };
749
+ content: {
750
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
751
+ };
752
+ };
753
+ /** @description Resource not found */
754
+ 404: {
755
+ headers: {
756
+ [name: string]: unknown;
757
+ };
758
+ content: {
759
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
760
+ };
761
+ };
762
+ /** @description Semantic failure (e.g. idempotency key reuse) */
763
+ 422: {
764
+ headers: {
765
+ [name: string]: unknown;
766
+ };
767
+ content: {
768
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
769
+ };
770
+ };
771
+ /** @description Rate limit exceeded */
772
+ 429: {
773
+ headers: {
774
+ [name: string]: unknown;
775
+ };
776
+ content: {
777
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
778
+ };
779
+ };
780
+ /** @description Internal server error */
781
+ 500: {
782
+ headers: {
783
+ [name: string]: unknown;
784
+ };
785
+ content: {
786
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
787
+ };
788
+ };
789
+ };
790
+ };
791
+ put?: never;
792
+ post?: never;
793
+ delete?: never;
794
+ options?: never;
795
+ head?: never;
796
+ patch?: never;
797
+ trace?: never;
798
+ };
799
+ "/{phone_number_id}/templates/{name}": {
800
+ parameters: {
801
+ query?: never;
802
+ header?: never;
803
+ path?: never;
804
+ cookie?: never;
805
+ };
806
+ /** Fetch a single template by name */
807
+ get: {
808
+ parameters: {
809
+ query?: {
810
+ language?: string;
811
+ };
812
+ header?: never;
813
+ path: {
814
+ phone_number_id: string;
815
+ name: string;
816
+ };
817
+ cookie?: never;
818
+ };
819
+ requestBody?: never;
820
+ responses: {
821
+ /** @description Template resource */
822
+ 200: {
823
+ headers: {
824
+ [name: string]: unknown;
825
+ };
826
+ content: {
827
+ "application/json": components["schemas"]["GetTemplateResponse"];
828
+ };
829
+ };
830
+ /** @description Validation failure */
831
+ 400: {
832
+ headers: {
833
+ [name: string]: unknown;
834
+ };
835
+ content: {
836
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
837
+ };
838
+ };
839
+ /** @description Authentication failure */
840
+ 401: {
841
+ headers: {
842
+ [name: string]: unknown;
843
+ };
844
+ content: {
845
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
846
+ };
847
+ };
848
+ /** @description Resource not found */
849
+ 404: {
850
+ headers: {
851
+ [name: string]: unknown;
852
+ };
853
+ content: {
854
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
855
+ };
856
+ };
857
+ /** @description Semantic failure (e.g. idempotency key reuse) */
858
+ 422: {
859
+ headers: {
860
+ [name: string]: unknown;
861
+ };
862
+ content: {
863
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
864
+ };
865
+ };
866
+ /** @description Rate limit exceeded */
867
+ 429: {
868
+ headers: {
869
+ [name: string]: unknown;
870
+ };
871
+ content: {
872
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
873
+ };
874
+ };
875
+ /** @description Internal server error */
876
+ 500: {
877
+ headers: {
878
+ [name: string]: unknown;
879
+ };
880
+ content: {
881
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
882
+ };
883
+ };
884
+ };
885
+ };
886
+ put?: never;
887
+ post?: never;
888
+ delete?: never;
889
+ options?: never;
890
+ head?: never;
891
+ patch?: never;
892
+ trace?: never;
893
+ };
894
+ "/webhook_subscriptions": {
895
+ parameters: {
896
+ query?: never;
897
+ header?: never;
898
+ path?: never;
899
+ cookie?: never;
900
+ };
901
+ /** List webhook subscriptions */
902
+ get: {
903
+ parameters: {
904
+ query?: {
905
+ status?: "active" | "paused" | "disabled" | "all";
906
+ limit?: string;
907
+ cursor?: string;
908
+ };
909
+ header?: never;
910
+ path?: never;
911
+ cookie?: never;
912
+ };
913
+ requestBody?: never;
914
+ responses: {
915
+ /** @description Subscription list */
916
+ 200: {
917
+ headers: {
918
+ [name: string]: unknown;
919
+ };
920
+ content: {
921
+ "application/json": components["schemas"]["ListWebhookSubscriptionsResponse"];
922
+ };
923
+ };
924
+ /** @description Validation failure */
925
+ 400: {
926
+ headers: {
927
+ [name: string]: unknown;
928
+ };
929
+ content: {
930
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
931
+ };
932
+ };
933
+ /** @description Authentication failure */
934
+ 401: {
935
+ headers: {
936
+ [name: string]: unknown;
937
+ };
938
+ content: {
939
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
940
+ };
941
+ };
942
+ /** @description Rate limit exceeded */
943
+ 429: {
944
+ headers: {
945
+ [name: string]: unknown;
946
+ };
947
+ content: {
948
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
949
+ };
950
+ };
951
+ /** @description Internal server error */
952
+ 500: {
953
+ headers: {
954
+ [name: string]: unknown;
955
+ };
956
+ content: {
957
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
958
+ };
959
+ };
960
+ };
961
+ };
962
+ put?: never;
963
+ /**
964
+ * Create a webhook subscription
965
+ * @description Create a webhook subscription. The response carries `initial_secret` ONCE — store it server-side immediately; Kirim cannot show it again.
966
+ */
967
+ post: {
968
+ parameters: {
969
+ query?: never;
970
+ header?: never;
971
+ path?: never;
972
+ cookie?: never;
973
+ };
974
+ requestBody?: {
975
+ content: {
976
+ "application/json": {
977
+ /** Format: uri */
978
+ url: string;
979
+ description?: string;
980
+ events: ("message.received" | "message.status" | "conversation.assigned" | "conversation.closed" | "contact.created" | "contact.updated")[];
981
+ };
982
+ };
983
+ };
984
+ responses: {
985
+ /** @description Created */
986
+ 200: {
987
+ headers: {
988
+ [name: string]: unknown;
989
+ };
990
+ content: {
991
+ "application/json": components["schemas"]["CreateWebhookSubscriptionResponse"];
992
+ };
993
+ };
994
+ /** @description Validation failure */
995
+ 400: {
996
+ headers: {
997
+ [name: string]: unknown;
998
+ };
999
+ content: {
1000
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1001
+ };
1002
+ };
1003
+ /** @description Authentication failure */
1004
+ 401: {
1005
+ headers: {
1006
+ [name: string]: unknown;
1007
+ };
1008
+ content: {
1009
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1010
+ };
1011
+ };
1012
+ /** @description Rate limit exceeded */
1013
+ 429: {
1014
+ headers: {
1015
+ [name: string]: unknown;
1016
+ };
1017
+ content: {
1018
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1019
+ };
1020
+ };
1021
+ /** @description Internal server error */
1022
+ 500: {
1023
+ headers: {
1024
+ [name: string]: unknown;
1025
+ };
1026
+ content: {
1027
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1028
+ };
1029
+ };
1030
+ /** @description Service unavailable */
1031
+ 503: {
1032
+ headers: {
1033
+ [name: string]: unknown;
1034
+ };
1035
+ content: {
1036
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1037
+ };
1038
+ };
1039
+ };
1040
+ };
1041
+ delete?: never;
1042
+ options?: never;
1043
+ head?: never;
1044
+ patch?: never;
1045
+ trace?: never;
1046
+ };
1047
+ "/webhook_subscriptions/{id}": {
1048
+ parameters: {
1049
+ query?: never;
1050
+ header?: never;
1051
+ path?: never;
1052
+ cookie?: never;
1053
+ };
1054
+ /** Fetch one webhook subscription */
1055
+ get: {
1056
+ parameters: {
1057
+ query?: never;
1058
+ header?: never;
1059
+ path: {
1060
+ id: string;
1061
+ };
1062
+ cookie?: never;
1063
+ };
1064
+ requestBody?: never;
1065
+ responses: {
1066
+ /** @description Subscription resource */
1067
+ 200: {
1068
+ headers: {
1069
+ [name: string]: unknown;
1070
+ };
1071
+ content: {
1072
+ "application/json": components["schemas"]["GetWebhookSubscriptionResponse"];
1073
+ };
1074
+ };
1075
+ /** @description Validation failure */
1076
+ 400: {
1077
+ headers: {
1078
+ [name: string]: unknown;
1079
+ };
1080
+ content: {
1081
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1082
+ };
1083
+ };
1084
+ /** @description Authentication failure */
1085
+ 401: {
1086
+ headers: {
1087
+ [name: string]: unknown;
1088
+ };
1089
+ content: {
1090
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1091
+ };
1092
+ };
1093
+ /** @description Resource not found */
1094
+ 404: {
1095
+ headers: {
1096
+ [name: string]: unknown;
1097
+ };
1098
+ content: {
1099
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1100
+ };
1101
+ };
1102
+ /** @description Rate limit exceeded */
1103
+ 429: {
1104
+ headers: {
1105
+ [name: string]: unknown;
1106
+ };
1107
+ content: {
1108
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1109
+ };
1110
+ };
1111
+ /** @description Internal server error */
1112
+ 500: {
1113
+ headers: {
1114
+ [name: string]: unknown;
1115
+ };
1116
+ content: {
1117
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1118
+ };
1119
+ };
1120
+ };
1121
+ };
1122
+ put?: never;
1123
+ post?: never;
1124
+ /** Delete a webhook subscription */
1125
+ delete: {
1126
+ parameters: {
1127
+ query?: never;
1128
+ header?: never;
1129
+ path: {
1130
+ id: string;
1131
+ };
1132
+ cookie?: never;
1133
+ };
1134
+ requestBody?: never;
1135
+ responses: {
1136
+ /** @description Deleted */
1137
+ 200: {
1138
+ headers: {
1139
+ [name: string]: unknown;
1140
+ };
1141
+ content: {
1142
+ "application/json": components["schemas"]["DeleteWebhookSubscriptionResponse"];
1143
+ };
1144
+ };
1145
+ /** @description Validation failure */
1146
+ 400: {
1147
+ headers: {
1148
+ [name: string]: unknown;
1149
+ };
1150
+ content: {
1151
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1152
+ };
1153
+ };
1154
+ /** @description Authentication failure */
1155
+ 401: {
1156
+ headers: {
1157
+ [name: string]: unknown;
1158
+ };
1159
+ content: {
1160
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1161
+ };
1162
+ };
1163
+ /** @description Resource not found */
1164
+ 404: {
1165
+ headers: {
1166
+ [name: string]: unknown;
1167
+ };
1168
+ content: {
1169
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1170
+ };
1171
+ };
1172
+ /** @description Rate limit exceeded */
1173
+ 429: {
1174
+ headers: {
1175
+ [name: string]: unknown;
1176
+ };
1177
+ content: {
1178
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1179
+ };
1180
+ };
1181
+ /** @description Internal server error */
1182
+ 500: {
1183
+ headers: {
1184
+ [name: string]: unknown;
1185
+ };
1186
+ content: {
1187
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1188
+ };
1189
+ };
1190
+ };
1191
+ };
1192
+ options?: never;
1193
+ head?: never;
1194
+ /**
1195
+ * Update a webhook subscription
1196
+ * @description Toggle status (active/paused), update URL/events/description.
1197
+ */
1198
+ patch: {
1199
+ parameters: {
1200
+ query?: never;
1201
+ header?: never;
1202
+ path: {
1203
+ id: string;
1204
+ };
1205
+ cookie?: never;
1206
+ };
1207
+ requestBody?: {
1208
+ content: {
1209
+ "application/json": {
1210
+ /** Format: uri */
1211
+ url?: string;
1212
+ description?: string | null;
1213
+ events?: ("message.received" | "message.status" | "conversation.assigned" | "conversation.closed" | "contact.created" | "contact.updated")[];
1214
+ /** @enum {string} */
1215
+ status?: "active" | "paused";
1216
+ };
1217
+ };
1218
+ };
1219
+ responses: {
1220
+ /** @description Updated subscription */
1221
+ 200: {
1222
+ headers: {
1223
+ [name: string]: unknown;
1224
+ };
1225
+ content: {
1226
+ "application/json": components["schemas"]["UpdateWebhookSubscriptionResponse"];
1227
+ };
1228
+ };
1229
+ /** @description Validation failure */
1230
+ 400: {
1231
+ headers: {
1232
+ [name: string]: unknown;
1233
+ };
1234
+ content: {
1235
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1236
+ };
1237
+ };
1238
+ /** @description Authentication failure */
1239
+ 401: {
1240
+ headers: {
1241
+ [name: string]: unknown;
1242
+ };
1243
+ content: {
1244
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1245
+ };
1246
+ };
1247
+ /** @description Resource not found */
1248
+ 404: {
1249
+ headers: {
1250
+ [name: string]: unknown;
1251
+ };
1252
+ content: {
1253
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1254
+ };
1255
+ };
1256
+ /** @description Rate limit exceeded */
1257
+ 429: {
1258
+ headers: {
1259
+ [name: string]: unknown;
1260
+ };
1261
+ content: {
1262
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1263
+ };
1264
+ };
1265
+ /** @description Internal server error */
1266
+ 500: {
1267
+ headers: {
1268
+ [name: string]: unknown;
1269
+ };
1270
+ content: {
1271
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1272
+ };
1273
+ };
1274
+ };
1275
+ };
1276
+ trace?: never;
1277
+ };
1278
+ "/webhook_subscriptions/{id}/secrets": {
1279
+ parameters: {
1280
+ query?: never;
1281
+ header?: never;
1282
+ path?: never;
1283
+ cookie?: never;
1284
+ };
1285
+ get?: never;
1286
+ put?: never;
1287
+ /**
1288
+ * Add a new signing secret (rotation)
1289
+ * @description Issue a new signing secret with the given expiry. During the overlap window every active secret is used to sign outbound deliveries; subscribers verify against any of them.
1290
+ */
1291
+ post: {
1292
+ parameters: {
1293
+ query?: never;
1294
+ header?: never;
1295
+ path: {
1296
+ id: string;
1297
+ };
1298
+ cookie?: never;
1299
+ };
1300
+ requestBody?: {
1301
+ content: {
1302
+ "application/json": {
1303
+ expires_in_hours?: number;
1304
+ };
1305
+ };
1306
+ };
1307
+ responses: {
1308
+ /** @description New secret created */
1309
+ 200: {
1310
+ headers: {
1311
+ [name: string]: unknown;
1312
+ };
1313
+ content: {
1314
+ "application/json": components["schemas"]["AddWebhookSecretResponse"];
1315
+ };
1316
+ };
1317
+ /** @description Validation failure */
1318
+ 400: {
1319
+ headers: {
1320
+ [name: string]: unknown;
1321
+ };
1322
+ content: {
1323
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1324
+ };
1325
+ };
1326
+ /** @description Authentication failure */
1327
+ 401: {
1328
+ headers: {
1329
+ [name: string]: unknown;
1330
+ };
1331
+ content: {
1332
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1333
+ };
1334
+ };
1335
+ /** @description Resource not found */
1336
+ 404: {
1337
+ headers: {
1338
+ [name: string]: unknown;
1339
+ };
1340
+ content: {
1341
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1342
+ };
1343
+ };
1344
+ /** @description Conflict (e.g. webhook subscription disabled) */
1345
+ 409: {
1346
+ headers: {
1347
+ [name: string]: unknown;
1348
+ };
1349
+ content: {
1350
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1351
+ };
1352
+ };
1353
+ /** @description Rate limit exceeded */
1354
+ 429: {
1355
+ headers: {
1356
+ [name: string]: unknown;
1357
+ };
1358
+ content: {
1359
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1360
+ };
1361
+ };
1362
+ /** @description Internal server error */
1363
+ 500: {
1364
+ headers: {
1365
+ [name: string]: unknown;
1366
+ };
1367
+ content: {
1368
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1369
+ };
1370
+ };
1371
+ /** @description Service unavailable */
1372
+ 503: {
1373
+ headers: {
1374
+ [name: string]: unknown;
1375
+ };
1376
+ content: {
1377
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1378
+ };
1379
+ };
1380
+ };
1381
+ };
1382
+ delete?: never;
1383
+ options?: never;
1384
+ head?: never;
1385
+ patch?: never;
1386
+ trace?: never;
1387
+ };
1388
+ "/webhook_subscriptions/{id}/secrets/{secret_id}": {
1389
+ parameters: {
1390
+ query?: never;
1391
+ header?: never;
1392
+ path?: never;
1393
+ cookie?: never;
1394
+ };
1395
+ get?: never;
1396
+ put?: never;
1397
+ post?: never;
1398
+ /** Revoke a signing secret */
1399
+ delete: {
1400
+ parameters: {
1401
+ query?: never;
1402
+ header?: never;
1403
+ path: {
1404
+ id: string;
1405
+ secret_id: string;
1406
+ };
1407
+ cookie?: never;
1408
+ };
1409
+ requestBody?: never;
1410
+ responses: {
1411
+ /** @description Secret revoked */
1412
+ 200: {
1413
+ headers: {
1414
+ [name: string]: unknown;
1415
+ };
1416
+ content: {
1417
+ "application/json": components["schemas"]["DeleteWebhookSecretResponse"];
1418
+ };
1419
+ };
1420
+ /** @description Validation failure */
1421
+ 400: {
1422
+ headers: {
1423
+ [name: string]: unknown;
1424
+ };
1425
+ content: {
1426
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1427
+ };
1428
+ };
1429
+ /** @description Authentication failure */
1430
+ 401: {
1431
+ headers: {
1432
+ [name: string]: unknown;
1433
+ };
1434
+ content: {
1435
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1436
+ };
1437
+ };
1438
+ /** @description Resource not found */
1439
+ 404: {
1440
+ headers: {
1441
+ [name: string]: unknown;
1442
+ };
1443
+ content: {
1444
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1445
+ };
1446
+ };
1447
+ /** @description Semantic failure (e.g. idempotency key reuse) */
1448
+ 422: {
1449
+ headers: {
1450
+ [name: string]: unknown;
1451
+ };
1452
+ content: {
1453
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1454
+ };
1455
+ };
1456
+ /** @description Rate limit exceeded */
1457
+ 429: {
1458
+ headers: {
1459
+ [name: string]: unknown;
1460
+ };
1461
+ content: {
1462
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1463
+ };
1464
+ };
1465
+ /** @description Internal server error */
1466
+ 500: {
1467
+ headers: {
1468
+ [name: string]: unknown;
1469
+ };
1470
+ content: {
1471
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1472
+ };
1473
+ };
1474
+ };
1475
+ };
1476
+ options?: never;
1477
+ head?: never;
1478
+ patch?: never;
1479
+ trace?: never;
1480
+ };
1481
+ "/webhook_deliveries": {
1482
+ parameters: {
1483
+ query?: never;
1484
+ header?: never;
1485
+ path?: never;
1486
+ cookie?: never;
1487
+ };
1488
+ /** List webhook deliveries */
1489
+ get: {
1490
+ parameters: {
1491
+ query?: {
1492
+ subscription_id?: string;
1493
+ status?: "pending" | "succeeded" | "failed" | "dead";
1494
+ event_type?: string;
1495
+ created_after?: string;
1496
+ created_before?: string;
1497
+ limit?: string;
1498
+ cursor?: string;
1499
+ };
1500
+ header?: never;
1501
+ path?: never;
1502
+ cookie?: never;
1503
+ };
1504
+ requestBody?: never;
1505
+ responses: {
1506
+ /** @description Delivery list */
1507
+ 200: {
1508
+ headers: {
1509
+ [name: string]: unknown;
1510
+ };
1511
+ content: {
1512
+ "application/json": components["schemas"]["ListWebhookDeliveriesResponse"];
1513
+ };
1514
+ };
1515
+ /** @description Validation failure */
1516
+ 400: {
1517
+ headers: {
1518
+ [name: string]: unknown;
1519
+ };
1520
+ content: {
1521
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1522
+ };
1523
+ };
1524
+ /** @description Authentication failure */
1525
+ 401: {
1526
+ headers: {
1527
+ [name: string]: unknown;
1528
+ };
1529
+ content: {
1530
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1531
+ };
1532
+ };
1533
+ /** @description Rate limit exceeded */
1534
+ 429: {
1535
+ headers: {
1536
+ [name: string]: unknown;
1537
+ };
1538
+ content: {
1539
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1540
+ };
1541
+ };
1542
+ /** @description Internal server error */
1543
+ 500: {
1544
+ headers: {
1545
+ [name: string]: unknown;
1546
+ };
1547
+ content: {
1548
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1549
+ };
1550
+ };
1551
+ };
1552
+ };
1553
+ put?: never;
1554
+ post?: never;
1555
+ delete?: never;
1556
+ options?: never;
1557
+ head?: never;
1558
+ patch?: never;
1559
+ trace?: never;
1560
+ };
1561
+ "/webhook_deliveries/{id}": {
1562
+ parameters: {
1563
+ query?: never;
1564
+ header?: never;
1565
+ path?: never;
1566
+ cookie?: never;
1567
+ };
1568
+ /** Fetch one delivery (with full payload) */
1569
+ get: {
1570
+ parameters: {
1571
+ query?: never;
1572
+ header?: never;
1573
+ path: {
1574
+ id: string;
1575
+ };
1576
+ cookie?: never;
1577
+ };
1578
+ requestBody?: never;
1579
+ responses: {
1580
+ /** @description Delivery resource */
1581
+ 200: {
1582
+ headers: {
1583
+ [name: string]: unknown;
1584
+ };
1585
+ content: {
1586
+ "application/json": components["schemas"]["GetWebhookDeliveryResponse"];
1587
+ };
1588
+ };
1589
+ /** @description Validation failure */
1590
+ 400: {
1591
+ headers: {
1592
+ [name: string]: unknown;
1593
+ };
1594
+ content: {
1595
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1596
+ };
1597
+ };
1598
+ /** @description Authentication failure */
1599
+ 401: {
1600
+ headers: {
1601
+ [name: string]: unknown;
1602
+ };
1603
+ content: {
1604
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1605
+ };
1606
+ };
1607
+ /** @description Resource not found */
1608
+ 404: {
1609
+ headers: {
1610
+ [name: string]: unknown;
1611
+ };
1612
+ content: {
1613
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1614
+ };
1615
+ };
1616
+ /** @description Rate limit exceeded */
1617
+ 429: {
1618
+ headers: {
1619
+ [name: string]: unknown;
1620
+ };
1621
+ content: {
1622
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1623
+ };
1624
+ };
1625
+ /** @description Internal server error */
1626
+ 500: {
1627
+ headers: {
1628
+ [name: string]: unknown;
1629
+ };
1630
+ content: {
1631
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1632
+ };
1633
+ };
1634
+ };
1635
+ };
1636
+ put?: never;
1637
+ post?: never;
1638
+ delete?: never;
1639
+ options?: never;
1640
+ head?: never;
1641
+ patch?: never;
1642
+ trace?: never;
1643
+ };
1644
+ "/webhook_deliveries/{id}/replay": {
1645
+ parameters: {
1646
+ query?: never;
1647
+ header?: never;
1648
+ path?: never;
1649
+ cookie?: never;
1650
+ };
1651
+ get?: never;
1652
+ put?: never;
1653
+ /**
1654
+ * Replay a single delivery
1655
+ * @description Re-fire a single delivery against the original subscription URL. Creates a fresh delivery row; the original stays for audit.
1656
+ */
1657
+ post: {
1658
+ parameters: {
1659
+ query?: never;
1660
+ header?: never;
1661
+ path: {
1662
+ id: string;
1663
+ };
1664
+ cookie?: never;
1665
+ };
1666
+ requestBody?: never;
1667
+ responses: {
1668
+ /** @description Replay enqueued */
1669
+ 200: {
1670
+ headers: {
1671
+ [name: string]: unknown;
1672
+ };
1673
+ content: {
1674
+ "application/json": components["schemas"]["ReplayWebhookDeliveryResponse"];
1675
+ };
1676
+ };
1677
+ /** @description Validation failure */
1678
+ 400: {
1679
+ headers: {
1680
+ [name: string]: unknown;
1681
+ };
1682
+ content: {
1683
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1684
+ };
1685
+ };
1686
+ /** @description Authentication failure */
1687
+ 401: {
1688
+ headers: {
1689
+ [name: string]: unknown;
1690
+ };
1691
+ content: {
1692
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1693
+ };
1694
+ };
1695
+ /** @description Resource not found */
1696
+ 404: {
1697
+ headers: {
1698
+ [name: string]: unknown;
1699
+ };
1700
+ content: {
1701
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1702
+ };
1703
+ };
1704
+ /** @description Conflict (e.g. webhook subscription disabled) */
1705
+ 409: {
1706
+ headers: {
1707
+ [name: string]: unknown;
1708
+ };
1709
+ content: {
1710
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1711
+ };
1712
+ };
1713
+ /** @description Rate limit exceeded */
1714
+ 429: {
1715
+ headers: {
1716
+ [name: string]: unknown;
1717
+ };
1718
+ content: {
1719
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1720
+ };
1721
+ };
1722
+ /** @description Internal server error */
1723
+ 500: {
1724
+ headers: {
1725
+ [name: string]: unknown;
1726
+ };
1727
+ content: {
1728
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1729
+ };
1730
+ };
1731
+ };
1732
+ };
1733
+ delete?: never;
1734
+ options?: never;
1735
+ head?: never;
1736
+ patch?: never;
1737
+ trace?: never;
1738
+ };
1739
+ "/webhook_deliveries/bulk_replay": {
1740
+ parameters: {
1741
+ query?: never;
1742
+ header?: never;
1743
+ path?: never;
1744
+ cookie?: never;
1745
+ };
1746
+ get?: never;
1747
+ put?: never;
1748
+ /**
1749
+ * Replay deliveries in bulk (DLQ)
1750
+ * @description Replay every delivery for a subscription matching the filter, capped at 1000 per request. Paginate via `created_after` / `created_before` for larger backfills.
1751
+ */
1752
+ post: {
1753
+ parameters: {
1754
+ query?: never;
1755
+ header?: never;
1756
+ path?: never;
1757
+ cookie?: never;
1758
+ };
1759
+ requestBody?: {
1760
+ content: {
1761
+ "application/json": {
1762
+ subscription_id: string;
1763
+ /**
1764
+ * @default dead
1765
+ * @enum {string}
1766
+ */
1767
+ status?: "failed" | "dead";
1768
+ event_type?: string;
1769
+ /** Format: date-time */
1770
+ created_after?: string;
1771
+ /** Format: date-time */
1772
+ created_before?: string;
1773
+ };
1774
+ };
1775
+ };
1776
+ responses: {
1777
+ /** @description Bulk replay enqueued */
1778
+ 200: {
1779
+ headers: {
1780
+ [name: string]: unknown;
1781
+ };
1782
+ content: {
1783
+ "application/json": components["schemas"]["BulkReplayResponse"];
1784
+ };
1785
+ };
1786
+ /** @description Validation failure */
1787
+ 400: {
1788
+ headers: {
1789
+ [name: string]: unknown;
1790
+ };
1791
+ content: {
1792
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1793
+ };
1794
+ };
1795
+ /** @description Authentication failure */
1796
+ 401: {
1797
+ headers: {
1798
+ [name: string]: unknown;
1799
+ };
1800
+ content: {
1801
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1802
+ };
1803
+ };
1804
+ /** @description Resource not found */
1805
+ 404: {
1806
+ headers: {
1807
+ [name: string]: unknown;
1808
+ };
1809
+ content: {
1810
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1811
+ };
1812
+ };
1813
+ /** @description Conflict (e.g. webhook subscription disabled) */
1814
+ 409: {
1815
+ headers: {
1816
+ [name: string]: unknown;
1817
+ };
1818
+ content: {
1819
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1820
+ };
1821
+ };
1822
+ /** @description Rate limit exceeded */
1823
+ 429: {
1824
+ headers: {
1825
+ [name: string]: unknown;
1826
+ };
1827
+ content: {
1828
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1829
+ };
1830
+ };
1831
+ /** @description Internal server error */
1832
+ 500: {
1833
+ headers: {
1834
+ [name: string]: unknown;
1835
+ };
1836
+ content: {
1837
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1838
+ };
1839
+ };
1840
+ };
1841
+ };
1842
+ delete?: never;
1843
+ options?: never;
1844
+ head?: never;
1845
+ patch?: never;
1846
+ trace?: never;
1847
+ };
1848
+ "/{phone_number_id}/conversations": {
1849
+ parameters: {
1850
+ query?: never;
1851
+ header?: never;
1852
+ path?: never;
1853
+ cookie?: never;
1854
+ };
1855
+ /**
1856
+ * List conversations
1857
+ * @description List conversations for the WhatsApp account identified by `phone_number_id`. Ordered newest-active first by `last_message_at` (NULLS LAST).
1858
+ */
1859
+ get: {
1860
+ parameters: {
1861
+ query?: {
1862
+ status?: "open" | "resolved" | "pending";
1863
+ contact_id?: string;
1864
+ limit?: string;
1865
+ cursor?: string;
1866
+ };
1867
+ header?: never;
1868
+ path: {
1869
+ phone_number_id: string;
1870
+ };
1871
+ cookie?: never;
1872
+ };
1873
+ requestBody?: never;
1874
+ responses: {
1875
+ /** @description Conversation list */
1876
+ 200: {
1877
+ headers: {
1878
+ [name: string]: unknown;
1879
+ };
1880
+ content: {
1881
+ "application/json": components["schemas"]["ListConversationsResponse"];
1882
+ };
1883
+ };
1884
+ /** @description Validation failure */
1885
+ 400: {
1886
+ headers: {
1887
+ [name: string]: unknown;
1888
+ };
1889
+ content: {
1890
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1891
+ };
1892
+ };
1893
+ /** @description Authentication failure */
1894
+ 401: {
1895
+ headers: {
1896
+ [name: string]: unknown;
1897
+ };
1898
+ content: {
1899
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1900
+ };
1901
+ };
1902
+ /** @description Resource not found */
1903
+ 404: {
1904
+ headers: {
1905
+ [name: string]: unknown;
1906
+ };
1907
+ content: {
1908
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1909
+ };
1910
+ };
1911
+ /** @description Semantic failure (e.g. idempotency key reuse) */
1912
+ 422: {
1913
+ headers: {
1914
+ [name: string]: unknown;
1915
+ };
1916
+ content: {
1917
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1918
+ };
1919
+ };
1920
+ /** @description Rate limit exceeded */
1921
+ 429: {
1922
+ headers: {
1923
+ [name: string]: unknown;
1924
+ };
1925
+ content: {
1926
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1927
+ };
1928
+ };
1929
+ /** @description Internal server error */
1930
+ 500: {
1931
+ headers: {
1932
+ [name: string]: unknown;
1933
+ };
1934
+ content: {
1935
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1936
+ };
1937
+ };
1938
+ };
1939
+ };
1940
+ put?: never;
1941
+ post?: never;
1942
+ delete?: never;
1943
+ options?: never;
1944
+ head?: never;
1945
+ patch?: never;
1946
+ trace?: never;
1947
+ };
1948
+ "/{phone_number_id}/conversations/{id}": {
1949
+ parameters: {
1950
+ query?: never;
1951
+ header?: never;
1952
+ path?: never;
1953
+ cookie?: never;
1954
+ };
1955
+ /** Fetch a conversation by id */
1956
+ get: {
1957
+ parameters: {
1958
+ query?: never;
1959
+ header?: never;
1960
+ path: {
1961
+ phone_number_id: string;
1962
+ id: string;
1963
+ };
1964
+ cookie?: never;
1965
+ };
1966
+ requestBody?: never;
1967
+ responses: {
1968
+ /** @description Conversation resource */
1969
+ 200: {
1970
+ headers: {
1971
+ [name: string]: unknown;
1972
+ };
1973
+ content: {
1974
+ "application/json": components["schemas"]["GetConversationResponse"];
1975
+ };
1976
+ };
1977
+ /** @description Validation failure */
1978
+ 400: {
1979
+ headers: {
1980
+ [name: string]: unknown;
1981
+ };
1982
+ content: {
1983
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1984
+ };
1985
+ };
1986
+ /** @description Authentication failure */
1987
+ 401: {
1988
+ headers: {
1989
+ [name: string]: unknown;
1990
+ };
1991
+ content: {
1992
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1993
+ };
1994
+ };
1995
+ /** @description Resource not found */
1996
+ 404: {
1997
+ headers: {
1998
+ [name: string]: unknown;
1999
+ };
2000
+ content: {
2001
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2002
+ };
2003
+ };
2004
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2005
+ 422: {
2006
+ headers: {
2007
+ [name: string]: unknown;
2008
+ };
2009
+ content: {
2010
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2011
+ };
2012
+ };
2013
+ /** @description Rate limit exceeded */
2014
+ 429: {
2015
+ headers: {
2016
+ [name: string]: unknown;
2017
+ };
2018
+ content: {
2019
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2020
+ };
2021
+ };
2022
+ /** @description Internal server error */
2023
+ 500: {
2024
+ headers: {
2025
+ [name: string]: unknown;
2026
+ };
2027
+ content: {
2028
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2029
+ };
2030
+ };
2031
+ };
2032
+ };
2033
+ put?: never;
2034
+ post?: never;
2035
+ delete?: never;
2036
+ options?: never;
2037
+ head?: never;
2038
+ /**
2039
+ * Update a conversation
2040
+ * @description Update status (`open` / `resolved` / `pending`) and/or `assigned_to` (user id, or `null` to clear). At least one field must be present.
2041
+ */
2042
+ patch: {
2043
+ parameters: {
2044
+ query?: never;
2045
+ header?: never;
2046
+ path: {
2047
+ phone_number_id: string;
2048
+ id: string;
2049
+ };
2050
+ cookie?: never;
2051
+ };
2052
+ requestBody?: {
2053
+ content: {
2054
+ "application/json": {
2055
+ /** @enum {string} */
2056
+ status?: "open" | "resolved" | "pending";
2057
+ assigned_to?: string | null;
2058
+ };
2059
+ };
2060
+ };
2061
+ responses: {
2062
+ /** @description Updated conversation */
2063
+ 200: {
2064
+ headers: {
2065
+ [name: string]: unknown;
2066
+ };
2067
+ content: {
2068
+ "application/json": components["schemas"]["UpdateConversationResponse"];
2069
+ };
2070
+ };
2071
+ /** @description Validation failure */
2072
+ 400: {
2073
+ headers: {
2074
+ [name: string]: unknown;
2075
+ };
2076
+ content: {
2077
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2078
+ };
2079
+ };
2080
+ /** @description Authentication failure */
2081
+ 401: {
2082
+ headers: {
2083
+ [name: string]: unknown;
2084
+ };
2085
+ content: {
2086
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2087
+ };
2088
+ };
2089
+ /** @description Resource not found */
2090
+ 404: {
2091
+ headers: {
2092
+ [name: string]: unknown;
2093
+ };
2094
+ content: {
2095
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2096
+ };
2097
+ };
2098
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2099
+ 422: {
2100
+ headers: {
2101
+ [name: string]: unknown;
2102
+ };
2103
+ content: {
2104
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2105
+ };
2106
+ };
2107
+ /** @description Rate limit exceeded */
2108
+ 429: {
2109
+ headers: {
2110
+ [name: string]: unknown;
2111
+ };
2112
+ content: {
2113
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2114
+ };
2115
+ };
2116
+ /** @description Internal server error */
2117
+ 500: {
2118
+ headers: {
2119
+ [name: string]: unknown;
2120
+ };
2121
+ content: {
2122
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2123
+ };
2124
+ };
2125
+ };
2126
+ };
2127
+ trace?: never;
2128
+ };
2129
+ "/{phone_number_id}/contacts": {
2130
+ parameters: {
2131
+ query?: never;
2132
+ header?: never;
2133
+ path?: never;
2134
+ cookie?: never;
2135
+ };
2136
+ /**
2137
+ * List contacts
2138
+ * @description List contacts attached to the WhatsApp account identified by `phone_number_id`. Filter by exact `phone` (E.164) or partial `search` (matches name and email).
2139
+ */
2140
+ get: {
2141
+ parameters: {
2142
+ query?: {
2143
+ phone?: string;
2144
+ search?: string;
2145
+ limit?: string;
2146
+ cursor?: string;
2147
+ };
2148
+ header?: never;
2149
+ path: {
2150
+ phone_number_id: string;
2151
+ };
2152
+ cookie?: never;
2153
+ };
2154
+ requestBody?: never;
2155
+ responses: {
2156
+ /** @description Contact list */
2157
+ 200: {
2158
+ headers: {
2159
+ [name: string]: unknown;
2160
+ };
2161
+ content: {
2162
+ "application/json": components["schemas"]["ListContactsResponse"];
2163
+ };
2164
+ };
2165
+ /** @description Validation failure */
2166
+ 400: {
2167
+ headers: {
2168
+ [name: string]: unknown;
2169
+ };
2170
+ content: {
2171
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2172
+ };
2173
+ };
2174
+ /** @description Authentication failure */
2175
+ 401: {
2176
+ headers: {
2177
+ [name: string]: unknown;
2178
+ };
2179
+ content: {
2180
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2181
+ };
2182
+ };
2183
+ /** @description Resource not found */
2184
+ 404: {
2185
+ headers: {
2186
+ [name: string]: unknown;
2187
+ };
2188
+ content: {
2189
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2190
+ };
2191
+ };
2192
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2193
+ 422: {
2194
+ headers: {
2195
+ [name: string]: unknown;
2196
+ };
2197
+ content: {
2198
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2199
+ };
2200
+ };
2201
+ /** @description Rate limit exceeded */
2202
+ 429: {
2203
+ headers: {
2204
+ [name: string]: unknown;
2205
+ };
2206
+ content: {
2207
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2208
+ };
2209
+ };
2210
+ /** @description Internal server error */
2211
+ 500: {
2212
+ headers: {
2213
+ [name: string]: unknown;
2214
+ };
2215
+ content: {
2216
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2217
+ };
2218
+ };
2219
+ };
2220
+ };
2221
+ put?: never;
2222
+ /**
2223
+ * Create a contact
2224
+ * @description Create a contact attached to the WhatsApp account identified by `phone_number_id` in the URL path.
2225
+ */
2226
+ post: {
2227
+ parameters: {
2228
+ query?: never;
2229
+ header?: never;
2230
+ path: {
2231
+ phone_number_id: string;
2232
+ };
2233
+ cookie?: never;
2234
+ };
2235
+ requestBody?: {
2236
+ content: {
2237
+ "application/json": {
2238
+ phone_number: string;
2239
+ name?: string;
2240
+ /** Format: email */
2241
+ email?: string | null;
2242
+ metadata?: {
2243
+ [key: string]: unknown;
2244
+ };
2245
+ };
2246
+ };
2247
+ };
2248
+ responses: {
2249
+ /** @description Contact created */
2250
+ 200: {
2251
+ headers: {
2252
+ [name: string]: unknown;
2253
+ };
2254
+ content: {
2255
+ "application/json": components["schemas"]["CreateContactResponse"];
2256
+ };
2257
+ };
2258
+ /** @description Validation failure */
2259
+ 400: {
2260
+ headers: {
2261
+ [name: string]: unknown;
2262
+ };
2263
+ content: {
2264
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2265
+ };
2266
+ };
2267
+ /** @description Authentication failure */
2268
+ 401: {
2269
+ headers: {
2270
+ [name: string]: unknown;
2271
+ };
2272
+ content: {
2273
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2274
+ };
2275
+ };
2276
+ /** @description Resource not found */
2277
+ 404: {
2278
+ headers: {
2279
+ [name: string]: unknown;
2280
+ };
2281
+ content: {
2282
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2283
+ };
2284
+ };
2285
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2286
+ 422: {
2287
+ headers: {
2288
+ [name: string]: unknown;
2289
+ };
2290
+ content: {
2291
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2292
+ };
2293
+ };
2294
+ /** @description Rate limit exceeded */
2295
+ 429: {
2296
+ headers: {
2297
+ [name: string]: unknown;
2298
+ };
2299
+ content: {
2300
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2301
+ };
2302
+ };
2303
+ /** @description Internal server error */
2304
+ 500: {
2305
+ headers: {
2306
+ [name: string]: unknown;
2307
+ };
2308
+ content: {
2309
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2310
+ };
2311
+ };
2312
+ };
2313
+ };
2314
+ delete?: never;
2315
+ options?: never;
2316
+ head?: never;
2317
+ patch?: never;
2318
+ trace?: never;
2319
+ };
2320
+ "/{phone_number_id}/contacts/{id}": {
2321
+ parameters: {
2322
+ query?: never;
2323
+ header?: never;
2324
+ path?: never;
2325
+ cookie?: never;
2326
+ };
2327
+ /** Fetch a contact by id */
2328
+ get: {
2329
+ parameters: {
2330
+ query?: never;
2331
+ header?: never;
2332
+ path: {
2333
+ phone_number_id: string;
2334
+ id: string;
2335
+ };
2336
+ cookie?: never;
2337
+ };
2338
+ requestBody?: never;
2339
+ responses: {
2340
+ /** @description Contact resource */
2341
+ 200: {
2342
+ headers: {
2343
+ [name: string]: unknown;
2344
+ };
2345
+ content: {
2346
+ "application/json": components["schemas"]["GetContactResponse"];
2347
+ };
2348
+ };
2349
+ /** @description Validation failure */
2350
+ 400: {
2351
+ headers: {
2352
+ [name: string]: unknown;
2353
+ };
2354
+ content: {
2355
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2356
+ };
2357
+ };
2358
+ /** @description Authentication failure */
2359
+ 401: {
2360
+ headers: {
2361
+ [name: string]: unknown;
2362
+ };
2363
+ content: {
2364
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2365
+ };
2366
+ };
2367
+ /** @description Resource not found */
2368
+ 404: {
2369
+ headers: {
2370
+ [name: string]: unknown;
2371
+ };
2372
+ content: {
2373
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2374
+ };
2375
+ };
2376
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2377
+ 422: {
2378
+ headers: {
2379
+ [name: string]: unknown;
2380
+ };
2381
+ content: {
2382
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2383
+ };
2384
+ };
2385
+ /** @description Rate limit exceeded */
2386
+ 429: {
2387
+ headers: {
2388
+ [name: string]: unknown;
2389
+ };
2390
+ content: {
2391
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2392
+ };
2393
+ };
2394
+ /** @description Internal server error */
2395
+ 500: {
2396
+ headers: {
2397
+ [name: string]: unknown;
2398
+ };
2399
+ content: {
2400
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2401
+ };
2402
+ };
2403
+ };
2404
+ };
2405
+ put?: never;
2406
+ post?: never;
2407
+ /**
2408
+ * Delete a contact
2409
+ * @description Hard-deletes the contact and cascades to its conversations, messages, and label attachments. Irreversible.
2410
+ */
2411
+ delete: {
2412
+ parameters: {
2413
+ query?: never;
2414
+ header?: never;
2415
+ path: {
2416
+ phone_number_id: string;
2417
+ id: string;
2418
+ };
2419
+ cookie?: never;
2420
+ };
2421
+ requestBody?: never;
2422
+ responses: {
2423
+ /** @description Deleted */
2424
+ 200: {
2425
+ headers: {
2426
+ [name: string]: unknown;
2427
+ };
2428
+ content: {
2429
+ "application/json": components["schemas"]["DeleteContactResponse"];
2430
+ };
2431
+ };
2432
+ /** @description Validation failure */
2433
+ 400: {
2434
+ headers: {
2435
+ [name: string]: unknown;
2436
+ };
2437
+ content: {
2438
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2439
+ };
2440
+ };
2441
+ /** @description Authentication failure */
2442
+ 401: {
2443
+ headers: {
2444
+ [name: string]: unknown;
2445
+ };
2446
+ content: {
2447
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2448
+ };
2449
+ };
2450
+ /** @description Resource not found */
2451
+ 404: {
2452
+ headers: {
2453
+ [name: string]: unknown;
2454
+ };
2455
+ content: {
2456
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2457
+ };
2458
+ };
2459
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2460
+ 422: {
2461
+ headers: {
2462
+ [name: string]: unknown;
2463
+ };
2464
+ content: {
2465
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2466
+ };
2467
+ };
2468
+ /** @description Rate limit exceeded */
2469
+ 429: {
2470
+ headers: {
2471
+ [name: string]: unknown;
2472
+ };
2473
+ content: {
2474
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2475
+ };
2476
+ };
2477
+ /** @description Internal server error */
2478
+ 500: {
2479
+ headers: {
2480
+ [name: string]: unknown;
2481
+ };
2482
+ content: {
2483
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2484
+ };
2485
+ };
2486
+ };
2487
+ };
2488
+ options?: never;
2489
+ head?: never;
2490
+ /**
2491
+ * Update a contact
2492
+ * @description Patch name, email, or metadata. Phone number is the identity column and cannot be changed via the API.
2493
+ */
2494
+ patch: {
2495
+ parameters: {
2496
+ query?: never;
2497
+ header?: never;
2498
+ path: {
2499
+ phone_number_id: string;
2500
+ id: string;
2501
+ };
2502
+ cookie?: never;
2503
+ };
2504
+ requestBody?: {
2505
+ content: {
2506
+ "application/json": {
2507
+ name?: string | null;
2508
+ email?: string | "" | null;
2509
+ metadata?: {
2510
+ [key: string]: unknown;
2511
+ } | null;
2512
+ };
2513
+ };
2514
+ };
2515
+ responses: {
2516
+ /** @description Updated contact */
2517
+ 200: {
2518
+ headers: {
2519
+ [name: string]: unknown;
2520
+ };
2521
+ content: {
2522
+ "application/json": components["schemas"]["UpdateContactResponse"];
2523
+ };
2524
+ };
2525
+ /** @description Validation failure */
2526
+ 400: {
2527
+ headers: {
2528
+ [name: string]: unknown;
2529
+ };
2530
+ content: {
2531
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2532
+ };
2533
+ };
2534
+ /** @description Authentication failure */
2535
+ 401: {
2536
+ headers: {
2537
+ [name: string]: unknown;
2538
+ };
2539
+ content: {
2540
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2541
+ };
2542
+ };
2543
+ /** @description Resource not found */
2544
+ 404: {
2545
+ headers: {
2546
+ [name: string]: unknown;
2547
+ };
2548
+ content: {
2549
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2550
+ };
2551
+ };
2552
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2553
+ 422: {
2554
+ headers: {
2555
+ [name: string]: unknown;
2556
+ };
2557
+ content: {
2558
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2559
+ };
2560
+ };
2561
+ /** @description Rate limit exceeded */
2562
+ 429: {
2563
+ headers: {
2564
+ [name: string]: unknown;
2565
+ };
2566
+ content: {
2567
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2568
+ };
2569
+ };
2570
+ /** @description Internal server error */
2571
+ 500: {
2572
+ headers: {
2573
+ [name: string]: unknown;
2574
+ };
2575
+ content: {
2576
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2577
+ };
2578
+ };
2579
+ };
2580
+ };
2581
+ trace?: never;
2582
+ };
2583
+ "/{phone_number_id}/messages/{id}/media": {
2584
+ parameters: {
2585
+ query?: never;
2586
+ header?: never;
2587
+ path?: never;
2588
+ cookie?: never;
2589
+ };
2590
+ /**
2591
+ * Redirect to the media asset for a message
2592
+ * @description Returns a 302 redirect to the underlying CDN URL when the message has media (image, document, video, audio). Returns 404 if the message has no media or if media download is still in flight.
2593
+ */
2594
+ get: {
2595
+ parameters: {
2596
+ query?: never;
2597
+ header?: never;
2598
+ path: {
2599
+ phone_number_id: string;
2600
+ id: string;
2601
+ };
2602
+ cookie?: never;
2603
+ };
2604
+ requestBody?: never;
2605
+ responses: {
2606
+ /** @description Redirect to the media URL */
2607
+ 302: {
2608
+ headers: {
2609
+ /** @description Public CDN URL for the asset */
2610
+ Location?: string;
2611
+ [name: string]: unknown;
2612
+ };
2613
+ content?: never;
2614
+ };
2615
+ /** @description Validation failure */
2616
+ 400: {
2617
+ headers: {
2618
+ [name: string]: unknown;
2619
+ };
2620
+ content: {
2621
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2622
+ };
2623
+ };
2624
+ /** @description Authentication failure */
2625
+ 401: {
2626
+ headers: {
2627
+ [name: string]: unknown;
2628
+ };
2629
+ content: {
2630
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2631
+ };
2632
+ };
2633
+ /** @description Resource not found */
2634
+ 404: {
2635
+ headers: {
2636
+ [name: string]: unknown;
2637
+ };
2638
+ content: {
2639
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2640
+ };
2641
+ };
2642
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2643
+ 422: {
2644
+ headers: {
2645
+ [name: string]: unknown;
2646
+ };
2647
+ content: {
2648
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2649
+ };
2650
+ };
2651
+ /** @description Rate limit exceeded */
2652
+ 429: {
2653
+ headers: {
2654
+ [name: string]: unknown;
2655
+ };
2656
+ content: {
2657
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2658
+ };
2659
+ };
2660
+ /** @description Internal server error */
2661
+ 500: {
2662
+ headers: {
2663
+ [name: string]: unknown;
2664
+ };
2665
+ content: {
2666
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2667
+ };
2668
+ };
2669
+ };
2670
+ };
2671
+ put?: never;
2672
+ post?: never;
2673
+ delete?: never;
2674
+ options?: never;
2675
+ head?: never;
2676
+ patch?: never;
2677
+ trace?: never;
2678
+ };
2679
+ "/{phone_number_id}/contacts/{id}/labels": {
2680
+ parameters: {
2681
+ query?: never;
2682
+ header?: never;
2683
+ path?: never;
2684
+ cookie?: never;
2685
+ };
2686
+ get?: never;
2687
+ put?: never;
2688
+ /**
2689
+ * Attach a label to a contact
2690
+ * @description Idempotent — attaching the same label twice is a no-op. The label and the contact must belong to the same team.
2691
+ */
2692
+ post: {
2693
+ parameters: {
2694
+ query?: never;
2695
+ header?: never;
2696
+ path: {
2697
+ phone_number_id: string;
2698
+ id: string;
2699
+ };
2700
+ cookie?: never;
2701
+ };
2702
+ requestBody?: {
2703
+ content: {
2704
+ "application/json": {
2705
+ label_id: string;
2706
+ };
2707
+ };
2708
+ };
2709
+ responses: {
2710
+ /** @description Attached */
2711
+ 200: {
2712
+ headers: {
2713
+ [name: string]: unknown;
2714
+ };
2715
+ content: {
2716
+ "application/json": components["schemas"]["AttachContactLabelResponse"];
2717
+ };
2718
+ };
2719
+ /** @description Validation failure */
2720
+ 400: {
2721
+ headers: {
2722
+ [name: string]: unknown;
2723
+ };
2724
+ content: {
2725
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2726
+ };
2727
+ };
2728
+ /** @description Authentication failure */
2729
+ 401: {
2730
+ headers: {
2731
+ [name: string]: unknown;
2732
+ };
2733
+ content: {
2734
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2735
+ };
2736
+ };
2737
+ /** @description Resource not found */
2738
+ 404: {
2739
+ headers: {
2740
+ [name: string]: unknown;
2741
+ };
2742
+ content: {
2743
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2744
+ };
2745
+ };
2746
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2747
+ 422: {
2748
+ headers: {
2749
+ [name: string]: unknown;
2750
+ };
2751
+ content: {
2752
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2753
+ };
2754
+ };
2755
+ /** @description Rate limit exceeded */
2756
+ 429: {
2757
+ headers: {
2758
+ [name: string]: unknown;
2759
+ };
2760
+ content: {
2761
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2762
+ };
2763
+ };
2764
+ /** @description Internal server error */
2765
+ 500: {
2766
+ headers: {
2767
+ [name: string]: unknown;
2768
+ };
2769
+ content: {
2770
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2771
+ };
2772
+ };
2773
+ };
2774
+ };
2775
+ delete?: never;
2776
+ options?: never;
2777
+ head?: never;
2778
+ patch?: never;
2779
+ trace?: never;
2780
+ };
2781
+ "/{phone_number_id}/contacts/{id}/labels/{label_id}": {
2782
+ parameters: {
2783
+ query?: never;
2784
+ header?: never;
2785
+ path?: never;
2786
+ cookie?: never;
2787
+ };
2788
+ get?: never;
2789
+ put?: never;
2790
+ post?: never;
2791
+ /** Detach a label from a contact */
2792
+ delete: {
2793
+ parameters: {
2794
+ query?: never;
2795
+ header?: never;
2796
+ path: {
2797
+ phone_number_id: string;
2798
+ id: string;
2799
+ label_id: string;
2800
+ };
2801
+ cookie?: never;
2802
+ };
2803
+ requestBody?: never;
2804
+ responses: {
2805
+ /** @description Detached */
2806
+ 200: {
2807
+ headers: {
2808
+ [name: string]: unknown;
2809
+ };
2810
+ content: {
2811
+ "application/json": components["schemas"]["DetachContactLabelResponse"];
2812
+ };
2813
+ };
2814
+ /** @description Validation failure */
2815
+ 400: {
2816
+ headers: {
2817
+ [name: string]: unknown;
2818
+ };
2819
+ content: {
2820
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2821
+ };
2822
+ };
2823
+ /** @description Authentication failure */
2824
+ 401: {
2825
+ headers: {
2826
+ [name: string]: unknown;
2827
+ };
2828
+ content: {
2829
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2830
+ };
2831
+ };
2832
+ /** @description Resource not found */
2833
+ 404: {
2834
+ headers: {
2835
+ [name: string]: unknown;
2836
+ };
2837
+ content: {
2838
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2839
+ };
2840
+ };
2841
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2842
+ 422: {
2843
+ headers: {
2844
+ [name: string]: unknown;
2845
+ };
2846
+ content: {
2847
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2848
+ };
2849
+ };
2850
+ /** @description Rate limit exceeded */
2851
+ 429: {
2852
+ headers: {
2853
+ [name: string]: unknown;
2854
+ };
2855
+ content: {
2856
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2857
+ };
2858
+ };
2859
+ /** @description Internal server error */
2860
+ 500: {
2861
+ headers: {
2862
+ [name: string]: unknown;
2863
+ };
2864
+ content: {
2865
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2866
+ };
2867
+ };
2868
+ };
2869
+ };
2870
+ options?: never;
2871
+ head?: never;
2872
+ patch?: never;
2873
+ trace?: never;
2874
+ };
2875
+ "/{phone_number_id}/contacts/bulk_label": {
2876
+ parameters: {
2877
+ query?: never;
2878
+ header?: never;
2879
+ path?: never;
2880
+ cookie?: never;
2881
+ };
2882
+ get?: never;
2883
+ put?: never;
2884
+ /**
2885
+ * Attach or detach a label across many contacts
2886
+ * @description Apply or remove a label from up to 1000 contacts in a single transaction. Contacts not owned by the path-scoped account are silently skipped and counted under `skipped_cross_org`.
2887
+ */
2888
+ post: {
2889
+ parameters: {
2890
+ query?: never;
2891
+ header?: never;
2892
+ path: {
2893
+ phone_number_id: string;
2894
+ };
2895
+ cookie?: never;
2896
+ };
2897
+ requestBody?: {
2898
+ content: {
2899
+ "application/json": {
2900
+ contact_ids: string[];
2901
+ label_id: string;
2902
+ /** @enum {string} */
2903
+ operation: "attach" | "detach";
2904
+ };
2905
+ };
2906
+ };
2907
+ responses: {
2908
+ /** @description Bulk operation result */
2909
+ 200: {
2910
+ headers: {
2911
+ [name: string]: unknown;
2912
+ };
2913
+ content: {
2914
+ "application/json": components["schemas"]["BulkLabelContactsResponse"];
2915
+ };
2916
+ };
2917
+ /** @description Validation failure */
2918
+ 400: {
2919
+ headers: {
2920
+ [name: string]: unknown;
2921
+ };
2922
+ content: {
2923
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2924
+ };
2925
+ };
2926
+ /** @description Authentication failure */
2927
+ 401: {
2928
+ headers: {
2929
+ [name: string]: unknown;
2930
+ };
2931
+ content: {
2932
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2933
+ };
2934
+ };
2935
+ /** @description Resource not found */
2936
+ 404: {
2937
+ headers: {
2938
+ [name: string]: unknown;
2939
+ };
2940
+ content: {
2941
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2942
+ };
2943
+ };
2944
+ /** @description Semantic failure (e.g. idempotency key reuse) */
2945
+ 422: {
2946
+ headers: {
2947
+ [name: string]: unknown;
2948
+ };
2949
+ content: {
2950
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2951
+ };
2952
+ };
2953
+ /** @description Rate limit exceeded */
2954
+ 429: {
2955
+ headers: {
2956
+ [name: string]: unknown;
2957
+ };
2958
+ content: {
2959
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2960
+ };
2961
+ };
2962
+ /** @description Internal server error */
2963
+ 500: {
2964
+ headers: {
2965
+ [name: string]: unknown;
2966
+ };
2967
+ content: {
2968
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
2969
+ };
2970
+ };
2971
+ };
2972
+ };
2973
+ delete?: never;
2974
+ options?: never;
2975
+ head?: never;
2976
+ patch?: never;
2977
+ trace?: never;
2978
+ };
2979
+ "/{phone_number_id}/conversations/{id}/labels": {
2980
+ parameters: {
2981
+ query?: never;
2982
+ header?: never;
2983
+ path?: never;
2984
+ cookie?: never;
2985
+ };
2986
+ get?: never;
2987
+ put?: never;
2988
+ /** Attach a label to a conversation */
2989
+ post: {
2990
+ parameters: {
2991
+ query?: never;
2992
+ header?: never;
2993
+ path: {
2994
+ phone_number_id: string;
2995
+ id: string;
2996
+ };
2997
+ cookie?: never;
2998
+ };
2999
+ requestBody?: {
3000
+ content: {
3001
+ "application/json": {
3002
+ label_id: string;
3003
+ };
3004
+ };
3005
+ };
3006
+ responses: {
3007
+ /** @description Attached */
3008
+ 200: {
3009
+ headers: {
3010
+ [name: string]: unknown;
3011
+ };
3012
+ content: {
3013
+ "application/json": components["schemas"]["AttachConversationLabelResponse"];
3014
+ };
3015
+ };
3016
+ /** @description Validation failure */
3017
+ 400: {
3018
+ headers: {
3019
+ [name: string]: unknown;
3020
+ };
3021
+ content: {
3022
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3023
+ };
3024
+ };
3025
+ /** @description Authentication failure */
3026
+ 401: {
3027
+ headers: {
3028
+ [name: string]: unknown;
3029
+ };
3030
+ content: {
3031
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3032
+ };
3033
+ };
3034
+ /** @description Resource not found */
3035
+ 404: {
3036
+ headers: {
3037
+ [name: string]: unknown;
3038
+ };
3039
+ content: {
3040
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3041
+ };
3042
+ };
3043
+ /** @description Semantic failure (e.g. idempotency key reuse) */
3044
+ 422: {
3045
+ headers: {
3046
+ [name: string]: unknown;
3047
+ };
3048
+ content: {
3049
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3050
+ };
3051
+ };
3052
+ /** @description Rate limit exceeded */
3053
+ 429: {
3054
+ headers: {
3055
+ [name: string]: unknown;
3056
+ };
3057
+ content: {
3058
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3059
+ };
3060
+ };
3061
+ /** @description Internal server error */
3062
+ 500: {
3063
+ headers: {
3064
+ [name: string]: unknown;
3065
+ };
3066
+ content: {
3067
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3068
+ };
3069
+ };
3070
+ };
3071
+ };
3072
+ delete?: never;
3073
+ options?: never;
3074
+ head?: never;
3075
+ patch?: never;
3076
+ trace?: never;
3077
+ };
3078
+ "/{phone_number_id}/conversations/{id}/labels/{label_id}": {
3079
+ parameters: {
3080
+ query?: never;
3081
+ header?: never;
3082
+ path?: never;
3083
+ cookie?: never;
3084
+ };
3085
+ get?: never;
3086
+ put?: never;
3087
+ post?: never;
3088
+ /** Detach a label from a conversation */
3089
+ delete: {
3090
+ parameters: {
3091
+ query?: never;
3092
+ header?: never;
3093
+ path: {
3094
+ phone_number_id: string;
3095
+ id: string;
3096
+ label_id: string;
3097
+ };
3098
+ cookie?: never;
3099
+ };
3100
+ requestBody?: never;
3101
+ responses: {
3102
+ /** @description Detached */
3103
+ 200: {
3104
+ headers: {
3105
+ [name: string]: unknown;
3106
+ };
3107
+ content: {
3108
+ "application/json": components["schemas"]["DetachConversationLabelResponse"];
3109
+ };
3110
+ };
3111
+ /** @description Validation failure */
3112
+ 400: {
3113
+ headers: {
3114
+ [name: string]: unknown;
3115
+ };
3116
+ content: {
3117
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3118
+ };
3119
+ };
3120
+ /** @description Authentication failure */
3121
+ 401: {
3122
+ headers: {
3123
+ [name: string]: unknown;
3124
+ };
3125
+ content: {
3126
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3127
+ };
3128
+ };
3129
+ /** @description Resource not found */
3130
+ 404: {
3131
+ headers: {
3132
+ [name: string]: unknown;
3133
+ };
3134
+ content: {
3135
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3136
+ };
3137
+ };
3138
+ /** @description Semantic failure (e.g. idempotency key reuse) */
3139
+ 422: {
3140
+ headers: {
3141
+ [name: string]: unknown;
3142
+ };
3143
+ content: {
3144
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3145
+ };
3146
+ };
3147
+ /** @description Rate limit exceeded */
3148
+ 429: {
3149
+ headers: {
3150
+ [name: string]: unknown;
3151
+ };
3152
+ content: {
3153
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3154
+ };
3155
+ };
3156
+ /** @description Internal server error */
3157
+ 500: {
3158
+ headers: {
3159
+ [name: string]: unknown;
3160
+ };
3161
+ content: {
3162
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3163
+ };
3164
+ };
3165
+ };
3166
+ };
3167
+ options?: never;
3168
+ head?: never;
3169
+ patch?: never;
3170
+ trace?: never;
3171
+ };
3172
+ "/labels": {
3173
+ parameters: {
3174
+ query?: never;
3175
+ header?: never;
3176
+ path?: never;
3177
+ cookie?: never;
3178
+ };
3179
+ /**
3180
+ * List labels
3181
+ * @description List labels across every team in the organization.
3182
+ */
3183
+ get: {
3184
+ parameters: {
3185
+ query?: {
3186
+ limit?: string;
3187
+ cursor?: string;
3188
+ };
3189
+ header?: never;
3190
+ path?: never;
3191
+ cookie?: never;
3192
+ };
3193
+ requestBody?: never;
3194
+ responses: {
3195
+ /** @description Label list */
3196
+ 200: {
3197
+ headers: {
3198
+ [name: string]: unknown;
3199
+ };
3200
+ content: {
3201
+ "application/json": components["schemas"]["ListLabelsResponse"];
3202
+ };
3203
+ };
3204
+ /** @description Validation failure */
3205
+ 400: {
3206
+ headers: {
3207
+ [name: string]: unknown;
3208
+ };
3209
+ content: {
3210
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3211
+ };
3212
+ };
3213
+ /** @description Authentication failure */
3214
+ 401: {
3215
+ headers: {
3216
+ [name: string]: unknown;
3217
+ };
3218
+ content: {
3219
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3220
+ };
3221
+ };
3222
+ /** @description Rate limit exceeded */
3223
+ 429: {
3224
+ headers: {
3225
+ [name: string]: unknown;
3226
+ };
3227
+ content: {
3228
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3229
+ };
3230
+ };
3231
+ /** @description Internal server error */
3232
+ 500: {
3233
+ headers: {
3234
+ [name: string]: unknown;
3235
+ };
3236
+ content: {
3237
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3238
+ };
3239
+ };
3240
+ };
3241
+ };
3242
+ put?: never;
3243
+ /**
3244
+ * Create a label
3245
+ * @description Create a label. Single-team orgs auto-resolve `team_id`; multi-team orgs MUST pass it. Names are unique per team — duplicates return `invalid_field_value`.
3246
+ */
3247
+ post: {
3248
+ parameters: {
3249
+ query?: never;
3250
+ header?: never;
3251
+ path?: never;
3252
+ cookie?: never;
3253
+ };
3254
+ requestBody?: {
3255
+ content: {
3256
+ "application/json": {
3257
+ team_id?: string;
3258
+ name: string;
3259
+ /**
3260
+ * @default gray
3261
+ * @enum {string}
3262
+ */
3263
+ color?: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "sky" | "blue" | "violet" | "pink";
3264
+ };
3265
+ };
3266
+ };
3267
+ responses: {
3268
+ /** @description Label created */
3269
+ 200: {
3270
+ headers: {
3271
+ [name: string]: unknown;
3272
+ };
3273
+ content: {
3274
+ "application/json": components["schemas"]["CreateLabelResponse"];
3275
+ };
3276
+ };
3277
+ /** @description Validation failure */
3278
+ 400: {
3279
+ headers: {
3280
+ [name: string]: unknown;
3281
+ };
3282
+ content: {
3283
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3284
+ };
3285
+ };
3286
+ /** @description Authentication failure */
3287
+ 401: {
3288
+ headers: {
3289
+ [name: string]: unknown;
3290
+ };
3291
+ content: {
3292
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3293
+ };
3294
+ };
3295
+ /** @description Rate limit exceeded */
3296
+ 429: {
3297
+ headers: {
3298
+ [name: string]: unknown;
3299
+ };
3300
+ content: {
3301
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3302
+ };
3303
+ };
3304
+ /** @description Internal server error */
3305
+ 500: {
3306
+ headers: {
3307
+ [name: string]: unknown;
3308
+ };
3309
+ content: {
3310
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3311
+ };
3312
+ };
3313
+ };
3314
+ };
3315
+ delete?: never;
3316
+ options?: never;
3317
+ head?: never;
3318
+ patch?: never;
3319
+ trace?: never;
3320
+ };
3321
+ "/labels/{id}": {
3322
+ parameters: {
3323
+ query?: never;
3324
+ header?: never;
3325
+ path?: never;
3326
+ cookie?: never;
3327
+ };
3328
+ /** Fetch a label by id */
3329
+ get: {
3330
+ parameters: {
3331
+ query?: never;
3332
+ header?: never;
3333
+ path: {
3334
+ id: string;
3335
+ };
3336
+ cookie?: never;
3337
+ };
3338
+ requestBody?: never;
3339
+ responses: {
3340
+ /** @description Label resource */
3341
+ 200: {
3342
+ headers: {
3343
+ [name: string]: unknown;
3344
+ };
3345
+ content: {
3346
+ "application/json": components["schemas"]["GetLabelResponse"];
3347
+ };
3348
+ };
3349
+ /** @description Validation failure */
3350
+ 400: {
3351
+ headers: {
3352
+ [name: string]: unknown;
3353
+ };
3354
+ content: {
3355
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3356
+ };
3357
+ };
3358
+ /** @description Authentication failure */
3359
+ 401: {
3360
+ headers: {
3361
+ [name: string]: unknown;
3362
+ };
3363
+ content: {
3364
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3365
+ };
3366
+ };
3367
+ /** @description Resource not found */
3368
+ 404: {
3369
+ headers: {
3370
+ [name: string]: unknown;
3371
+ };
3372
+ content: {
3373
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3374
+ };
3375
+ };
3376
+ /** @description Rate limit exceeded */
3377
+ 429: {
3378
+ headers: {
3379
+ [name: string]: unknown;
3380
+ };
3381
+ content: {
3382
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3383
+ };
3384
+ };
3385
+ /** @description Internal server error */
3386
+ 500: {
3387
+ headers: {
3388
+ [name: string]: unknown;
3389
+ };
3390
+ content: {
3391
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3392
+ };
3393
+ };
3394
+ };
3395
+ };
3396
+ put?: never;
3397
+ post?: never;
3398
+ /**
3399
+ * Delete a label
3400
+ * @description Hard-deletes the label and cascades to every contact and conversation it was attached to (the row in the join table goes away, the parent resources stay).
3401
+ */
3402
+ delete: {
3403
+ parameters: {
3404
+ query?: never;
3405
+ header?: never;
3406
+ path: {
3407
+ id: string;
3408
+ };
3409
+ cookie?: never;
3410
+ };
3411
+ requestBody?: never;
3412
+ responses: {
3413
+ /** @description Deleted */
3414
+ 200: {
3415
+ headers: {
3416
+ [name: string]: unknown;
3417
+ };
3418
+ content: {
3419
+ "application/json": components["schemas"]["DeleteLabelResponse"];
3420
+ };
3421
+ };
3422
+ /** @description Validation failure */
3423
+ 400: {
3424
+ headers: {
3425
+ [name: string]: unknown;
3426
+ };
3427
+ content: {
3428
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3429
+ };
3430
+ };
3431
+ /** @description Authentication failure */
3432
+ 401: {
3433
+ headers: {
3434
+ [name: string]: unknown;
3435
+ };
3436
+ content: {
3437
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3438
+ };
3439
+ };
3440
+ /** @description Resource not found */
3441
+ 404: {
3442
+ headers: {
3443
+ [name: string]: unknown;
3444
+ };
3445
+ content: {
3446
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3447
+ };
3448
+ };
3449
+ /** @description Rate limit exceeded */
3450
+ 429: {
3451
+ headers: {
3452
+ [name: string]: unknown;
3453
+ };
3454
+ content: {
3455
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3456
+ };
3457
+ };
3458
+ /** @description Internal server error */
3459
+ 500: {
3460
+ headers: {
3461
+ [name: string]: unknown;
3462
+ };
3463
+ content: {
3464
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3465
+ };
3466
+ };
3467
+ };
3468
+ };
3469
+ options?: never;
3470
+ head?: never;
3471
+ /** Update a label */
3472
+ patch: {
3473
+ parameters: {
3474
+ query?: never;
3475
+ header?: never;
3476
+ path: {
3477
+ id: string;
3478
+ };
3479
+ cookie?: never;
3480
+ };
3481
+ requestBody?: {
3482
+ content: {
3483
+ "application/json": {
3484
+ name?: string;
3485
+ /** @enum {string} */
3486
+ color?: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "sky" | "blue" | "violet" | "pink";
3487
+ };
3488
+ };
3489
+ };
3490
+ responses: {
3491
+ /** @description Updated label */
3492
+ 200: {
3493
+ headers: {
3494
+ [name: string]: unknown;
3495
+ };
3496
+ content: {
3497
+ "application/json": components["schemas"]["UpdateLabelResponse"];
3498
+ };
3499
+ };
3500
+ /** @description Validation failure */
3501
+ 400: {
3502
+ headers: {
3503
+ [name: string]: unknown;
3504
+ };
3505
+ content: {
3506
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3507
+ };
3508
+ };
3509
+ /** @description Authentication failure */
3510
+ 401: {
3511
+ headers: {
3512
+ [name: string]: unknown;
3513
+ };
3514
+ content: {
3515
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3516
+ };
3517
+ };
3518
+ /** @description Resource not found */
3519
+ 404: {
3520
+ headers: {
3521
+ [name: string]: unknown;
3522
+ };
3523
+ content: {
3524
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3525
+ };
3526
+ };
3527
+ /** @description Rate limit exceeded */
3528
+ 429: {
3529
+ headers: {
3530
+ [name: string]: unknown;
3531
+ };
3532
+ content: {
3533
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3534
+ };
3535
+ };
3536
+ /** @description Internal server error */
3537
+ 500: {
3538
+ headers: {
3539
+ [name: string]: unknown;
3540
+ };
3541
+ content: {
3542
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
3543
+ };
3544
+ };
3545
+ };
3546
+ };
3547
+ trace?: never;
3548
+ };
3549
+ }
3550
+ export type webhooks = Record<string, never>;
3551
+ export interface components {
3552
+ schemas: {
3553
+ ApiErrorEnvelope: {
3554
+ error: {
3555
+ /** @example invalid_request_error */
3556
+ type: string;
3557
+ /** @example invalid_phone_number */
3558
+ code: string;
3559
+ message: string;
3560
+ param?: string;
3561
+ /** @example req_01HXYZABCDEFGHJKMNPQRSTVWX */
3562
+ request_id: string;
3563
+ };
3564
+ };
3565
+ Message: {
3566
+ /** @example msg_01HXYZABCDEFGHJKMNPQRSTVWX */
3567
+ id: string;
3568
+ /** @enum {string} */
3569
+ object: "message";
3570
+ to?: string;
3571
+ type?: string;
3572
+ /** @enum {string} */
3573
+ status: "queued" | "pending" | "sent" | "delivered" | "read" | "failed";
3574
+ /** Format: date-time */
3575
+ created_at?: string;
3576
+ conversation_id?: string;
3577
+ message_id?: string;
3578
+ error?: {
3579
+ code: string;
3580
+ message: string;
3581
+ provider_code: number | null;
3582
+ };
3583
+ };
3584
+ Template: {
3585
+ /** @example tmpl_01HXYZABCDEFGHJKMNPQRSTVWX */
3586
+ id: string;
3587
+ /** @enum {string} */
3588
+ object: "template";
3589
+ name: string;
3590
+ language: string;
3591
+ /** @enum {string} */
3592
+ status: "pending" | "approved" | "rejected";
3593
+ content: string;
3594
+ variables: string[];
3595
+ components?: unknown;
3596
+ whatsapp_account: {
3597
+ phone_number: string | null;
3598
+ };
3599
+ provider_template_id: string | null;
3600
+ /** Format: date-time */
3601
+ created_at: string;
3602
+ /** Format: date-time */
3603
+ updated_at: string;
3604
+ };
3605
+ Account: {
3606
+ /** @enum {string} */
3607
+ object: "account";
3608
+ /**
3609
+ * @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.
3610
+ * @example 106540352242922
3611
+ */
3612
+ phone_number_id: string | null;
3613
+ /** @example +628111222333 */
3614
+ phone_number: string | null;
3615
+ /** @example Customer Support */
3616
+ name: string | null;
3617
+ /**
3618
+ * @description Lifecycle state of the account (e.g. `connected`, `disconnected`, `degraded`, `onboarding`).
3619
+ * @example connected
3620
+ */
3621
+ status: string;
3622
+ };
3623
+ WebhookSubscription: {
3624
+ /** @example wbs_01HXYZABCDEFGHJKMNPQRSTVWX */
3625
+ id: string;
3626
+ /** @enum {string} */
3627
+ object: "webhook_subscription";
3628
+ /** Format: uri */
3629
+ url: string;
3630
+ description: string | null;
3631
+ events: string[];
3632
+ /** @enum {string} */
3633
+ status: "active" | "paused" | "disabled";
3634
+ disabled_reason: string | null;
3635
+ consecutive_failures: number;
3636
+ secrets: {
3637
+ /** @example sec_01HXYZABCDEFGHJKMNPQRSTVWX */
3638
+ id: string;
3639
+ /** Format: date-time */
3640
+ created_at: string;
3641
+ /** Format: date-time */
3642
+ expires_at: string | null;
3643
+ }[];
3644
+ /** Format: date-time */
3645
+ created_at: string;
3646
+ /** Format: date-time */
3647
+ updated_at: string;
3648
+ initial_secret?: string;
3649
+ };
3650
+ WebhookDelivery: {
3651
+ /** @example wbd_01HXYZABCDEFGHJKMNPQRSTVWX */
3652
+ id: string;
3653
+ /** @enum {string} */
3654
+ object: "webhook_delivery";
3655
+ subscription_id: string;
3656
+ event_type: string;
3657
+ event_id: string;
3658
+ /** @enum {string} */
3659
+ status: "pending" | "succeeded" | "failed" | "dead";
3660
+ attempt_count: number;
3661
+ /** Format: date-time */
3662
+ last_attempt_at: string | null;
3663
+ /** Format: date-time */
3664
+ next_attempt_at: string | null;
3665
+ response_status: number | null;
3666
+ response_body_snippet: string | null;
3667
+ duration_ms: number | null;
3668
+ replayed_from: string | null;
3669
+ payload?: unknown;
3670
+ /** Format: date-time */
3671
+ created_at: string;
3672
+ };
3673
+ Conversation: {
3674
+ /** @example cnv_01HXYZABCDEFGHJKMNPQRSTVWX */
3675
+ id: string;
3676
+ /** @enum {string} */
3677
+ object: "conversation";
3678
+ /** @enum {string} */
3679
+ status: "open" | "resolved" | "pending";
3680
+ contact: {
3681
+ id: string;
3682
+ phone_number: string | null;
3683
+ name: string | null;
3684
+ };
3685
+ whatsapp_account: {
3686
+ phone_number: string | null;
3687
+ };
3688
+ assignee: {
3689
+ id: string;
3690
+ name: string | null;
3691
+ email: string | null;
3692
+ } | null;
3693
+ unread_count: number;
3694
+ /** Format: date-time */
3695
+ last_message_at: string | null;
3696
+ /** Format: date-time */
3697
+ last_inbound_at: string | null;
3698
+ /** Format: date-time */
3699
+ created_at: string;
3700
+ /** Format: date-time */
3701
+ updated_at: string;
3702
+ };
3703
+ Contact: {
3704
+ /** @example ctc_01HXYZABCDEFGHJKMNPQRSTVWX */
3705
+ id: string;
3706
+ /** @enum {string} */
3707
+ object: "contact";
3708
+ phone_number: string | null;
3709
+ name: string | null;
3710
+ email: string | null;
3711
+ metadata: {
3712
+ [key: string]: unknown;
3713
+ } | null;
3714
+ whatsapp_account: {
3715
+ phone_number: string | null;
3716
+ };
3717
+ /** Format: date-time */
3718
+ created_at: string;
3719
+ /** Format: date-time */
3720
+ updated_at: string;
3721
+ };
3722
+ Label: {
3723
+ /** @example lbl_01HXYZABCDEFGHJKMNPQRSTVWX */
3724
+ id: string;
3725
+ /** @enum {string} */
3726
+ object: "label";
3727
+ name: string;
3728
+ /** @enum {string} */
3729
+ color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "sky" | "blue" | "violet" | "pink";
3730
+ team_id: string;
3731
+ /** Format: date-time */
3732
+ created_at: string;
3733
+ /** Format: date-time */
3734
+ updated_at: string;
3735
+ };
3736
+ MessageListItem: {
3737
+ /** @example msg_01HXYZABCDEFGHJKMNPQRSTVWX */
3738
+ id: string;
3739
+ /** @enum {string} */
3740
+ object: "message";
3741
+ conversation_id: string;
3742
+ to: string | null;
3743
+ /** @enum {string} */
3744
+ direction: "inbound" | "outbound";
3745
+ type: string;
3746
+ content: string | null;
3747
+ media_url: string | null;
3748
+ /** @enum {string} */
3749
+ status: "pending" | "sent" | "delivered" | "read" | "failed";
3750
+ /** Format: date-time */
3751
+ created_at: string;
3752
+ error?: {
3753
+ code: string;
3754
+ message: string;
3755
+ provider_code: number | null;
3756
+ };
3757
+ };
3758
+ MeResponse: {
3759
+ data: {
3760
+ organization: {
3761
+ /** @example org_01HXYZABCDEFGHJKMNPQRSTVWX */
3762
+ id: string;
3763
+ /** @enum {string} */
3764
+ object: "organization";
3765
+ name: string;
3766
+ };
3767
+ api_key: {
3768
+ /** @example key_01HXYZABCDEFGHJKMNPQRSTVWX */
3769
+ id: string;
3770
+ /** @enum {string} */
3771
+ object: "api_key";
3772
+ label: string;
3773
+ last4: string;
3774
+ };
3775
+ rate_limits: {
3776
+ tier: string;
3777
+ write_per_minute: number;
3778
+ read_per_minute: number;
3779
+ };
3780
+ };
3781
+ request_id: string;
3782
+ };
3783
+ ListAccountsResponse: {
3784
+ data: components["schemas"]["Account"][];
3785
+ has_more: boolean;
3786
+ next_cursor: string | null;
3787
+ request_id: string;
3788
+ };
3789
+ SendMessageResponse: {
3790
+ data: components["schemas"]["Message"];
3791
+ request_id: string;
3792
+ };
3793
+ GetMessageResponse: {
3794
+ data: components["schemas"]["Message"];
3795
+ request_id: string;
3796
+ };
3797
+ ListTemplatesResponse: {
3798
+ data: components["schemas"]["Template"][];
3799
+ has_more: boolean;
3800
+ next_cursor: string | null;
3801
+ request_id: string;
3802
+ };
3803
+ GetTemplateResponse: {
3804
+ data: components["schemas"]["Template"];
3805
+ request_id: string;
3806
+ };
3807
+ CreateWebhookSubscriptionResponse: {
3808
+ data: components["schemas"]["WebhookSubscription"];
3809
+ request_id: string;
3810
+ };
3811
+ ListWebhookSubscriptionsResponse: {
3812
+ data: components["schemas"]["WebhookSubscription"][];
3813
+ has_more: boolean;
3814
+ next_cursor: string | null;
3815
+ request_id: string;
3816
+ };
3817
+ GetWebhookSubscriptionResponse: {
3818
+ data: components["schemas"]["WebhookSubscription"];
3819
+ request_id: string;
3820
+ };
3821
+ UpdateWebhookSubscriptionResponse: {
3822
+ data: components["schemas"]["WebhookSubscription"];
3823
+ request_id: string;
3824
+ };
3825
+ DeleteWebhookSubscriptionResponse: {
3826
+ data: {
3827
+ id: string;
3828
+ /** @enum {boolean} */
3829
+ deleted: true;
3830
+ };
3831
+ request_id: string;
3832
+ };
3833
+ AddWebhookSecretResponse: {
3834
+ data: {
3835
+ id: string;
3836
+ /** @enum {string} */
3837
+ object: "webhook_secret";
3838
+ secret: string;
3839
+ /** Format: date-time */
3840
+ created_at: string;
3841
+ /** Format: date-time */
3842
+ expires_at: string | null;
3843
+ };
3844
+ request_id: string;
3845
+ };
3846
+ DeleteWebhookSecretResponse: {
3847
+ data: {
3848
+ id: string;
3849
+ /** @enum {boolean} */
3850
+ deleted: true;
3851
+ };
3852
+ request_id: string;
3853
+ };
3854
+ ListWebhookDeliveriesResponse: {
3855
+ data: components["schemas"]["WebhookDelivery"][];
3856
+ has_more: boolean;
3857
+ next_cursor: string | null;
3858
+ request_id: string;
3859
+ };
3860
+ GetWebhookDeliveryResponse: {
3861
+ data: components["schemas"]["WebhookDelivery"];
3862
+ request_id: string;
3863
+ };
3864
+ ReplayWebhookDeliveryResponse: {
3865
+ data: {
3866
+ id: string;
3867
+ /** @enum {string} */
3868
+ object: "webhook_delivery";
3869
+ replayed_from: string;
3870
+ /** @enum {string} */
3871
+ status: "pending";
3872
+ };
3873
+ request_id: string;
3874
+ };
3875
+ BulkReplayResponse: {
3876
+ data: {
3877
+ enqueued: number;
3878
+ capped: boolean;
3879
+ };
3880
+ request_id: string;
3881
+ };
3882
+ ListConversationsResponse: {
3883
+ data: components["schemas"]["Conversation"][];
3884
+ has_more: boolean;
3885
+ next_cursor: string | null;
3886
+ request_id: string;
3887
+ };
3888
+ GetConversationResponse: {
3889
+ data: components["schemas"]["Conversation"];
3890
+ request_id: string;
3891
+ };
3892
+ ListContactsResponse: {
3893
+ data: components["schemas"]["Contact"][];
3894
+ has_more: boolean;
3895
+ next_cursor: string | null;
3896
+ request_id: string;
3897
+ };
3898
+ GetContactResponse: {
3899
+ data: components["schemas"]["Contact"];
3900
+ request_id: string;
3901
+ };
3902
+ ListMessagesResponse: {
3903
+ data: components["schemas"]["MessageListItem"][];
3904
+ has_more: boolean;
3905
+ next_cursor: string | null;
3906
+ request_id: string;
3907
+ };
3908
+ CreateContactResponse: {
3909
+ data: components["schemas"]["Contact"];
3910
+ request_id: string;
3911
+ };
3912
+ UpdateContactResponse: {
3913
+ data: components["schemas"]["Contact"];
3914
+ request_id: string;
3915
+ };
3916
+ DeleteContactResponse: {
3917
+ data: {
3918
+ id: string;
3919
+ /** @enum {string} */
3920
+ object: "contact";
3921
+ /** @enum {boolean} */
3922
+ deleted: true;
3923
+ };
3924
+ request_id: string;
3925
+ };
3926
+ AttachContactLabelResponse: {
3927
+ data: {
3928
+ contact_id: string;
3929
+ label_id: string;
3930
+ /** @enum {boolean} */
3931
+ attached: true;
3932
+ };
3933
+ request_id: string;
3934
+ };
3935
+ DetachContactLabelResponse: {
3936
+ data: {
3937
+ contact_id: string;
3938
+ label_id: string;
3939
+ /** @enum {boolean} */
3940
+ attached: false;
3941
+ };
3942
+ request_id: string;
3943
+ };
3944
+ BulkLabelContactsResponse: {
3945
+ data: {
3946
+ applied: number;
3947
+ skipped_cross_org: number;
3948
+ skipped_team_mismatch: number;
3949
+ };
3950
+ request_id: string;
3951
+ };
3952
+ UpdateConversationResponse: {
3953
+ data: components["schemas"]["Conversation"];
3954
+ request_id: string;
3955
+ };
3956
+ AttachConversationLabelResponse: {
3957
+ data: {
3958
+ conversation_id: string;
3959
+ label_id: string;
3960
+ /** @enum {boolean} */
3961
+ attached: true;
3962
+ };
3963
+ request_id: string;
3964
+ };
3965
+ DetachConversationLabelResponse: {
3966
+ data: {
3967
+ conversation_id: string;
3968
+ label_id: string;
3969
+ /** @enum {boolean} */
3970
+ attached: false;
3971
+ };
3972
+ request_id: string;
3973
+ };
3974
+ ListLabelsResponse: {
3975
+ data: components["schemas"]["Label"][];
3976
+ has_more: boolean;
3977
+ next_cursor: string | null;
3978
+ request_id: string;
3979
+ };
3980
+ CreateLabelResponse: {
3981
+ data: components["schemas"]["Label"];
3982
+ request_id: string;
3983
+ };
3984
+ GetLabelResponse: {
3985
+ data: components["schemas"]["Label"];
3986
+ request_id: string;
3987
+ };
3988
+ UpdateLabelResponse: {
3989
+ data: components["schemas"]["Label"];
3990
+ request_id: string;
3991
+ };
3992
+ DeleteLabelResponse: {
3993
+ data: {
3994
+ id: string;
3995
+ /** @enum {string} */
3996
+ object: "label";
3997
+ /** @enum {boolean} */
3998
+ deleted: true;
3999
+ };
4000
+ request_id: string;
4001
+ };
4002
+ };
4003
+ responses: never;
4004
+ parameters: never;
4005
+ requestBodies: never;
4006
+ headers: never;
4007
+ pathItems: never;
4008
+ }
4009
+ export type $defs = Record<string, never>;
4010
+ export type operations = Record<string, never>;