@vitrina/api 11.6.0 → 11.8.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.ts CHANGED
@@ -89157,6 +89157,1050 @@ interface paths {
89157
89157
  patch?: never;
89158
89158
  trace?: never;
89159
89159
  };
89160
+ "/ads/actions": {
89161
+ parameters: {
89162
+ query?: never;
89163
+ header?: never;
89164
+ path?: never;
89165
+ cookie?: never;
89166
+ };
89167
+ /**
89168
+ * The suggested actions for one Ads screen
89169
+ * @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 a worn-out 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.
89170
+ *
89171
+ * A `key` is `<kind>:<target external id>:<YYYY-MM-DD>` and is stable for the day. Dismissed actions stay on the list with `dismissed_until` set, sorted last. `include=adset_duplicate_swap` also lists the duplicate-and-swap actions (hidden by default).
89172
+ *
89173
+ * Card state machine (client): `proposed → previewing → confirming → running → done | failed | refused → (done) reverted`; `dismissed` for 7 days; `simulated` replaces `done` in sample mode.
89174
+ */
89175
+ get: {
89176
+ parameters: {
89177
+ query: {
89178
+ /** @description The screen whose action rail to list (`atribuidos` has none). */
89179
+ screen: "resumen" | "campanas" | "atribuidos" | "creativos" | "salud";
89180
+ from: string;
89181
+ to: string;
89182
+ /** @description `adset_duplicate_swap` also lists the duplicate-and-swap actions (Salud). Hidden by default: it rebuilds an ad set (new id, learning reset) and is offered as the alternative after a `promoted_object_frozen` refusal. */
89183
+ include?: "adset_duplicate_swap";
89184
+ /** @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. */
89185
+ sample?: "1" | "true";
89186
+ };
89187
+ header?: never;
89188
+ path?: never;
89189
+ cookie?: never;
89190
+ };
89191
+ requestBody?: never;
89192
+ responses: {
89193
+ /** @description The actions */
89194
+ 200: {
89195
+ headers: {
89196
+ [name: string]: unknown;
89197
+ };
89198
+ content: {
89199
+ /**
89200
+ * @example {
89201
+ * "data": [
89202
+ * {
89203
+ * "key": "pause_ad:120212000000000006:2026-09-23",
89204
+ * "kind": "pause_ad",
89205
+ * "screen": [
89206
+ * "creativos",
89207
+ * "resumen"
89208
+ * ],
89209
+ * "primary": true,
89210
+ * "title": "Pausar «Video testimonio · 30 s»",
89211
+ * "why": "Está desgastado: la gente ya lo vio demasiadas veces y **$184.300** de gasto rinde cada vez menos.",
89212
+ * "effect": "Deja de mostrarse de inmediato; puedes reactivarlo cuando quieras.",
89213
+ * "target": {
89214
+ * "level": "ad",
89215
+ * "external_id": "120212000000000006",
89216
+ * "name": "Video testimonio · 30 s",
89217
+ * "campaign_external_id": null
89218
+ * },
89219
+ * "params": {},
89220
+ * "reversible": true,
89221
+ * "risk": "reversible",
89222
+ * "engine_ref": {
89223
+ * "op": "ads.pause"
89224
+ * },
89225
+ * "facts": [
89226
+ * "critical_creative_name",
89227
+ * "critical_creative_spend",
89228
+ * "fatigued_creatives"
89229
+ * ],
89230
+ * "dismissed_until": null
89231
+ * },
89232
+ * {
89233
+ * "key": "budget_change:120211000000000077:2026-09-23",
89234
+ * "kind": "budget_change",
89235
+ * "screen": [
89236
+ * "campanas",
89237
+ * "resumen"
89238
+ * ],
89239
+ * "primary": false,
89240
+ * "title": "Subir 20 % el presupuesto de «Implantes · Conjunto principal»",
89241
+ * "why": "Está trayendo tratamientos a buen costo y tiene espacio para crecer. Es parte de «Implantes · Septiembre», tu campaña con mejor retorno (**4,1×**).",
89242
+ * "effect": "El presupuesto diario sube 20 %; puedes deshacerlo.",
89243
+ * "target": {
89244
+ * "level": "ad_set",
89245
+ * "external_id": "120211000000000077",
89246
+ * "name": "Implantes · Conjunto principal",
89247
+ * "campaign_external_id": null
89248
+ * },
89249
+ * "params": {
89250
+ * "budget_change_pct": 20
89251
+ * },
89252
+ * "reversible": true,
89253
+ * "risk": "reversible",
89254
+ * "engine_ref": {
89255
+ * "op": "recommendations.apply",
89256
+ * "recommendation_id": "a0a0a0a0-0000-4000-8000-000000000001"
89257
+ * },
89258
+ * "facts": [
89259
+ * "best_campaign_name",
89260
+ * "best_campaign_roas"
89261
+ * ],
89262
+ * "dismissed_until": null
89263
+ * }
89264
+ * ]
89265
+ * }
89266
+ */
89267
+ "application/json": {
89268
+ data: components["schemas"]["AdsAction"][];
89269
+ };
89270
+ };
89271
+ };
89272
+ /** @description Validation error */
89273
+ 400: {
89274
+ headers: {
89275
+ [name: string]: unknown;
89276
+ };
89277
+ content: {
89278
+ "application/json": components["schemas"]["Error"];
89279
+ };
89280
+ };
89281
+ /** @description Unauthorized */
89282
+ 401: {
89283
+ headers: {
89284
+ [name: string]: unknown;
89285
+ };
89286
+ content: {
89287
+ "application/json": components["schemas"]["Error"];
89288
+ };
89289
+ };
89290
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
89291
+ 402: {
89292
+ headers: {
89293
+ [name: string]: unknown;
89294
+ };
89295
+ content: {
89296
+ /**
89297
+ * @example {
89298
+ * "error": {
89299
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
89300
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
89301
+ * "details": {
89302
+ * "required": [
89303
+ * "vitrina_ads"
89304
+ * ],
89305
+ * "active": [],
89306
+ * "feature": "vitrina_ads",
89307
+ * "entitlement_state": "off"
89308
+ * }
89309
+ * }
89310
+ * }
89311
+ */
89312
+ "application/json": components["schemas"]["Error"];
89313
+ };
89314
+ };
89315
+ /** @description Forbidden */
89316
+ 403: {
89317
+ headers: {
89318
+ [name: string]: unknown;
89319
+ };
89320
+ content: {
89321
+ "application/json": components["schemas"]["Error"];
89322
+ };
89323
+ };
89324
+ /** @description Not found */
89325
+ 404: {
89326
+ headers: {
89327
+ [name: string]: unknown;
89328
+ };
89329
+ content: {
89330
+ "application/json": components["schemas"]["Error"];
89331
+ };
89332
+ };
89333
+ /** @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. */
89334
+ 409: {
89335
+ headers: {
89336
+ [name: string]: unknown;
89337
+ };
89338
+ content: {
89339
+ /**
89340
+ * @example {
89341
+ * "error": {
89342
+ * "code": "ADS_KEY_NEEDS_REMINT",
89343
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
89344
+ * "details": {
89345
+ * "key_kind": "core"
89346
+ * }
89347
+ * }
89348
+ * }
89349
+ */
89350
+ "application/json": components["schemas"]["Error"];
89351
+ };
89352
+ };
89353
+ /** @description Rate limited */
89354
+ 429: {
89355
+ headers: {
89356
+ [name: string]: unknown;
89357
+ };
89358
+ content: {
89359
+ "application/json": components["schemas"]["Error"];
89360
+ };
89361
+ };
89362
+ };
89363
+ };
89364
+ put?: never;
89365
+ post?: never;
89366
+ delete?: never;
89367
+ options?: never;
89368
+ head?: never;
89369
+ patch?: never;
89370
+ trace?: never;
89371
+ };
89372
+ "/ads/actions/{key}/preview": {
89373
+ parameters: {
89374
+ query?: never;
89375
+ header?: never;
89376
+ path?: never;
89377
+ cookie?: never;
89378
+ };
89379
+ get?: never;
89380
+ put?: never;
89381
+ /**
89382
+ * Preview an action before confirming it
89383
+ * @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.
89384
+ *
89385
+ * 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).
89386
+ */
89387
+ post: {
89388
+ parameters: {
89389
+ query?: never;
89390
+ header?: {
89391
+ /** @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. */
89392
+ "Idempotency-Key"?: string;
89393
+ };
89394
+ path: {
89395
+ /** @description The action key: `<kind>:<target external id>:<YYYY-MM-DD>`. */
89396
+ key: string;
89397
+ };
89398
+ cookie?: never;
89399
+ };
89400
+ requestBody: {
89401
+ content: {
89402
+ /**
89403
+ * @example {
89404
+ * "from": "2026-08-24",
89405
+ * "to": "2026-09-23"
89406
+ * }
89407
+ */
89408
+ "application/json": {
89409
+ from: string;
89410
+ to: string;
89411
+ sample?: boolean;
89412
+ };
89413
+ };
89414
+ };
89415
+ responses: {
89416
+ /** @description The preview */
89417
+ 200: {
89418
+ headers: {
89419
+ [name: string]: unknown;
89420
+ };
89421
+ content: {
89422
+ /**
89423
+ * @example {
89424
+ * "data": {
89425
+ * "preview_id": "b1b1b1b1-0000-4000-8000-000000000001",
89426
+ * "expires_at": "2026-09-23T15:10:00.000Z",
89427
+ * "action_key": "budget_change:120211000000000077:2026-09-23",
89428
+ * "rows": [
89429
+ * {
89430
+ * "key": "daily_budget",
89431
+ * "label": "Presupuesto diario",
89432
+ * "before": "$10.000",
89433
+ * "after": "$12.000"
89434
+ * }
89435
+ * ],
89436
+ * "warnings": [
89437
+ * "Solo se permite cambiar el presupuesto hasta 50 % por vez."
89438
+ * ],
89439
+ * "consent": [],
89440
+ * "consent_terms": null,
89441
+ * "reversible": true,
89442
+ * "engine_op": "recommendations.apply"
89443
+ * }
89444
+ * }
89445
+ */
89446
+ "application/json": {
89447
+ data: components["schemas"]["AdsActionPreview"];
89448
+ };
89449
+ };
89450
+ };
89451
+ /** @description Validation error */
89452
+ 400: {
89453
+ headers: {
89454
+ [name: string]: unknown;
89455
+ };
89456
+ content: {
89457
+ "application/json": components["schemas"]["Error"];
89458
+ };
89459
+ };
89460
+ /** @description Unauthorized */
89461
+ 401: {
89462
+ headers: {
89463
+ [name: string]: unknown;
89464
+ };
89465
+ content: {
89466
+ "application/json": components["schemas"]["Error"];
89467
+ };
89468
+ };
89469
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
89470
+ 402: {
89471
+ headers: {
89472
+ [name: string]: unknown;
89473
+ };
89474
+ content: {
89475
+ /**
89476
+ * @example {
89477
+ * "error": {
89478
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
89479
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
89480
+ * "details": {
89481
+ * "required": [
89482
+ * "vitrina_ads"
89483
+ * ],
89484
+ * "active": [],
89485
+ * "feature": "vitrina_ads",
89486
+ * "entitlement_state": "off"
89487
+ * }
89488
+ * }
89489
+ * }
89490
+ */
89491
+ "application/json": components["schemas"]["Error"];
89492
+ };
89493
+ };
89494
+ /** @description Forbidden */
89495
+ 403: {
89496
+ headers: {
89497
+ [name: string]: unknown;
89498
+ };
89499
+ content: {
89500
+ "application/json": components["schemas"]["Error"];
89501
+ };
89502
+ };
89503
+ /** @description Not found */
89504
+ 404: {
89505
+ headers: {
89506
+ [name: string]: unknown;
89507
+ };
89508
+ content: {
89509
+ "application/json": components["schemas"]["Error"];
89510
+ };
89511
+ };
89512
+ /** @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. */
89513
+ 409: {
89514
+ headers: {
89515
+ [name: string]: unknown;
89516
+ };
89517
+ content: {
89518
+ /**
89519
+ * @example {
89520
+ * "error": {
89521
+ * "code": "ADS_KEY_NEEDS_REMINT",
89522
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
89523
+ * "details": {
89524
+ * "key_kind": "core"
89525
+ * }
89526
+ * }
89527
+ * }
89528
+ */
89529
+ "application/json": components["schemas"]["Error"];
89530
+ };
89531
+ };
89532
+ /** @description Rate limited */
89533
+ 429: {
89534
+ headers: {
89535
+ [name: string]: unknown;
89536
+ };
89537
+ content: {
89538
+ "application/json": components["schemas"]["Error"];
89539
+ };
89540
+ };
89541
+ };
89542
+ };
89543
+ delete?: never;
89544
+ options?: never;
89545
+ head?: never;
89546
+ patch?: never;
89547
+ trace?: never;
89548
+ };
89549
+ "/ads/actions/{key}/execute": {
89550
+ parameters: {
89551
+ query?: never;
89552
+ header?: never;
89553
+ path?: never;
89554
+ cookie?: never;
89555
+ };
89556
+ get?: never;
89557
+ put?: never;
89558
+ /**
89559
+ * Confirm and run a previewed action
89560
+ * @description Spends the preview’s single-use approval and queues the engine write; poll `GET /ads/actions/executions/{id}`. **`Idempotency-Key` is required** (400 without): a replay with the same key answers the first execution and writes nothing.
89561
+ *
89562
+ * 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.
89563
+ *
89564
+ * **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.
89565
+ *
89566
+ * If the job cannot be queued the answer is still 202, with `status: failed`: the execution exists and says why (`error.code: queue_unavailable`).
89567
+ */
89568
+ post: {
89569
+ parameters: {
89570
+ query?: never;
89571
+ header?: {
89572
+ /** @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. */
89573
+ "Idempotency-Key"?: string;
89574
+ };
89575
+ path: {
89576
+ /** @description The action key: `<kind>:<target external id>:<YYYY-MM-DD>`. */
89577
+ key: string;
89578
+ };
89579
+ cookie?: never;
89580
+ };
89581
+ requestBody: {
89582
+ content: {
89583
+ /**
89584
+ * @example {
89585
+ * "preview_id": "b1b1b1b1-0000-4000-8000-000000000001"
89586
+ * }
89587
+ */
89588
+ "application/json": {
89589
+ /**
89590
+ * Format: uuid
89591
+ * @description The `preview_id` the preview returned (single use, 10 minutes).
89592
+ */
89593
+ preview_id: string;
89594
+ sample?: boolean;
89595
+ /** @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. */
89596
+ consent?: {
89597
+ version: string;
89598
+ text_hash: string;
89599
+ /**
89600
+ * Format: date-time
89601
+ * @description When the owner accepted (ISO 8601; defaults to now). At most 24 h old.
89602
+ */
89603
+ accepted_at?: string;
89604
+ };
89605
+ };
89606
+ };
89607
+ };
89608
+ responses: {
89609
+ /** @description Queued (or the replayed execution) */
89610
+ 202: {
89611
+ headers: {
89612
+ [name: string]: unknown;
89613
+ };
89614
+ content: {
89615
+ /**
89616
+ * @example {
89617
+ * "data": {
89618
+ * "execution_id": "e5e5e5e5-0000-4000-8000-000000000001",
89619
+ * "status": "queued"
89620
+ * }
89621
+ * }
89622
+ */
89623
+ "application/json": {
89624
+ data: {
89625
+ /** Format: uuid */
89626
+ execution_id: string;
89627
+ /** @enum {string} */
89628
+ status: "queued" | "running" | "succeeded" | "failed" | "refused" | "rolled_back";
89629
+ };
89630
+ };
89631
+ };
89632
+ };
89633
+ /** @description Validation error */
89634
+ 400: {
89635
+ headers: {
89636
+ [name: string]: unknown;
89637
+ };
89638
+ content: {
89639
+ "application/json": components["schemas"]["Error"];
89640
+ };
89641
+ };
89642
+ /** @description Unauthorized */
89643
+ 401: {
89644
+ headers: {
89645
+ [name: string]: unknown;
89646
+ };
89647
+ content: {
89648
+ "application/json": components["schemas"]["Error"];
89649
+ };
89650
+ };
89651
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
89652
+ 402: {
89653
+ headers: {
89654
+ [name: string]: unknown;
89655
+ };
89656
+ content: {
89657
+ /**
89658
+ * @example {
89659
+ * "error": {
89660
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
89661
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
89662
+ * "details": {
89663
+ * "required": [
89664
+ * "vitrina_ads"
89665
+ * ],
89666
+ * "active": [],
89667
+ * "feature": "vitrina_ads",
89668
+ * "entitlement_state": "off"
89669
+ * }
89670
+ * }
89671
+ * }
89672
+ */
89673
+ "application/json": components["schemas"]["Error"];
89674
+ };
89675
+ };
89676
+ /** @description Forbidden */
89677
+ 403: {
89678
+ headers: {
89679
+ [name: string]: unknown;
89680
+ };
89681
+ content: {
89682
+ "application/json": components["schemas"]["Error"];
89683
+ };
89684
+ };
89685
+ /** @description Not found */
89686
+ 404: {
89687
+ headers: {
89688
+ [name: string]: unknown;
89689
+ };
89690
+ content: {
89691
+ "application/json": components["schemas"]["Error"];
89692
+ };
89693
+ };
89694
+ /** @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. */
89695
+ 409: {
89696
+ headers: {
89697
+ [name: string]: unknown;
89698
+ };
89699
+ content: {
89700
+ /**
89701
+ * @example {
89702
+ * "error": {
89703
+ * "code": "ADS_KEY_NEEDS_REMINT",
89704
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
89705
+ * "details": {
89706
+ * "key_kind": "core"
89707
+ * }
89708
+ * }
89709
+ * }
89710
+ */
89711
+ "application/json": components["schemas"]["Error"];
89712
+ };
89713
+ };
89714
+ /** @description Rate limited */
89715
+ 429: {
89716
+ headers: {
89717
+ [name: string]: unknown;
89718
+ };
89719
+ content: {
89720
+ "application/json": components["schemas"]["Error"];
89721
+ };
89722
+ };
89723
+ };
89724
+ };
89725
+ delete?: never;
89726
+ options?: never;
89727
+ head?: never;
89728
+ patch?: never;
89729
+ trace?: never;
89730
+ };
89731
+ "/ads/actions/executions/{id}": {
89732
+ parameters: {
89733
+ query?: never;
89734
+ header?: never;
89735
+ path?: never;
89736
+ cookie?: never;
89737
+ };
89738
+ /**
89739
+ * The status of an action execution
89740
+ * @description `queued → running → succeeded | failed | refused`; a succeeded execution becomes `rolled_back` when its rollback succeeds. `error.reason` is one of `promoted_object_frozen` (Meta froze the ad set’s conversion — the duplicate-and-swap is the alternative), `reconnect_required`, `permission_gap` (Meta connected without permission to manage ads — reconnect keeping it), `rate_limited`, `not_reversible`, `forbidden` (no person could be put on the record for the change — not a Meta grant problem), `consent_required` (the duplicate-and-swap consent is missing or stale — preview again), `engine_error` (incl. `code: budget_change_out_of_bounds` — outside the ±50 % allowed per change — `code: not_active` and `code: no_recommendation`). `error.message` is Spanish copy ready for the card.
89741
+ */
89742
+ get: {
89743
+ parameters: {
89744
+ query?: {
89745
+ /** @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. */
89746
+ sample?: "1" | "true";
89747
+ };
89748
+ header?: never;
89749
+ path: {
89750
+ /** @description The execution id. */
89751
+ id: string;
89752
+ };
89753
+ cookie?: never;
89754
+ };
89755
+ requestBody?: never;
89756
+ responses: {
89757
+ /** @description The execution */
89758
+ 200: {
89759
+ headers: {
89760
+ [name: string]: unknown;
89761
+ };
89762
+ content: {
89763
+ /**
89764
+ * @example {
89765
+ * "data": {
89766
+ * "id": "e5e5e5e5-0000-4000-8000-000000000001",
89767
+ * "action_key": "budget_change:120211000000000077:2026-09-23",
89768
+ * "kind": "budget_change",
89769
+ * "status": "succeeded",
89770
+ * "outcome": {
89771
+ * "summary": "Cambio aplicado en Meta.",
89772
+ * "engine_action_id": "f7f7f7f7-0000-4000-8000-000000000001",
89773
+ * "applied_at": "2026-09-23T15:01:12.000Z"
89774
+ * },
89775
+ * "error": null,
89776
+ * "rollback_available": true,
89777
+ * "rollback_of": null,
89778
+ * "simulated": false,
89779
+ * "created_at": "2026-09-23T15:01:10.000Z",
89780
+ * "finished_at": "2026-09-23T15:01:12.000Z"
89781
+ * }
89782
+ * }
89783
+ */
89784
+ "application/json": {
89785
+ data: components["schemas"]["AdsActionExecution"];
89786
+ };
89787
+ };
89788
+ };
89789
+ /** @description Validation error */
89790
+ 400: {
89791
+ headers: {
89792
+ [name: string]: unknown;
89793
+ };
89794
+ content: {
89795
+ "application/json": components["schemas"]["Error"];
89796
+ };
89797
+ };
89798
+ /** @description Unauthorized */
89799
+ 401: {
89800
+ headers: {
89801
+ [name: string]: unknown;
89802
+ };
89803
+ content: {
89804
+ "application/json": components["schemas"]["Error"];
89805
+ };
89806
+ };
89807
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
89808
+ 402: {
89809
+ headers: {
89810
+ [name: string]: unknown;
89811
+ };
89812
+ content: {
89813
+ /**
89814
+ * @example {
89815
+ * "error": {
89816
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
89817
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
89818
+ * "details": {
89819
+ * "required": [
89820
+ * "vitrina_ads"
89821
+ * ],
89822
+ * "active": [],
89823
+ * "feature": "vitrina_ads",
89824
+ * "entitlement_state": "off"
89825
+ * }
89826
+ * }
89827
+ * }
89828
+ */
89829
+ "application/json": components["schemas"]["Error"];
89830
+ };
89831
+ };
89832
+ /** @description Forbidden */
89833
+ 403: {
89834
+ headers: {
89835
+ [name: string]: unknown;
89836
+ };
89837
+ content: {
89838
+ "application/json": components["schemas"]["Error"];
89839
+ };
89840
+ };
89841
+ /** @description Not found */
89842
+ 404: {
89843
+ headers: {
89844
+ [name: string]: unknown;
89845
+ };
89846
+ content: {
89847
+ "application/json": components["schemas"]["Error"];
89848
+ };
89849
+ };
89850
+ /** @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. */
89851
+ 409: {
89852
+ headers: {
89853
+ [name: string]: unknown;
89854
+ };
89855
+ content: {
89856
+ /**
89857
+ * @example {
89858
+ * "error": {
89859
+ * "code": "ADS_KEY_NEEDS_REMINT",
89860
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
89861
+ * "details": {
89862
+ * "key_kind": "core"
89863
+ * }
89864
+ * }
89865
+ * }
89866
+ */
89867
+ "application/json": components["schemas"]["Error"];
89868
+ };
89869
+ };
89870
+ /** @description Rate limited */
89871
+ 429: {
89872
+ headers: {
89873
+ [name: string]: unknown;
89874
+ };
89875
+ content: {
89876
+ "application/json": components["schemas"]["Error"];
89877
+ };
89878
+ };
89879
+ };
89880
+ };
89881
+ put?: never;
89882
+ post?: never;
89883
+ delete?: never;
89884
+ options?: never;
89885
+ head?: never;
89886
+ patch?: never;
89887
+ trace?: never;
89888
+ };
89889
+ "/ads/actions/executions/{id}/rollback": {
89890
+ parameters: {
89891
+ query?: never;
89892
+ header?: never;
89893
+ path?: never;
89894
+ cookie?: never;
89895
+ };
89896
+ get?: never;
89897
+ put?: never;
89898
+ /**
89899
+ * Undo an executed action
89900
+ * @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.
89901
+ */
89902
+ post: {
89903
+ parameters: {
89904
+ query?: {
89905
+ /** @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. */
89906
+ sample?: "1" | "true";
89907
+ };
89908
+ header?: {
89909
+ /** @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. */
89910
+ "Idempotency-Key"?: string;
89911
+ };
89912
+ path: {
89913
+ /** @description The execution id. */
89914
+ id: string;
89915
+ };
89916
+ cookie?: never;
89917
+ };
89918
+ requestBody?: never;
89919
+ responses: {
89920
+ /** @description The rollback execution */
89921
+ 202: {
89922
+ headers: {
89923
+ [name: string]: unknown;
89924
+ };
89925
+ content: {
89926
+ /**
89927
+ * @example {
89928
+ * "data": {
89929
+ * "execution_id": "e5e5e5e5-0000-4000-8000-000000000002",
89930
+ * "status": "queued"
89931
+ * }
89932
+ * }
89933
+ */
89934
+ "application/json": {
89935
+ data: {
89936
+ /** Format: uuid */
89937
+ execution_id: string;
89938
+ /** @enum {string} */
89939
+ status: "queued" | "running" | "succeeded" | "failed" | "refused" | "rolled_back";
89940
+ };
89941
+ };
89942
+ };
89943
+ };
89944
+ /** @description Validation error */
89945
+ 400: {
89946
+ headers: {
89947
+ [name: string]: unknown;
89948
+ };
89949
+ content: {
89950
+ "application/json": components["schemas"]["Error"];
89951
+ };
89952
+ };
89953
+ /** @description Unauthorized */
89954
+ 401: {
89955
+ headers: {
89956
+ [name: string]: unknown;
89957
+ };
89958
+ content: {
89959
+ "application/json": components["schemas"]["Error"];
89960
+ };
89961
+ };
89962
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
89963
+ 402: {
89964
+ headers: {
89965
+ [name: string]: unknown;
89966
+ };
89967
+ content: {
89968
+ /**
89969
+ * @example {
89970
+ * "error": {
89971
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
89972
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
89973
+ * "details": {
89974
+ * "required": [
89975
+ * "vitrina_ads"
89976
+ * ],
89977
+ * "active": [],
89978
+ * "feature": "vitrina_ads",
89979
+ * "entitlement_state": "off"
89980
+ * }
89981
+ * }
89982
+ * }
89983
+ */
89984
+ "application/json": components["schemas"]["Error"];
89985
+ };
89986
+ };
89987
+ /** @description Forbidden */
89988
+ 403: {
89989
+ headers: {
89990
+ [name: string]: unknown;
89991
+ };
89992
+ content: {
89993
+ "application/json": components["schemas"]["Error"];
89994
+ };
89995
+ };
89996
+ /** @description Not found */
89997
+ 404: {
89998
+ headers: {
89999
+ [name: string]: unknown;
90000
+ };
90001
+ content: {
90002
+ "application/json": components["schemas"]["Error"];
90003
+ };
90004
+ };
90005
+ /** @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. */
90006
+ 409: {
90007
+ headers: {
90008
+ [name: string]: unknown;
90009
+ };
90010
+ content: {
90011
+ /**
90012
+ * @example {
90013
+ * "error": {
90014
+ * "code": "ADS_KEY_NEEDS_REMINT",
90015
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
90016
+ * "details": {
90017
+ * "key_kind": "core"
90018
+ * }
90019
+ * }
90020
+ * }
90021
+ */
90022
+ "application/json": components["schemas"]["Error"];
90023
+ };
90024
+ };
90025
+ /** @description Rate limited */
90026
+ 429: {
90027
+ headers: {
90028
+ [name: string]: unknown;
90029
+ };
90030
+ content: {
90031
+ "application/json": components["schemas"]["Error"];
90032
+ };
90033
+ };
90034
+ };
90035
+ };
90036
+ delete?: never;
90037
+ options?: never;
90038
+ head?: never;
90039
+ patch?: never;
90040
+ trace?: never;
90041
+ };
90042
+ "/ads/actions/{key}/dismiss": {
90043
+ parameters: {
90044
+ query?: never;
90045
+ header?: never;
90046
+ path?: never;
90047
+ cookie?: never;
90048
+ };
90049
+ get?: never;
90050
+ put?: never;
90051
+ /**
90052
+ * Hide an action for a few days
90053
+ * @description Hides the action from the rail for `days` (default 7, max 30): it stays on `GET /ads/actions` with `dismissed_until` set and sorted last. Stored in the workspace’s Ads settings; not persisted in sample mode (`persisted: false`).
90054
+ */
90055
+ post: {
90056
+ parameters: {
90057
+ query?: never;
90058
+ header?: {
90059
+ /** @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. */
90060
+ "Idempotency-Key"?: string;
90061
+ };
90062
+ path: {
90063
+ /** @description The action key: `<kind>:<target external id>:<YYYY-MM-DD>`. */
90064
+ key: string;
90065
+ };
90066
+ cookie?: never;
90067
+ };
90068
+ requestBody: {
90069
+ content: {
90070
+ /**
90071
+ * @example {
90072
+ * "days": 7
90073
+ * }
90074
+ */
90075
+ "application/json": {
90076
+ /** @default 7 */
90077
+ days?: number;
90078
+ sample?: boolean;
90079
+ };
90080
+ };
90081
+ };
90082
+ responses: {
90083
+ /** @description Dismissed */
90084
+ 200: {
90085
+ headers: {
90086
+ [name: string]: unknown;
90087
+ };
90088
+ content: {
90089
+ /**
90090
+ * @example {
90091
+ * "data": {
90092
+ * "dismissed_until": "2026-09-30T15:00:00.000Z",
90093
+ * "persisted": true
90094
+ * }
90095
+ * }
90096
+ */
90097
+ "application/json": {
90098
+ data: {
90099
+ dismissed_until: string;
90100
+ /** @description `false` in sample mode. */
90101
+ persisted: boolean;
90102
+ };
90103
+ };
90104
+ };
90105
+ };
90106
+ /** @description Validation error */
90107
+ 400: {
90108
+ headers: {
90109
+ [name: string]: unknown;
90110
+ };
90111
+ content: {
90112
+ "application/json": components["schemas"]["Error"];
90113
+ };
90114
+ };
90115
+ /** @description Unauthorized */
90116
+ 401: {
90117
+ headers: {
90118
+ [name: string]: unknown;
90119
+ };
90120
+ content: {
90121
+ "application/json": components["schemas"]["Error"];
90122
+ };
90123
+ };
90124
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
90125
+ 402: {
90126
+ headers: {
90127
+ [name: string]: unknown;
90128
+ };
90129
+ content: {
90130
+ /**
90131
+ * @example {
90132
+ * "error": {
90133
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
90134
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
90135
+ * "details": {
90136
+ * "required": [
90137
+ * "vitrina_ads"
90138
+ * ],
90139
+ * "active": [],
90140
+ * "feature": "vitrina_ads",
90141
+ * "entitlement_state": "off"
90142
+ * }
90143
+ * }
90144
+ * }
90145
+ */
90146
+ "application/json": components["schemas"]["Error"];
90147
+ };
90148
+ };
90149
+ /** @description Forbidden */
90150
+ 403: {
90151
+ headers: {
90152
+ [name: string]: unknown;
90153
+ };
90154
+ content: {
90155
+ "application/json": components["schemas"]["Error"];
90156
+ };
90157
+ };
90158
+ /** @description Not found */
90159
+ 404: {
90160
+ headers: {
90161
+ [name: string]: unknown;
90162
+ };
90163
+ content: {
90164
+ "application/json": components["schemas"]["Error"];
90165
+ };
90166
+ };
90167
+ /** @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. */
90168
+ 409: {
90169
+ headers: {
90170
+ [name: string]: unknown;
90171
+ };
90172
+ content: {
90173
+ /**
90174
+ * @example {
90175
+ * "error": {
90176
+ * "code": "ADS_KEY_NEEDS_REMINT",
90177
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
90178
+ * "details": {
90179
+ * "key_kind": "core"
90180
+ * }
90181
+ * }
90182
+ * }
90183
+ */
90184
+ "application/json": components["schemas"]["Error"];
90185
+ };
90186
+ };
90187
+ /** @description Rate limited */
90188
+ 429: {
90189
+ headers: {
90190
+ [name: string]: unknown;
90191
+ };
90192
+ content: {
90193
+ "application/json": components["schemas"]["Error"];
90194
+ };
90195
+ };
90196
+ };
90197
+ };
90198
+ delete?: never;
90199
+ options?: never;
90200
+ head?: never;
90201
+ patch?: never;
90202
+ trace?: never;
90203
+ };
89160
90204
  "/ads/tracking/key": {
89161
90205
  parameters: {
89162
90206
  query?: never;
@@ -89165,12 +90209,315 @@ interface paths {
89165
90209
  cookie?: never;
89166
90210
  };
89167
90211
  /**
89168
- * The workspace's tracking key and the tag to paste
89169
- * @description Ensures an active tracking key exists for the workspace (minting one on the first call — idempotent, a repeat never mints a second key) and returns the tag to paste. `combined_snippet` is THE tag: Vitrina's one-line loader (`<script src=".../tag.js?site=pk_…">`), which boots the assistant and the measurement from the same tag. Its site key (`site_key`) is the newest unexpired publishable key of the workspace, or — when it has none — one minted on this read for the workspace's Vitrina site, registered domains and declared website, and listed afterwards among its publishable keys. `combined_snippet` and `site_key` are `null` only when no origin can be derived at all.
90212
+ * The workspace's tracking key and the tag to paste
90213
+ * @description Ensures an active tracking key exists for the workspace (minting one on the first call — idempotent, a repeat never mints a second key) and returns the tag to paste. `combined_snippet` is THE tag: Vitrina's one-line loader (`<script src=".../tag.js?site=pk_…">`), which boots the assistant and the measurement from the same tag. Its site key (`site_key`) is the newest unexpired publishable key of the workspace, or — when it has none — one minted on this read for the workspace's Vitrina site, registered domains and declared website, and listed afterwards among its publishable keys. `combined_snippet` and `site_key` are `null` only when no origin can be derived at all.
90214
+ *
90215
+ * `snippet` is the measurement provider's raw tracker script (the tracking half alone), kept for API consumers that self-host it; Vitrina's own UI renders `combined_snippet` only. `meta_pixel_id` is present when the workspace has a Meta pixel configured.
90216
+ *
90217
+ * 402 `ENTITLEMENT_NOT_ACTIVE` (`feature: vitrina_ads`) when Vitrina Ads is not active for this workspace; 409 `ADS_KEY_NEEDS_REMINT` when the Add-on is on but the delegated key has not finished rotating. Admin-scoped (`ads:read`).
90218
+ */
90219
+ get: {
90220
+ parameters: {
90221
+ query?: never;
90222
+ header?: never;
90223
+ path?: never;
90224
+ cookie?: never;
90225
+ };
90226
+ requestBody?: never;
90227
+ responses: {
90228
+ /** @description The tracking key and the tag to paste */
90229
+ 200: {
90230
+ headers: {
90231
+ [name: string]: unknown;
90232
+ };
90233
+ content: {
90234
+ /**
90235
+ * @example {
90236
+ * "data": {
90237
+ * "key_id": "abababab-0000-4000-8000-000000000001",
90238
+ * "public_key": "trk_live_abc123",
90239
+ * "snippet": "<script src=\"https://track.atribu.app/t.js?k=trk_live_abc123\" async></script>",
90240
+ * "combined_snippet": "<script src=\"https://api.vitrinadev.com/tag.js?site=pk_live_sitekey000000000000\" async></script>",
90241
+ * "site_key": "pk_live_sitekey000000000000",
90242
+ * "meta_pixel_id": null
90243
+ * }
90244
+ * }
90245
+ */
90246
+ "application/json": {
90247
+ data: components["schemas"]["AdsTrackingKey"];
90248
+ };
90249
+ };
90250
+ };
90251
+ /** @description Validation error */
90252
+ 400: {
90253
+ headers: {
90254
+ [name: string]: unknown;
90255
+ };
90256
+ content: {
90257
+ "application/json": components["schemas"]["Error"];
90258
+ };
90259
+ };
90260
+ /** @description Unauthorized */
90261
+ 401: {
90262
+ headers: {
90263
+ [name: string]: unknown;
90264
+ };
90265
+ content: {
90266
+ "application/json": components["schemas"]["Error"];
90267
+ };
90268
+ };
90269
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
90270
+ 402: {
90271
+ headers: {
90272
+ [name: string]: unknown;
90273
+ };
90274
+ content: {
90275
+ /**
90276
+ * @example {
90277
+ * "error": {
90278
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
90279
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
90280
+ * "details": {
90281
+ * "required": [
90282
+ * "vitrina_ads"
90283
+ * ],
90284
+ * "active": [],
90285
+ * "feature": "vitrina_ads",
90286
+ * "entitlement_state": "off"
90287
+ * }
90288
+ * }
90289
+ * }
90290
+ */
90291
+ "application/json": components["schemas"]["Error"];
90292
+ };
90293
+ };
90294
+ /** @description Forbidden */
90295
+ 403: {
90296
+ headers: {
90297
+ [name: string]: unknown;
90298
+ };
90299
+ content: {
90300
+ "application/json": components["schemas"]["Error"];
90301
+ };
90302
+ };
90303
+ /** @description Not found */
90304
+ 404: {
90305
+ headers: {
90306
+ [name: string]: unknown;
90307
+ };
90308
+ content: {
90309
+ "application/json": components["schemas"]["Error"];
90310
+ };
90311
+ };
90312
+ /** @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. */
90313
+ 409: {
90314
+ headers: {
90315
+ [name: string]: unknown;
90316
+ };
90317
+ content: {
90318
+ /**
90319
+ * @example {
90320
+ * "error": {
90321
+ * "code": "ADS_KEY_NEEDS_REMINT",
90322
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
90323
+ * "details": {
90324
+ * "key_kind": "core"
90325
+ * }
90326
+ * }
90327
+ * }
90328
+ */
90329
+ "application/json": components["schemas"]["Error"];
90330
+ };
90331
+ };
90332
+ /** @description Rate limited */
90333
+ 429: {
90334
+ headers: {
90335
+ [name: string]: unknown;
90336
+ };
90337
+ content: {
90338
+ "application/json": components["schemas"]["Error"];
90339
+ };
90340
+ };
90341
+ };
90342
+ };
90343
+ put?: never;
90344
+ post?: never;
90345
+ delete?: never;
90346
+ options?: never;
90347
+ head?: never;
90348
+ patch?: never;
90349
+ trace?: never;
90350
+ };
90351
+ "/ads/tracking/installers/gtm": {
90352
+ parameters: {
90353
+ query?: never;
90354
+ header?: never;
90355
+ path?: never;
90356
+ cookie?: never;
90357
+ };
90358
+ /**
90359
+ * The tag as a ready-to-paste Google Tag Manager installer
90360
+ * @description The tag name, "All Pages" trigger, snippet and setup checklist for a Google Tag Manager Custom HTML tag. The `snippet` is the COMBINED loader (`<script src=".../tag.js?site=…">`): pasting this ONE tag boots the assistant AND starts the measurement. `tag_name` and `setup_checklist` are Vitrina-branded user-facing copy (Spanish) that names only `tag.js`.
90361
+ *
90362
+ * `site_id` (optional) is the publishable `pk_…` key of the site the tag is being installed on — embedded into the snippet's `?site=` query so the tag survives GTM stripping `data-*` off the `<script>` tag it re-creates. Absent → the workspace's own site key (the `site_key` of `GET /ads/tracking/key`, minted on first read); 400 when the workspace has none and no origin to mint one for.
90363
+ *
90364
+ * Same entitlement gate as `GET /ads/tracking/key`. Admin-scoped (`ads:read`).
90365
+ */
90366
+ get: {
90367
+ parameters: {
90368
+ query?: {
90369
+ site_id?: string;
90370
+ };
90371
+ header?: never;
90372
+ path?: never;
90373
+ cookie?: never;
90374
+ };
90375
+ requestBody?: never;
90376
+ responses: {
90377
+ /** @description The GTM Custom HTML installer payload */
90378
+ 200: {
90379
+ headers: {
90380
+ [name: string]: unknown;
90381
+ };
90382
+ content: {
90383
+ /**
90384
+ * @example {
90385
+ * "data": {
90386
+ * "key_id": "abababab-0000-4000-8000-000000000001",
90387
+ * "public_key": "trk_live_abc123",
90388
+ * "site_key": "pk_live_sitekey000000000000",
90389
+ * "tag_name": "Vitrina Ads · tag",
90390
+ * "trigger": "All Pages",
90391
+ * "snippet": "<script src=\"https://api.vitrinadev.com/tag.js?site=pk_live_sitekey000000000000\" async></script>",
90392
+ * "setup_checklist": [
90393
+ * "En Google Tag Manager, crea una etiqueta nueva de tipo «HTML personalizado».",
90394
+ * "Pega el fragmento de Vitrina (tag.js) tal cual.",
90395
+ * "Activador: All Pages.",
90396
+ * "Guarda la etiqueta y publica el contenedor.",
90397
+ * "El asistente y la medición se cargan desde este mismo tag.js: no agregues otro fragmento de Vitrina aparte."
90398
+ * ]
90399
+ * }
90400
+ * }
90401
+ */
90402
+ "application/json": {
90403
+ data: components["schemas"]["AdsGtmInstaller"];
90404
+ };
90405
+ };
90406
+ };
90407
+ /** @description Validation error */
90408
+ 400: {
90409
+ headers: {
90410
+ [name: string]: unknown;
90411
+ };
90412
+ content: {
90413
+ "application/json": components["schemas"]["Error"];
90414
+ };
90415
+ };
90416
+ /** @description Unauthorized */
90417
+ 401: {
90418
+ headers: {
90419
+ [name: string]: unknown;
90420
+ };
90421
+ content: {
90422
+ "application/json": components["schemas"]["Error"];
90423
+ };
90424
+ };
90425
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
90426
+ 402: {
90427
+ headers: {
90428
+ [name: string]: unknown;
90429
+ };
90430
+ content: {
90431
+ /**
90432
+ * @example {
90433
+ * "error": {
90434
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
90435
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
90436
+ * "details": {
90437
+ * "required": [
90438
+ * "vitrina_ads"
90439
+ * ],
90440
+ * "active": [],
90441
+ * "feature": "vitrina_ads",
90442
+ * "entitlement_state": "off"
90443
+ * }
90444
+ * }
90445
+ * }
90446
+ */
90447
+ "application/json": components["schemas"]["Error"];
90448
+ };
90449
+ };
90450
+ /** @description Forbidden */
90451
+ 403: {
90452
+ headers: {
90453
+ [name: string]: unknown;
90454
+ };
90455
+ content: {
90456
+ "application/json": components["schemas"]["Error"];
90457
+ };
90458
+ };
90459
+ /** @description Not found */
90460
+ 404: {
90461
+ headers: {
90462
+ [name: string]: unknown;
90463
+ };
90464
+ content: {
90465
+ "application/json": components["schemas"]["Error"];
90466
+ };
90467
+ };
90468
+ /** @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. */
90469
+ 409: {
90470
+ headers: {
90471
+ [name: string]: unknown;
90472
+ };
90473
+ content: {
90474
+ /**
90475
+ * @example {
90476
+ * "error": {
90477
+ * "code": "ADS_KEY_NEEDS_REMINT",
90478
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
90479
+ * "details": {
90480
+ * "key_kind": "core"
90481
+ * }
90482
+ * }
90483
+ * }
90484
+ */
90485
+ "application/json": components["schemas"]["Error"];
90486
+ };
90487
+ };
90488
+ /** @description Rate limited */
90489
+ 429: {
90490
+ headers: {
90491
+ [name: string]: unknown;
90492
+ };
90493
+ content: {
90494
+ "application/json": components["schemas"]["Error"];
90495
+ };
90496
+ };
90497
+ };
90498
+ };
90499
+ put?: never;
90500
+ post?: never;
90501
+ delete?: never;
90502
+ options?: never;
90503
+ head?: never;
90504
+ patch?: never;
90505
+ trace?: never;
90506
+ };
90507
+ "/ads/tracking/status": {
90508
+ parameters: {
90509
+ query?: never;
90510
+ header?: never;
90511
+ path?: never;
90512
+ cookie?: never;
90513
+ };
90514
+ /**
90515
+ * Is the tag installed? Last event seen, events in 24 h, domain
90516
+ * @description Tag detection for the workspace's tracking key. `source: tracker` (the normal case) reads the measurement provider's per-key last-event time (`last_seen_at`), the tracker events of the last 24 hours (`events_24h`) and the hostname of the latest verified install check (`domain`). `installed` is `true` only when the tag sent an event in the last 30 days — never without a timestamp.
89170
90517
  *
89171
- * `snippet` is the measurement provider's raw tracker script (the tracking half alone), kept for API consumers that self-host it; Vitrina's own UI renders `combined_snippet` only. `meta_pixel_id` is present when the workspace has a Meta pixel configured.
90518
+ * When the per-key read is unavailable the answer falls back to the health read's daily UTM scan: `source: health`, `installed` = the refreshed scan counted events, `last_seen_at` / `events_24h` / `domain` = `null`. `events_24h` is `null` (never `0`) whenever the count could not be read.
89172
90519
  *
89173
- * 402 `ENTITLEMENT_NOT_ACTIVE` (`feature: vitrina_ads`) when Vitrina Ads is not active for this workspace; 409 `ADS_KEY_NEEDS_REMINT` when the Add-on is on but the delegated key has not finished rotating. Admin-scoped (`ads:read`).
90520
+ * Same entitlement gate as `GET /ads/tracking/key`. Admin-scoped (`ads:read`).
89174
90521
  */
89175
90522
  get: {
89176
90523
  parameters: {
@@ -89181,7 +90528,7 @@ interface paths {
89181
90528
  };
89182
90529
  requestBody?: never;
89183
90530
  responses: {
89184
- /** @description The tracking key and the tag to paste */
90531
+ /** @description The tag detection status */
89185
90532
  200: {
89186
90533
  headers: {
89187
90534
  [name: string]: unknown;
@@ -89190,17 +90537,16 @@ interface paths {
89190
90537
  /**
89191
90538
  * @example {
89192
90539
  * "data": {
89193
- * "key_id": "abababab-0000-4000-8000-000000000001",
89194
- * "public_key": "trk_live_abc123",
89195
- * "snippet": "<script src=\"https://track.atribu.app/t.js?k=trk_live_abc123\" async></script>",
89196
- * "combined_snippet": "<script src=\"https://api.vitrinadev.com/tag.js?site=pk_live_sitekey000000000000\" async></script>",
89197
- * "site_key": "pk_live_sitekey000000000000",
89198
- * "meta_pixel_id": null
90540
+ * "installed": true,
90541
+ * "last_seen_at": "2026-09-23T14:02:11.000Z",
90542
+ * "events_24h": 184,
90543
+ * "domain": "www.clinica-ejemplo.cl",
90544
+ * "source": "tracker"
89199
90545
  * }
89200
90546
  * }
89201
90547
  */
89202
90548
  "application/json": {
89203
- data: components["schemas"]["AdsTrackingKey"];
90549
+ data: components["schemas"]["AdsTrackingStatus"];
89204
90550
  };
89205
90551
  };
89206
90552
  };
@@ -89304,7 +90650,7 @@ interface paths {
89304
90650
  patch?: never;
89305
90651
  trace?: never;
89306
90652
  };
89307
- "/ads/tracking/installers/gtm": {
90653
+ "/ads/feed": {
89308
90654
  parameters: {
89309
90655
  query?: never;
89310
90656
  header?: never;
@@ -89312,17 +90658,34 @@ interface paths {
89312
90658
  cookie?: never;
89313
90659
  };
89314
90660
  /**
89315
- * The tag as a ready-to-paste Google Tag Manager installer
89316
- * @description The tag name, "All Pages" trigger, snippet and setup checklist for a Google Tag Manager Custom HTML tag. The `snippet` is the COMBINED loader (`<script src=".../tag.js?site=…">`): pasting this ONE tag boots the assistant AND starts the measurement. `tag_name` and `setup_checklist` are Vitrina-branded user-facing copy (Spanish) that names only `tag.js`.
90661
+ * The live feed of recorded outcomes
90662
+ * @description Every outcome Vitrina recorded for the workspace (a lead, a booking, an attended visit, a presented quote, a closed sale, a payment), newest first — Vitrina’s own ledger, so a row appears the moment it happens, not after the engine’s daily sync. A row names the campaign the attribution engine credited (`ad`, from a cache refreshed every 5 minutes over the requested window, up to 92 days back; `null` until then — `meta.enrichment` says whether it is complete — with `matched: true` that reads «anuncio por confirmar»).
89317
90663
  *
89318
- * `site_id` (optional) is the publishable `pk_…` key of the site the tag is being installed on — embedded into the snippet's `?site=` query so the tag survives GTM stripping `data-*` off the `<script>` tag it re-creates. Absent → the workspace's own site key (the `site_key` of `GET /ads/tracking/key`, minted on first read); 400 when the workspace has none and no origin to mint one for.
90664
+ * `contact.display_name` is filled only for a caller that also holds `contacts:read`; everyone else gets `null` and `contact.key` (the last 4 hex of the contact id).
89319
90665
  *
89320
- * Same entitlement gate as `GET /ads/tracking/key`. Admin-scoped (`ads:read`).
90666
+ * Polling: call with `since=<newest created_at seen>` (verbatim); the answer re-includes the 5 seconds before it, so dedupe by `id`. Paging: `before=<meta.next_before>` (verbatim; when a polling page comes back full, page down with `before` + the same `since` to close the gap). `only_ads=1` / `campaign_id` keep the rows the engine credited (to that campaign). With `sample=1` answers the sample dataset’s feed.
89321
90667
  */
89322
90668
  get: {
89323
90669
  parameters: {
89324
- query?: {
89325
- site_id?: string;
90670
+ query: {
90671
+ /** @description Window start (inclusive, Santiago day), YYYY-MM-DD. */
90672
+ from: string;
90673
+ /** @description Window end (inclusive, Santiago day), YYYY-MM-DD. */
90674
+ to: string;
90675
+ /** @description Only outcomes of this stage. */
90676
+ stage?: "lead_created" | "appointment_booked" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received";
90677
+ /** @description `1` keeps only outcomes the engine credited to a campaign (the enrichment covers the requested window, up to 92 days back; check `meta.enrichment`). */
90678
+ only_ads?: "1" | "true";
90679
+ /** @description Only outcomes credited to this campaign (its PLATFORM id). */
90680
+ campaign_id?: string;
90681
+ /** @description Polling cursor: pass back the newest `created_at` seen, verbatim. The answer re-includes the 5 seconds before it (an outcome committed late with an earlier timestamp is not lost) — dedupe by `id`. */
90682
+ since?: string;
90683
+ /** @description Paging cursor: `meta.next_before` of the previous page, verbatim (`<created_at>,<id>` — the id breaks ties between rows recorded in the same instant). Combine with `since` to fill a gap after a full polling page. */
90684
+ before?: string;
90685
+ /** @description Page size, 1–50. Defaults to 30. */
90686
+ limit?: number;
90687
+ /** @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. */
90688
+ sample?: "1" | "true";
89326
90689
  };
89327
90690
  header?: never;
89328
90691
  path?: never;
@@ -89330,7 +90693,7 @@ interface paths {
89330
90693
  };
89331
90694
  requestBody?: never;
89332
90695
  responses: {
89333
- /** @description The GTM Custom HTML installer payload */
90696
+ /** @description A page of the feed, newest first */
89334
90697
  200: {
89335
90698
  headers: {
89336
90699
  [name: string]: unknown;
@@ -89338,25 +90701,68 @@ interface paths {
89338
90701
  content: {
89339
90702
  /**
89340
90703
  * @example {
89341
- * "data": {
89342
- * "key_id": "abababab-0000-4000-8000-000000000001",
89343
- * "public_key": "trk_live_abc123",
89344
- * "site_key": "pk_live_sitekey000000000000",
89345
- * "tag_name": "Vitrina Ads · tag",
89346
- * "trigger": "All Pages",
89347
- * "snippet": "<script src=\"https://api.vitrinadev.com/tag.js?site=pk_live_sitekey000000000000\" async></script>",
89348
- * "setup_checklist": [
89349
- * "En Google Tag Manager, crea una etiqueta nueva de tipo «HTML personalizado».",
89350
- * "Pega el fragmento de Vitrina (tag.js) tal cual.",
89351
- * "Activador: All Pages.",
89352
- * "Guarda la etiqueta y publica el contenedor.",
89353
- * "El asistente y la medición se cargan desde este mismo tag.js: no agregues otro fragmento de Vitrina aparte."
89354
- * ]
90704
+ * "data": [
90705
+ * {
90706
+ * "id": "01926f3e-7c1a-7b2e-9f10-3a5b7c9d0e1f",
90707
+ * "stage": "closed_won",
90708
+ * "occurred_at": "2026-09-22T19:40:12.000Z",
90709
+ * "created_at": "2026-09-22T19:40:13.482913Z",
90710
+ * "matched": true,
90711
+ * "value": 1200000,
90712
+ * "action_source": "business_messaging",
90713
+ * "contact": {
90714
+ * "id": "5b0c2f1e-8a3d-4c6b-9e7f-1a2b3c4d5e6f",
90715
+ * "display_name": "Paciente Ejemplo",
90716
+ * "key": "5e6f"
90717
+ * },
90718
+ * "ad": {
90719
+ * "name": null,
90720
+ * "ad_set_name": null,
90721
+ * "campaign": {
90722
+ * "external_id": "120211000000000001",
90723
+ * "name": "Ortodoncia invisible · Septiembre"
90724
+ * }
90725
+ * },
90726
+ * "credited_weight": 1,
90727
+ * "touch_count": 3
90728
+ * },
90729
+ * {
90730
+ * "id": "01926f3a-1b2c-7d3e-8f40-5a6b7c8d9e0f",
90731
+ * "stage": "appointment_booked",
90732
+ * "occurred_at": "2026-09-22T18:02:55.000Z",
90733
+ * "created_at": "2026-09-22T18:02:56.104220Z",
90734
+ * "matched": true,
90735
+ * "value": null,
90736
+ * "action_source": "business_messaging",
90737
+ * "contact": {
90738
+ * "id": "7c1d3e2f-9b4a-4d5c-8e6f-2b3c4d5e6f70",
90739
+ * "display_name": null,
90740
+ * "key": "6f70"
90741
+ * },
90742
+ * "ad": null,
90743
+ * "credited_weight": null,
90744
+ * "touch_count": null
90745
+ * }
90746
+ * ],
90747
+ * "meta": {
90748
+ * "next_before": "2026-09-22T18:02:56.104220Z,01926f3a-1b2c-7d3e-8f40-5a6b7c8d9e0f",
90749
+ * "server_time": "2026-09-22T19:41:00.000Z",
90750
+ * "enrichment": "ready"
89355
90751
  * }
89356
90752
  * }
89357
90753
  */
89358
90754
  "application/json": {
89359
- data: components["schemas"]["AdsGtmInstaller"];
90755
+ data: components["schemas"]["AdsFeedItem"][];
90756
+ meta: {
90757
+ /** @description Opaque cursor (`<created_at>,<id>`): pass as `before` for the next (older) page; `null` at the end. */
90758
+ next_before: string | null;
90759
+ server_time: string;
90760
+ /**
90761
+ * @description Whether the campaign credit on this page is complete: `pending` — still being read, retry shortly (a matched row may show `ad: null` and `only_ads` may be short); `unavailable` — the attribution engine could not be read in the last minute.
90762
+ * @enum {string}
90763
+ */
90764
+ enrichment: "ready" | "pending" | "unavailable";
90765
+ };
89360
90766
  };
89361
90767
  };
89362
90768
  };
@@ -89460,7 +90866,7 @@ interface paths {
89460
90866
  patch?: never;
89461
90867
  trace?: never;
89462
90868
  };
89463
- "/ads/tracking/status": {
90869
+ "/ads/feed/{id}/journey": {
89464
90870
  parameters: {
89465
90871
  query?: never;
89466
90872
  header?: never;
@@ -89468,23 +90874,29 @@ interface paths {
89468
90874
  cookie?: never;
89469
90875
  };
89470
90876
  /**
89471
- * Is the tag installed? Last event seen, events in 24 h, domain
89472
- * @description Tag detection for the workspace's tracking key. `source: tracker` (the normal case) reads the measurement provider's per-key last-event time (`last_seen_at`), the tracker events of the last 24 hours (`events_24h`) and the hostname of the latest verified install check (`domain`). `installed` is `true` only when the tag sent an event in the last 30 days — never without a timestamp.
89473
- *
89474
- * When the per-key read is unavailable the answer falls back to the health read's daily UTM scan: `source: health`, `installed` = the refreshed scan counted events, `last_seen_at` / `events_24h` / `domain` = `null`. `events_24h` is `null` (never `0`) whenever the count could not be read.
89475
- *
89476
- * Same entitlement gate as `GET /ads/tracking/key`. Admin-scoped (`ads:read`).
90877
+ * One feed row’s path to its outcome
90878
+ * @description The touches that led to one recorded outcome, oldest first, ending at the outcome: ad views and clicks (ad and campaign names), site visits, conversations. From the attribution engine (`source: engine`) when it credited the outcome and the delegated key may read people; otherwise Vitrina’s own record of this contact’s outcomes (`source: vitrina`) — still a path, without the ad touches. Never carries a URL, referrer, email or device. 404 when the id is not a live row of this workspace. With `sample=1` answers the sample dataset’s journey (pass the feed’s `from`/`to` when it was not the last 30 days).
89477
90879
  */
89478
90880
  get: {
89479
90881
  parameters: {
89480
- query?: never;
90882
+ query?: {
90883
+ /** @description Sample mode only: the feed window the item came from (defaults to the last 30 days). Ignored for real data. */
90884
+ from?: string;
90885
+ /** @description Sample mode only — see `from`. */
90886
+ to?: string;
90887
+ /** @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. */
90888
+ sample?: "1" | "true";
90889
+ };
89481
90890
  header?: never;
89482
- path?: never;
90891
+ path: {
90892
+ /** @description The feed item id (`data[].id`). */
90893
+ id: string;
90894
+ };
89483
90895
  cookie?: never;
89484
90896
  };
89485
90897
  requestBody?: never;
89486
90898
  responses: {
89487
- /** @description The tag detection status */
90899
+ /** @description The journey */
89488
90900
  200: {
89489
90901
  headers: {
89490
90902
  [name: string]: unknown;
@@ -89493,16 +90905,44 @@ interface paths {
89493
90905
  /**
89494
90906
  * @example {
89495
90907
  * "data": {
89496
- * "installed": true,
89497
- * "last_seen_at": "2026-09-23T14:02:11.000Z",
89498
- * "events_24h": 184,
89499
- * "domain": "www.clinica-ejemplo.cl",
89500
- * "source": "tracker"
90908
+ * "steps": [
90909
+ * {
90910
+ * "kind": "ad",
90911
+ * "label": "Reel · Antes y después",
90912
+ * "detail": "Ortodoncia invisible · Septiembre",
90913
+ * "at": "2026-09-19T21:10:00.000Z",
90914
+ * "channel": "meta"
90915
+ * },
90916
+ * {
90917
+ * "kind": "click",
90918
+ * "label": "Reel · Antes y después",
90919
+ * "detail": "Ortodoncia invisible · Septiembre",
90920
+ * "at": "2026-09-20T13:02:00.000Z",
90921
+ * "channel": "meta"
90922
+ * },
90923
+ * {
90924
+ * "kind": "chat",
90925
+ * "label": "Conversación",
90926
+ * "detail": null,
90927
+ * "at": "2026-09-20T13:03:00.000Z",
90928
+ * "channel": "whatsapp"
90929
+ * },
90930
+ * {
90931
+ * "kind": "outcome",
90932
+ * "label": "Presupuesto aceptado",
90933
+ * "detail": null,
90934
+ * "at": "2026-09-22T19:40:12.000Z"
90935
+ * }
90936
+ * ],
90937
+ * "touch_count": 3,
90938
+ * "credited_weight": 1,
90939
+ * "model": "last_touch",
90940
+ * "source": "engine"
89501
90941
  * }
89502
90942
  * }
89503
90943
  */
89504
90944
  "application/json": {
89505
- data: components["schemas"]["AdsTrackingStatus"];
90945
+ data: components["schemas"]["AdsJourney"];
89506
90946
  };
89507
90947
  };
89508
90948
  };
@@ -108689,6 +110129,100 @@ interface components {
108689
110129
  /** @description `false` in sample mode: the goal was validated but not stored. */
108690
110130
  persisted?: boolean;
108691
110131
  } | null;
110132
+ AdsAction: {
110133
+ /** @description `<kind>:<target external id>:<YYYY-MM-DD>` — a composite key, stable for a day. */
110134
+ key: string;
110135
+ /** @enum {string} */
110136
+ kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "nav";
110137
+ screen: ("resumen" | "campanas" | "creativos" | "salud")[];
110138
+ /** @description The one card the rail leads with. */
110139
+ primary: boolean;
110140
+ title: string;
110141
+ /** @description Spanish; `**bold**` is the only markup. */
110142
+ why: string;
110143
+ effect: string | null;
110144
+ target: {
110145
+ /** @enum {string} */
110146
+ level: "ad" | "ad_set" | "campaign" | "profile";
110147
+ /** @description The Meta id of the object (null for profile-level actions). */
110148
+ external_id: string | null;
110149
+ name: string | null;
110150
+ campaign_external_id?: string | null;
110151
+ };
110152
+ /** @description The engine’s own vocabulary, e.g. `{ budget_change_pct: 20 }`. */
110153
+ params: {
110154
+ [key: string]: unknown;
110155
+ };
110156
+ reversible: boolean;
110157
+ /** @enum {string|null} */
110158
+ risk: "reversible" | "learning_reset" | "consequences" | null;
110159
+ /** @description Which operation executes it; `null` for `nav`. */
110160
+ engine_ref: {
110161
+ /** @enum {string} */
110162
+ op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback";
110163
+ recommendation_id?: string;
110164
+ } | null;
110165
+ /** @description `nav` only: a workspace-relative path. */
110166
+ href?: string;
110167
+ cta?: string;
110168
+ /** @description Fact keys the card is built from. */
110169
+ facts: string[];
110170
+ dismissed_until: string | null;
110171
+ };
110172
+ AdsActionPreview: {
110173
+ /** Format: uuid */
110174
+ preview_id: string;
110175
+ expires_at: string;
110176
+ action_key: string;
110177
+ rows: {
110178
+ key: string;
110179
+ label: string;
110180
+ before: string;
110181
+ after: string;
110182
+ }[];
110183
+ warnings: string[];
110184
+ /** @description Duplicate-and-swap only: `consent_terms.text` split into lines, for display (verbatim). */
110185
+ consent: string[];
110186
+ /** @description Duplicate-and-swap only: what the owner accepts before confirming. Execute must send `consent: { version, text_hash }`. */
110187
+ consent_terms: {
110188
+ version: string;
110189
+ /** @enum {string} */
110190
+ locale: "es";
110191
+ /** @description The consent text, VERBATIM — render it as is (plain text, `\n` line breaks, `- ` bullets). */
110192
+ text: string;
110193
+ /** @description SHA-256 (lowercase hex, UTF-8) of `text`. */
110194
+ text_hash: string;
110195
+ } | null;
110196
+ reversible: boolean;
110197
+ /** @enum {string|null} */
110198
+ engine_op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | null;
110199
+ };
110200
+ AdsActionExecution: {
110201
+ /** Format: uuid */
110202
+ id: string;
110203
+ action_key: string;
110204
+ /** @enum {string} */
110205
+ kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck";
110206
+ /** @enum {string} */
110207
+ status: "queued" | "running" | "succeeded" | "failed" | "refused" | "rolled_back";
110208
+ outcome: {
110209
+ summary: string;
110210
+ engine_action_id: string | null;
110211
+ applied_at: string | null;
110212
+ } | null;
110213
+ error: {
110214
+ code: string;
110215
+ /** @enum {string} */
110216
+ reason: "promoted_object_frozen" | "reconnect_required" | "permission_gap" | "rate_limited" | "not_reversible" | "forbidden" | "consent_required" | "engine_error";
110217
+ message: string;
110218
+ } | null;
110219
+ rollback_available: boolean;
110220
+ /** Format: uuid */
110221
+ rollback_of: string | null;
110222
+ simulated: boolean;
110223
+ created_at: string;
110224
+ finished_at: string | null;
110225
+ };
108692
110226
  AdsTrackingKey: {
108693
110227
  key_id: string;
108694
110228
  public_key: string;
@@ -108714,6 +110248,59 @@ interface components {
108714
110248
  /** @enum {string} */
108715
110249
  source: "tracker" | "health";
108716
110250
  };
110251
+ AdsFeedItem: {
110252
+ /** Format: uuid */
110253
+ id: string;
110254
+ /** @enum {string} */
110255
+ stage: "lead_created" | "appointment_booked" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received";
110256
+ /** @description When the outcome happened. */
110257
+ occurred_at: string;
110258
+ /** @description When Vitrina recorded it — the cursor field, microsecond-exact. */
110259
+ created_at: string;
110260
+ /** @description The engine accepted the outcome as a conversion it can attribute. `true` with `ad: null` = «anuncio por confirmar». */
110261
+ matched: boolean;
110262
+ /** @description CLP for money stages; `null` otherwise (never 0). */
110263
+ value: number | null;
110264
+ /** @enum {string} */
110265
+ action_source: "website" | "business_messaging" | "physical_store" | "system_generated" | "phone_call" | "chat" | "email" | "app" | "other";
110266
+ contact: {
110267
+ id: string;
110268
+ /** @description Only when the caller holds `contacts:read`; else `null`. */
110269
+ display_name: string | null;
110270
+ /** @description Last 4 hex of the contact id. */
110271
+ key: string;
110272
+ };
110273
+ /** @description The campaign the engine credited; `null` until it has. Campaign-grain today: `name`/`ad_set_name` are `null` for real data. */
110274
+ ad: {
110275
+ name: string | null;
110276
+ ad_set_name: string | null;
110277
+ campaign: {
110278
+ /** @description The campaign’s PLATFORM id (what `campaign_id` filters on). */
110279
+ external_id: string;
110280
+ name: string;
110281
+ };
110282
+ } | null;
110283
+ credited_weight: number | null;
110284
+ touch_count: number | null;
110285
+ };
110286
+ AdsJourney: {
110287
+ steps: {
110288
+ /** @enum {string} */
110289
+ kind: "ad" | "click" | "visit" | "chat" | "outcome";
110290
+ label: string;
110291
+ detail: string | null;
110292
+ at: string;
110293
+ channel?: string;
110294
+ }[];
110295
+ touch_count: number;
110296
+ credited_weight: number | null;
110297
+ model: string;
110298
+ /**
110299
+ * @description `engine` = the attribution engine’s touches; `vitrina` = only the outcomes Vitrina recorded for this contact (the delegated key cannot read people, or the engine has no path for it yet).
110300
+ * @enum {string}
110301
+ */
110302
+ source: "engine" | "vitrina";
110303
+ };
108717
110304
  };
108718
110305
  responses: never;
108719
110306
  parameters: never;
@@ -108774,7 +110361,7 @@ declare function createClient(opts: CreateClientOptions): VitrinaClient;
108774
110361
  * is regenerated — narrow on the ones you handle, never assume this
108775
110362
  * list is exhaustive at runtime.
108776
110363
  */
108777
- type ErrorCode = 'VALIDATION_ERROR' | 'NOT_FOUND' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UNIQUE_CONFLICT' | 'IDEMPOTENCY_KEY_CONFLICT' | 'VERTICAL_NOT_ENABLED' | 'ENTITLEMENT_NOT_ACTIVE' | 'UNSUPPORTED_VEHICLE_TYPE' | 'NO_OFFERING_ADAPTER' | 'PAYLOAD_TOO_LARGE' | 'UNSUPPORTED_MEDIA_TYPE' | 'UPSTREAM_ERROR' | 'RATE_LIMITED' | 'GONE' | 'INTERNAL_ERROR' | 'MESSAGING_ACCOUNT_TENANT_MISSING' | 'COPILOT_APPROVALS_UNAVAILABLE' | 'COPILOT_APPROVAL_REPLAY_BLOCKED' | 'DEALER_SITES_NOT_CONFIGURED' | 'STOREFRONT_ZONES_NOT_CONFIGURED' | 'RECONTACTO_NOT_ENABLED' | 'SYNC_QUEUE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_MISMATCH' | 'ADS_KEY_NEEDS_REMINT' | 'MISSING_SIGNATURE' | 'MALFORMED_SIGNATURE' | 'STALE_SIGNATURE' | 'INVALID_SIGNATURE' | 'REPLAY_DETECTED' | 'TURNSTILE_UNAVAILABLE' | 'TASADOR_QUOTA_EXHAUSTED' | 'TASADOR_ANON_DAILY_LIMIT' | 'TASADOR_CAPACITY_REACHED' | 'CLINIC_PLAN_REQUIRED' | 'TENANT_BILLING_PAUSED' | 'FACEBOOK_MARKETPLACE_NOT_AVAILABLE' | 'WORKSPACE_MEMBER_INACTIVE' | 'DEVICE_AGENT_ALREADY_PAIRED' | 'DEVICE_AGENT_SELF_REQUIRES_USER' | 'DEVICE_AGENT_KIND_NOT_ALLOWED' | 'DEVICE_TASK_STATUS_NOT_ALLOWED' | 'FACEBOOK_MARKETPLACE_NO_PHONE_AGENT' | 'FACEBOOK_MARKETPLACE_THREAD_NOT_ADDRESSABLE' | 'FACEBOOK_MARKETPLACE_ATTACHMENT_UNSUPPORTED' | 'REPLY_PACING_LOCKED' | 'SANDBOX_CHANNEL_FORBIDDEN' | 'SANDBOX_BILLING_FORBIDDEN' | 'SANDBOX_NOT_PROVISIONED' | 'SANDBOX_RESET_UNAVAILABLE' | 'CONNECTED_APP_SENSITIVE_DATA' | 'handoff_mismatch' | 'sync_in_flight' | 'atribu_refused' | 'start_again' | 'reconnect' | 'partner_token_invalid' | 'OUTBOUND_BLOCKED' | 'OUTBOUND_WARNING' | 'dpa_acceptance_required' | 'EMAIL_SENDER_UNRESOLVED' | 'CAMPAIGN_FROM_CONNECTED_MAILBOX' | 'BANK_FEED_NOT_CONFIGURED' | 'ADDON_NOT_PRICED' | 'MIRROR_LINES_UNMAPPED';
110364
+ type ErrorCode = 'VALIDATION_ERROR' | 'NOT_FOUND' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UNIQUE_CONFLICT' | 'IDEMPOTENCY_KEY_CONFLICT' | 'VERTICAL_NOT_ENABLED' | 'ENTITLEMENT_NOT_ACTIVE' | 'UNSUPPORTED_VEHICLE_TYPE' | 'NO_OFFERING_ADAPTER' | 'PAYLOAD_TOO_LARGE' | 'UNSUPPORTED_MEDIA_TYPE' | 'UPSTREAM_ERROR' | 'RATE_LIMITED' | 'GONE' | 'INTERNAL_ERROR' | 'MESSAGING_ACCOUNT_TENANT_MISSING' | 'COPILOT_APPROVALS_UNAVAILABLE' | 'COPILOT_APPROVAL_REPLAY_BLOCKED' | 'DEALER_SITES_NOT_CONFIGURED' | 'STOREFRONT_ZONES_NOT_CONFIGURED' | 'RECONTACTO_NOT_ENABLED' | 'SYNC_QUEUE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_MISMATCH' | 'ADS_KEY_NEEDS_REMINT' | 'ADS_ACTION_REPLAY_BLOCKED' | 'ADS_ACTION_NOT_AVAILABLE' | 'ADS_ACTION_NOT_REVERSIBLE' | 'ADS_ACTION_CONSENT_REQUIRED' | 'MISSING_SIGNATURE' | 'MALFORMED_SIGNATURE' | 'STALE_SIGNATURE' | 'INVALID_SIGNATURE' | 'REPLAY_DETECTED' | 'TURNSTILE_UNAVAILABLE' | 'TASADOR_QUOTA_EXHAUSTED' | 'TASADOR_ANON_DAILY_LIMIT' | 'TASADOR_CAPACITY_REACHED' | 'CLINIC_PLAN_REQUIRED' | 'TENANT_BILLING_PAUSED' | 'FACEBOOK_MARKETPLACE_NOT_AVAILABLE' | 'WORKSPACE_MEMBER_INACTIVE' | 'DEVICE_AGENT_ALREADY_PAIRED' | 'DEVICE_AGENT_SELF_REQUIRES_USER' | 'DEVICE_AGENT_KIND_NOT_ALLOWED' | 'DEVICE_TASK_STATUS_NOT_ALLOWED' | 'FACEBOOK_MARKETPLACE_NO_PHONE_AGENT' | 'FACEBOOK_MARKETPLACE_THREAD_NOT_ADDRESSABLE' | 'FACEBOOK_MARKETPLACE_ATTACHMENT_UNSUPPORTED' | 'REPLY_PACING_LOCKED' | 'SANDBOX_CHANNEL_FORBIDDEN' | 'SANDBOX_BILLING_FORBIDDEN' | 'SANDBOX_NOT_PROVISIONED' | 'SANDBOX_RESET_UNAVAILABLE' | 'CONNECTED_APP_SENSITIVE_DATA' | 'handoff_mismatch' | 'sync_in_flight' | 'atribu_refused' | 'start_again' | 'reconnect' | 'partner_token_invalid' | 'OUTBOUND_BLOCKED' | 'OUTBOUND_WARNING' | 'dpa_acceptance_required' | 'EMAIL_SENDER_UNRESOLVED' | 'CAMPAIGN_FROM_CONNECTED_MAILBOX' | 'BANK_FEED_NOT_CONFIGURED' | 'ADDON_NOT_PRICED' | 'MIRROR_LINES_UNMAPPED';
108778
110365
  declare const ERROR_CODES: readonly ErrorCode[];
108779
110366
 
108780
110367
  /**