@vitrina/api 11.19.0 → 11.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -91698,9 +91698,9 @@ interface paths {
91698
91698
  };
91699
91699
  /**
91700
91700
  * The suggested actions for one Ads screen
91701
- * @description Up to 6 suggested actions for a screen, primary first, derived from the screen’s figures and the open recommendations of the measurement engine: pause an ad that «se desgasta» (the observed `fatigue_state: degraded` — on 3 days in a row its trailing 7-day CTR at or under 70 % of its own previous 28 days, or its trailing 7-day cost per result at or over 1/0.7× (+42.86 %); never a learned tier or a probability) AND no longer pays for itself (no attributed value, or a return under 1× — a worn ad still returning 1× or more gets «Prepara una variante» instead, never the pause), pause the delivering ads of a campaign that spent with no results in the period (one card per ad), raise a winning ad set’s budget, re-check the conversion wiring, re-scan the ad links — or, when Meta is not connected, only a `nav` card to reconnect it. Nothing here runs by itself: preview → confirm → execute.
91701
+ * @description Up to 6 suggested actions for a screen, primary first, derived from the screen’s figures and the open recommendations of the measurement engine: pause an ad that «se desgasta» (the observed `fatigue_state: degraded` — on 3 days in a row its trailing 7-day CTR at or under 70 % of its own previous 28 days, or its trailing 7-day cost per result at or over 1/0.7× (+42.86 %); never a learned tier or a probability) AND no longer pays for itself (no attributed value, or a return under 1× — a worn ad still returning 1× or more gets «Prepara una variante» instead, never the pause), pause the delivering ads of a campaign that spent with no results in the period (one card per ad), raise a winning ad set’s budget, re-check the conversion wiring, re-scan the ad links, correct the links of the ads whose «Parámetros de URL» do not carry the ad id (`url_tags_fix`, Salud: one fix over at most 25 ads, busiest first, each ad listed in `target.ads` and its exact change in `params.ads` — the six standard `utm_` parameters take the standard values, replacing the ad’s own; it replaces each ad’s creative, so Meta may restart the learning phase — consent required, undoable per ad) — or, when Meta is not connected, only a `nav` card to reconnect it. Nothing here runs by itself: preview → confirm → execute.
91702
91702
  *
91703
- * `nav` cards only open a page and never execute (dismissable like any card): Campañas — «Mira quién llegó por …», the lowest cost per result among campaigns with 3 or more results, into the attributed list filtered by that campaign; Creativos — «Prepara una variante de …» for an ad that se desgasta and «Usa … como base» for the best-scored ad that does not, both opening the ad in Meta Ads Manager; Salud — «Instalar el tag en …» (never seen) or «El tag dejó de reportar en …» (installed, silent) when the tag sent nothing in the last 24 hours while Meta is connected, into the set-up’s tag step.
91703
+ * `nav` cards only open a page and never execute (dismissable like any card): Campañas — «Mira quién llegó por …», the lowest cost per result among campaigns with 3 or more results, into the attributed list filtered by that campaign; Creativos — «Prepara una variante de …» for an ad that se desgasta and «Usa … como base» for the best-scored ad that does not, both opening the ad in Meta Ads Manager; Salud — «Instalar el tag en …» (never seen) or «El tag dejó de reportar en …» (installed, silent) when the tag sent nothing in the last 24 hours while Meta is connected, into the set-up’s tag step; «Corregir los enlaces de tus anuncios en Meta» instead of `url_tags_fix` when the change cannot be made from Vitrina (a read-only Meta connection, or a Vitrina connection that needs renewing): it opens those ads in Meta Ads Manager; `params` carries the parameters to paste in place of the current ones.
91704
91704
  *
91705
91705
  * Every figure a `why` prints names its window: an ad’s spend is the creatives read’s rolling window («en los últimos 28 días» — what the gallery shows), a campaign’s spend is the requested period.
91706
91706
  *
@@ -91837,6 +91837,57 @@ interface paths {
91837
91837
  * "cta": "Ver tratamientos",
91838
91838
  * "facts": [],
91839
91839
  * "dismissed_until": null
91840
+ * },
91841
+ * {
91842
+ * "key": "url_tags_fix:profile:2026-09-23",
91843
+ * "kind": "url_tags_fix",
91844
+ * "screen": [
91845
+ * "salud"
91846
+ * ],
91847
+ * "primary": false,
91848
+ * "title": "Corregir los enlaces de tus anuncios",
91849
+ * "why": "Los parámetros de URL de **2** anuncios pasan a los estándar para que cada clic diga qué anuncio lo trajo («utm_content={{ad.id}}»); hoy sus resultados no se le pueden atribuir a ningún anuncio. Cambian «utm_source», «utm_medium», «utm_campaign», «utm_term», «utm_content» y «utm_id»: la vista previa muestra, anuncio por anuncio, lo que tiene hoy y lo que queda.",
91850
+ * "effect": "Meta puede reiniciar el aprendizaje de los conjuntos afectados; los anuncios siguen activos. Puedes deshacerlo.",
91851
+ * "target": {
91852
+ * "level": "profile",
91853
+ * "external_id": null,
91854
+ * "name": null,
91855
+ * "ads": [
91856
+ * {
91857
+ * "external_id": "120212000000000011",
91858
+ * "name": "Carrusel · Antes y después",
91859
+ * "ad_set_name": "Implantes · Las Condes",
91860
+ * "campaign_name": "Implantes · Septiembre"
91861
+ * },
91862
+ * {
91863
+ * "external_id": "120212000000000012",
91864
+ * "name": "Historia · Evaluación gratis",
91865
+ * "ad_set_name": "Implantes · Providencia",
91866
+ * "campaign_name": "Implantes · Septiembre"
91867
+ * }
91868
+ * ]
91869
+ * },
91870
+ * "params": {
91871
+ * "ads": [
91872
+ * {
91873
+ * "external_id": "120212000000000011",
91874
+ * "expected_url_tags": "utm_source=facebook&utm_campaign={{campaign.name}}&utm_content={{ad.name}}",
91875
+ * "url_tags": "utm_source={{site_source_name}}&utm_medium=paid_social&utm_campaign={{campaign.id}}&utm_term={{adset.id}}&utm_content={{ad.id}}&utm_id={{campaign.id}}"
91876
+ * },
91877
+ * {
91878
+ * "external_id": "120212000000000012",
91879
+ * "expected_url_tags": null,
91880
+ * "url_tags": "utm_source={{site_source_name}}&utm_medium=paid_social&utm_campaign={{campaign.id}}&utm_term={{adset.id}}&utm_content={{ad.id}}&utm_id={{campaign.id}}"
91881
+ * }
91882
+ * ]
91883
+ * },
91884
+ * "reversible": true,
91885
+ * "risk": "learning_reset",
91886
+ * "engine_ref": {
91887
+ * "op": "quality.url_tags_apply"
91888
+ * },
91889
+ * "facts": [],
91890
+ * "dismissed_until": null
91840
91891
  * }
91841
91892
  * ]
91842
91893
  * }
@@ -91957,7 +92008,7 @@ interface paths {
91957
92008
  put?: never;
91958
92009
  /**
91959
92010
  * Preview an action before confirming it
91960
- * @description Reads the target’s live state and returns what will change (`rows`: before → after), the warnings, and — for a duplicate-and-swap — the consent lines the owner must accept. It also records ONE single-use approval bound to the caller, the action and its exact parameters, valid for 10 minutes (`expires_at`): `preview_id` is what `execute` spends. No engine write happens here.
92011
+ * @description Reads the target’s live state and returns what will change (`rows`: before → after), the warnings, and — for a duplicate-and-swap or a URL-parameter fix — the consent lines the owner must accept. A `url_tags_fix` preview lists `untagged_ads` («{n} → 0») first, then one row per ad (`ad:<id>`): its current parameters → exactly what it gets; an ad changed in Meta after the preview is skipped at execute, never rewritten blind. It also records ONE single-use approval bound to the caller, the action and its exact parameters, valid for 10 minutes (`expires_at`): `preview_id` is what `execute` spends. No engine write happens here.
91961
92012
  *
91962
92013
  * 409 `ADS_ACTION_NOT_AVAILABLE` when the action is no longer on today’s list (or is a `nav` card, which has nothing to execute).
91963
92014
  */
