@vitrina/api 17.38.0 → 17.40.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.
Files changed (3) hide show
  1. package/dist/index.d.cts +921 -179
  2. package/dist/index.d.ts +921 -179
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -140251,8 +140251,8 @@ interface paths {
140251
140251
  * "stage": "appointment_booked",
140252
140252
  * "label": "Visita agendada",
140253
140253
  * "website_event": "Schedule",
140254
- * "messaging_default": "QualifiedLead",
140255
- * "messaging_event": "QualifiedLead",
140254
+ * "messaging_default": "ViewContent",
140255
+ * "messaging_event": "ViewContent",
140256
140256
  * "overridden": false
140257
140257
  * },
140258
140258
  * {
@@ -140299,8 +140299,8 @@ interface paths {
140299
140299
  * "stage": "seller_visit_booked",
140300
140300
  * "label": "Vendedor con visita agendada",
140301
140301
  * "website_event": "SellerVisitScheduled",
140302
- * "messaging_default": null,
140303
- * "messaging_event": null,
140302
+ * "messaging_default": "RatingProvided",
140303
+ * "messaging_event": "RatingProvided",
140304
140304
  * "overridden": false
140305
140305
  * },
140306
140306
  * {
@@ -140490,8 +140490,8 @@ interface paths {
140490
140490
  * "stage": "appointment_booked",
140491
140491
  * "label": "Visita agendada",
140492
140492
  * "website_event": "Schedule",
140493
- * "messaging_default": "QualifiedLead",
140494
- * "messaging_event": "QualifiedLead",
140493
+ * "messaging_default": "ViewContent",
140494
+ * "messaging_event": "ViewContent",
140495
140495
  * "overridden": false
140496
140496
  * },
140497
140497
  * {
@@ -140538,8 +140538,8 @@ interface paths {
140538
140538
  * "stage": "seller_visit_booked",
140539
140539
  * "label": "Vendedor con visita agendada",
140540
140540
  * "website_event": "SellerVisitScheduled",
140541
- * "messaging_default": null,
140542
- * "messaging_event": null,
140541
+ * "messaging_default": "RatingProvided",
140542
+ * "messaging_event": "RatingProvided",
140543
140543
  * "overridden": false
140544
140544
  * },
140545
140545
  * {
@@ -140659,6 +140659,516 @@ interface paths {
140659
140659
  };
140660
140660
  trace?: never;
140661
140661
  };
140662
+ "/ads/conversion-sync/website-event-names": {
140663
+ parameters: {
140664
+ query?: never;
140665
+ header?: never;
140666
+ path?: never;
140667
+ cookie?: never;
140668
+ };
140669
+ /**
140670
+ * Each stage’s Meta event name on the website (pixel) lane
140671
+ * @description Per stage the workspace sends: the matrix’s website-lane name (`website_default`) and the name in force (`website_event`: the workspace’s choice, else the default). `accepted_events` are Meta’s standard pixel events; `messaging_optimizable_events` (and each stage’s `messaging_optimizable`) mark the names Meta accepts as the optimisation event of a click-to-WhatsApp ad set that optimises on website conversions. Change them with `PATCH` on this path. `sample=1` (or a sandbox) answers the defaults. Requires `ads:read`.
140672
+ */
140673
+ get: {
140674
+ parameters: {
140675
+ query?: {
140676
+ /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
140677
+ sample?: "1" | "true";
140678
+ };
140679
+ header?: never;
140680
+ path?: never;
140681
+ cookie?: never;
140682
+ };
140683
+ requestBody?: never;
140684
+ responses: {
140685
+ /** @description The stages and their website-lane names */
140686
+ 200: {
140687
+ headers: {
140688
+ [name: string]: unknown;
140689
+ };
140690
+ content: {
140691
+ /**
140692
+ * @example {
140693
+ * "data": {
140694
+ * "overrides": {
140695
+ * "appointment_booked": "CompleteRegistration"
140696
+ * },
140697
+ * "accepted_events": [
140698
+ * "AddPaymentInfo",
140699
+ * "AddToCart",
140700
+ * "AddToWishlist",
140701
+ * "CompleteRegistration",
140702
+ * "Contact",
140703
+ * "CustomizeProduct",
140704
+ * "Donate",
140705
+ * "FindLocation",
140706
+ * "InitiateCheckout",
140707
+ * "Lead",
140708
+ * "Purchase",
140709
+ * "Schedule",
140710
+ * "Search",
140711
+ * "StartTrial",
140712
+ * "SubmitApplication",
140713
+ * "Subscribe",
140714
+ * "ViewContent"
140715
+ * ],
140716
+ * "messaging_optimizable_events": [
140717
+ * "AddPaymentInfo",
140718
+ * "AddToCart",
140719
+ * "AddToWishlist",
140720
+ * "CompleteRegistration",
140721
+ * "InitiateCheckout",
140722
+ * "Purchase",
140723
+ * "Search",
140724
+ * "StartTrial",
140725
+ * "Subscribe",
140726
+ * "ViewContent"
140727
+ * ],
140728
+ * "stages": [
140729
+ * {
140730
+ * "stage": "lead_created",
140731
+ * "label": "Contacto nuevo",
140732
+ * "website_default": "Lead",
140733
+ * "website_event": "Lead",
140734
+ * "overridden": false,
140735
+ * "messaging_optimizable": false
140736
+ * },
140737
+ * {
140738
+ * "stage": "lead_qualified",
140739
+ * "label": "Cotizó",
140740
+ * "website_default": "QualifiedLead",
140741
+ * "website_event": "QualifiedLead",
140742
+ * "overridden": false,
140743
+ * "messaging_optimizable": false
140744
+ * },
140745
+ * {
140746
+ * "stage": "appointment_booked",
140747
+ * "label": "Visita agendada",
140748
+ * "website_default": "Schedule",
140749
+ * "website_event": "CompleteRegistration",
140750
+ * "overridden": true,
140751
+ * "messaging_optimizable": true
140752
+ * },
140753
+ * {
140754
+ * "stage": "checkout_started",
140755
+ * "label": "Abrió el link de pago",
140756
+ * "website_default": "InitiateCheckout",
140757
+ * "website_event": "InitiateCheckout",
140758
+ * "overridden": false,
140759
+ * "messaging_optimizable": true
140760
+ * },
140761
+ * {
140762
+ * "stage": "deposit_paid",
140763
+ * "label": "Abono pagado",
140764
+ * "website_default": "vitrina_step_8",
140765
+ * "website_event": "vitrina_step_8",
140766
+ * "overridden": false,
140767
+ * "messaging_optimizable": false
140768
+ * },
140769
+ * {
140770
+ * "stage": "closed_won",
140771
+ * "label": "Venta o compra",
140772
+ * "website_default": "Purchase",
140773
+ * "website_event": "Purchase",
140774
+ * "overridden": false,
140775
+ * "messaging_optimizable": true
140776
+ * },
140777
+ * {
140778
+ * "stage": "payment_received",
140779
+ * "label": "Pago recibido",
140780
+ * "website_default": "Purchase",
140781
+ * "website_event": "Purchase",
140782
+ * "overridden": false,
140783
+ * "messaging_optimizable": true
140784
+ * },
140785
+ * {
140786
+ * "stage": "seller_qualified",
140787
+ * "label": "Vendedor calificado",
140788
+ * "website_default": "SellerQualified",
140789
+ * "website_event": "SellerQualified",
140790
+ * "overridden": false,
140791
+ * "messaging_optimizable": false
140792
+ * },
140793
+ * {
140794
+ * "stage": "seller_visit_booked",
140795
+ * "label": "Vendedor con visita agendada",
140796
+ * "website_default": "SellerVisitScheduled",
140797
+ * "website_event": "SellerVisitScheduled",
140798
+ * "overridden": false,
140799
+ * "messaging_optimizable": false
140800
+ * },
140801
+ * {
140802
+ * "stage": "seller_deal_closed",
140803
+ * "label": "Compra cerrada a un vendedor",
140804
+ * "website_default": "SellerDealClosed",
140805
+ * "website_event": "SellerDealClosed",
140806
+ * "overridden": false,
140807
+ * "messaging_optimizable": false
140808
+ * }
140809
+ * ]
140810
+ * }
140811
+ * }
140812
+ */
140813
+ "application/json": {
140814
+ data: components["schemas"]["AdsWebsiteEventNames"];
140815
+ };
140816
+ };
140817
+ };
140818
+ /** @description Validation error */
140819
+ 400: {
140820
+ headers: {
140821
+ [name: string]: unknown;
140822
+ };
140823
+ content: {
140824
+ "application/json": components["schemas"]["Error"];
140825
+ };
140826
+ };
140827
+ /** @description Unauthorized */
140828
+ 401: {
140829
+ headers: {
140830
+ [name: string]: unknown;
140831
+ };
140832
+ content: {
140833
+ "application/json": components["schemas"]["Error"];
140834
+ };
140835
+ };
140836
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
140837
+ 402: {
140838
+ headers: {
140839
+ [name: string]: unknown;
140840
+ };
140841
+ content: {
140842
+ /**
140843
+ * @example {
140844
+ * "error": {
140845
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
140846
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
140847
+ * "details": {
140848
+ * "required": [
140849
+ * "vitrina_ads"
140850
+ * ],
140851
+ * "active": [],
140852
+ * "feature": "vitrina_ads",
140853
+ * "entitlement_state": "off"
140854
+ * }
140855
+ * }
140856
+ * }
140857
+ */
140858
+ "application/json": components["schemas"]["Error"];
140859
+ };
140860
+ };
140861
+ /** @description Forbidden */
140862
+ 403: {
140863
+ headers: {
140864
+ [name: string]: unknown;
140865
+ };
140866
+ content: {
140867
+ "application/json": components["schemas"]["Error"];
140868
+ };
140869
+ };
140870
+ /** @description Not found */
140871
+ 404: {
140872
+ headers: {
140873
+ [name: string]: unknown;
140874
+ };
140875
+ content: {
140876
+ "application/json": components["schemas"]["Error"];
140877
+ };
140878
+ };
140879
+ /** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
140880
+ 409: {
140881
+ headers: {
140882
+ [name: string]: unknown;
140883
+ };
140884
+ content: {
140885
+ /**
140886
+ * @example {
140887
+ * "error": {
140888
+ * "code": "ADS_KEY_NEEDS_REMINT",
140889
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
140890
+ * "details": {
140891
+ * "key_kind": "core"
140892
+ * }
140893
+ * }
140894
+ * }
140895
+ */
140896
+ "application/json": components["schemas"]["Error"];
140897
+ };
140898
+ };
140899
+ /** @description Rate limited */
140900
+ 429: {
140901
+ headers: {
140902
+ [name: string]: unknown;
140903
+ };
140904
+ content: {
140905
+ "application/json": components["schemas"]["Error"];
140906
+ };
140907
+ };
140908
+ };
140909
+ };
140910
+ put?: never;
140911
+ post?: never;
140912
+ delete?: never;
140913
+ options?: never;
140914
+ head?: never;
140915
+ /**
140916
+ * Choose a stage’s Meta event name on the website (pixel) lane
140917
+ * @description Merges onto the stored choices: `overrides` sets a stage’s name (one of `accepted_events`; `null` drops the choice), `reset` drops a choice (back to `website_default`). The WhatsApp lane never changes here. The RESULT is validated, and nothing is stored on a `422` (`field_errors.overrides.<stage>`, `details.problems.<stage>`): `unknown_stage` (the workspace does not send it), `stage_not_sent` (instalments), `name_not_accepted`, `purchase_needs_value` (Purchase only on a stage that carries a value), `seller_name_shared` (a seller-side stage never shares its name with a buyer stage), `name_taken` (another stage already reaches Meta under that name; a choice equal to the stage’s own default is always valid). Then the engine’s live rules are converged at once (`sync.state: converged`, `sync.updated` = the stages rewritten); `pending` = stored, the daily sweep retries the write. Requires `ads:write`. Errors: `402 ENTITLEMENT_NOT_ACTIVE` (`details.feature: vitrina_ads`, with `hint`) when the Vitrina Ads Add-on is not active — never retried; `409 ADS_KEY_NEEDS_REMINT` when the Add-on is on but the delegated key has not finished rotating, or still lacks `exports:write` after one automatic re-mint (the entitlement rail converges it; see `GET /ads/state`).
140918
+ */
140919
+ patch: {
140920
+ parameters: {
140921
+ query?: never;
140922
+ header?: never;
140923
+ path?: never;
140924
+ cookie?: never;
140925
+ };
140926
+ requestBody?: {
140927
+ content: {
140928
+ /**
140929
+ * @example {
140930
+ * "overrides": {
140931
+ * "appointment_booked": "CompleteRegistration"
140932
+ * }
140933
+ * }
140934
+ */
140935
+ "application/json": components["schemas"]["AdsWebsiteEventNamesPatch"];
140936
+ };
140937
+ };
140938
+ responses: {
140939
+ /** @description The stored choices and the engine write */
140940
+ 200: {
140941
+ headers: {
140942
+ [name: string]: unknown;
140943
+ };
140944
+ content: {
140945
+ /**
140946
+ * @example {
140947
+ * "data": {
140948
+ * "overrides": {
140949
+ * "appointment_booked": "CompleteRegistration"
140950
+ * },
140951
+ * "accepted_events": [
140952
+ * "AddPaymentInfo",
140953
+ * "AddToCart",
140954
+ * "AddToWishlist",
140955
+ * "CompleteRegistration",
140956
+ * "Contact",
140957
+ * "CustomizeProduct",
140958
+ * "Donate",
140959
+ * "FindLocation",
140960
+ * "InitiateCheckout",
140961
+ * "Lead",
140962
+ * "Purchase",
140963
+ * "Schedule",
140964
+ * "Search",
140965
+ * "StartTrial",
140966
+ * "SubmitApplication",
140967
+ * "Subscribe",
140968
+ * "ViewContent"
140969
+ * ],
140970
+ * "messaging_optimizable_events": [
140971
+ * "AddPaymentInfo",
140972
+ * "AddToCart",
140973
+ * "AddToWishlist",
140974
+ * "CompleteRegistration",
140975
+ * "InitiateCheckout",
140976
+ * "Purchase",
140977
+ * "Search",
140978
+ * "StartTrial",
140979
+ * "Subscribe",
140980
+ * "ViewContent"
140981
+ * ],
140982
+ * "stages": [
140983
+ * {
140984
+ * "stage": "lead_created",
140985
+ * "label": "Contacto nuevo",
140986
+ * "website_default": "Lead",
140987
+ * "website_event": "Lead",
140988
+ * "overridden": false,
140989
+ * "messaging_optimizable": false
140990
+ * },
140991
+ * {
140992
+ * "stage": "lead_qualified",
140993
+ * "label": "Cotizó",
140994
+ * "website_default": "QualifiedLead",
140995
+ * "website_event": "QualifiedLead",
140996
+ * "overridden": false,
140997
+ * "messaging_optimizable": false
140998
+ * },
140999
+ * {
141000
+ * "stage": "appointment_booked",
141001
+ * "label": "Visita agendada",
141002
+ * "website_default": "Schedule",
141003
+ * "website_event": "CompleteRegistration",
141004
+ * "overridden": true,
141005
+ * "messaging_optimizable": true
141006
+ * },
141007
+ * {
141008
+ * "stage": "checkout_started",
141009
+ * "label": "Abrió el link de pago",
141010
+ * "website_default": "InitiateCheckout",
141011
+ * "website_event": "InitiateCheckout",
141012
+ * "overridden": false,
141013
+ * "messaging_optimizable": true
141014
+ * },
141015
+ * {
141016
+ * "stage": "deposit_paid",
141017
+ * "label": "Abono pagado",
141018
+ * "website_default": "vitrina_step_8",
141019
+ * "website_event": "vitrina_step_8",
141020
+ * "overridden": false,
141021
+ * "messaging_optimizable": false
141022
+ * },
141023
+ * {
141024
+ * "stage": "closed_won",
141025
+ * "label": "Venta o compra",
141026
+ * "website_default": "Purchase",
141027
+ * "website_event": "Purchase",
141028
+ * "overridden": false,
141029
+ * "messaging_optimizable": true
141030
+ * },
141031
+ * {
141032
+ * "stage": "payment_received",
141033
+ * "label": "Pago recibido",
141034
+ * "website_default": "Purchase",
141035
+ * "website_event": "Purchase",
141036
+ * "overridden": false,
141037
+ * "messaging_optimizable": true
141038
+ * },
141039
+ * {
141040
+ * "stage": "seller_qualified",
141041
+ * "label": "Vendedor calificado",
141042
+ * "website_default": "SellerQualified",
141043
+ * "website_event": "SellerQualified",
141044
+ * "overridden": false,
141045
+ * "messaging_optimizable": false
141046
+ * },
141047
+ * {
141048
+ * "stage": "seller_visit_booked",
141049
+ * "label": "Vendedor con visita agendada",
141050
+ * "website_default": "SellerVisitScheduled",
141051
+ * "website_event": "SellerVisitScheduled",
141052
+ * "overridden": false,
141053
+ * "messaging_optimizable": false
141054
+ * },
141055
+ * {
141056
+ * "stage": "seller_deal_closed",
141057
+ * "label": "Compra cerrada a un vendedor",
141058
+ * "website_default": "SellerDealClosed",
141059
+ * "website_event": "SellerDealClosed",
141060
+ * "overridden": false,
141061
+ * "messaging_optimizable": false
141062
+ * }
141063
+ * ],
141064
+ * "sync": {
141065
+ * "state": "converged",
141066
+ * "updated": [
141067
+ * "appointment_booked"
141068
+ * ]
141069
+ * }
141070
+ * }
141071
+ * }
141072
+ */
141073
+ "application/json": {
141074
+ data: components["schemas"]["AdsWebsiteEventNamesPatchResult"];
141075
+ };
141076
+ };
141077
+ };
141078
+ /** @description Validation error */
141079
+ 400: {
141080
+ headers: {
141081
+ [name: string]: unknown;
141082
+ };
141083
+ content: {
141084
+ "application/json": components["schemas"]["Error"];
141085
+ };
141086
+ };
141087
+ /** @description Unauthorized */
141088
+ 401: {
141089
+ headers: {
141090
+ [name: string]: unknown;
141091
+ };
141092
+ content: {
141093
+ "application/json": components["schemas"]["Error"];
141094
+ };
141095
+ };
141096
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
141097
+ 402: {
141098
+ headers: {
141099
+ [name: string]: unknown;
141100
+ };
141101
+ content: {
141102
+ /**
141103
+ * @example {
141104
+ * "error": {
141105
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
141106
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
141107
+ * "details": {
141108
+ * "required": [
141109
+ * "vitrina_ads"
141110
+ * ],
141111
+ * "active": [],
141112
+ * "feature": "vitrina_ads",
141113
+ * "entitlement_state": "off"
141114
+ * }
141115
+ * }
141116
+ * }
141117
+ */
141118
+ "application/json": components["schemas"]["Error"];
141119
+ };
141120
+ };
141121
+ /** @description Forbidden */
141122
+ 403: {
141123
+ headers: {
141124
+ [name: string]: unknown;
141125
+ };
141126
+ content: {
141127
+ "application/json": components["schemas"]["Error"];
141128
+ };
141129
+ };
141130
+ /** @description Not found */
141131
+ 404: {
141132
+ headers: {
141133
+ [name: string]: unknown;
141134
+ };
141135
+ content: {
141136
+ "application/json": components["schemas"]["Error"];
141137
+ };
141138
+ };
141139
+ /** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
141140
+ 409: {
141141
+ headers: {
141142
+ [name: string]: unknown;
141143
+ };
141144
+ content: {
141145
+ /**
141146
+ * @example {
141147
+ * "error": {
141148
+ * "code": "ADS_KEY_NEEDS_REMINT",
141149
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
141150
+ * "details": {
141151
+ * "key_kind": "core"
141152
+ * }
141153
+ * }
141154
+ * }
141155
+ */
141156
+ "application/json": components["schemas"]["Error"];
141157
+ };
141158
+ };
141159
+ /** @description Rate limited */
141160
+ 429: {
141161
+ headers: {
141162
+ [name: string]: unknown;
141163
+ };
141164
+ content: {
141165
+ "application/json": components["schemas"]["Error"];
141166
+ };
141167
+ };
141168
+ };
141169
+ };
141170
+ trace?: never;
141171
+ };
140662
141172
  "/ads/conversion-sync/data-sources": {
140663
141173
  parameters: {
140664
141174
  query?: never;
@@ -140965,11 +141475,279 @@ interface paths {
140965
141475
  * },
140966
141476
  * "website": {
140967
141477
  * "kind": "website",
140968
- * "state": "ready",
141478
+ * "state": "ready",
141479
+ * "reason_code": null,
141480
+ * "message": null,
141481
+ * "dataset": null,
141482
+ * "can_create": true,
141483
+ * "can_turn_off": false,
141484
+ * "notice": {
141485
+ * "version": "meta-website-pixel-2026-10-02",
141486
+ * "points": [
141487
+ * "Tu píxel del sitio recibe los resultados que no traen el clic…"
141488
+ * ],
141489
+ * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
141490
+ * },
141491
+ * "candidates": [
141492
+ * {
141493
+ * "external_id": "<pixel_id>",
141494
+ * "id_tail": "9748",
141495
+ * "name": "Píxel del sitio",
141496
+ * "last_fired_at": "2026-10-01T22:10:00.000Z",
141497
+ * "recommended": true
141498
+ * }
141499
+ * ],
141500
+ * "can_create_pixel": false
141501
+ * },
141502
+ * "instagram": {
141503
+ * "kind": "instagram",
141504
+ * "state": "ready",
141505
+ * "reason_code": null,
141506
+ * "message": null,
141507
+ * "dataset": null,
141508
+ * "can_create": true,
141509
+ * "can_turn_off": false,
141510
+ * "notice": {
141511
+ * "version": "meta-instagram-dataset-2026-10-07",
141512
+ * "points": [
141513
+ * "Meta crea un conjunto de datos conectado a tu cuenta de Instagram…"
141514
+ * ],
141515
+ * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
141516
+ * }
141517
+ * },
141518
+ * "click_less_not_sent": true,
141519
+ * "preview": {
141520
+ * "window_days": 30,
141521
+ * "total": 120,
141522
+ * "with_ad_click": 14,
141523
+ * "without_ad_click": 106,
141524
+ * "click_less_to": "not_sent",
141525
+ * "enabled_meta_rules": 0,
141526
+ * "source": "engine",
141527
+ * "truncated": false,
141528
+ * "stages": [
141529
+ * {
141530
+ * "stage": "lead_created",
141531
+ * "label": "Contacto nuevo",
141532
+ * "on": true,
141533
+ * "total": 60,
141534
+ * "with_ad_click": 9,
141535
+ * "weekly": 14,
141536
+ * "weekly_with_ad_click": 2.1,
141537
+ * "measured_weeks": 4,
141538
+ * "measured_days": 30
141539
+ * }
141540
+ * ]
141541
+ * }
141542
+ * }
141543
+ * }
141544
+ * }
141545
+ */
141546
+ "application/json": {
141547
+ data: {
141548
+ /** @enum {string} */
141549
+ outcome: "created" | "already_present";
141550
+ status: components["schemas"]["AdsMetaDatasetStatus"];
141551
+ };
141552
+ };
141553
+ };
141554
+ };
141555
+ /** @description Validation error */
141556
+ 400: {
141557
+ headers: {
141558
+ [name: string]: unknown;
141559
+ };
141560
+ content: {
141561
+ "application/json": components["schemas"]["Error"];
141562
+ };
141563
+ };
141564
+ /** @description Unauthorized */
141565
+ 401: {
141566
+ headers: {
141567
+ [name: string]: unknown;
141568
+ };
141569
+ content: {
141570
+ "application/json": components["schemas"]["Error"];
141571
+ };
141572
+ };
141573
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
141574
+ 402: {
141575
+ headers: {
141576
+ [name: string]: unknown;
141577
+ };
141578
+ content: {
141579
+ /**
141580
+ * @example {
141581
+ * "error": {
141582
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
141583
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
141584
+ * "details": {
141585
+ * "required": [
141586
+ * "vitrina_ads"
141587
+ * ],
141588
+ * "active": [],
141589
+ * "feature": "vitrina_ads",
141590
+ * "entitlement_state": "off"
141591
+ * }
141592
+ * }
141593
+ * }
141594
+ */
141595
+ "application/json": components["schemas"]["Error"];
141596
+ };
141597
+ };
141598
+ /** @description Forbidden */
141599
+ 403: {
141600
+ headers: {
141601
+ [name: string]: unknown;
141602
+ };
141603
+ content: {
141604
+ "application/json": components["schemas"]["Error"];
141605
+ };
141606
+ };
141607
+ /** @description Not found */
141608
+ 404: {
141609
+ headers: {
141610
+ [name: string]: unknown;
141611
+ };
141612
+ content: {
141613
+ "application/json": components["schemas"]["Error"];
141614
+ };
141615
+ };
141616
+ /** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
141617
+ 409: {
141618
+ headers: {
141619
+ [name: string]: unknown;
141620
+ };
141621
+ content: {
141622
+ /**
141623
+ * @example {
141624
+ * "error": {
141625
+ * "code": "ADS_KEY_NEEDS_REMINT",
141626
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
141627
+ * "details": {
141628
+ * "key_kind": "core"
141629
+ * }
141630
+ * }
141631
+ * }
141632
+ */
141633
+ "application/json": components["schemas"]["Error"];
141634
+ };
141635
+ };
141636
+ /** @description Rate limited */
141637
+ 429: {
141638
+ headers: {
141639
+ [name: string]: unknown;
141640
+ };
141641
+ content: {
141642
+ "application/json": components["schemas"]["Error"];
141643
+ };
141644
+ };
141645
+ };
141646
+ };
141647
+ delete?: never;
141648
+ options?: never;
141649
+ head?: never;
141650
+ patch?: never;
141651
+ trace?: never;
141652
+ };
141653
+ "/ads/conversion-sync/data-sources/website/ensure": {
141654
+ parameters: {
141655
+ query?: never;
141656
+ header?: never;
141657
+ path?: never;
141658
+ cookie?: never;
141659
+ };
141660
+ get?: never;
141661
+ put?: never;
141662
+ /**
141663
+ * Connect the website pixel as the destination of click-less outcomes
141664
+ * @description The Meta destinations of the workspace’s outcomes, each set up by its own explicit press, never as a side effect. Step 1 — the dataset linked to the WhatsApp Business Account — receives the outcomes carrying the click-to-WhatsApp ad click (`ctwa_clid`), as `business_messaging`; a click-to-WhatsApp ad set optimised on Purchase needs it. Step 2 — the website pixel — receives every other outcome, matched by the hashed phone and e-mail; without it those outcomes (most payments) are not sent at all. Step 3 — the dataset linked to the Instagram account — receives the outcomes of conversations an Instagram ad opened, as `business_messaging` with the customer’s Instagram-scoped id (measurement only: Meta offers no Purchase optimisation on Instagram); until it exists they reach the website pixel as before. Each sends from its press on (no history), and nothing flows until the stages are switched on in «Enviar a Meta». Meta cannot delete a dataset. `external_id` must be one of `website.candidates` (409 `not_a_pixel` otherwise). Needs the CURRENT `website.notice` (409 `notice_required`). 409 `engine_not_ready` while the measurement engine cannot wire a pixel yet («Pronto»). Turning the pixel off is «Enviar a Meta»’s `send_stop`. The answer carries the engine’s read-back. Requires `ads:write`.
141665
+ */
141666
+ post: {
141667
+ parameters: {
141668
+ query?: never;
141669
+ header?: {
141670
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
141671
+ "Idempotency-Key"?: string;
141672
+ };
141673
+ path?: never;
141674
+ cookie?: never;
141675
+ };
141676
+ requestBody?: {
141677
+ content: {
141678
+ /**
141679
+ * @example {
141680
+ * "notice_version": "meta-website-pixel-2026-10-02",
141681
+ * "notice_hash": "0000000000000000000000000000000000000000000000000000000000000000",
141682
+ * "external_id": "<pixel_id>"
141683
+ * }
141684
+ */
141685
+ "application/json": {
141686
+ /** @description `notice.version` from the read. */
141687
+ notice_version: string;
141688
+ /** @description `notice.hash` from the read: proof the notice was read. */
141689
+ notice_hash: string;
141690
+ /** @description The chosen pixel: one of `website.candidates[].external_id`. */
141691
+ external_id: string;
141692
+ };
141693
+ };
141694
+ };
141695
+ responses: {
141696
+ /** @description Connected (or already present), with the read-back. */
141697
+ 200: {
141698
+ headers: {
141699
+ [name: string]: unknown;
141700
+ };
141701
+ content: {
141702
+ /**
141703
+ * @example {
141704
+ * "data": {
141705
+ * "outcome": "created",
141706
+ * "status": {
141707
+ * "prerequisites": {
141708
+ * "meta_ads_connected": true,
141709
+ * "whatsapp_connected": true,
141710
+ * "instagram_connected": true
141711
+ * },
141712
+ * "whatsapp": {
141713
+ * "kind": "whatsapp",
141714
+ * "state": "created",
141715
+ * "reason_code": null,
141716
+ * "message": null,
141717
+ * "dataset": {
141718
+ * "external_id": "<dataset_id>",
141719
+ * "id_tail": "4821",
141720
+ * "export_from": "2026-10-02T15:00:00.000Z",
141721
+ * "destination_enabled": true,
141722
+ * "access_granted": true,
141723
+ * "shared": false,
141724
+ * "shared_count": null
141725
+ * },
141726
+ * "can_create": false,
141727
+ * "can_turn_off": true,
141728
+ * "notice": {
141729
+ * "version": "meta-whatsapp-dataset-2026-10-02",
141730
+ * "points": [
141731
+ * "Meta crea un conjunto de datos conectado a tu WhatsApp Business…"
141732
+ * ],
141733
+ * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
141734
+ * }
141735
+ * },
141736
+ * "website": {
141737
+ * "kind": "website",
141738
+ * "state": "created",
140969
141739
  * "reason_code": null,
140970
141740
  * "message": null,
140971
- * "dataset": null,
140972
- * "can_create": true,
141741
+ * "dataset": {
141742
+ * "external_id": "<pixel_id>",
141743
+ * "id_tail": "9748",
141744
+ * "export_from": "2026-10-02T15:05:00.000Z",
141745
+ * "destination_enabled": true,
141746
+ * "access_granted": null,
141747
+ * "shared": false,
141748
+ * "shared_count": null
141749
+ * },
141750
+ * "can_create": false,
140973
141751
  * "can_turn_off": false,
140974
141752
  * "notice": {
140975
141753
  * "version": "meta-website-pixel-2026-10-02",
@@ -140978,15 +141756,7 @@ interface paths {
140978
141756
  * ],
140979
141757
  * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
140980
141758
  * },
140981
- * "candidates": [
140982
- * {
140983
- * "external_id": "<pixel_id>",
140984
- * "id_tail": "9748",
140985
- * "name": "Píxel del sitio",
140986
- * "last_fired_at": "2026-10-01T22:10:00.000Z",
140987
- * "recommended": true
140988
- * }
140989
- * ],
141759
+ * "candidates": [],
140990
141760
  * "can_create_pixel": false
140991
141761
  * },
140992
141762
  * "instagram": {
@@ -141005,7 +141775,7 @@ interface paths {
141005
141775
  * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
141006
141776
  * }
141007
141777
  * },
141008
- * "click_less_not_sent": true,
141778
+ * "click_less_not_sent": false,
141009
141779
  * "preview": {
141010
141780
  * "window_days": 30,
141011
141781
  * "total": 120,
@@ -141140,7 +141910,7 @@ interface paths {
141140
141910
  patch?: never;
141141
141911
  trace?: never;
141142
141912
  };
141143
- "/ads/conversion-sync/data-sources/website/ensure": {
141913
+ "/ads/conversion-sync/data-sources/website/create-pixel": {
141144
141914
  parameters: {
141145
141915
  query?: never;
141146
141916
  header?: never;
@@ -141150,8 +141920,8 @@ interface paths {
141150
141920
  get?: never;
141151
141921
  put?: never;
141152
141922
  /**
141153
- * Connect the website pixel as the destination of click-less outcomes
141154
- * @description The Meta destinations of the workspace’s outcomes, each set up by its own explicit press, never as a side effect. Step 1 — the dataset linked to the WhatsApp Business Account — receives the outcomes carrying the click-to-WhatsApp ad click (`ctwa_clid`), as `business_messaging`; a click-to-WhatsApp ad set optimised on Purchase needs it. Step 2 — the website pixel — receives every other outcome, matched by the hashed phone and e-mail; without it those outcomes (most payments) are not sent at all. Step 3 — the dataset linked to the Instagram account — receives the outcomes of conversations an Instagram ad opened, as `business_messaging` with the customer’s Instagram-scoped id (measurement only: Meta offers no Purchase optimisation on Instagram); until it exists they reach the website pixel as before. Each sends from its press on (no history), and nothing flows until the stages are switched on in «Enviar a Meta». Meta cannot delete a dataset. `external_id` must be one of `website.candidates` (409 `not_a_pixel` otherwise). Needs the CURRENT `website.notice` (409 `notice_required`). 409 `engine_not_ready` while the measurement engine cannot wire a pixel yet («Pronto»). Turning the pixel off is «Enviar a Meta»’s `send_stop`. The answer carries the engine’s read-back. Requires `ads:write`.
141923
+ * Create a pixel in the ad account and connect it as the website pixel («Crear píxel»)
141924
+ * @description The Meta destinations of the workspace’s outcomes, each set up by its own explicit press, never as a side effect. Step 1 — the dataset linked to the WhatsApp Business Account — receives the outcomes carrying the click-to-WhatsApp ad click (`ctwa_clid`), as `business_messaging`; a click-to-WhatsApp ad set optimised on Purchase needs it. Step 2 — the website pixel — receives every other outcome, matched by the hashed phone and e-mail; without it those outcomes (most payments) are not sent at all. Step 3 — the dataset linked to the Instagram account — receives the outcomes of conversations an Instagram ad opened, as `business_messaging` with the customer’s Instagram-scoped id (measurement only: Meta offers no Purchase optimisation on Instagram); until it exists they reach the website pixel as before. Each sends from its press on (no history), and nothing flows until the stages are switched on in «Enviar a Meta». Meta cannot delete a dataset. For an ad account with no pixel (`website.can_create_pixel`): the measurement engine creates ONE pixel named «<workspace> · Vitrina» in the ad account (or adopts a pixel already carrying that name) and connects it exactly as `website/ensure` does. Meta cannot delete a pixel; a retry replays (idempotent per workspace and name) and answers `already_present`. Needs the CURRENT `website.notice` (409 `notice_required`). 409 `details.reason`: `website_pixel_connected` (another pixel is already connected; nothing created), `pixel_slot_taken` (Meta allows one self-created pixel per ad account and it is used: connect it with `website/ensure`), `pixel_already_attached`, `meta_ads_not_connected`, `meta_write_permission_missing` (reconnect Meta Ads granting every permission), `reconnect_required`, `entitlement_required`, `engine_not_ready` («Pronto»). 502 when Meta failed (nothing was created). The answer carries the engine’s read-back. Requires `ads:write`.
141155
141925
  */
141156
141926
  post: {
141157
141927
  parameters: {
@@ -141168,8 +141938,7 @@ interface paths {
141168
141938
  /**
141169
141939
  * @example {
141170
141940
  * "notice_version": "meta-website-pixel-2026-10-02",
141171
- * "notice_hash": "0000000000000000000000000000000000000000000000000000000000000000",
141172
- * "external_id": "<pixel_id>"
141941
+ * "notice_hash": "0000000000000000000000000000000000000000000000000000000000000000"
141173
141942
  * }
141174
141943
  */
141175
141944
  "application/json": {
@@ -141177,13 +141946,11 @@ interface paths {
141177
141946
  notice_version: string;
141178
141947
  /** @description `notice.hash` from the read: proof the notice was read. */
141179
141948
  notice_hash: string;
141180
- /** @description The chosen pixel: one of `website.candidates[].external_id`. */
141181
- external_id: string;
141182
141949
  };
141183
141950
  };
141184
141951
  };
141185
141952
  responses: {
141186
- /** @description Connected (or already present), with the read-back. */
141953
+ /** @description Created (or already present) and connected, with the read-back. */
141187
141954
  200: {
141188
141955
  headers: {
141189
141956
  [name: string]: unknown;
@@ -141229,8 +141996,8 @@ interface paths {
141229
141996
  * "reason_code": null,
141230
141997
  * "message": null,
141231
141998
  * "dataset": {
141232
- * "external_id": "<pixel_id>",
141233
- * "id_tail": "9748",
141999
+ * "external_id": "<new_pixel_id>",
142000
+ * "id_tail": "7890",
141234
142001
  * "export_from": "2026-10-02T15:05:00.000Z",
141235
142002
  * "destination_enabled": true,
141236
142003
  * "access_granted": null,
@@ -141400,7 +142167,7 @@ interface paths {
141400
142167
  patch?: never;
141401
142168
  trace?: never;
141402
142169
  };
141403
- "/ads/conversion-sync/data-sources/website/create-pixel": {
142170
+ "/ads/conversion-sync/data-sources/instagram/ensure": {
141404
142171
  parameters: {
141405
142172
  query?: never;
141406
142173
  header?: never;
@@ -141410,8 +142177,8 @@ interface paths {
141410
142177
  get?: never;
141411
142178
  put?: never;
141412
142179
  /**
141413
- * Create a pixel in the ad account and connect it as the website pixel («Crear píxel»)
141414
- * @description The Meta destinations of the workspace’s outcomes, each set up by its own explicit press, never as a side effect. Step 1 — the dataset linked to the WhatsApp Business Account — receives the outcomes carrying the click-to-WhatsApp ad click (`ctwa_clid`), as `business_messaging`; a click-to-WhatsApp ad set optimised on Purchase needs it. Step 2 — the website pixel — receives every other outcome, matched by the hashed phone and e-mail; without it those outcomes (most payments) are not sent at all. Step 3 — the dataset linked to the Instagram account — receives the outcomes of conversations an Instagram ad opened, as `business_messaging` with the customer’s Instagram-scoped id (measurement only: Meta offers no Purchase optimisation on Instagram); until it exists they reach the website pixel as before. Each sends from its press on (no history), and nothing flows until the stages are switched on in «Enviar a Meta». Meta cannot delete a dataset. For an ad account with no pixel (`website.can_create_pixel`): the measurement engine creates ONE pixel named «<workspace> · Vitrina» in the ad account (or adopts a pixel already carrying that name) and connects it exactly as `website/ensure` does. Meta cannot delete a pixel; a retry replays (idempotent per workspace and name) and answers `already_present`. Needs the CURRENT `website.notice` (409 `notice_required`). 409 `details.reason`: `website_pixel_connected` (another pixel is already connected; nothing created), `pixel_slot_taken` (Meta allows one self-created pixel per ad account and it is used: connect it with `website/ensure`), `pixel_already_attached`, `meta_ads_not_connected`, `meta_write_permission_missing` (reconnect Meta Ads granting every permission), `reconnect_required`, `entitlement_required`, `engine_not_ready` («Pronto»). 502 when Meta failed (nothing was created). The answer carries the engine’s read-back. Requires `ads:write`.
142180
+ * Create the Instagram dataset in Meta (idempotent)
142181
+ * @description The Meta destinations of the workspace’s outcomes, each set up by its own explicit press, never as a side effect. Step 1 — the dataset linked to the WhatsApp Business Account — receives the outcomes carrying the click-to-WhatsApp ad click (`ctwa_clid`), as `business_messaging`; a click-to-WhatsApp ad set optimised on Purchase needs it. Step 2 — the website pixel — receives every other outcome, matched by the hashed phone and e-mail; without it those outcomes (most payments) are not sent at all. Step 3 — the dataset linked to the Instagram account — receives the outcomes of conversations an Instagram ad opened, as `business_messaging` with the customer’s Instagram-scoped id (measurement only: Meta offers no Purchase optimisation on Instagram); until it exists they reach the website pixel as before. Each sends from its press on (no history), and nothing flows until the stages are switched on in «Enviar a Meta». Meta cannot delete a dataset. The measurement engine asks Meta to create the dataset linked to the connected Instagram account, and creates its Instagram destination; an existing destination is never repointed. Needs the CURRENT `instagram.notice` (version + hash from the read): 409 `notice_required` otherwise. A retry answers `already_present`; a turned-off dataset is turned back on. 409 `details.reason`: `meta_ads_not_connected`, `instagram_not_connected`, `entitlement_required`, `duplicate_kind`, `dataset_unreadable`, `already_exists`, `engine_not_ready` (the engine cannot create it yet: «Pronto»), `meta_permission_missing` (Meta refused for a missing app permission — `instagram_manage_events`), `reconnect_required` (the Meta Ads connection expired), `instagram_events_permission_required` (the Meta Ads connection has no `instagram_manage_events` yet: `POST …/instagram/enable-events` first; the read-back already carries it as the step's `reason_code`, with no press offered); nothing is created on any refusal. 502 when Meta failed (nothing was created). The answer carries the engine’s read-back. Requires `ads:write`.
141415
142182
  */
141416
142183
  post: {
141417
142184
  parameters: {
@@ -141427,7 +142194,7 @@ interface paths {
141427
142194
  content: {
141428
142195
  /**
141429
142196
  * @example {
141430
- * "notice_version": "meta-website-pixel-2026-10-02",
142197
+ * "notice_version": "meta-instagram-dataset-2026-10-07",
141431
142198
  * "notice_hash": "0000000000000000000000000000000000000000000000000000000000000000"
141432
142199
  * }
141433
142200
  */
@@ -141440,7 +142207,7 @@ interface paths {
141440
142207
  };
141441
142208
  };
141442
142209
  responses: {
141443
- /** @description Created (or already present) and connected, with the read-back. */
142210
+ /** @description Created (or already present), with the read-back. */
141444
142211
  200: {
141445
142212
  headers: {
141446
142213
  [name: string]: unknown;
@@ -141458,20 +142225,12 @@ interface paths {
141458
142225
  * },
141459
142226
  * "whatsapp": {
141460
142227
  * "kind": "whatsapp",
141461
- * "state": "created",
142228
+ * "state": "ready",
141462
142229
  * "reason_code": null,
141463
142230
  * "message": null,
141464
- * "dataset": {
141465
- * "external_id": "<dataset_id>",
141466
- * "id_tail": "4821",
141467
- * "export_from": "2026-10-02T15:00:00.000Z",
141468
- * "destination_enabled": true,
141469
- * "access_granted": true,
141470
- * "shared": false,
141471
- * "shared_count": null
141472
- * },
141473
- * "can_create": false,
141474
- * "can_turn_off": true,
142231
+ * "dataset": null,
142232
+ * "can_create": true,
142233
+ * "can_turn_off": false,
141475
142234
  * "notice": {
141476
142235
  * "version": "meta-whatsapp-dataset-2026-10-02",
141477
142236
  * "points": [
@@ -141482,19 +142241,11 @@ interface paths {
141482
142241
  * },
141483
142242
  * "website": {
141484
142243
  * "kind": "website",
141485
- * "state": "created",
142244
+ * "state": "ready",
141486
142245
  * "reason_code": null,
141487
142246
  * "message": null,
141488
- * "dataset": {
141489
- * "external_id": "<new_pixel_id>",
141490
- * "id_tail": "7890",
141491
- * "export_from": "2026-10-02T15:05:00.000Z",
141492
- * "destination_enabled": true,
141493
- * "access_granted": null,
141494
- * "shared": false,
141495
- * "shared_count": null
141496
- * },
141497
- * "can_create": false,
142247
+ * "dataset": null,
142248
+ * "can_create": true,
141498
142249
  * "can_turn_off": false,
141499
142250
  * "notice": {
141500
142251
  * "version": "meta-website-pixel-2026-10-02",
@@ -141503,17 +142254,33 @@ interface paths {
141503
142254
  * ],
141504
142255
  * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
141505
142256
  * },
141506
- * "candidates": [],
142257
+ * "candidates": [
142258
+ * {
142259
+ * "external_id": "<pixel_id>",
142260
+ * "id_tail": "9748",
142261
+ * "name": "Píxel del sitio",
142262
+ * "last_fired_at": "2026-10-01T22:10:00.000Z",
142263
+ * "recommended": true
142264
+ * }
142265
+ * ],
141507
142266
  * "can_create_pixel": false
141508
142267
  * },
141509
142268
  * "instagram": {
141510
142269
  * "kind": "instagram",
141511
- * "state": "ready",
142270
+ * "state": "created",
141512
142271
  * "reason_code": null,
141513
142272
  * "message": null,
141514
- * "dataset": null,
141515
- * "can_create": true,
141516
- * "can_turn_off": false,
142273
+ * "dataset": {
142274
+ * "external_id": "<dataset_id>",
142275
+ * "id_tail": "3307",
142276
+ * "export_from": "2026-10-07T15:00:00.000Z",
142277
+ * "destination_enabled": true,
142278
+ * "access_granted": true,
142279
+ * "shared": false,
142280
+ * "shared_count": null
142281
+ * },
142282
+ * "can_create": false,
142283
+ * "can_turn_off": true,
141517
142284
  * "notice": {
141518
142285
  * "version": "meta-instagram-dataset-2026-10-07",
141519
142286
  * "points": [
@@ -141657,7 +142424,7 @@ interface paths {
141657
142424
  patch?: never;
141658
142425
  trace?: never;
141659
142426
  };
141660
- "/ads/conversion-sync/data-sources/instagram/ensure": {
142427
+ "/ads/conversion-sync/data-sources/instagram/enable-events": {
141661
142428
  parameters: {
141662
142429
  query?: never;
141663
142430
  header?: never;
@@ -141667,8 +142434,8 @@ interface paths {
141667
142434
  get?: never;
141668
142435
  put?: never;
141669
142436
  /**
141670
- * Create the Instagram dataset in Meta (idempotent)
141671
- * @description The Meta destinations of the workspace’s outcomes, each set up by its own explicit press, never as a side effect. Step 1 — the dataset linked to the WhatsApp Business Account — receives the outcomes carrying the click-to-WhatsApp ad click (`ctwa_clid`), as `business_messaging`; a click-to-WhatsApp ad set optimised on Purchase needs it. Step 2 — the website pixel — receives every other outcome, matched by the hashed phone and e-mail; without it those outcomes (most payments) are not sent at all. Step 3 — the dataset linked to the Instagram account — receives the outcomes of conversations an Instagram ad opened, as `business_messaging` with the customer’s Instagram-scoped id (measurement only: Meta offers no Purchase optimisation on Instagram); until it exists they reach the website pixel as before. Each sends from its press on (no history), and nothing flows until the stages are switched on in «Enviar a Meta». Meta cannot delete a dataset. The measurement engine asks Meta to create the dataset linked to the connected Instagram account, and creates its Instagram destination; an existing destination is never repointed. Needs the CURRENT `instagram.notice` (version + hash from the read): 409 `notice_required` otherwise. A retry answers `already_present`; a turned-off dataset is turned back on. 409 `details.reason`: `meta_ads_not_connected`, `instagram_not_connected`, `entitlement_required`, `duplicate_kind`, `dataset_unreadable`, `already_exists`, `engine_not_ready` (the engine cannot create it yet: «Pronto»), `meta_permission_missing` (Meta refused for a missing app permission — `instagram_manage_events`), `reconnect_required` (the Instagram connection expired), `instagram_facebook_login_required` (the Instagram account is connected with Instagram Login; Meta creates the dataset only from a Facebook Login for Business connection linked to a Page — the read-back already carries it as the step's `reason_code`, with no press offered); nothing is created on any refusal. 502 when Meta failed (nothing was created). The answer carries the engine’s read-back. Requires `ads:write`.
142437
+ * Start the Meta Ads reconnect that turns on Instagram events
142438
+ * @description The Meta destinations of the workspace’s outcomes, each set up by its own explicit press, never as a side effect. Step 1 — the dataset linked to the WhatsApp Business Account — receives the outcomes carrying the click-to-WhatsApp ad click (`ctwa_clid`), as `business_messaging`; a click-to-WhatsApp ad set optimised on Purchase needs it. Step 2 — the website pixel — receives every other outcome, matched by the hashed phone and e-mail; without it those outcomes (most payments) are not sent at all. Step 3 — the dataset linked to the Instagram account — receives the outcomes of conversations an Instagram ad opened, as `business_messaging` with the customer’s Instagram-scoped id (measurement only: Meta offers no Purchase optimisation on Instagram); until it exists they reach the website pixel as before. Each sends from its press on (no history), and nothing flows until the stages are switched on in «Enviar a Meta». Meta cannot delete a dataset. The Instagram dataset, and every event sent to it, uses the workspace's Meta Ads connection, which needs Meta's `instagram_manage_events` permission first: Step 3 reads `reason_code: instagram_events_permission_required` until it has it. This returns the URL of ONE Meta Ads reconnect that asks for it; open it in a browser, accept, and come back to `return_to` (with `instagram_events=return`), then read the status again. The Meta Ads card and the Instagram connection do not change. Meta reports these events but does not optimize Instagram ads on them yet. 502 when the measurement engine could not mint the link. Requires `ads:write`.
141672
142439
  */
141673
142440
  post: {
141674
142441
  parameters: {
@@ -141684,20 +142451,20 @@ interface paths {
141684
142451
  content: {
141685
142452
  /**
141686
142453
  * @example {
141687
- * "notice_version": "meta-instagram-dataset-2026-10-07",
141688
- * "notice_hash": "0000000000000000000000000000000000000000000000000000000000000000"
142454
+ * "return_to": "https://app.vitrinadev.com/anuncios/salud/envio"
141689
142455
  * }
141690
142456
  */
141691
142457
  "application/json": {
141692
- /** @description `notice.version` from the read. */
141693
- notice_version: string;
141694
- /** @description `notice.hash` from the read: proof the notice was read. */
141695
- notice_hash: string;
142458
+ /**
142459
+ * Format: uri
142460
+ * @description Where the owner comes back to after Meta’s consent: an absolute URL on the app’s own origin. `instagram_events=return` is appended.
142461
+ */
142462
+ return_to: string;
141696
142463
  };
141697
142464
  };
141698
142465
  };
141699
142466
  responses: {
141700
- /** @description Created (or already present), with the read-back. */
142467
+ /** @description The reconnect URL. */
141701
142468
  200: {
141702
142469
  headers: {
141703
142470
  [name: string]: unknown;
@@ -141706,112 +142473,20 @@ interface paths {
141706
142473
  /**
141707
142474
  * @example {
141708
142475
  * "data": {
141709
- * "outcome": "created",
141710
- * "status": {
141711
- * "prerequisites": {
141712
- * "meta_ads_connected": true,
141713
- * "whatsapp_connected": true,
141714
- * "instagram_connected": true
141715
- * },
141716
- * "whatsapp": {
141717
- * "kind": "whatsapp",
141718
- * "state": "ready",
141719
- * "reason_code": null,
141720
- * "message": null,
141721
- * "dataset": null,
141722
- * "can_create": true,
141723
- * "can_turn_off": false,
141724
- * "notice": {
141725
- * "version": "meta-whatsapp-dataset-2026-10-02",
141726
- * "points": [
141727
- * "Meta crea un conjunto de datos conectado a tu WhatsApp Business…"
141728
- * ],
141729
- * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
141730
- * }
141731
- * },
141732
- * "website": {
141733
- * "kind": "website",
141734
- * "state": "ready",
141735
- * "reason_code": null,
141736
- * "message": null,
141737
- * "dataset": null,
141738
- * "can_create": true,
141739
- * "can_turn_off": false,
141740
- * "notice": {
141741
- * "version": "meta-website-pixel-2026-10-02",
141742
- * "points": [
141743
- * "Tu píxel del sitio recibe los resultados que no traen el clic…"
141744
- * ],
141745
- * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
141746
- * },
141747
- * "candidates": [
141748
- * {
141749
- * "external_id": "<pixel_id>",
141750
- * "id_tail": "9748",
141751
- * "name": "Píxel del sitio",
141752
- * "last_fired_at": "2026-10-01T22:10:00.000Z",
141753
- * "recommended": true
141754
- * }
141755
- * ],
141756
- * "can_create_pixel": false
141757
- * },
141758
- * "instagram": {
141759
- * "kind": "instagram",
141760
- * "state": "created",
141761
- * "reason_code": null,
141762
- * "message": null,
141763
- * "dataset": {
141764
- * "external_id": "<dataset_id>",
141765
- * "id_tail": "3307",
141766
- * "export_from": "2026-10-07T15:00:00.000Z",
141767
- * "destination_enabled": true,
141768
- * "access_granted": true,
141769
- * "shared": false,
141770
- * "shared_count": null
141771
- * },
141772
- * "can_create": false,
141773
- * "can_turn_off": true,
141774
- * "notice": {
141775
- * "version": "meta-instagram-dataset-2026-10-07",
141776
- * "points": [
141777
- * "Meta crea un conjunto de datos conectado a tu cuenta de Instagram…"
141778
- * ],
141779
- * "hash": "0000000000000000000000000000000000000000000000000000000000000000"
141780
- * }
141781
- * },
141782
- * "click_less_not_sent": false,
141783
- * "preview": {
141784
- * "window_days": 30,
141785
- * "total": 120,
141786
- * "with_ad_click": 14,
141787
- * "without_ad_click": 106,
141788
- * "click_less_to": "not_sent",
141789
- * "enabled_meta_rules": 0,
141790
- * "source": "engine",
141791
- * "truncated": false,
141792
- * "stages": [
141793
- * {
141794
- * "stage": "lead_created",
141795
- * "label": "Contacto nuevo",
141796
- * "on": true,
141797
- * "total": 60,
141798
- * "with_ad_click": 9,
141799
- * "weekly": 14,
141800
- * "weekly_with_ad_click": 2.1,
141801
- * "measured_weeks": 4,
141802
- * "measured_days": 30
141803
- * }
141804
- * ]
141805
- * }
141806
- * }
142476
+ * "url": "https://connect.example.com/h/abc123",
142477
+ * "expires_at": "2026-11-03T19:45:00.000Z"
141807
142478
  * }
141808
142479
  * }
141809
142480
  */
141810
142481
  "application/json": {
141811
142482
  data: {
141812
- /** @enum {string} */
141813
- outcome: "created" | "already_present";
141814
- status: components["schemas"]["AdsMetaDatasetStatus"];
142483
+ /**
142484
+ * Format: uri
142485
+ * @description Open it in the browser: the Meta Ads consent that asks for Instagram events.
142486
+ */
142487
+ url: string;
142488
+ /** @description When the link stops working (about 45 minutes). */
142489
+ expires_at: string | null;
141815
142490
  };
141816
142491
  };
141817
142492
  };
@@ -288979,7 +289654,7 @@ interface components {
288979
289654
  /** @enum {string} */
288980
289655
  stage: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received" | "seller_qualified" | "seller_visit_booked" | "seller_deal_closed";
288981
289656
  label: string;
288982
- /** @description The website pixel lane’s name (not configurable here). */
289657
+ /** @description The website pixel lane’s name in force (configured with `website-event-names`, not here). */
288983
289658
  website_event: string;
288984
289659
  /** @description The matrix’s own WhatsApp-lane name; `null` = not sent there. */
288985
289660
  messaging_default: string | null;
@@ -289033,6 +289708,73 @@ interface components {
289033
289708
  /** @description Stages whose choice is dropped: they go back to the matrix's name (`messaging_default`). Applied before `overrides`. */
289034
289709
  reset?: ("lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received" | "seller_qualified" | "seller_visit_booked" | "seller_deal_closed")[];
289035
289710
  };
289711
+ AdsWebsiteEventNames: {
289712
+ /** @description The stored choices, `{ stage: name }`. */
289713
+ overrides: {
289714
+ [key: string]: string;
289715
+ };
289716
+ /** @description Meta’s standard pixel events: the names a stage may take. */
289717
+ accepted_events: string[];
289718
+ /** @description The subset Meta accepts as the optimisation event of a click-to-WhatsApp (messaging) ad set that optimises on website conversions. */
289719
+ messaging_optimizable_events: string[];
289720
+ stages: {
289721
+ /** @enum {string} */
289722
+ stage: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received" | "seller_qualified" | "seller_visit_booked" | "seller_deal_closed";
289723
+ label: string;
289724
+ /** @description The matrix’s own website-lane name. */
289725
+ website_default: string;
289726
+ /** @description The website-lane name in force: the workspace’s choice, else the default. */
289727
+ website_event: string;
289728
+ overridden: boolean;
289729
+ /** @description Whether a click-to-WhatsApp ad set can optimise on `website_event`. */
289730
+ messaging_optimizable: boolean;
289731
+ }[];
289732
+ };
289733
+ AdsWebsiteEventNamesPatchResult: components["schemas"]["AdsWebsiteEventNames"] & {
289734
+ sync: {
289735
+ /**
289736
+ * @description `converged`: the engine’s live rules now hold the names in force. `pending`: stored, the engine write failed and the daily sweep retries it.
289737
+ * @enum {string}
289738
+ */
289739
+ state: "converged" | "pending";
289740
+ updated: ("lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received" | "seller_qualified" | "seller_visit_booked" | "seller_deal_closed")[];
289741
+ };
289742
+ };
289743
+ AdsWebsiteEventNamesPatch: {
289744
+ /** @description Per stage, the name the website (pixel) dataset receives: one of `accepted_events`, or `null` = drop the choice (back to the matrix's name, `website_default`). Stages left out keep what they have. */
289745
+ overrides?: {
289746
+ /** @enum {string|null} */
289747
+ lead_created?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289748
+ /** @enum {string|null} */
289749
+ lead_qualified?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289750
+ /** @enum {string|null} */
289751
+ appointment_booked?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289752
+ /** @enum {string|null} */
289753
+ checkout_started?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289754
+ /** @enum {string|null} */
289755
+ deposit_paid?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289756
+ /** @enum {string|null} */
289757
+ appointment_attended?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289758
+ /** @enum {string|null} */
289759
+ quote_presented?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289760
+ /** @enum {string|null} */
289761
+ closed_won?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289762
+ /** @enum {string|null} */
289763
+ first_payment?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289764
+ /** @enum {string|null} */
289765
+ returning_first_payment?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289766
+ /** @enum {string|null} */
289767
+ payment_received?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289768
+ /** @enum {string|null} */
289769
+ seller_qualified?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289770
+ /** @enum {string|null} */
289771
+ seller_visit_booked?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289772
+ /** @enum {string|null} */
289773
+ seller_deal_closed?: "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | null;
289774
+ };
289775
+ /** @description Stages whose choice is dropped: they go back to the matrix's name (`website_default`). Applied before `overrides`. */
289776
+ reset?: ("lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received" | "seller_qualified" | "seller_visit_booked" | "seller_deal_closed")[];
289777
+ };
289036
289778
  AdsMetaDatasetStatus: {
289037
289779
  prerequisites: {
289038
289780
  meta_ads_connected: boolean | null;
@@ -289050,7 +289792,7 @@ interface components {
289050
289792
  */
289051
289793
  state: "coming_soon" | "unknown" | "prerequisites_missing" | "ready" | "created" | "sending" | "off" | "error";
289052
289794
  /** @enum {string|null} */
289053
- reason_code: "entitlement_required" | "duplicate_kind" | "access_missing" | "dataset_unreadable" | "already_exists" | "no_pixel" | "pixels_unavailable" | "pixel_already_attached" | "instagram_facebook_login_required" | "meta_refused" | "meta_unavailable" | "engine_error" | null;
289795
+ reason_code: "entitlement_required" | "duplicate_kind" | "access_missing" | "dataset_unreadable" | "already_exists" | "no_pixel" | "pixels_unavailable" | "pixel_already_attached" | "instagram_facebook_login_required" | "instagram_events_permission_required" | "meta_refused" | "meta_unavailable" | "engine_error" | null;
289054
289796
  /** @description What to do, in Spanish, when `reason_code` is set. */
289055
289797
  message: string | null;
289056
289798
  dataset: {
@@ -289084,7 +289826,7 @@ interface components {
289084
289826
  */
289085
289827
  state: "coming_soon" | "unknown" | "prerequisites_missing" | "ready" | "created" | "sending" | "off" | "error";
289086
289828
  /** @enum {string|null} */
289087
- reason_code: "entitlement_required" | "duplicate_kind" | "access_missing" | "dataset_unreadable" | "already_exists" | "no_pixel" | "pixels_unavailable" | "pixel_already_attached" | "instagram_facebook_login_required" | "meta_refused" | "meta_unavailable" | "engine_error" | null;
289829
+ reason_code: "entitlement_required" | "duplicate_kind" | "access_missing" | "dataset_unreadable" | "already_exists" | "no_pixel" | "pixels_unavailable" | "pixel_already_attached" | "instagram_facebook_login_required" | "instagram_events_permission_required" | "meta_refused" | "meta_unavailable" | "engine_error" | null;
289088
289830
  /** @description What to do, in Spanish, when `reason_code` is set. */
289089
289831
  message: string | null;
289090
289832
  dataset: {
@@ -289129,7 +289871,7 @@ interface components {
289129
289871
  */
289130
289872
  state: "coming_soon" | "unknown" | "prerequisites_missing" | "ready" | "created" | "sending" | "off" | "error";
289131
289873
  /** @enum {string|null} */
289132
- reason_code: "entitlement_required" | "duplicate_kind" | "access_missing" | "dataset_unreadable" | "already_exists" | "no_pixel" | "pixels_unavailable" | "pixel_already_attached" | "instagram_facebook_login_required" | "meta_refused" | "meta_unavailable" | "engine_error" | null;
289874
+ reason_code: "entitlement_required" | "duplicate_kind" | "access_missing" | "dataset_unreadable" | "already_exists" | "no_pixel" | "pixels_unavailable" | "pixel_already_attached" | "instagram_facebook_login_required" | "instagram_events_permission_required" | "meta_refused" | "meta_unavailable" | "engine_error" | null;
289133
289875
  /** @description What to do, in Spanish, when `reason_code` is set. */
289134
289876
  message: string | null;
289135
289877
  dataset: {