@vitrina/api 14.10.0 → 14.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +562 -1
- package/dist/index.d.ts +562 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -88445,12 +88445,18 @@ interface paths {
|
|
|
88445
88445
|
* List the campaign’s recipients
|
|
88446
88446
|
* @description One row per recipient with its delivery state — `pending`, `sent`, `delivered`, `read`, `failed` or `suppressed`. `suppressed` means the contact was in the audience but the suppression list stopped the send, which is a successful outcome rather than a failure.
|
|
88447
88447
|
*
|
|
88448
|
-
* The list only exists once the run materialises it, so a draft or not-yet-started campaign answers empty rather than previewing who WOULD receive it. `limit` defaults to 50 and caps at
|
|
88448
|
+
* The list only exists once the run materialises it, so a draft or not-yet-started campaign answers empty rather than previewing who WOULD receive it. `limit` defaults to 50 and caps at 500; the count is `meta.pagination.total`.
|
|
88449
|
+
*
|
|
88450
|
+
* Filters: `state`, `error_code` (Meta's code, failed rows of one reason) and `replied`. Each row carries Meta's raw `error`, the same failure in plain language with a suggested action (`error_reason`), and `replied_button` — the template quick-reply button the person's first reply tapped (null for free text or no reply).
|
|
88449
88451
|
*/
|
|
88450
88452
|
get: {
|
|
88451
88453
|
parameters: {
|
|
88452
88454
|
query?: {
|
|
88453
88455
|
state?: "pending" | "sent" | "delivered" | "read" | "failed" | "suppressed";
|
|
88456
|
+
/** @description Meta's error code (e.g. `131026`) — failed rows of one reason. */
|
|
88457
|
+
error_code?: string;
|
|
88458
|
+
/** @description `true`: only recipients who replied; `false`: only those who did not. */
|
|
88459
|
+
replied?: "true" | "false";
|
|
88454
88460
|
limit?: number;
|
|
88455
88461
|
offset?: number | null;
|
|
88456
88462
|
};
|
|
@@ -88506,6 +88512,13 @@ interface paths {
|
|
|
88506
88512
|
* "title": "Message undeliverable",
|
|
88507
88513
|
* "detail": null
|
|
88508
88514
|
* },
|
|
88515
|
+
* "error_reason": {
|
|
88516
|
+
* "code": "131026",
|
|
88517
|
+
* "human_es": "El número no tiene WhatsApp o no puede recibir este mensaje (app desactualizada, no aceptó los términos o bloqueó a la empresa).",
|
|
88518
|
+
* "human_en": "The number is not on WhatsApp or cannot receive this message (outdated app, terms not accepted, or it blocked the business).",
|
|
88519
|
+
* "action": "remove_number"
|
|
88520
|
+
* },
|
|
88521
|
+
* "replied_button": null,
|
|
88509
88522
|
* "sent_at": null,
|
|
88510
88523
|
* "replied_at": null,
|
|
88511
88524
|
* "replied_conversation_id": null,
|
|
@@ -88535,6 +88548,437 @@ interface paths {
|
|
|
88535
88548
|
* }
|
|
88536
88549
|
* }
|
|
88537
88550
|
*/
|
|
88551
|
+
"application/json": {
|
|
88552
|
+
data: components["schemas"]["CampaignRecipient"][];
|
|
88553
|
+
meta: {
|
|
88554
|
+
pagination: {
|
|
88555
|
+
total: number;
|
|
88556
|
+
limit: number;
|
|
88557
|
+
offset: number;
|
|
88558
|
+
};
|
|
88559
|
+
};
|
|
88560
|
+
};
|
|
88561
|
+
};
|
|
88562
|
+
};
|
|
88563
|
+
/** @description Validation error */
|
|
88564
|
+
400: {
|
|
88565
|
+
headers: {
|
|
88566
|
+
[name: string]: unknown;
|
|
88567
|
+
};
|
|
88568
|
+
content: {
|
|
88569
|
+
"application/json": components["schemas"]["Error"];
|
|
88570
|
+
};
|
|
88571
|
+
};
|
|
88572
|
+
/** @description Unauthorized */
|
|
88573
|
+
401: {
|
|
88574
|
+
headers: {
|
|
88575
|
+
[name: string]: unknown;
|
|
88576
|
+
};
|
|
88577
|
+
content: {
|
|
88578
|
+
"application/json": components["schemas"]["Error"];
|
|
88579
|
+
};
|
|
88580
|
+
};
|
|
88581
|
+
/** @description Forbidden */
|
|
88582
|
+
403: {
|
|
88583
|
+
headers: {
|
|
88584
|
+
[name: string]: unknown;
|
|
88585
|
+
};
|
|
88586
|
+
content: {
|
|
88587
|
+
"application/json": components["schemas"]["Error"];
|
|
88588
|
+
};
|
|
88589
|
+
};
|
|
88590
|
+
/** @description Not found */
|
|
88591
|
+
404: {
|
|
88592
|
+
headers: {
|
|
88593
|
+
[name: string]: unknown;
|
|
88594
|
+
};
|
|
88595
|
+
content: {
|
|
88596
|
+
"application/json": components["schemas"]["Error"];
|
|
88597
|
+
};
|
|
88598
|
+
};
|
|
88599
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
88600
|
+
409: {
|
|
88601
|
+
headers: {
|
|
88602
|
+
[name: string]: unknown;
|
|
88603
|
+
};
|
|
88604
|
+
content: {
|
|
88605
|
+
"application/json": components["schemas"]["Error"];
|
|
88606
|
+
};
|
|
88607
|
+
};
|
|
88608
|
+
/** @description Rate limited */
|
|
88609
|
+
429: {
|
|
88610
|
+
headers: {
|
|
88611
|
+
[name: string]: unknown;
|
|
88612
|
+
};
|
|
88613
|
+
content: {
|
|
88614
|
+
"application/json": components["schemas"]["Error"];
|
|
88615
|
+
};
|
|
88616
|
+
};
|
|
88617
|
+
};
|
|
88618
|
+
};
|
|
88619
|
+
put?: never;
|
|
88620
|
+
post?: never;
|
|
88621
|
+
delete?: never;
|
|
88622
|
+
options?: never;
|
|
88623
|
+
head?: never;
|
|
88624
|
+
patch?: never;
|
|
88625
|
+
trace?: never;
|
|
88626
|
+
};
|
|
88627
|
+
"/campaigns/{id}/recipients/export.csv": {
|
|
88628
|
+
parameters: {
|
|
88629
|
+
query?: never;
|
|
88630
|
+
header?: never;
|
|
88631
|
+
path?: never;
|
|
88632
|
+
cookie?: never;
|
|
88633
|
+
};
|
|
88634
|
+
/**
|
|
88635
|
+
* Export the campaign’s recipients as CSV
|
|
88636
|
+
* @description The whole recipients list (same filters as the list: `state`, `error_code`, `replied`) as a UTF-8 CSV with a BOM and Spanish headers: `Nombre, Identificador, Estado, Enviado, Entregado, Leído, Respondió, Botón, Código de error, Motivo, Acción sugerida`. Times are in the workspace time zone. Requires `campaigns:read` AND `contacts:read` (it carries names and phone numbers).
|
|
88637
|
+
*/
|
|
88638
|
+
get: {
|
|
88639
|
+
parameters: {
|
|
88640
|
+
query?: {
|
|
88641
|
+
state?: "pending" | "sent" | "delivered" | "read" | "failed" | "suppressed";
|
|
88642
|
+
/** @description Meta's error code (e.g. `131026`) — failed rows of one reason. */
|
|
88643
|
+
error_code?: string;
|
|
88644
|
+
/** @description `true`: only recipients who replied; `false`: only those who did not. */
|
|
88645
|
+
replied?: "true" | "false";
|
|
88646
|
+
};
|
|
88647
|
+
header?: never;
|
|
88648
|
+
path: {
|
|
88649
|
+
id: string;
|
|
88650
|
+
};
|
|
88651
|
+
cookie?: never;
|
|
88652
|
+
};
|
|
88653
|
+
requestBody?: never;
|
|
88654
|
+
responses: {
|
|
88655
|
+
/** @description The CSV file */
|
|
88656
|
+
200: {
|
|
88657
|
+
headers: {
|
|
88658
|
+
[name: string]: unknown;
|
|
88659
|
+
};
|
|
88660
|
+
content: {
|
|
88661
|
+
"text/csv": string;
|
|
88662
|
+
};
|
|
88663
|
+
};
|
|
88664
|
+
/** @description Validation error */
|
|
88665
|
+
400: {
|
|
88666
|
+
headers: {
|
|
88667
|
+
[name: string]: unknown;
|
|
88668
|
+
};
|
|
88669
|
+
content: {
|
|
88670
|
+
"application/json": components["schemas"]["Error"];
|
|
88671
|
+
};
|
|
88672
|
+
};
|
|
88673
|
+
/** @description Unauthorized */
|
|
88674
|
+
401: {
|
|
88675
|
+
headers: {
|
|
88676
|
+
[name: string]: unknown;
|
|
88677
|
+
};
|
|
88678
|
+
content: {
|
|
88679
|
+
"application/json": components["schemas"]["Error"];
|
|
88680
|
+
};
|
|
88681
|
+
};
|
|
88682
|
+
/** @description Forbidden */
|
|
88683
|
+
403: {
|
|
88684
|
+
headers: {
|
|
88685
|
+
[name: string]: unknown;
|
|
88686
|
+
};
|
|
88687
|
+
content: {
|
|
88688
|
+
"application/json": components["schemas"]["Error"];
|
|
88689
|
+
};
|
|
88690
|
+
};
|
|
88691
|
+
/** @description Not found */
|
|
88692
|
+
404: {
|
|
88693
|
+
headers: {
|
|
88694
|
+
[name: string]: unknown;
|
|
88695
|
+
};
|
|
88696
|
+
content: {
|
|
88697
|
+
"application/json": components["schemas"]["Error"];
|
|
88698
|
+
};
|
|
88699
|
+
};
|
|
88700
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
88701
|
+
409: {
|
|
88702
|
+
headers: {
|
|
88703
|
+
[name: string]: unknown;
|
|
88704
|
+
};
|
|
88705
|
+
content: {
|
|
88706
|
+
"application/json": components["schemas"]["Error"];
|
|
88707
|
+
};
|
|
88708
|
+
};
|
|
88709
|
+
/** @description Rate limited */
|
|
88710
|
+
429: {
|
|
88711
|
+
headers: {
|
|
88712
|
+
[name: string]: unknown;
|
|
88713
|
+
};
|
|
88714
|
+
content: {
|
|
88715
|
+
"application/json": components["schemas"]["Error"];
|
|
88716
|
+
};
|
|
88717
|
+
};
|
|
88718
|
+
};
|
|
88719
|
+
};
|
|
88720
|
+
put?: never;
|
|
88721
|
+
post?: never;
|
|
88722
|
+
delete?: never;
|
|
88723
|
+
options?: never;
|
|
88724
|
+
head?: never;
|
|
88725
|
+
patch?: never;
|
|
88726
|
+
trace?: never;
|
|
88727
|
+
};
|
|
88728
|
+
"/campaigns/{id}/results": {
|
|
88729
|
+
parameters: {
|
|
88730
|
+
query?: never;
|
|
88731
|
+
header?: never;
|
|
88732
|
+
path?: never;
|
|
88733
|
+
cookie?: never;
|
|
88734
|
+
};
|
|
88735
|
+
/**
|
|
88736
|
+
* The campaign’s results
|
|
88737
|
+
* @description What happened to the campaign, from its own recipients: the funnel (`recipients → sent → delivered → read → replied`, plus `failed`, `opted_out`, `suppressed`, `pending`) and its rates (delivered/sent, read/delivered, replied/delivered); replies per template quick-reply button (a reply whose first message is a button label) and the `free_text` rest; failures grouped by Meta error code, each with a plain-language reason (es/en) and a suggested `action`; opt-outs attributable to the campaign (recorded by it, or on a recipient’s number within the reply-attribution window after the send) by reason; and a timeline of sends, deliveries, reads and replies per hour (per day past a week), bucketed in the workspace time zone. Delivery/read times are recorded from 2026-10-14 on; older sends show in the funnel but not in the timeline.
|
|
88738
|
+
*/
|
|
88739
|
+
get: {
|
|
88740
|
+
parameters: {
|
|
88741
|
+
query?: never;
|
|
88742
|
+
header?: never;
|
|
88743
|
+
path: {
|
|
88744
|
+
id: string;
|
|
88745
|
+
};
|
|
88746
|
+
cookie?: never;
|
|
88747
|
+
};
|
|
88748
|
+
requestBody?: never;
|
|
88749
|
+
responses: {
|
|
88750
|
+
/** @description The results */
|
|
88751
|
+
200: {
|
|
88752
|
+
headers: {
|
|
88753
|
+
[name: string]: unknown;
|
|
88754
|
+
};
|
|
88755
|
+
content: {
|
|
88756
|
+
/**
|
|
88757
|
+
* @example {
|
|
88758
|
+
* "data": {
|
|
88759
|
+
* "campaign_id": "7a7a7a7a-0000-4000-8000-0000000000c1",
|
|
88760
|
+
* "channel": "whatsapp",
|
|
88761
|
+
* "funnel": {
|
|
88762
|
+
* "recipients": 64,
|
|
88763
|
+
* "sent": 64,
|
|
88764
|
+
* "delivered": 52,
|
|
88765
|
+
* "read": 40,
|
|
88766
|
+
* "replied": 17,
|
|
88767
|
+
* "opted_out": 2,
|
|
88768
|
+
* "failed": 9,
|
|
88769
|
+
* "suppressed": 0,
|
|
88770
|
+
* "pending": 0
|
|
88771
|
+
* },
|
|
88772
|
+
* "rates": {
|
|
88773
|
+
* "delivered": 0.8125,
|
|
88774
|
+
* "read": 0.7692,
|
|
88775
|
+
* "replied": 0.3269
|
|
88776
|
+
* },
|
|
88777
|
+
* "buttons": [
|
|
88778
|
+
* {
|
|
88779
|
+
* "text": "Quiero más información",
|
|
88780
|
+
* "count": 10
|
|
88781
|
+
* },
|
|
88782
|
+
* {
|
|
88783
|
+
* "text": "No me interesa",
|
|
88784
|
+
* "count": 2
|
|
88785
|
+
* }
|
|
88786
|
+
* ],
|
|
88787
|
+
* "free_text": 5,
|
|
88788
|
+
* "failures": [
|
|
88789
|
+
* {
|
|
88790
|
+
* "code": "131026",
|
|
88791
|
+
* "title": "Message undeliverable",
|
|
88792
|
+
* "human_es": "El número no tiene WhatsApp o no puede recibir este mensaje (app desactualizada, no aceptó los términos o bloqueó a la empresa).",
|
|
88793
|
+
* "human_en": "The number is not on WhatsApp or cannot receive this message (outdated app, terms not accepted, or it blocked the business).",
|
|
88794
|
+
* "action": "remove_number",
|
|
88795
|
+
* "count": 4
|
|
88796
|
+
* },
|
|
88797
|
+
* {
|
|
88798
|
+
* "code": "130472",
|
|
88799
|
+
* "title": "User's number is part of an experiment",
|
|
88800
|
+
* "human_es": "Meta retiene mensajes de marketing a una muestra de usuarios para un experimento. No depende de ti.",
|
|
88801
|
+
* "human_en": "Meta holds back marketing messages from a sample of users for an experiment. Nothing on your side.",
|
|
88802
|
+
* "action": "none",
|
|
88803
|
+
* "count": 2
|
|
88804
|
+
* }
|
|
88805
|
+
* ],
|
|
88806
|
+
* "opt_outs": {
|
|
88807
|
+
* "count": 2,
|
|
88808
|
+
* "by_reason": {
|
|
88809
|
+
* "stop_keyword": 1,
|
|
88810
|
+
* "classified_marketing": 1
|
|
88811
|
+
* }
|
|
88812
|
+
* },
|
|
88813
|
+
* "timeline": {
|
|
88814
|
+
* "unit": "hour",
|
|
88815
|
+
* "timezone": "America/Santiago",
|
|
88816
|
+
* "points": [
|
|
88817
|
+
* {
|
|
88818
|
+
* "at": "2026-09-15T17:00:00.000Z",
|
|
88819
|
+
* "sent": 64,
|
|
88820
|
+
* "delivered": 52,
|
|
88821
|
+
* "read": 10,
|
|
88822
|
+
* "replied": 4
|
|
88823
|
+
* },
|
|
88824
|
+
* {
|
|
88825
|
+
* "at": "2026-09-15T18:00:00.000Z",
|
|
88826
|
+
* "sent": 0,
|
|
88827
|
+
* "delivered": 0,
|
|
88828
|
+
* "read": 4,
|
|
88829
|
+
* "replied": 2
|
|
88830
|
+
* }
|
|
88831
|
+
* ]
|
|
88832
|
+
* }
|
|
88833
|
+
* }
|
|
88834
|
+
* }
|
|
88835
|
+
*/
|
|
88836
|
+
"application/json": {
|
|
88837
|
+
data: components["schemas"]["CampaignResults"];
|
|
88838
|
+
meta?: {
|
|
88839
|
+
[key: string]: unknown;
|
|
88840
|
+
};
|
|
88841
|
+
};
|
|
88842
|
+
};
|
|
88843
|
+
};
|
|
88844
|
+
/** @description Validation error */
|
|
88845
|
+
400: {
|
|
88846
|
+
headers: {
|
|
88847
|
+
[name: string]: unknown;
|
|
88848
|
+
};
|
|
88849
|
+
content: {
|
|
88850
|
+
"application/json": components["schemas"]["Error"];
|
|
88851
|
+
};
|
|
88852
|
+
};
|
|
88853
|
+
/** @description Unauthorized */
|
|
88854
|
+
401: {
|
|
88855
|
+
headers: {
|
|
88856
|
+
[name: string]: unknown;
|
|
88857
|
+
};
|
|
88858
|
+
content: {
|
|
88859
|
+
"application/json": components["schemas"]["Error"];
|
|
88860
|
+
};
|
|
88861
|
+
};
|
|
88862
|
+
/** @description Forbidden */
|
|
88863
|
+
403: {
|
|
88864
|
+
headers: {
|
|
88865
|
+
[name: string]: unknown;
|
|
88866
|
+
};
|
|
88867
|
+
content: {
|
|
88868
|
+
"application/json": components["schemas"]["Error"];
|
|
88869
|
+
};
|
|
88870
|
+
};
|
|
88871
|
+
/** @description Not found */
|
|
88872
|
+
404: {
|
|
88873
|
+
headers: {
|
|
88874
|
+
[name: string]: unknown;
|
|
88875
|
+
};
|
|
88876
|
+
content: {
|
|
88877
|
+
"application/json": components["schemas"]["Error"];
|
|
88878
|
+
};
|
|
88879
|
+
};
|
|
88880
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
88881
|
+
409: {
|
|
88882
|
+
headers: {
|
|
88883
|
+
[name: string]: unknown;
|
|
88884
|
+
};
|
|
88885
|
+
content: {
|
|
88886
|
+
"application/json": components["schemas"]["Error"];
|
|
88887
|
+
};
|
|
88888
|
+
};
|
|
88889
|
+
/** @description Rate limited */
|
|
88890
|
+
429: {
|
|
88891
|
+
headers: {
|
|
88892
|
+
[name: string]: unknown;
|
|
88893
|
+
};
|
|
88894
|
+
content: {
|
|
88895
|
+
"application/json": components["schemas"]["Error"];
|
|
88896
|
+
};
|
|
88897
|
+
};
|
|
88898
|
+
};
|
|
88899
|
+
};
|
|
88900
|
+
put?: never;
|
|
88901
|
+
post?: never;
|
|
88902
|
+
delete?: never;
|
|
88903
|
+
options?: never;
|
|
88904
|
+
head?: never;
|
|
88905
|
+
patch?: never;
|
|
88906
|
+
trace?: never;
|
|
88907
|
+
};
|
|
88908
|
+
"/campaigns/{id}/meta-insights": {
|
|
88909
|
+
parameters: {
|
|
88910
|
+
query?: never;
|
|
88911
|
+
header?: never;
|
|
88912
|
+
path?: never;
|
|
88913
|
+
cookie?: never;
|
|
88914
|
+
};
|
|
88915
|
+
/**
|
|
88916
|
+
* Meta’s own analytics for the campaign’s template
|
|
88917
|
+
* @description Meta’s per-template analytics (sent, delivered, read, button clicks) over the campaign’s dates (the 200 shape below is the planned one). **Not available yet**: the messaging bridge Vitrina reaches Meta through does not expose WhatsApp template analytics yet (ADR 0137). Answers **501 `meta_insights_unavailable`** until it does; 404 for an unknown campaign.
|
|
88918
|
+
*/
|
|
88919
|
+
get: {
|
|
88920
|
+
parameters: {
|
|
88921
|
+
query?: never;
|
|
88922
|
+
header?: never;
|
|
88923
|
+
path: {
|
|
88924
|
+
id: string;
|
|
88925
|
+
};
|
|
88926
|
+
cookie?: never;
|
|
88927
|
+
};
|
|
88928
|
+
requestBody?: never;
|
|
88929
|
+
responses: {
|
|
88930
|
+
/** @description Meta’s template analytics */
|
|
88931
|
+
200: {
|
|
88932
|
+
headers: {
|
|
88933
|
+
[name: string]: unknown;
|
|
88934
|
+
};
|
|
88935
|
+
content: {
|
|
88936
|
+
/**
|
|
88937
|
+
* @example {
|
|
88938
|
+
* "data": {
|
|
88939
|
+
* "template": {
|
|
88940
|
+
* "name": "promo_octubre",
|
|
88941
|
+
* "language": "es",
|
|
88942
|
+
* "external_id": "1234567890"
|
|
88943
|
+
* },
|
|
88944
|
+
* "range": {
|
|
88945
|
+
* "start": "2026-10-01",
|
|
88946
|
+
* "end": "2026-10-14"
|
|
88947
|
+
* },
|
|
88948
|
+
* "totals": {
|
|
88949
|
+
* "sent": 820,
|
|
88950
|
+
* "delivered": 790,
|
|
88951
|
+
* "read": 512,
|
|
88952
|
+
* "cost": {
|
|
88953
|
+
* "amount": 41.2,
|
|
88954
|
+
* "currency": "USD"
|
|
88955
|
+
* }
|
|
88956
|
+
* },
|
|
88957
|
+
* "clicks": [
|
|
88958
|
+
* {
|
|
88959
|
+
* "type": "quick_reply_button",
|
|
88960
|
+
* "button": "Quiero más información",
|
|
88961
|
+
* "count": 61
|
|
88962
|
+
* },
|
|
88963
|
+
* {
|
|
88964
|
+
* "type": "url_button",
|
|
88965
|
+
* "button": "Ver promoción",
|
|
88966
|
+
* "count": 37
|
|
88967
|
+
* }
|
|
88968
|
+
* ],
|
|
88969
|
+
* "daily": [
|
|
88970
|
+
* {
|
|
88971
|
+
* "date": "2026-10-13",
|
|
88972
|
+
* "sent": 400,
|
|
88973
|
+
* "delivered": 388,
|
|
88974
|
+
* "read": 250,
|
|
88975
|
+
* "clicks": 52
|
|
88976
|
+
* }
|
|
88977
|
+
* ],
|
|
88978
|
+
* "fetched_at": "2026-10-14T13:05:00.000Z"
|
|
88979
|
+
* }
|
|
88980
|
+
* }
|
|
88981
|
+
*/
|
|
88538
88982
|
"application/json": {
|
|
88539
88983
|
data?: unknown;
|
|
88540
88984
|
meta?: {
|
|
@@ -88597,6 +89041,15 @@ interface paths {
|
|
|
88597
89041
|
"application/json": components["schemas"]["Error"];
|
|
88598
89042
|
};
|
|
88599
89043
|
};
|
|
89044
|
+
/** @description `meta_insights_unavailable` — not available yet. */
|
|
89045
|
+
501: {
|
|
89046
|
+
headers: {
|
|
89047
|
+
[name: string]: unknown;
|
|
89048
|
+
};
|
|
89049
|
+
content: {
|
|
89050
|
+
"application/json": components["schemas"]["Error"];
|
|
89051
|
+
};
|
|
89052
|
+
};
|
|
88600
89053
|
};
|
|
88601
89054
|
};
|
|
88602
89055
|
put?: never;
|
|
@@ -179695,6 +180148,114 @@ interface components {
|
|
|
179695
180148
|
*/
|
|
179696
180149
|
send_mode?: "paced" | "asap";
|
|
179697
180150
|
};
|
|
180151
|
+
CampaignRecipient: {
|
|
180152
|
+
/** Format: uuid */
|
|
180153
|
+
id: string;
|
|
180154
|
+
/** Format: uuid */
|
|
180155
|
+
campaign_id: string;
|
|
180156
|
+
/** Format: uuid */
|
|
180157
|
+
contact_id: string | null;
|
|
180158
|
+
contact_name: string | null;
|
|
180159
|
+
identifier: string;
|
|
180160
|
+
params: {
|
|
180161
|
+
[key: string]: string;
|
|
180162
|
+
};
|
|
180163
|
+
rendered_text: string | null;
|
|
180164
|
+
/** @enum {string} */
|
|
180165
|
+
state: "pending" | "sent" | "delivered" | "read" | "failed" | "suppressed";
|
|
180166
|
+
external_message_id: string | null;
|
|
180167
|
+
/** @description Meta's raw error, as it answered. */
|
|
180168
|
+
error: {
|
|
180169
|
+
code: string;
|
|
180170
|
+
title: string;
|
|
180171
|
+
detail: string | null;
|
|
180172
|
+
} | null;
|
|
180173
|
+
/** @description The failure in plain language, with a suggested action. */
|
|
180174
|
+
error_reason: {
|
|
180175
|
+
code: string;
|
|
180176
|
+
human_es: string;
|
|
180177
|
+
human_en: string;
|
|
180178
|
+
/**
|
|
180179
|
+
* @description none: Meta decided, nothing to do; remove_number: the number cannot receive WhatsApp — take it out of the audience; retry_later: a limit or transient error; check_template: the template/variables/media must be fixed.
|
|
180180
|
+
* @enum {string}
|
|
180181
|
+
*/
|
|
180182
|
+
action: "none" | "remove_number" | "retry_later" | "check_template";
|
|
180183
|
+
} | null;
|
|
180184
|
+
/** @description The template quick-reply button the person's first reply tapped; null when they wrote free text or did not reply. */
|
|
180185
|
+
replied_button: string | null;
|
|
180186
|
+
sent_at: string | null;
|
|
180187
|
+
delivered_at: string | null;
|
|
180188
|
+
read_at: string | null;
|
|
180189
|
+
failed_at: string | null;
|
|
180190
|
+
replied_at: string | null;
|
|
180191
|
+
/** Format: uuid */
|
|
180192
|
+
replied_conversation_id: string | null;
|
|
180193
|
+
created_at: string;
|
|
180194
|
+
};
|
|
180195
|
+
CampaignResults: {
|
|
180196
|
+
/** Format: uuid */
|
|
180197
|
+
campaign_id: string;
|
|
180198
|
+
/** @enum {string} */
|
|
180199
|
+
channel: "whatsapp" | "email" | "voice";
|
|
180200
|
+
funnel: {
|
|
180201
|
+
recipients: number;
|
|
180202
|
+
sent: number;
|
|
180203
|
+
delivered: number;
|
|
180204
|
+
read: number;
|
|
180205
|
+
replied: number;
|
|
180206
|
+
opted_out: number;
|
|
180207
|
+
failed: number;
|
|
180208
|
+
suppressed: number;
|
|
180209
|
+
pending: number;
|
|
180210
|
+
};
|
|
180211
|
+
/** @description 0–1 fractions; null when the denominator is 0. */
|
|
180212
|
+
rates: {
|
|
180213
|
+
/** @description delivered / sent */
|
|
180214
|
+
delivered: number | null;
|
|
180215
|
+
/** @description read / delivered */
|
|
180216
|
+
read: number | null;
|
|
180217
|
+
/** @description replied / delivered */
|
|
180218
|
+
replied: number | null;
|
|
180219
|
+
};
|
|
180220
|
+
/** @description Replies whose first message was a tap on one of the template's quick-reply buttons, per button (every button listed, zeros included). */
|
|
180221
|
+
buttons: {
|
|
180222
|
+
text: string;
|
|
180223
|
+
count: number;
|
|
180224
|
+
}[];
|
|
180225
|
+
/** @description Replies whose first message was not a button tap. */
|
|
180226
|
+
free_text: number;
|
|
180227
|
+
failures: {
|
|
180228
|
+
code: string;
|
|
180229
|
+
title: string;
|
|
180230
|
+
human_es: string;
|
|
180231
|
+
human_en: string;
|
|
180232
|
+
/**
|
|
180233
|
+
* @description none: Meta decided, nothing to do; remove_number: the number cannot receive WhatsApp — take it out of the audience; retry_later: a limit or transient error; check_template: the template/variables/media must be fixed.
|
|
180234
|
+
* @enum {string}
|
|
180235
|
+
*/
|
|
180236
|
+
action: "none" | "remove_number" | "retry_later" | "check_template";
|
|
180237
|
+
count: number;
|
|
180238
|
+
}[];
|
|
180239
|
+
opt_outs: {
|
|
180240
|
+
count: number;
|
|
180241
|
+
by_reason: {
|
|
180242
|
+
[key: string]: number;
|
|
180243
|
+
};
|
|
180244
|
+
};
|
|
180245
|
+
timeline: {
|
|
180246
|
+
/** @enum {string} */
|
|
180247
|
+
unit: "hour" | "day";
|
|
180248
|
+
timezone: string;
|
|
180249
|
+
points: {
|
|
180250
|
+
/** @description Bucket start (ISO, UTC). */
|
|
180251
|
+
at: string;
|
|
180252
|
+
sent: number;
|
|
180253
|
+
delivered: number;
|
|
180254
|
+
read: number;
|
|
180255
|
+
replied: number;
|
|
180256
|
+
}[];
|
|
180257
|
+
};
|
|
180258
|
+
};
|
|
179698
180259
|
CampaignTestSendResult: {
|
|
179699
180260
|
/** Format: uuid */
|
|
179700
180261
|
campaign_id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -88445,12 +88445,18 @@ interface paths {
|
|
|
88445
88445
|
* List the campaign’s recipients
|
|
88446
88446
|
* @description One row per recipient with its delivery state — `pending`, `sent`, `delivered`, `read`, `failed` or `suppressed`. `suppressed` means the contact was in the audience but the suppression list stopped the send, which is a successful outcome rather than a failure.
|
|
88447
88447
|
*
|
|
88448
|
-
* The list only exists once the run materialises it, so a draft or not-yet-started campaign answers empty rather than previewing who WOULD receive it. `limit` defaults to 50 and caps at
|
|
88448
|
+
* The list only exists once the run materialises it, so a draft or not-yet-started campaign answers empty rather than previewing who WOULD receive it. `limit` defaults to 50 and caps at 500; the count is `meta.pagination.total`.
|
|
88449
|
+
*
|
|
88450
|
+
* Filters: `state`, `error_code` (Meta's code, failed rows of one reason) and `replied`. Each row carries Meta's raw `error`, the same failure in plain language with a suggested action (`error_reason`), and `replied_button` — the template quick-reply button the person's first reply tapped (null for free text or no reply).
|
|
88449
88451
|
*/
|
|
88450
88452
|
get: {
|
|
88451
88453
|
parameters: {
|
|
88452
88454
|
query?: {
|
|
88453
88455
|
state?: "pending" | "sent" | "delivered" | "read" | "failed" | "suppressed";
|
|
88456
|
+
/** @description Meta's error code (e.g. `131026`) — failed rows of one reason. */
|
|
88457
|
+
error_code?: string;
|
|
88458
|
+
/** @description `true`: only recipients who replied; `false`: only those who did not. */
|
|
88459
|
+
replied?: "true" | "false";
|
|
88454
88460
|
limit?: number;
|
|
88455
88461
|
offset?: number | null;
|
|
88456
88462
|
};
|
|
@@ -88506,6 +88512,13 @@ interface paths {
|
|
|
88506
88512
|
* "title": "Message undeliverable",
|
|
88507
88513
|
* "detail": null
|
|
88508
88514
|
* },
|
|
88515
|
+
* "error_reason": {
|
|
88516
|
+
* "code": "131026",
|
|
88517
|
+
* "human_es": "El número no tiene WhatsApp o no puede recibir este mensaje (app desactualizada, no aceptó los términos o bloqueó a la empresa).",
|
|
88518
|
+
* "human_en": "The number is not on WhatsApp or cannot receive this message (outdated app, terms not accepted, or it blocked the business).",
|
|
88519
|
+
* "action": "remove_number"
|
|
88520
|
+
* },
|
|
88521
|
+
* "replied_button": null,
|
|
88509
88522
|
* "sent_at": null,
|
|
88510
88523
|
* "replied_at": null,
|
|
88511
88524
|
* "replied_conversation_id": null,
|
|
@@ -88535,6 +88548,437 @@ interface paths {
|
|
|
88535
88548
|
* }
|
|
88536
88549
|
* }
|
|
88537
88550
|
*/
|
|
88551
|
+
"application/json": {
|
|
88552
|
+
data: components["schemas"]["CampaignRecipient"][];
|
|
88553
|
+
meta: {
|
|
88554
|
+
pagination: {
|
|
88555
|
+
total: number;
|
|
88556
|
+
limit: number;
|
|
88557
|
+
offset: number;
|
|
88558
|
+
};
|
|
88559
|
+
};
|
|
88560
|
+
};
|
|
88561
|
+
};
|
|
88562
|
+
};
|
|
88563
|
+
/** @description Validation error */
|
|
88564
|
+
400: {
|
|
88565
|
+
headers: {
|
|
88566
|
+
[name: string]: unknown;
|
|
88567
|
+
};
|
|
88568
|
+
content: {
|
|
88569
|
+
"application/json": components["schemas"]["Error"];
|
|
88570
|
+
};
|
|
88571
|
+
};
|
|
88572
|
+
/** @description Unauthorized */
|
|
88573
|
+
401: {
|
|
88574
|
+
headers: {
|
|
88575
|
+
[name: string]: unknown;
|
|
88576
|
+
};
|
|
88577
|
+
content: {
|
|
88578
|
+
"application/json": components["schemas"]["Error"];
|
|
88579
|
+
};
|
|
88580
|
+
};
|
|
88581
|
+
/** @description Forbidden */
|
|
88582
|
+
403: {
|
|
88583
|
+
headers: {
|
|
88584
|
+
[name: string]: unknown;
|
|
88585
|
+
};
|
|
88586
|
+
content: {
|
|
88587
|
+
"application/json": components["schemas"]["Error"];
|
|
88588
|
+
};
|
|
88589
|
+
};
|
|
88590
|
+
/** @description Not found */
|
|
88591
|
+
404: {
|
|
88592
|
+
headers: {
|
|
88593
|
+
[name: string]: unknown;
|
|
88594
|
+
};
|
|
88595
|
+
content: {
|
|
88596
|
+
"application/json": components["schemas"]["Error"];
|
|
88597
|
+
};
|
|
88598
|
+
};
|
|
88599
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
88600
|
+
409: {
|
|
88601
|
+
headers: {
|
|
88602
|
+
[name: string]: unknown;
|
|
88603
|
+
};
|
|
88604
|
+
content: {
|
|
88605
|
+
"application/json": components["schemas"]["Error"];
|
|
88606
|
+
};
|
|
88607
|
+
};
|
|
88608
|
+
/** @description Rate limited */
|
|
88609
|
+
429: {
|
|
88610
|
+
headers: {
|
|
88611
|
+
[name: string]: unknown;
|
|
88612
|
+
};
|
|
88613
|
+
content: {
|
|
88614
|
+
"application/json": components["schemas"]["Error"];
|
|
88615
|
+
};
|
|
88616
|
+
};
|
|
88617
|
+
};
|
|
88618
|
+
};
|
|
88619
|
+
put?: never;
|
|
88620
|
+
post?: never;
|
|
88621
|
+
delete?: never;
|
|
88622
|
+
options?: never;
|
|
88623
|
+
head?: never;
|
|
88624
|
+
patch?: never;
|
|
88625
|
+
trace?: never;
|
|
88626
|
+
};
|
|
88627
|
+
"/campaigns/{id}/recipients/export.csv": {
|
|
88628
|
+
parameters: {
|
|
88629
|
+
query?: never;
|
|
88630
|
+
header?: never;
|
|
88631
|
+
path?: never;
|
|
88632
|
+
cookie?: never;
|
|
88633
|
+
};
|
|
88634
|
+
/**
|
|
88635
|
+
* Export the campaign’s recipients as CSV
|
|
88636
|
+
* @description The whole recipients list (same filters as the list: `state`, `error_code`, `replied`) as a UTF-8 CSV with a BOM and Spanish headers: `Nombre, Identificador, Estado, Enviado, Entregado, Leído, Respondió, Botón, Código de error, Motivo, Acción sugerida`. Times are in the workspace time zone. Requires `campaigns:read` AND `contacts:read` (it carries names and phone numbers).
|
|
88637
|
+
*/
|
|
88638
|
+
get: {
|
|
88639
|
+
parameters: {
|
|
88640
|
+
query?: {
|
|
88641
|
+
state?: "pending" | "sent" | "delivered" | "read" | "failed" | "suppressed";
|
|
88642
|
+
/** @description Meta's error code (e.g. `131026`) — failed rows of one reason. */
|
|
88643
|
+
error_code?: string;
|
|
88644
|
+
/** @description `true`: only recipients who replied; `false`: only those who did not. */
|
|
88645
|
+
replied?: "true" | "false";
|
|
88646
|
+
};
|
|
88647
|
+
header?: never;
|
|
88648
|
+
path: {
|
|
88649
|
+
id: string;
|
|
88650
|
+
};
|
|
88651
|
+
cookie?: never;
|
|
88652
|
+
};
|
|
88653
|
+
requestBody?: never;
|
|
88654
|
+
responses: {
|
|
88655
|
+
/** @description The CSV file */
|
|
88656
|
+
200: {
|
|
88657
|
+
headers: {
|
|
88658
|
+
[name: string]: unknown;
|
|
88659
|
+
};
|
|
88660
|
+
content: {
|
|
88661
|
+
"text/csv": string;
|
|
88662
|
+
};
|
|
88663
|
+
};
|
|
88664
|
+
/** @description Validation error */
|
|
88665
|
+
400: {
|
|
88666
|
+
headers: {
|
|
88667
|
+
[name: string]: unknown;
|
|
88668
|
+
};
|
|
88669
|
+
content: {
|
|
88670
|
+
"application/json": components["schemas"]["Error"];
|
|
88671
|
+
};
|
|
88672
|
+
};
|
|
88673
|
+
/** @description Unauthorized */
|
|
88674
|
+
401: {
|
|
88675
|
+
headers: {
|
|
88676
|
+
[name: string]: unknown;
|
|
88677
|
+
};
|
|
88678
|
+
content: {
|
|
88679
|
+
"application/json": components["schemas"]["Error"];
|
|
88680
|
+
};
|
|
88681
|
+
};
|
|
88682
|
+
/** @description Forbidden */
|
|
88683
|
+
403: {
|
|
88684
|
+
headers: {
|
|
88685
|
+
[name: string]: unknown;
|
|
88686
|
+
};
|
|
88687
|
+
content: {
|
|
88688
|
+
"application/json": components["schemas"]["Error"];
|
|
88689
|
+
};
|
|
88690
|
+
};
|
|
88691
|
+
/** @description Not found */
|
|
88692
|
+
404: {
|
|
88693
|
+
headers: {
|
|
88694
|
+
[name: string]: unknown;
|
|
88695
|
+
};
|
|
88696
|
+
content: {
|
|
88697
|
+
"application/json": components["schemas"]["Error"];
|
|
88698
|
+
};
|
|
88699
|
+
};
|
|
88700
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
88701
|
+
409: {
|
|
88702
|
+
headers: {
|
|
88703
|
+
[name: string]: unknown;
|
|
88704
|
+
};
|
|
88705
|
+
content: {
|
|
88706
|
+
"application/json": components["schemas"]["Error"];
|
|
88707
|
+
};
|
|
88708
|
+
};
|
|
88709
|
+
/** @description Rate limited */
|
|
88710
|
+
429: {
|
|
88711
|
+
headers: {
|
|
88712
|
+
[name: string]: unknown;
|
|
88713
|
+
};
|
|
88714
|
+
content: {
|
|
88715
|
+
"application/json": components["schemas"]["Error"];
|
|
88716
|
+
};
|
|
88717
|
+
};
|
|
88718
|
+
};
|
|
88719
|
+
};
|
|
88720
|
+
put?: never;
|
|
88721
|
+
post?: never;
|
|
88722
|
+
delete?: never;
|
|
88723
|
+
options?: never;
|
|
88724
|
+
head?: never;
|
|
88725
|
+
patch?: never;
|
|
88726
|
+
trace?: never;
|
|
88727
|
+
};
|
|
88728
|
+
"/campaigns/{id}/results": {
|
|
88729
|
+
parameters: {
|
|
88730
|
+
query?: never;
|
|
88731
|
+
header?: never;
|
|
88732
|
+
path?: never;
|
|
88733
|
+
cookie?: never;
|
|
88734
|
+
};
|
|
88735
|
+
/**
|
|
88736
|
+
* The campaign’s results
|
|
88737
|
+
* @description What happened to the campaign, from its own recipients: the funnel (`recipients → sent → delivered → read → replied`, plus `failed`, `opted_out`, `suppressed`, `pending`) and its rates (delivered/sent, read/delivered, replied/delivered); replies per template quick-reply button (a reply whose first message is a button label) and the `free_text` rest; failures grouped by Meta error code, each with a plain-language reason (es/en) and a suggested `action`; opt-outs attributable to the campaign (recorded by it, or on a recipient’s number within the reply-attribution window after the send) by reason; and a timeline of sends, deliveries, reads and replies per hour (per day past a week), bucketed in the workspace time zone. Delivery/read times are recorded from 2026-10-14 on; older sends show in the funnel but not in the timeline.
|
|
88738
|
+
*/
|
|
88739
|
+
get: {
|
|
88740
|
+
parameters: {
|
|
88741
|
+
query?: never;
|
|
88742
|
+
header?: never;
|
|
88743
|
+
path: {
|
|
88744
|
+
id: string;
|
|
88745
|
+
};
|
|
88746
|
+
cookie?: never;
|
|
88747
|
+
};
|
|
88748
|
+
requestBody?: never;
|
|
88749
|
+
responses: {
|
|
88750
|
+
/** @description The results */
|
|
88751
|
+
200: {
|
|
88752
|
+
headers: {
|
|
88753
|
+
[name: string]: unknown;
|
|
88754
|
+
};
|
|
88755
|
+
content: {
|
|
88756
|
+
/**
|
|
88757
|
+
* @example {
|
|
88758
|
+
* "data": {
|
|
88759
|
+
* "campaign_id": "7a7a7a7a-0000-4000-8000-0000000000c1",
|
|
88760
|
+
* "channel": "whatsapp",
|
|
88761
|
+
* "funnel": {
|
|
88762
|
+
* "recipients": 64,
|
|
88763
|
+
* "sent": 64,
|
|
88764
|
+
* "delivered": 52,
|
|
88765
|
+
* "read": 40,
|
|
88766
|
+
* "replied": 17,
|
|
88767
|
+
* "opted_out": 2,
|
|
88768
|
+
* "failed": 9,
|
|
88769
|
+
* "suppressed": 0,
|
|
88770
|
+
* "pending": 0
|
|
88771
|
+
* },
|
|
88772
|
+
* "rates": {
|
|
88773
|
+
* "delivered": 0.8125,
|
|
88774
|
+
* "read": 0.7692,
|
|
88775
|
+
* "replied": 0.3269
|
|
88776
|
+
* },
|
|
88777
|
+
* "buttons": [
|
|
88778
|
+
* {
|
|
88779
|
+
* "text": "Quiero más información",
|
|
88780
|
+
* "count": 10
|
|
88781
|
+
* },
|
|
88782
|
+
* {
|
|
88783
|
+
* "text": "No me interesa",
|
|
88784
|
+
* "count": 2
|
|
88785
|
+
* }
|
|
88786
|
+
* ],
|
|
88787
|
+
* "free_text": 5,
|
|
88788
|
+
* "failures": [
|
|
88789
|
+
* {
|
|
88790
|
+
* "code": "131026",
|
|
88791
|
+
* "title": "Message undeliverable",
|
|
88792
|
+
* "human_es": "El número no tiene WhatsApp o no puede recibir este mensaje (app desactualizada, no aceptó los términos o bloqueó a la empresa).",
|
|
88793
|
+
* "human_en": "The number is not on WhatsApp or cannot receive this message (outdated app, terms not accepted, or it blocked the business).",
|
|
88794
|
+
* "action": "remove_number",
|
|
88795
|
+
* "count": 4
|
|
88796
|
+
* },
|
|
88797
|
+
* {
|
|
88798
|
+
* "code": "130472",
|
|
88799
|
+
* "title": "User's number is part of an experiment",
|
|
88800
|
+
* "human_es": "Meta retiene mensajes de marketing a una muestra de usuarios para un experimento. No depende de ti.",
|
|
88801
|
+
* "human_en": "Meta holds back marketing messages from a sample of users for an experiment. Nothing on your side.",
|
|
88802
|
+
* "action": "none",
|
|
88803
|
+
* "count": 2
|
|
88804
|
+
* }
|
|
88805
|
+
* ],
|
|
88806
|
+
* "opt_outs": {
|
|
88807
|
+
* "count": 2,
|
|
88808
|
+
* "by_reason": {
|
|
88809
|
+
* "stop_keyword": 1,
|
|
88810
|
+
* "classified_marketing": 1
|
|
88811
|
+
* }
|
|
88812
|
+
* },
|
|
88813
|
+
* "timeline": {
|
|
88814
|
+
* "unit": "hour",
|
|
88815
|
+
* "timezone": "America/Santiago",
|
|
88816
|
+
* "points": [
|
|
88817
|
+
* {
|
|
88818
|
+
* "at": "2026-09-15T17:00:00.000Z",
|
|
88819
|
+
* "sent": 64,
|
|
88820
|
+
* "delivered": 52,
|
|
88821
|
+
* "read": 10,
|
|
88822
|
+
* "replied": 4
|
|
88823
|
+
* },
|
|
88824
|
+
* {
|
|
88825
|
+
* "at": "2026-09-15T18:00:00.000Z",
|
|
88826
|
+
* "sent": 0,
|
|
88827
|
+
* "delivered": 0,
|
|
88828
|
+
* "read": 4,
|
|
88829
|
+
* "replied": 2
|
|
88830
|
+
* }
|
|
88831
|
+
* ]
|
|
88832
|
+
* }
|
|
88833
|
+
* }
|
|
88834
|
+
* }
|
|
88835
|
+
*/
|
|
88836
|
+
"application/json": {
|
|
88837
|
+
data: components["schemas"]["CampaignResults"];
|
|
88838
|
+
meta?: {
|
|
88839
|
+
[key: string]: unknown;
|
|
88840
|
+
};
|
|
88841
|
+
};
|
|
88842
|
+
};
|
|
88843
|
+
};
|
|
88844
|
+
/** @description Validation error */
|
|
88845
|
+
400: {
|
|
88846
|
+
headers: {
|
|
88847
|
+
[name: string]: unknown;
|
|
88848
|
+
};
|
|
88849
|
+
content: {
|
|
88850
|
+
"application/json": components["schemas"]["Error"];
|
|
88851
|
+
};
|
|
88852
|
+
};
|
|
88853
|
+
/** @description Unauthorized */
|
|
88854
|
+
401: {
|
|
88855
|
+
headers: {
|
|
88856
|
+
[name: string]: unknown;
|
|
88857
|
+
};
|
|
88858
|
+
content: {
|
|
88859
|
+
"application/json": components["schemas"]["Error"];
|
|
88860
|
+
};
|
|
88861
|
+
};
|
|
88862
|
+
/** @description Forbidden */
|
|
88863
|
+
403: {
|
|
88864
|
+
headers: {
|
|
88865
|
+
[name: string]: unknown;
|
|
88866
|
+
};
|
|
88867
|
+
content: {
|
|
88868
|
+
"application/json": components["schemas"]["Error"];
|
|
88869
|
+
};
|
|
88870
|
+
};
|
|
88871
|
+
/** @description Not found */
|
|
88872
|
+
404: {
|
|
88873
|
+
headers: {
|
|
88874
|
+
[name: string]: unknown;
|
|
88875
|
+
};
|
|
88876
|
+
content: {
|
|
88877
|
+
"application/json": components["schemas"]["Error"];
|
|
88878
|
+
};
|
|
88879
|
+
};
|
|
88880
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
88881
|
+
409: {
|
|
88882
|
+
headers: {
|
|
88883
|
+
[name: string]: unknown;
|
|
88884
|
+
};
|
|
88885
|
+
content: {
|
|
88886
|
+
"application/json": components["schemas"]["Error"];
|
|
88887
|
+
};
|
|
88888
|
+
};
|
|
88889
|
+
/** @description Rate limited */
|
|
88890
|
+
429: {
|
|
88891
|
+
headers: {
|
|
88892
|
+
[name: string]: unknown;
|
|
88893
|
+
};
|
|
88894
|
+
content: {
|
|
88895
|
+
"application/json": components["schemas"]["Error"];
|
|
88896
|
+
};
|
|
88897
|
+
};
|
|
88898
|
+
};
|
|
88899
|
+
};
|
|
88900
|
+
put?: never;
|
|
88901
|
+
post?: never;
|
|
88902
|
+
delete?: never;
|
|
88903
|
+
options?: never;
|
|
88904
|
+
head?: never;
|
|
88905
|
+
patch?: never;
|
|
88906
|
+
trace?: never;
|
|
88907
|
+
};
|
|
88908
|
+
"/campaigns/{id}/meta-insights": {
|
|
88909
|
+
parameters: {
|
|
88910
|
+
query?: never;
|
|
88911
|
+
header?: never;
|
|
88912
|
+
path?: never;
|
|
88913
|
+
cookie?: never;
|
|
88914
|
+
};
|
|
88915
|
+
/**
|
|
88916
|
+
* Meta’s own analytics for the campaign’s template
|
|
88917
|
+
* @description Meta’s per-template analytics (sent, delivered, read, button clicks) over the campaign’s dates (the 200 shape below is the planned one). **Not available yet**: the messaging bridge Vitrina reaches Meta through does not expose WhatsApp template analytics yet (ADR 0137). Answers **501 `meta_insights_unavailable`** until it does; 404 for an unknown campaign.
|
|
88918
|
+
*/
|
|
88919
|
+
get: {
|
|
88920
|
+
parameters: {
|
|
88921
|
+
query?: never;
|
|
88922
|
+
header?: never;
|
|
88923
|
+
path: {
|
|
88924
|
+
id: string;
|
|
88925
|
+
};
|
|
88926
|
+
cookie?: never;
|
|
88927
|
+
};
|
|
88928
|
+
requestBody?: never;
|
|
88929
|
+
responses: {
|
|
88930
|
+
/** @description Meta’s template analytics */
|
|
88931
|
+
200: {
|
|
88932
|
+
headers: {
|
|
88933
|
+
[name: string]: unknown;
|
|
88934
|
+
};
|
|
88935
|
+
content: {
|
|
88936
|
+
/**
|
|
88937
|
+
* @example {
|
|
88938
|
+
* "data": {
|
|
88939
|
+
* "template": {
|
|
88940
|
+
* "name": "promo_octubre",
|
|
88941
|
+
* "language": "es",
|
|
88942
|
+
* "external_id": "1234567890"
|
|
88943
|
+
* },
|
|
88944
|
+
* "range": {
|
|
88945
|
+
* "start": "2026-10-01",
|
|
88946
|
+
* "end": "2026-10-14"
|
|
88947
|
+
* },
|
|
88948
|
+
* "totals": {
|
|
88949
|
+
* "sent": 820,
|
|
88950
|
+
* "delivered": 790,
|
|
88951
|
+
* "read": 512,
|
|
88952
|
+
* "cost": {
|
|
88953
|
+
* "amount": 41.2,
|
|
88954
|
+
* "currency": "USD"
|
|
88955
|
+
* }
|
|
88956
|
+
* },
|
|
88957
|
+
* "clicks": [
|
|
88958
|
+
* {
|
|
88959
|
+
* "type": "quick_reply_button",
|
|
88960
|
+
* "button": "Quiero más información",
|
|
88961
|
+
* "count": 61
|
|
88962
|
+
* },
|
|
88963
|
+
* {
|
|
88964
|
+
* "type": "url_button",
|
|
88965
|
+
* "button": "Ver promoción",
|
|
88966
|
+
* "count": 37
|
|
88967
|
+
* }
|
|
88968
|
+
* ],
|
|
88969
|
+
* "daily": [
|
|
88970
|
+
* {
|
|
88971
|
+
* "date": "2026-10-13",
|
|
88972
|
+
* "sent": 400,
|
|
88973
|
+
* "delivered": 388,
|
|
88974
|
+
* "read": 250,
|
|
88975
|
+
* "clicks": 52
|
|
88976
|
+
* }
|
|
88977
|
+
* ],
|
|
88978
|
+
* "fetched_at": "2026-10-14T13:05:00.000Z"
|
|
88979
|
+
* }
|
|
88980
|
+
* }
|
|
88981
|
+
*/
|
|
88538
88982
|
"application/json": {
|
|
88539
88983
|
data?: unknown;
|
|
88540
88984
|
meta?: {
|
|
@@ -88597,6 +89041,15 @@ interface paths {
|
|
|
88597
89041
|
"application/json": components["schemas"]["Error"];
|
|
88598
89042
|
};
|
|
88599
89043
|
};
|
|
89044
|
+
/** @description `meta_insights_unavailable` — not available yet. */
|
|
89045
|
+
501: {
|
|
89046
|
+
headers: {
|
|
89047
|
+
[name: string]: unknown;
|
|
89048
|
+
};
|
|
89049
|
+
content: {
|
|
89050
|
+
"application/json": components["schemas"]["Error"];
|
|
89051
|
+
};
|
|
89052
|
+
};
|
|
88600
89053
|
};
|
|
88601
89054
|
};
|
|
88602
89055
|
put?: never;
|
|
@@ -179695,6 +180148,114 @@ interface components {
|
|
|
179695
180148
|
*/
|
|
179696
180149
|
send_mode?: "paced" | "asap";
|
|
179697
180150
|
};
|
|
180151
|
+
CampaignRecipient: {
|
|
180152
|
+
/** Format: uuid */
|
|
180153
|
+
id: string;
|
|
180154
|
+
/** Format: uuid */
|
|
180155
|
+
campaign_id: string;
|
|
180156
|
+
/** Format: uuid */
|
|
180157
|
+
contact_id: string | null;
|
|
180158
|
+
contact_name: string | null;
|
|
180159
|
+
identifier: string;
|
|
180160
|
+
params: {
|
|
180161
|
+
[key: string]: string;
|
|
180162
|
+
};
|
|
180163
|
+
rendered_text: string | null;
|
|
180164
|
+
/** @enum {string} */
|
|
180165
|
+
state: "pending" | "sent" | "delivered" | "read" | "failed" | "suppressed";
|
|
180166
|
+
external_message_id: string | null;
|
|
180167
|
+
/** @description Meta's raw error, as it answered. */
|
|
180168
|
+
error: {
|
|
180169
|
+
code: string;
|
|
180170
|
+
title: string;
|
|
180171
|
+
detail: string | null;
|
|
180172
|
+
} | null;
|
|
180173
|
+
/** @description The failure in plain language, with a suggested action. */
|
|
180174
|
+
error_reason: {
|
|
180175
|
+
code: string;
|
|
180176
|
+
human_es: string;
|
|
180177
|
+
human_en: string;
|
|
180178
|
+
/**
|
|
180179
|
+
* @description none: Meta decided, nothing to do; remove_number: the number cannot receive WhatsApp — take it out of the audience; retry_later: a limit or transient error; check_template: the template/variables/media must be fixed.
|
|
180180
|
+
* @enum {string}
|
|
180181
|
+
*/
|
|
180182
|
+
action: "none" | "remove_number" | "retry_later" | "check_template";
|
|
180183
|
+
} | null;
|
|
180184
|
+
/** @description The template quick-reply button the person's first reply tapped; null when they wrote free text or did not reply. */
|
|
180185
|
+
replied_button: string | null;
|
|
180186
|
+
sent_at: string | null;
|
|
180187
|
+
delivered_at: string | null;
|
|
180188
|
+
read_at: string | null;
|
|
180189
|
+
failed_at: string | null;
|
|
180190
|
+
replied_at: string | null;
|
|
180191
|
+
/** Format: uuid */
|
|
180192
|
+
replied_conversation_id: string | null;
|
|
180193
|
+
created_at: string;
|
|
180194
|
+
};
|
|
180195
|
+
CampaignResults: {
|
|
180196
|
+
/** Format: uuid */
|
|
180197
|
+
campaign_id: string;
|
|
180198
|
+
/** @enum {string} */
|
|
180199
|
+
channel: "whatsapp" | "email" | "voice";
|
|
180200
|
+
funnel: {
|
|
180201
|
+
recipients: number;
|
|
180202
|
+
sent: number;
|
|
180203
|
+
delivered: number;
|
|
180204
|
+
read: number;
|
|
180205
|
+
replied: number;
|
|
180206
|
+
opted_out: number;
|
|
180207
|
+
failed: number;
|
|
180208
|
+
suppressed: number;
|
|
180209
|
+
pending: number;
|
|
180210
|
+
};
|
|
180211
|
+
/** @description 0–1 fractions; null when the denominator is 0. */
|
|
180212
|
+
rates: {
|
|
180213
|
+
/** @description delivered / sent */
|
|
180214
|
+
delivered: number | null;
|
|
180215
|
+
/** @description read / delivered */
|
|
180216
|
+
read: number | null;
|
|
180217
|
+
/** @description replied / delivered */
|
|
180218
|
+
replied: number | null;
|
|
180219
|
+
};
|
|
180220
|
+
/** @description Replies whose first message was a tap on one of the template's quick-reply buttons, per button (every button listed, zeros included). */
|
|
180221
|
+
buttons: {
|
|
180222
|
+
text: string;
|
|
180223
|
+
count: number;
|
|
180224
|
+
}[];
|
|
180225
|
+
/** @description Replies whose first message was not a button tap. */
|
|
180226
|
+
free_text: number;
|
|
180227
|
+
failures: {
|
|
180228
|
+
code: string;
|
|
180229
|
+
title: string;
|
|
180230
|
+
human_es: string;
|
|
180231
|
+
human_en: string;
|
|
180232
|
+
/**
|
|
180233
|
+
* @description none: Meta decided, nothing to do; remove_number: the number cannot receive WhatsApp — take it out of the audience; retry_later: a limit or transient error; check_template: the template/variables/media must be fixed.
|
|
180234
|
+
* @enum {string}
|
|
180235
|
+
*/
|
|
180236
|
+
action: "none" | "remove_number" | "retry_later" | "check_template";
|
|
180237
|
+
count: number;
|
|
180238
|
+
}[];
|
|
180239
|
+
opt_outs: {
|
|
180240
|
+
count: number;
|
|
180241
|
+
by_reason: {
|
|
180242
|
+
[key: string]: number;
|
|
180243
|
+
};
|
|
180244
|
+
};
|
|
180245
|
+
timeline: {
|
|
180246
|
+
/** @enum {string} */
|
|
180247
|
+
unit: "hour" | "day";
|
|
180248
|
+
timezone: string;
|
|
180249
|
+
points: {
|
|
180250
|
+
/** @description Bucket start (ISO, UTC). */
|
|
180251
|
+
at: string;
|
|
180252
|
+
sent: number;
|
|
180253
|
+
delivered: number;
|
|
180254
|
+
read: number;
|
|
180255
|
+
replied: number;
|
|
180256
|
+
}[];
|
|
180257
|
+
};
|
|
180258
|
+
};
|
|
179698
180259
|
CampaignTestSendResult: {
|
|
179699
180260
|
/** Format: uuid */
|
|
179700
180261
|
campaign_id: string;
|
package/package.json
CHANGED