@@ -92143,9 +92194,11 @@ interface paths {
92143
92194
  *
92144
92195
  * 409 `ADS_ACTION_REPLAY_BLOCKED` when the approval cannot be spent — `details.reason` is `expired` (preview older than 10 minutes), `consumed` (already confirmed, e.g. from another tab), `not_found` or `binding_mismatch` (another person’s preview, or another action — incl. a real preview sent with `sample: true`). In sample mode nothing reaches the engine: the execution is born `succeeded` with `simulated: true`, and only a sample preview can be spent.
92145
92196
  *
92146
- * **Duplicate-and-swap** needs the owner’s acceptance of the preview’s `consent_terms` (the verbatim consent text): send `consent: { version, text_hash, accepted_at? }`. Missing, different or older than 24 h → 409 `ADS_ACTION_CONSENT_REQUIRED` (`details.reason` missing|mismatch|stale, `details.consent` = the current version and hash) — nothing is spent and nothing reaches the engine.
92197
+ * **Duplicate-and-swap** and **`url_tags_fix`** need the owner’s acceptance of the preview’s `consent_terms` (the verbatim consent text): send `consent: { version, text_hash, accepted_at? }`. Missing, different or older than 24 h → 409 `ADS_ACTION_CONSENT_REQUIRED` (`details.reason` missing|mismatch|stale, `details.consent` = the current version and hash) — nothing is spent and nothing reaches the engine.
92147
92198
  *
92148
92199
  * If the job cannot be queued the answer is still 202, with `status: failed`: the execution exists and says why (`error.code: queue_unavailable`).
92200
+ *
92201
+ * A `url_tags_fix` corrects each ad on its own: `outcome.summary` reads «{k} de {n} anuncios corregidos», `outcome.partial` is true when k < n, and `outcome.ads[]` says what happened to each ad. None corrected → `failed`/`refused` with the first ad’s reason, still with `outcome.ads[]`.
92149
92202
  */
92150
92203
  post: {
92151
92204
  parameters: {
@@ -92174,7 +92227,7 @@ interface paths {
92174
92227
  */
92175
92228
  preview_id: string;
92176
92229
  sample?: boolean;
92177
- /** @description Duplicate-and-swap ONLY, and required there: the owner's acceptance of `consent_terms` from the preview — echo its `version` and `text_hash`. The accepting person is always the caller. */
92230
+ /** @description Required for a duplicate-and-swap and a URL-parameter fix (`url_tags_fix`), ignored otherwise: the owner's acceptance of `consent_terms` from the preview — echo its `version` and `text_hash`. The accepting person is always the caller. */
92178
92231
  consent?: {
92179
92232
  version: string;
92180
92233
  text_hash: string;
@@ -92375,6 +92428,65 @@ interface paths {
92375
92428
  * "created_by": "Dueña Ejemplo"
92376
92429
  * },
92377
92430
  * {
92431
+ * "id": "e5e5e5e5-0000-4000-8000-000000000004",
92432
+ * "action_key": "url_tags_fix:profile:2026-09-23",
92433
+ * "kind": "url_tags_fix",
92434
+ * "status": "succeeded",
92435
+ * "outcome": {
92436
+ * "summary": "1 de 2 anuncios corregidos.",
92437
+ * "engine_action_id": "f7f7f7f7-0000-4000-8000-000000000003",
92438
+ * "applied_at": "2026-09-23T15:40:09.000Z",
92439
+ * "partial": true,
92440
+ * "corrected_count": 1,
92441
+ * "requested_count": 2,
92442
+ * "ads": [
92443
+ * {
92444
+ * "external_id": "120212000000000011",
92445
+ * "name": "Carrusel · Antes y después",
92446
+ * "result": "corrected",
92447
+ * "code": null,
92448
+ * "message": null,
92449
+ * "url_tags_after": "utm_source={{site_source_name}}&utm_medium=paid_social&utm_campaign={{campaign.id}}&utm_term={{adset.id}}&utm_content={{ad.id}}&utm_id={{campaign.id}}",
92450
+ * "engine_action_id": "f7f7f7f7-0000-4000-8000-000000000003",
92451
+ * "undo_available": true
92452
+ * },
92453
+ * {
92454
+ * "external_id": "120212000000000012",
92455
+ * "name": "Historia · Evaluación gratis",
92456
+ * "result": "skipped",
92457
+ * "code": "url_tags_changed_since_preview",
92458
+ * "message": "Los parámetros de URL del anuncio cambiaron en Meta después de la vista previa, así que no lo tocamos. Revisa la propuesta de nuevo.",
92459
+ * "url_tags_after": null,
92460
+ * "engine_action_id": null,
92461
+ * "undo_available": false
92462
+ * }
92463
+ * ]
92464
+ * },
92465
+ * "error": null,
92466
+ * "rollback_available": true,
92467
+ * "rollback_of": null,
92468
+ * "simulated": false,
92469
+ * "created_at": "2026-09-23T15:40:01.000Z",
92470
+ * "finished_at": "2026-09-23T15:40:09.000Z",
92471
+ * "target": {
92472
+ * "level": "profile",
92473
+ * "external_id": null,
92474
+ * "name": null,
92475
+ * "campaign_name": null,
92476
+ * "ads": [
92477
+ * {
92478
+ * "external_id": "120212000000000011",
92479
+ * "name": "Carrusel · Antes y después"
92480
+ * },
92481
+ * {
92482
+ * "external_id": "120212000000000012",
92483
+ * "name": "Historia · Evaluación gratis"
92484
+ * }
92485
+ * ]
92486
+ * },
92487
+ * "created_by": "Dueña Ejemplo"
92488
+ * },
92489
+ * {
92378
92490
  * "id": "e5e5e5e5-0000-4000-8000-000000000001",
92379
92491
  * "action_key": "budget_change:120211000000000077:2026-09-23",
92380
92492
  * "kind": "budget_change",
@@ -92688,7 +92800,7 @@ interface paths {
92688
92800
  put?: never;
92689
92801
  /**
92690
92802
  * Undo an executed action
92691
- * @description Queues the engine’s rollback of a `succeeded` execution with `rollback_available: true` and answers the NEW execution (`rollback_of` = the original). The engine restores the pre-change state only while the object still carries what the action wrote; otherwise the rollback is `refused` with `reason: not_reversible` (`code: state_drifted`). **`Idempotency-Key` is required.** 409 `ADS_ACTION_NOT_REVERSIBLE` when the execution has nothing to undo.
92803
+ * @description Queues the engine’s rollback of a `succeeded` execution with `rollback_available: true` and answers the NEW execution (`rollback_of` = the original). The engine restores the pre-change state only while the object still carries what the action wrote; otherwise the rollback is `refused` with `reason: not_reversible` (`code: state_drifted`). A `url_tags_fix` is undone ad by ad (each ad back on its previous parameters): an ad changed in Meta since is left alone (final), an ad whose undo got no answer stays pending — the original keeps `rollback_available: true` and the next rollback sends only those ads; the original reads `rolled_back` once nothing is pending. **`Idempotency-Key` is required.** 409 `ADS_ACTION_NOT_REVERSIBLE` when the execution has nothing to undo.
92692
92804
  */
92693
92805
  post: {
92694
92806
  parameters: {
@@ -113964,7 +114076,7 @@ interface components {
113964
114076
  /** @description `<kind>:<target external id>:<YYYY-MM-DD>` — a composite key, stable for a day. */
113965
114077
  key: string;
113966
114078
  /** @enum {string} */
113967
- kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "nav";
114079
+ kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "url_tags_fix" | "nav";
113968
114080
  screen: ("resumen" | "campanas" | "creativos" | "salud")[];
113969
114081
  /** @description The one card the rail leads with. */
113970
114082
  primary: boolean;
@@ -113986,8 +114098,16 @@ interface components {
113986
114098
  external_id: string;
113987
114099
  name: string | null;
113988
114100
  } | null;
114101
+ /** @description `url_tags_fix` (and its read-only `nav` fallback) only: the ads whose «Parámetros de URL» do not carry the ad id where attribution reads it, busiest first, at most what one fix accepts (25). Ad set and campaign are named, not identified (the audit carries names only). */
114102
+ ads?: {
114103
+ /** @description The ad’s Meta id. */
114104
+ external_id: string;
114105
+ name: string | null;
114106
+ ad_set_name: string | null;
114107
+ campaign_name: string | null;
114108
+ }[];
113989
114109
  };
113990
- /** @description The engine’s own vocabulary, e.g. `{ budget_change_pct: 20 }`. */
114110
+ /** @description The engine’s own vocabulary, e.g. `{ budget_change_pct: 20 }`. `url_tags_fix`: `{ ads: [{ external_id, expected_url_tags, url_tags }] }` — each ad’s current parameters (null = none) and exactly what it gets. */
113991
114111
  params: {
113992
114112
  [key: string]: unknown;
113993
114113
  };
@@ -113997,7 +114117,7 @@ interface components {
113997
114117
  /** @description Which operation executes it; `null` for `nav`. */
113998
114118
  engine_ref: {
113999
114119
  /** @enum {string} */
114000
- op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback";
114120
+ op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | "quality.url_tags_apply" | "quality.url_tags_undo";
114001
114121
  recommendation_id?: string;
114002
114122
  } | null;
114003
114123
  /** @description `nav` only: a workspace-relative path (`/anuncios/atribuidos?c=…`, `/anuncios/activar?paso=tag`), or an absolute Meta Ads Manager URL built from Meta ids (`https://www.facebook.com/adsmanager/…`) — open it in a new tab; it changes nothing by itself. */
@@ -114019,9 +114139,9 @@ interface components {
114019
114139
  after: string;
114020
114140
  }[];
114021
114141
  warnings: string[];
114022
- /** @description Duplicate-and-swap only: `consent_terms.text` split into lines, for display (verbatim). */
114142
+ /** @description Duplicate-and-swap and `url_tags_fix` only: `consent_terms.text` split into lines, for display (verbatim). */
114023
114143
  consent: string[];
114024
- /** @description Duplicate-and-swap only: what the owner accepts before confirming. Execute must send `consent: { version, text_hash }`. */
114144
+ /** @description Duplicate-and-swap and `url_tags_fix` only: what the owner accepts before confirming. Execute must send `consent: { version, text_hash }`. For `url_tags_fix` the text is one sentence: rewriting an ad’s parameters replaces its creative, which can restart the learning phase of the affected ad sets. */
114025
114145
  consent_terms: {
114026
114146
  version: string;
114027
114147
  /** @enum {string} */
@@ -114033,14 +114153,14 @@ interface components {
114033
114153
  } | null;
114034
114154
  reversible: boolean;
114035
114155
  /** @enum {string|null} */
114036
- engine_op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | null;
114156
+ engine_op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | "quality.url_tags_apply" | "quality.url_tags_undo" | null;
114037
114157
  };
114038
114158
  AdsActionExecution: {
114039
114159
  /** Format: uuid */
114040
114160
  id: string;
114041
114161
  action_key: string;
114042
114162
  /** @enum {string} */
114043
- kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck";
114163
+ kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "url_tags_fix";
114044
114164
  /** @enum {string} */
114045
114165
  status: "queued" | "running" | "succeeded" | "failed" | "refused" | "rolled_back";
114046
114166
  target: {
@@ -114051,7 +114171,14 @@ interface components {
114051
114171
  name: string | null;
114052
114172
  /** @description The campaign the card named: set on an ad-set budget change (the card is titled with the campaign, the ad set is `name`) and on an ad pause whose campaign was known; `null` otherwise and on rows recorded before this field existed. */
114053
114173
  campaign_name: string | null;
114174
+ /** @description `url_tags_fix` only: the ads the fix was asked to correct (the journal writes «corregiste los enlaces de {n} anuncios»). Each ad’s result is on `outcome.ads[]`. */
114175
+ ads?: {
114176
+ /** @description The ad’s Meta id. */
114177
+ external_id: string;
114178
+ name: string | null;
114179
+ }[];
114054
114180
  };
114181
+ /** @description What happened. `url_tags_fix` adds `partial` (true when fewer ads were corrected than asked — never show «Hecho» then), `corrected_count`, `requested_count` and `ads[]`: per ad `{external_id, name, result: corrected|skipped|failed, code, message, url_tags_after, engine_action_id, undo_available}` (an ad that already carried the parameters counts as corrected; it is undoable when this fix wrote it). Its undo (a rollback row) reports `undone_count`, `drifted_count` (changed in Meta since — never touched), `gone_count` (already undone elsewhere — no longer undoable from here), `reconnect_count` (Meta asks to reconnect), `retryable_count` (no answer or reconnect — the original stays undoable and the next rollback sends only those ads), `requested_count`, `partial` and `ads[]` `{external_id, name, result: undone|drifted|gone|retryable|reconnect, code, message}`; a failed or refused fix still carries `ads[]`. */
114055
114182
  outcome: {
114056
114183
  summary: string;
114057
114184
  engine_action_id: string | null;
package/dist/index.d.ts CHANGED
@@ -91698,9 +91698,9 @@ interface paths {
91698
91698
  };
91699
91699
  /**
91700
91700
  * The suggested actions for one Ads screen
91701
- * @description Up to 6 suggested actions for a screen, primary first, derived from the screen’s figures and the open recommendations of the measurement engine: pause an ad that «se desgasta» (the observed `fatigue_state: degraded` — on 3 days in a row its trailing 7-day CTR at or under 70 % of its own previous 28 days, or its trailing 7-day cost per result at or over 1/0.7× (+42.86 %); never a learned tier or a probability) AND no longer pays for itself (no attributed value, or a return under 1× — a worn ad still returning 1× or more gets «Prepara una variante» instead, never the pause), pause the delivering ads of a campaign that spent with no results in the period (one card per ad), raise a winning ad set’s budget, re-check the conversion wiring, re-scan the ad links — or, when Meta is not connected, only a `nav` card to reconnect it. Nothing here runs by itself: preview → confirm → execute.
91701
+ * @description Up to 6 suggested actions for a screen, primary first, derived from the screen’s figures and the open recommendations of the measurement engine: pause an ad that «se desgasta» (the observed `fatigue_state: degraded` — on 3 days in a row its trailing 7-day CTR at or under 70 % of its own previous 28 days, or its trailing 7-day cost per result at or over 1/0.7× (+42.86 %); never a learned tier or a probability) AND no longer pays for itself (no attributed value, or a return under 1× — a worn ad still returning 1× or more gets «Prepara una variante» instead, never the pause), pause the delivering ads of a campaign that spent with no results in the period (one card per ad), raise a winning ad set’s budget, re-check the conversion wiring, re-scan the ad links, correct the links of the ads whose «Parámetros de URL» do not carry the ad id (`url_tags_fix`, Salud: one fix over at most 25 ads, busiest first, each ad listed in `target.ads` and its exact change in `params.ads` — the six standard `utm_` parameters take the standard values, replacing the ad’s own; it replaces each ad’s creative, so Meta may restart the learning phase — consent required, undoable per ad) — or, when Meta is not connected, only a `nav` card to reconnect it. Nothing here runs by itself: preview → confirm → execute.
91702
91702
  *
91703
- * `nav` cards only open a page and never execute (dismissable like any card): Campañas — «Mira quién llegó por …», the lowest cost per result among campaigns with 3 or more results, into the attributed list filtered by that campaign; Creativos — «Prepara una variante de …» for an ad that se desgasta and «Usa … como base» for the best-scored ad that does not, both opening the ad in Meta Ads Manager; Salud — «Instalar el tag en …» (never seen) or «El tag dejó de reportar en …» (installed, silent) when the tag sent nothing in the last 24 hours while Meta is connected, into the set-up’s tag step.
91703
+ * `nav` cards only open a page and never execute (dismissable like any card): Campañas — «Mira quién llegó por …», the lowest cost per result among campaigns with 3 or more results, into the attributed list filtered by that campaign; Creativos — «Prepara una variante de …» for an ad that se desgasta and «Usa … como base» for the best-scored ad that does not, both opening the ad in Meta Ads Manager; Salud — «Instalar el tag en …» (never seen) or «El tag dejó de reportar en …» (installed, silent) when the tag sent nothing in the last 24 hours while Meta is connected, into the set-up’s tag step; «Corregir los enlaces de tus anuncios en Meta» instead of `url_tags_fix` when the change cannot be made from Vitrina (a read-only Meta connection, or a Vitrina connection that needs renewing): it opens those ads in Meta Ads Manager; `params` carries the parameters to paste in place of the current ones.
91704
91704
  *
91705
91705
  * Every figure a `why` prints names its window: an ad’s spend is the creatives read’s rolling window («en los últimos 28 días» — what the gallery shows), a campaign’s spend is the requested period.
91706
91706
  *
@@ -91837,6 +91837,57 @@ interface paths {
91837
91837
  * "cta": "Ver tratamientos",
91838
91838
  * "facts": [],
91839
91839
  * "dismissed_until": null
91840
+ * },
91841
+ * {
91842
+ * "key": "url_tags_fix:profile:2026-09-23",
91843
+ * "kind": "url_tags_fix",
91844
+ * "screen": [
91845
+ * "salud"
91846
+ * ],
91847
+ * "primary": false,
91848
+ * "title": "Corregir los enlaces de tus anuncios",
91849
+ * "why": "Los parámetros de URL de **2** anuncios pasan a los estándar para que cada clic diga qué anuncio lo trajo («utm_content={{ad.id}}»); hoy sus resultados no se le pueden atribuir a ningún anuncio. Cambian «utm_source», «utm_medium», «utm_campaign», «utm_term», «utm_content» y «utm_id»: la vista previa muestra, anuncio por anuncio, lo que tiene hoy y lo que queda.",
91850
+ * "effect": "Meta puede reiniciar el aprendizaje de los conjuntos afectados; los anuncios siguen activos. Puedes deshacerlo.",
91851
+ * "target": {
91852
+ * "level": "profile",
91853
+ * "external_id": null,
91854
+ * "name": null,
91855
+ * "ads": [
91856
+ * {
91857
+ * "external_id": "120212000000000011",
91858
+ * "name": "Carrusel · Antes y después",
91859
+ * "ad_set_name": "Implantes · Las Condes",
91860
+ * "campaign_name": "Implantes · Septiembre"
91861
+ * },
91862
+ * {
91863
+ * "external_id": "120212000000000012",
91864
+ * "name": "Historia · Evaluación gratis",
91865
+ * "ad_set_name": "Implantes · Providencia",
91866
+ * "campaign_name": "Implantes · Septiembre"
91867
+ * }
91868
+ * ]
91869
+ * },
91870
+ * "params": {
91871
+ * "ads": [
91872
+ * {
91873
+ * "external_id": "120212000000000011",
91874
+ * "expected_url_tags": "utm_source=facebook&utm_campaign={{campaign.name}}&utm_content={{ad.name}}",
91875
+ * "url_tags": "utm_source={{site_source_name}}&utm_medium=paid_social&utm_campaign={{campaign.id}}&utm_term={{adset.id}}&utm_content={{ad.id}}&utm_id={{campaign.id}}"
91876
+ * },
91877
+ * {
91878
+ * "external_id": "120212000000000012",
91879
+ * "expected_url_tags": null,
91880
+ * "url_tags": "utm_source={{site_source_name}}&utm_medium=paid_social&utm_campaign={{campaign.id}}&utm_term={{adset.id}}&utm_content={{ad.id}}&utm_id={{campaign.id}}"
91881
+ * }
91882
+ * ]
91883
+ * },
91884
+ * "reversible": true,
91885
+ * "risk": "learning_reset",
91886
+ * "engine_ref": {
91887
+ * "op": "quality.url_tags_apply"
91888
+ * },
91889
+ * "facts": [],
91890
+ * "dismissed_until": null
91840
91891
  * }
91841
91892
  * ]
91842
91893
  * }
@@ -91957,7 +92008,7 @@ interface paths {
91957
92008
  put?: never;
91958
92009
  /**
91959
92010
  * Preview an action before confirming it
91960
- * @description Reads the target’s live state and returns what will change (`rows`: before → after), the warnings, and — for a duplicate-and-swap — the consent lines the owner must accept. It also records ONE single-use approval bound to the caller, the action and its exact parameters, valid for 10 minutes (`expires_at`): `preview_id` is what `execute` spends. No engine write happens here.
92011
+ * @description Reads the target’s live state and returns what will change (`rows`: before → after), the warnings, and — for a duplicate-and-swap or a URL-parameter fix — the consent lines the owner must accept. A `url_tags_fix` preview lists `untagged_ads` («{n} → 0») first, then one row per ad (`ad:<id>`): its current parameters → exactly what it gets; an ad changed in Meta after the preview is skipped at execute, never rewritten blind. It also records ONE single-use approval bound to the caller, the action and its exact parameters, valid for 10 minutes (`expires_at`): `preview_id` is what `execute` spends. No engine write happens here.
91961
92012
  *
91962
92013
  * 409 `ADS_ACTION_NOT_AVAILABLE` when the action is no longer on today’s list (or is a `nav` card, which has nothing to execute).
91963
92014
  */
@@ -92143,9 +92194,11 @@ interface paths {
92143
92194
  *
92144
92195
  * 409 `ADS_ACTION_REPLAY_BLOCKED` when the approval cannot be spent — `details.reason` is `expired` (preview older than 10 minutes), `consumed` (already confirmed, e.g. from another tab), `not_found` or `binding_mismatch` (another person’s preview, or another action — incl. a real preview sent with `sample: true`). In sample mode nothing reaches the engine: the execution is born `succeeded` with `simulated: true`, and only a sample preview can be spent.
92145
92196
  *
92146
- * **Duplicate-and-swap** needs the owner’s acceptance of the preview’s `consent_terms` (the verbatim consent text): send `consent: { version, text_hash, accepted_at? }`. Missing, different or older than 24 h → 409 `ADS_ACTION_CONSENT_REQUIRED` (`details.reason` missing|mismatch|stale, `details.consent` = the current version and hash) — nothing is spent and nothing reaches the engine.
92197
+ * **Duplicate-and-swap** and **`url_tags_fix`** need the owner’s acceptance of the preview’s `consent_terms` (the verbatim consent text): send `consent: { version, text_hash, accepted_at? }`. Missing, different or older than 24 h → 409 `ADS_ACTION_CONSENT_REQUIRED` (`details.reason` missing|mismatch|stale, `details.consent` = the current version and hash) — nothing is spent and nothing reaches the engine.
92147
92198
  *
92148
92199
  * If the job cannot be queued the answer is still 202, with `status: failed`: the execution exists and says why (`error.code: queue_unavailable`).
92200
+ *
92201
+ * A `url_tags_fix` corrects each ad on its own: `outcome.summary` reads «{k} de {n} anuncios corregidos», `outcome.partial` is true when k < n, and `outcome.ads[]` says what happened to each ad. None corrected → `failed`/`refused` with the first ad’s reason, still with `outcome.ads[]`.
92149
92202
  */
92150
92203
  post: {
92151
92204
  parameters: {
@@ -92174,7 +92227,7 @@ interface paths {
92174
92227
  */
92175
92228
  preview_id: string;
92176
92229
  sample?: boolean;
92177
- /** @description Duplicate-and-swap ONLY, and required there: the owner's acceptance of `consent_terms` from the preview — echo its `version` and `text_hash`. The accepting person is always the caller. */
92230
+ /** @description Required for a duplicate-and-swap and a URL-parameter fix (`url_tags_fix`), ignored otherwise: the owner's acceptance of `consent_terms` from the preview — echo its `version` and `text_hash`. The accepting person is always the caller. */
92178
92231
  consent?: {
92179
92232
  version: string;
92180
92233
  text_hash: string;
@@ -92375,6 +92428,65 @@ interface paths {
92375
92428
  * "created_by": "Dueña Ejemplo"
92376
92429
  * },
92377
92430
  * {
92431
+ * "id": "e5e5e5e5-0000-4000-8000-000000000004",
92432
+ * "action_key": "url_tags_fix:profile:2026-09-23",
92433
+ * "kind": "url_tags_fix",
92434
+ * "status": "succeeded",
92435
+ * "outcome": {
92436
+ * "summary": "1 de 2 anuncios corregidos.",
92437
+ * "engine_action_id": "f7f7f7f7-0000-4000-8000-000000000003",
92438
+ * "applied_at": "2026-09-23T15:40:09.000Z",
92439
+ * "partial": true,
92440
+ * "corrected_count": 1,
92441
+ * "requested_count": 2,
92442
+ * "ads": [
92443
+ * {
92444
+ * "external_id": "120212000000000011",
92445
+ * "name": "Carrusel · Antes y después",
92446
+ * "result": "corrected",
92447
+ * "code": null,
92448
+ * "message": null,
92449
+ * "url_tags_after": "utm_source={{site_source_name}}&utm_medium=paid_social&utm_campaign={{campaign.id}}&utm_term={{adset.id}}&utm_content={{ad.id}}&utm_id={{campaign.id}}",
92450
+ * "engine_action_id": "f7f7f7f7-0000-4000-8000-000000000003",
92451
+ * "undo_available": true
92452
+ * },
92453
+ * {
92454
+ * "external_id": "120212000000000012",
92455
+ * "name": "Historia · Evaluación gratis",
92456
+ * "result": "skipped",
92457
+ * "code": "url_tags_changed_since_preview",
92458
+ * "message": "Los parámetros de URL del anuncio cambiaron en Meta después de la vista previa, así que no lo tocamos. Revisa la propuesta de nuevo.",
92459
+ * "url_tags_after": null,
92460
+ * "engine_action_id": null,
92461
+ * "undo_available": false
92462
+ * }
92463
+ * ]
92464
+ * },
92465
+ * "error": null,
92466
+ * "rollback_available": true,
92467
+ * "rollback_of": null,
92468
+ * "simulated": false,
92469
+ * "created_at": "2026-09-23T15:40:01.000Z",
92470
+ * "finished_at": "2026-09-23T15:40:09.000Z",
92471
+ * "target": {
92472
+ * "level": "profile",
92473
+ * "external_id": null,
92474
+ * "name": null,
92475
+ * "campaign_name": null,
92476
+ * "ads": [
92477
+ * {
92478
+ * "external_id": "120212000000000011",
92479
+ * "name": "Carrusel · Antes y después"
92480
+ * },
92481
+ * {
92482
+ * "external_id": "120212000000000012",
92483
+ * "name": "Historia · Evaluación gratis"
92484
+ * }
92485
+ * ]
92486
+ * },
92487
+ * "created_by": "Dueña Ejemplo"
92488
+ * },
92489
+ * {
92378
92490
  * "id": "e5e5e5e5-0000-4000-8000-000000000001",
92379
92491
  * "action_key": "budget_change:120211000000000077:2026-09-23",
92380
92492
  * "kind": "budget_change",
@@ -92688,7 +92800,7 @@ interface paths {
92688
92800
  put?: never;
92689
92801
  /**
92690
92802
  * Undo an executed action
92691
- * @description Queues the engine’s rollback of a `succeeded` execution with `rollback_available: true` and answers the NEW execution (`rollback_of` = the original). The engine restores the pre-change state only while the object still carries what the action wrote; otherwise the rollback is `refused` with `reason: not_reversible` (`code: state_drifted`). **`Idempotency-Key` is required.** 409 `ADS_ACTION_NOT_REVERSIBLE` when the execution has nothing to undo.
92803
+ * @description Queues the engine’s rollback of a `succeeded` execution with `rollback_available: true` and answers the NEW execution (`rollback_of` = the original). The engine restores the pre-change state only while the object still carries what the action wrote; otherwise the rollback is `refused` with `reason: not_reversible` (`code: state_drifted`). A `url_tags_fix` is undone ad by ad (each ad back on its previous parameters): an ad changed in Meta since is left alone (final), an ad whose undo got no answer stays pending — the original keeps `rollback_available: true` and the next rollback sends only those ads; the original reads `rolled_back` once nothing is pending. **`Idempotency-Key` is required.** 409 `ADS_ACTION_NOT_REVERSIBLE` when the execution has nothing to undo.
92692
92804
  */
92693
92805
  post: {
92694
92806
  parameters: {
@@ -113964,7 +114076,7 @@ interface components {
113964
114076
  /** @description `<kind>:<target external id>:<YYYY-MM-DD>` — a composite key, stable for a day. */
113965
114077
  key: string;
113966
114078
  /** @enum {string} */
113967
- kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "nav";
114079
+ kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "url_tags_fix" | "nav";
113968
114080
  screen: ("resumen" | "campanas" | "creativos" | "salud")[];
113969
114081
  /** @description The one card the rail leads with. */
113970
114082
  primary: boolean;
@@ -113986,8 +114098,16 @@ interface components {
113986
114098
  external_id: string;
113987
114099
  name: string | null;
113988
114100
  } | null;
114101
+ /** @description `url_tags_fix` (and its read-only `nav` fallback) only: the ads whose «Parámetros de URL» do not carry the ad id where attribution reads it, busiest first, at most what one fix accepts (25). Ad set and campaign are named, not identified (the audit carries names only). */
114102
+ ads?: {
114103
+ /** @description The ad’s Meta id. */
114104
+ external_id: string;
114105
+ name: string | null;
114106
+ ad_set_name: string | null;
114107
+ campaign_name: string | null;
114108
+ }[];
113989
114109
  };
113990
- /** @description The engine’s own vocabulary, e.g. `{ budget_change_pct: 20 }`. */
114110
+ /** @description The engine’s own vocabulary, e.g. `{ budget_change_pct: 20 }`. `url_tags_fix`: `{ ads: [{ external_id, expected_url_tags, url_tags }] }` — each ad’s current parameters (null = none) and exactly what it gets. */
113991
114111
  params: {
113992
114112
  [key: string]: unknown;
113993
114113
  };
@@ -113997,7 +114117,7 @@ interface components {
113997
114117
  /** @description Which operation executes it; `null` for `nav`. */
113998
114118
  engine_ref: {
113999
114119
  /** @enum {string} */
114000
- op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback";
114120
+ op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | "quality.url_tags_apply" | "quality.url_tags_undo";
114001
114121
  recommendation_id?: string;
114002
114122
  } | null;
114003
114123
  /** @description `nav` only: a workspace-relative path (`/anuncios/atribuidos?c=…`, `/anuncios/activar?paso=tag`), or an absolute Meta Ads Manager URL built from Meta ids (`https://www.facebook.com/adsmanager/…`) — open it in a new tab; it changes nothing by itself. */
@@ -114019,9 +114139,9 @@ interface components {
114019
114139
  after: string;
114020
114140
  }[];
114021
114141
  warnings: string[];
114022
- /** @description Duplicate-and-swap only: `consent_terms.text` split into lines, for display (verbatim). */
114142
+ /** @description Duplicate-and-swap and `url_tags_fix` only: `consent_terms.text` split into lines, for display (verbatim). */
114023
114143
  consent: string[];
114024
- /** @description Duplicate-and-swap only: what the owner accepts before confirming. Execute must send `consent: { version, text_hash }`. */
114144
+ /** @description Duplicate-and-swap and `url_tags_fix` only: what the owner accepts before confirming. Execute must send `consent: { version, text_hash }`. For `url_tags_fix` the text is one sentence: rewriting an ad’s parameters replaces its creative, which can restart the learning phase of the affected ad sets. */
114025
114145
  consent_terms: {
114026
114146
  version: string;
114027
114147
  /** @enum {string} */
@@ -114033,14 +114153,14 @@ interface components {
114033
114153
  } | null;
114034
114154
  reversible: boolean;
114035
114155
  /** @enum {string|null} */
114036
- engine_op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | null;
114156
+ engine_op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | "quality.url_tags_apply" | "quality.url_tags_undo" | null;
114037
114157
  };
114038
114158
  AdsActionExecution: {
114039
114159
  /** Format: uuid */
114040
114160
  id: string;
114041
114161
  action_key: string;
114042
114162
  /** @enum {string} */
114043
- kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck";
114163
+ kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "url_tags_fix";
114044
114164
  /** @enum {string} */
114045
114165
  status: "queued" | "running" | "succeeded" | "failed" | "refused" | "rolled_back";
114046
114166
  target: {
@@ -114051,7 +114171,14 @@ interface components {
114051
114171
  name: string | null;
114052
114172
  /** @description The campaign the card named: set on an ad-set budget change (the card is titled with the campaign, the ad set is `name`) and on an ad pause whose campaign was known; `null` otherwise and on rows recorded before this field existed. */
114053
114173
  campaign_name: string | null;
114174
+ /** @description `url_tags_fix` only: the ads the fix was asked to correct (the journal writes «corregiste los enlaces de {n} anuncios»). Each ad’s result is on `outcome.ads[]`. */
114175
+ ads?: {
114176
+ /** @description The ad’s Meta id. */
114177
+ external_id: string;
114178
+ name: string | null;
114179
+ }[];
114054
114180
  };
114181
+ /** @description What happened. `url_tags_fix` adds `partial` (true when fewer ads were corrected than asked — never show «Hecho» then), `corrected_count`, `requested_count` and `ads[]`: per ad `{external_id, name, result: corrected|skipped|failed, code, message, url_tags_after, engine_action_id, undo_available}` (an ad that already carried the parameters counts as corrected; it is undoable when this fix wrote it). Its undo (a rollback row) reports `undone_count`, `drifted_count` (changed in Meta since — never touched), `gone_count` (already undone elsewhere — no longer undoable from here), `reconnect_count` (Meta asks to reconnect), `retryable_count` (no answer or reconnect — the original stays undoable and the next rollback sends only those ads), `requested_count`, `partial` and `ads[]` `{external_id, name, result: undone|drifted|gone|retryable|reconnect, code, message}`; a failed or refused fix still carries `ads[]`. */
114055
114182
  outcome: {
114056
114183
  summary: string;
114057
114184
  engine_action_id: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "11.19.0",
3
+ "version": "11.21.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",