@vitrina/api 11.5.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.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2618 -241
- package/dist/index.d.ts +2618 -241
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -9
package/dist/index.d.cts
CHANGED
|
@@ -4598,7 +4598,7 @@ interface paths {
|
|
|
4598
4598
|
get?: never;
|
|
4599
4599
|
/**
|
|
4600
4600
|
* Assign a ticket to a teammate or a team
|
|
4601
|
-
* @description Send at least one of `handler`, `assignee_user_id`, `team_id`; an empty body is a 400. `null` on either id CLEARS it, omitting the key leaves it alone — two different requests, and the server tells them apart. Assigning drops a system line in the origin conversation naming the author («Camila», «Camila vía Claude», «CRM
|
|
4601
|
+
* @description Send at least one of `handler`, `assignee_user_id`, `team_id`; an empty body is a 400. `null` on either id CLEARS it, omitting the key leaves it alone — two different requests, and the server tells them apart. Assigning drops a system line in the origin conversation naming the author («Camila», «Camila vía Claude», «CRM propio (API)»).
|
|
4602
4602
|
*
|
|
4603
4603
|
* This is the key-friendly counterpart of `POST /tickets/{id}/claim`.
|
|
4604
4604
|
*/
|
|
@@ -5610,7 +5610,7 @@ interface paths {
|
|
|
5610
5610
|
* "conversation_id": "bbbbbbbb-0000-4000-8000-000000000001",
|
|
5611
5611
|
* "channel": "web",
|
|
5612
5612
|
* "role": "system",
|
|
5613
|
-
* "content": "CRM
|
|
5613
|
+
* "content": "CRM propio (API) reasignó la conversación",
|
|
5614
5614
|
* "type": "event",
|
|
5615
5615
|
* "tool_calls": null,
|
|
5616
5616
|
* "tool_call_id": null,
|
|
@@ -14265,6 +14265,8 @@ interface paths {
|
|
|
14265
14265
|
/**
|
|
14266
14266
|
* Create a vehicle (manual stock)
|
|
14267
14267
|
* @description plate_normalized is server-derived from registration_number; a plate already claimed by another ACTIVE vehicle of the tenant returns 409 (conflicto de patente). A plate the Chilean grammar cannot read derives plate_normalized = null, so the DB backstop cannot see it: the service then compares the RAW value (upper/trim) against the tenant active stock and answers the SAME 409, and flags the unit under attributes.curated.needsReview = ["plate"] with curated.plateReason = "plate_unrecognized". The plate is never refused on its own merits (allow-and-flag, ADR 0022) — only a duplicate is.
|
|
14268
|
+
*
|
|
14269
|
+
* **Publish in the same call (`publish_to`).** Optional. Name the marketplaces this vehicle should go to — portal slugs such as `chileautos` / `mercadolibre`, or integration ids from GET /marketplaces — and it is published right after it is saved, through the same path as POST /vehicles/{id}/publish. Omitted or `[]` saves only; there is no default. Every entry is validated first: a portal with no connected account, a slug matching several accounts, or an id from another workspace answers **422 and nothing is saved**. Once saved, the vehicle stays saved: a portal that fails to publish is an `error` entry in `publications`, never a failed request (still 201). The response then carries `publications`, one `PublishOutcome` per account (`published`, `pending` for queued transports such as `chileautos_panel` and Facebook Marketplace, `already_published`, or `error` with the reason). `publications` is absent when `publish_to` was not sent.
|
|
14268
14270
|
*/
|
|
14269
14271
|
post: {
|
|
14270
14272
|
parameters: {
|
|
@@ -14292,7 +14294,11 @@ interface paths {
|
|
|
14292
14294
|
* "color": "Gris",
|
|
14293
14295
|
* "registration_number": "FGXY21",
|
|
14294
14296
|
* "vin": "9BWZZZ377NP004512",
|
|
14295
|
-
* "location_id": "b1b1b1b1-0000-4000-8000-000000000001"
|
|
14297
|
+
* "location_id": "b1b1b1b1-0000-4000-8000-000000000001",
|
|
14298
|
+
* "publish_to": [
|
|
14299
|
+
* "chileautos",
|
|
14300
|
+
* "mercadolibre"
|
|
14301
|
+
* ]
|
|
14296
14302
|
* }
|
|
14297
14303
|
*/
|
|
14298
14304
|
"application/json": {
|
|
@@ -14346,11 +14352,19 @@ interface paths {
|
|
|
14346
14352
|
municipalidad_comuna_code?: string | null;
|
|
14347
14353
|
last_service_date?: string | null;
|
|
14348
14354
|
service_odometer_km?: number | null;
|
|
14355
|
+
/**
|
|
14356
|
+
* @description OPTIONAL. Marketplaces to publish this vehicle to right after it is saved — the same effect as a follow-up POST /vehicles/{id}/publish, in one call. Omitted or `[]` means save only and publish nowhere: there is no default and no tenant-level setting. Each entry is either a portal slug (`chileautos`, `chileautos_panel`, `facebook`, `facebook_marketplace`, `linze`, `mercadolibre`, `yapo`) or a marketplace integration id (the `id` of a row from GET /marketplaces). A portal slug resolves to the connected account the workspace has for that portal, whichever transport it uses (`chileautos` reaches the certified API account or the `chileautos_panel` account). Every entry is validated BEFORE the vehicle is written, and any bad entry answers 422 with nothing saved: a slug with no connected account, a slug matching more than one account (pass the integration id instead), an id that is not one of this workspace's accounts, or a portal that does not accept this vehicle type. Entries resolving to the same account are deduplicated. A portal FAILING to publish never fails the save — see `publications` in the response. On PUT, `publish_to` only ADDS portals: a portal where the vehicle is already live or queued is a no-op (`already_published`), never a second ad, and a portal left out is NOT unpublished — removal is DELETE /vehicles/{id}/publications/{pubId}.
|
|
14357
|
+
* @example [
|
|
14358
|
+
* "chileautos",
|
|
14359
|
+
* "mercadolibre"
|
|
14360
|
+
* ]
|
|
14361
|
+
*/
|
|
14362
|
+
publish_to?: string[];
|
|
14349
14363
|
};
|
|
14350
14364
|
};
|
|
14351
14365
|
};
|
|
14352
14366
|
responses: {
|
|
14353
|
-
/** @description Vehicle */
|
|
14367
|
+
/** @description Vehicle. Carries `publications` only when `publish_to` was sent. */
|
|
14354
14368
|
201: {
|
|
14355
14369
|
headers: {
|
|
14356
14370
|
[name: string]: unknown;
|
|
@@ -14428,7 +14442,61 @@ interface paths {
|
|
|
14428
14442
|
* "updated_at": "2026-09-15T18:34:48.575Z",
|
|
14429
14443
|
* "live_sale_note": null,
|
|
14430
14444
|
* "active_reservation": null,
|
|
14431
|
-
* "not_on_lot": false
|
|
14445
|
+
* "not_on_lot": false,
|
|
14446
|
+
* "publications": [
|
|
14447
|
+
* {
|
|
14448
|
+
* "integration_id": "33333333-0000-4000-8000-000000000003",
|
|
14449
|
+
* "provider": "chileautos_panel",
|
|
14450
|
+
* "status": "pending",
|
|
14451
|
+
* "external_id": null,
|
|
14452
|
+
* "publication": {
|
|
14453
|
+
* "id": "88888888-0000-4000-8000-000000000003",
|
|
14454
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
14455
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
14456
|
+
* "marketplace_account_id": "33333333-0000-4000-8000-000000000003",
|
|
14457
|
+
* "provider": "chileautos_panel",
|
|
14458
|
+
* "external_id": null,
|
|
14459
|
+
* "status": "pending",
|
|
14460
|
+
* "origin": "vitrina",
|
|
14461
|
+
* "permalink": null,
|
|
14462
|
+
* "last_synced_at": null,
|
|
14463
|
+
* "last_published_at": null,
|
|
14464
|
+
* "last_error": null,
|
|
14465
|
+
* "close_retry_count": 0,
|
|
14466
|
+
* "portal_state": null,
|
|
14467
|
+
* "portal_state_at": null,
|
|
14468
|
+
* "raw_provider_payload": null,
|
|
14469
|
+
* "created_at": "2026-09-16T09:00:00.000Z",
|
|
14470
|
+
* "updated_at": "2026-09-19T10:00:00.000Z"
|
|
14471
|
+
* }
|
|
14472
|
+
* },
|
|
14473
|
+
* {
|
|
14474
|
+
* "integration_id": "33333333-0000-4000-8000-000000000001",
|
|
14475
|
+
* "provider": "mercadolibre",
|
|
14476
|
+
* "status": "published",
|
|
14477
|
+
* "external_id": "MLC-1234567890",
|
|
14478
|
+
* "publication": {
|
|
14479
|
+
* "id": "88888888-0000-4000-8000-000000000001",
|
|
14480
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
14481
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
14482
|
+
* "marketplace_account_id": "33333333-0000-4000-8000-000000000001",
|
|
14483
|
+
* "provider": "mercadolibre",
|
|
14484
|
+
* "external_id": "MLC-1234567890",
|
|
14485
|
+
* "status": "published",
|
|
14486
|
+
* "origin": "vitrina",
|
|
14487
|
+
* "permalink": "https://articulo.mercadolibre.cl/MLC-1234567890",
|
|
14488
|
+
* "last_synced_at": "2026-09-19T10:00:00.000Z",
|
|
14489
|
+
* "last_published_at": "2026-09-16T09:00:00.000Z",
|
|
14490
|
+
* "last_error": null,
|
|
14491
|
+
* "close_retry_count": 0,
|
|
14492
|
+
* "portal_state": "active",
|
|
14493
|
+
* "portal_state_at": "2026-09-19T10:00:00.000Z",
|
|
14494
|
+
* "raw_provider_payload": null,
|
|
14495
|
+
* "created_at": "2026-09-16T09:00:00.000Z",
|
|
14496
|
+
* "updated_at": "2026-09-19T10:00:00.000Z"
|
|
14497
|
+
* }
|
|
14498
|
+
* }
|
|
14499
|
+
* ]
|
|
14432
14500
|
* }
|
|
14433
14501
|
* }
|
|
14434
14502
|
*/
|
|
@@ -14795,6 +14863,8 @@ interface paths {
|
|
|
14795
14863
|
/**
|
|
14796
14864
|
* Update a vehicle
|
|
14797
14865
|
* @description Updating registration_number re-derives plate_normalized; a collision with another ACTIVE vehicle of the tenant returns 409 (conflicto de patente).
|
|
14866
|
+
*
|
|
14867
|
+
* **`publish_to` only ADDS portals.** Same contract as on POST /vehicles (validated before the edit is written; 422 writes nothing; a portal failure is an `error` entry in `publications`, never a failed request). A portal where the vehicle is already live or has a queued publish is a no-op (`already_published`) — never a second ad, so an ERP may safely retry. A portal LEFT OUT of `publish_to` is NOT unpublished: removal is DELETE /vehicles/{id}/publications/{pubId}. A body with only `publish_to` publishes without editing the vehicle.
|
|
14798
14868
|
*/
|
|
14799
14869
|
put: {
|
|
14800
14870
|
parameters: {
|
|
@@ -14863,11 +14933,19 @@ interface paths {
|
|
|
14863
14933
|
municipalidad_comuna_code?: string | null;
|
|
14864
14934
|
last_service_date?: string | null;
|
|
14865
14935
|
service_odometer_km?: number | null;
|
|
14936
|
+
/**
|
|
14937
|
+
* @description OPTIONAL. Marketplaces to publish this vehicle to right after it is saved — the same effect as a follow-up POST /vehicles/{id}/publish, in one call. Omitted or `[]` means save only and publish nowhere: there is no default and no tenant-level setting. Each entry is either a portal slug (`chileautos`, `chileautos_panel`, `facebook`, `facebook_marketplace`, `linze`, `mercadolibre`, `yapo`) or a marketplace integration id (the `id` of a row from GET /marketplaces). A portal slug resolves to the connected account the workspace has for that portal, whichever transport it uses (`chileautos` reaches the certified API account or the `chileautos_panel` account). Every entry is validated BEFORE the vehicle is written, and any bad entry answers 422 with nothing saved: a slug with no connected account, a slug matching more than one account (pass the integration id instead), an id that is not one of this workspace's accounts, or a portal that does not accept this vehicle type. Entries resolving to the same account are deduplicated. A portal FAILING to publish never fails the save — see `publications` in the response. On PUT, `publish_to` only ADDS portals: a portal where the vehicle is already live or queued is a no-op (`already_published`), never a second ad, and a portal left out is NOT unpublished — removal is DELETE /vehicles/{id}/publications/{pubId}.
|
|
14938
|
+
* @example [
|
|
14939
|
+
* "chileautos",
|
|
14940
|
+
* "mercadolibre"
|
|
14941
|
+
* ]
|
|
14942
|
+
*/
|
|
14943
|
+
publish_to?: string[];
|
|
14866
14944
|
};
|
|
14867
14945
|
};
|
|
14868
14946
|
};
|
|
14869
14947
|
responses: {
|
|
14870
|
-
/** @description Vehicle */
|
|
14948
|
+
/** @description Vehicle. Carries `publications` only when `publish_to` was sent. */
|
|
14871
14949
|
200: {
|
|
14872
14950
|
headers: {
|
|
14873
14951
|
[name: string]: unknown;
|
|
@@ -20918,7 +20996,7 @@ interface paths {
|
|
|
20918
20996
|
};
|
|
20919
20997
|
/**
|
|
20920
20998
|
* List a lead's activity timeline
|
|
20921
|
-
* @description Newest first. Every line carries its `author` (ADR 0106 §3.1): the member who acted (with `via` when they acted through a connected app or a personal token — «Camila vía Claude»), the API key that acted («CRM
|
|
20999
|
+
* @description Newest first. Every line carries its `author` (ADR 0106 §3.1): the member who acted (with `via` when they acted through a connected app or a personal token — «Camila vía Claude»), the API key that acted («CRM propio (API)», named as it was then), the AI agent, or the system. `kind` says what happened and `data` is kind-specific; `id` is the timeline row's own legacy sequence number, not a uuid — `lead_id` beside it is the reference.
|
|
20922
21000
|
*/
|
|
20923
21001
|
get: {
|
|
20924
21002
|
parameters: {
|
|
@@ -20982,7 +21060,7 @@ interface paths {
|
|
|
20982
21060
|
* "author": {
|
|
20983
21061
|
* "kind": "api_key",
|
|
20984
21062
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
20985
|
-
* "name": "CRM
|
|
21063
|
+
* "name": "CRM propio"
|
|
20986
21064
|
* },
|
|
20987
21065
|
* "created_at": "2026-09-21T14:02:11.000Z"
|
|
20988
21066
|
* },
|
|
@@ -72431,7 +72509,7 @@ interface paths {
|
|
|
72431
72509
|
* "author": {
|
|
72432
72510
|
* "kind": "api_key",
|
|
72433
72511
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
72434
|
-
* "name": "CRM
|
|
72512
|
+
* "name": "CRM propio"
|
|
72435
72513
|
* },
|
|
72436
72514
|
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
72437
72515
|
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
@@ -72638,7 +72716,7 @@ interface paths {
|
|
|
72638
72716
|
* "author": {
|
|
72639
72717
|
* "kind": "api_key",
|
|
72640
72718
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
72641
|
-
* "name": "CRM
|
|
72719
|
+
* "name": "CRM propio"
|
|
72642
72720
|
* },
|
|
72643
72721
|
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
72644
72722
|
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
@@ -72879,7 +72957,7 @@ interface paths {
|
|
|
72879
72957
|
* "author": {
|
|
72880
72958
|
* "kind": "api_key",
|
|
72881
72959
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
72882
|
-
* "name": "CRM
|
|
72960
|
+
* "name": "CRM propio"
|
|
72883
72961
|
* },
|
|
72884
72962
|
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
72885
72963
|
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
@@ -73267,7 +73345,7 @@ interface paths {
|
|
|
73267
73345
|
* "author": {
|
|
73268
73346
|
* "kind": "api_key",
|
|
73269
73347
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
73270
|
-
* "name": "CRM
|
|
73348
|
+
* "name": "CRM propio"
|
|
73271
73349
|
* },
|
|
73272
73350
|
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
73273
73351
|
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
@@ -73454,7 +73532,7 @@ interface paths {
|
|
|
73454
73532
|
* "author": {
|
|
73455
73533
|
* "kind": "api_key",
|
|
73456
73534
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
73457
|
-
* "name": "CRM
|
|
73535
|
+
* "name": "CRM propio"
|
|
73458
73536
|
* },
|
|
73459
73537
|
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
73460
73538
|
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
@@ -73768,7 +73846,7 @@ interface paths {
|
|
|
73768
73846
|
* "author": {
|
|
73769
73847
|
* "kind": "api_key",
|
|
73770
73848
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
73771
|
-
* "name": "CRM
|
|
73849
|
+
* "name": "CRM propio"
|
|
73772
73850
|
* },
|
|
73773
73851
|
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
73774
73852
|
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
@@ -73945,7 +74023,7 @@ interface paths {
|
|
|
73945
74023
|
* "author": {
|
|
73946
74024
|
* "kind": "api_key",
|
|
73947
74025
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
73948
|
-
* "name": "CRM
|
|
74026
|
+
* "name": "CRM propio"
|
|
73949
74027
|
* },
|
|
73950
74028
|
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
73951
74029
|
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
@@ -74116,7 +74194,7 @@ interface paths {
|
|
|
74116
74194
|
* "author": {
|
|
74117
74195
|
* "kind": "api_key",
|
|
74118
74196
|
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
74119
|
-
* "name": "CRM
|
|
74197
|
+
* "name": "CRM propio"
|
|
74120
74198
|
* },
|
|
74121
74199
|
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
74122
74200
|
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
@@ -87575,6 +87653,8 @@ interface paths {
|
|
|
87575
87653
|
to: string;
|
|
87576
87654
|
/** @description Atribu attribution model. Defaults to `last_touch`. */
|
|
87577
87655
|
model?: string;
|
|
87656
|
+
/** @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. */
|
|
87657
|
+
sample?: "1" | "true";
|
|
87578
87658
|
/** @description Documentary only — `/ads/overview` always returns `previous` (the immediately-preceding window of equal length) alongside `current`; there is nothing to switch on. */
|
|
87579
87659
|
compare?: "previous_period";
|
|
87580
87660
|
};
|
|
@@ -87749,15 +87829,1906 @@ interface paths {
|
|
|
87749
87829
|
};
|
|
87750
87830
|
};
|
|
87751
87831
|
};
|
|
87752
|
-
put?: never;
|
|
87753
|
-
post?: never;
|
|
87832
|
+
put?: never;
|
|
87833
|
+
post?: never;
|
|
87834
|
+
delete?: never;
|
|
87835
|
+
options?: never;
|
|
87836
|
+
head?: never;
|
|
87837
|
+
patch?: never;
|
|
87838
|
+
trace?: never;
|
|
87839
|
+
};
|
|
87840
|
+
"/ads/campaigns": {
|
|
87841
|
+
parameters: {
|
|
87842
|
+
query?: never;
|
|
87843
|
+
header?: never;
|
|
87844
|
+
path?: never;
|
|
87845
|
+
cookie?: never;
|
|
87846
|
+
};
|
|
87847
|
+
/**
|
|
87848
|
+
* Campaign performance for a window
|
|
87849
|
+
* @description Proxies Atribu’s `campaigns` operation (the ranked top-N shape — no `level` is ever sent, so this is always the campaign rollup, not the per-ad-set/per-ad ranking). One row per campaign: spend, attributed outcome count/value and ROAS, plus the direct/inherited cash split when Atribu can compute it.
|
|
87850
|
+
*
|
|
87851
|
+
* `campaign_external_id` on each row is the PLATFORM id — pass it as `campaign_id` to `/ads/attributed-sales` for the drill-down.
|
|
87852
|
+
*/
|
|
87853
|
+
get: {
|
|
87854
|
+
parameters: {
|
|
87855
|
+
query: {
|
|
87856
|
+
/** @description Window start (inclusive), YYYY-MM-DD. */
|
|
87857
|
+
from: string;
|
|
87858
|
+
/** @description Window end (inclusive), YYYY-MM-DD. */
|
|
87859
|
+
to: string;
|
|
87860
|
+
/** @description Atribu attribution model. Defaults to `last_touch`. */
|
|
87861
|
+
model?: string;
|
|
87862
|
+
/** @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. */
|
|
87863
|
+
sample?: "1" | "true";
|
|
87864
|
+
limit?: number;
|
|
87865
|
+
};
|
|
87866
|
+
header?: never;
|
|
87867
|
+
path?: never;
|
|
87868
|
+
cookie?: never;
|
|
87869
|
+
};
|
|
87870
|
+
requestBody?: never;
|
|
87871
|
+
responses: {
|
|
87872
|
+
/** @description The window’s campaigns, ranked */
|
|
87873
|
+
200: {
|
|
87874
|
+
headers: {
|
|
87875
|
+
[name: string]: unknown;
|
|
87876
|
+
};
|
|
87877
|
+
content: {
|
|
87878
|
+
/**
|
|
87879
|
+
* @example {
|
|
87880
|
+
* "data": {
|
|
87881
|
+
* "data": [
|
|
87882
|
+
* {
|
|
87883
|
+
* "campaign_id": "a7a7a7a7-0000-4000-8000-000000000001",
|
|
87884
|
+
* "campaign_name": "Leads · Septiembre",
|
|
87885
|
+
* "campaign_external_id": "120211000000000001",
|
|
87886
|
+
* "spend": 845200,
|
|
87887
|
+
* "outcome_count": 31,
|
|
87888
|
+
* "outcome_value": 3120000,
|
|
87889
|
+
* "roas": 3.69,
|
|
87890
|
+
* "direct_cash_value": 2100000,
|
|
87891
|
+
* "inherited_cash_value": 600000
|
|
87892
|
+
* }
|
|
87893
|
+
* ]
|
|
87894
|
+
* }
|
|
87895
|
+
* }
|
|
87896
|
+
*/
|
|
87897
|
+
"application/json": {
|
|
87898
|
+
data: components["schemas"]["AdsCampaigns"];
|
|
87899
|
+
};
|
|
87900
|
+
};
|
|
87901
|
+
};
|
|
87902
|
+
/** @description Validation error */
|
|
87903
|
+
400: {
|
|
87904
|
+
headers: {
|
|
87905
|
+
[name: string]: unknown;
|
|
87906
|
+
};
|
|
87907
|
+
content: {
|
|
87908
|
+
"application/json": components["schemas"]["Error"];
|
|
87909
|
+
};
|
|
87910
|
+
};
|
|
87911
|
+
/** @description Unauthorized */
|
|
87912
|
+
401: {
|
|
87913
|
+
headers: {
|
|
87914
|
+
[name: string]: unknown;
|
|
87915
|
+
};
|
|
87916
|
+
content: {
|
|
87917
|
+
"application/json": components["schemas"]["Error"];
|
|
87918
|
+
};
|
|
87919
|
+
};
|
|
87920
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
87921
|
+
402: {
|
|
87922
|
+
headers: {
|
|
87923
|
+
[name: string]: unknown;
|
|
87924
|
+
};
|
|
87925
|
+
content: {
|
|
87926
|
+
/**
|
|
87927
|
+
* @example {
|
|
87928
|
+
* "error": {
|
|
87929
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
87930
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
87931
|
+
* "details": {
|
|
87932
|
+
* "required": [
|
|
87933
|
+
* "vitrina_ads"
|
|
87934
|
+
* ],
|
|
87935
|
+
* "active": [],
|
|
87936
|
+
* "feature": "vitrina_ads",
|
|
87937
|
+
* "entitlement_state": "off"
|
|
87938
|
+
* }
|
|
87939
|
+
* }
|
|
87940
|
+
* }
|
|
87941
|
+
*/
|
|
87942
|
+
"application/json": components["schemas"]["Error"];
|
|
87943
|
+
};
|
|
87944
|
+
};
|
|
87945
|
+
/** @description Forbidden */
|
|
87946
|
+
403: {
|
|
87947
|
+
headers: {
|
|
87948
|
+
[name: string]: unknown;
|
|
87949
|
+
};
|
|
87950
|
+
content: {
|
|
87951
|
+
"application/json": components["schemas"]["Error"];
|
|
87952
|
+
};
|
|
87953
|
+
};
|
|
87954
|
+
/** @description Not found */
|
|
87955
|
+
404: {
|
|
87956
|
+
headers: {
|
|
87957
|
+
[name: string]: unknown;
|
|
87958
|
+
};
|
|
87959
|
+
content: {
|
|
87960
|
+
"application/json": components["schemas"]["Error"];
|
|
87961
|
+
};
|
|
87962
|
+
};
|
|
87963
|
+
/** @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. */
|
|
87964
|
+
409: {
|
|
87965
|
+
headers: {
|
|
87966
|
+
[name: string]: unknown;
|
|
87967
|
+
};
|
|
87968
|
+
content: {
|
|
87969
|
+
/**
|
|
87970
|
+
* @example {
|
|
87971
|
+
* "error": {
|
|
87972
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
87973
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
87974
|
+
* "details": {
|
|
87975
|
+
* "key_kind": "core"
|
|
87976
|
+
* }
|
|
87977
|
+
* }
|
|
87978
|
+
* }
|
|
87979
|
+
*/
|
|
87980
|
+
"application/json": components["schemas"]["Error"];
|
|
87981
|
+
};
|
|
87982
|
+
};
|
|
87983
|
+
/** @description Rate limited */
|
|
87984
|
+
429: {
|
|
87985
|
+
headers: {
|
|
87986
|
+
[name: string]: unknown;
|
|
87987
|
+
};
|
|
87988
|
+
content: {
|
|
87989
|
+
"application/json": components["schemas"]["Error"];
|
|
87990
|
+
};
|
|
87991
|
+
};
|
|
87992
|
+
};
|
|
87993
|
+
};
|
|
87994
|
+
put?: never;
|
|
87995
|
+
post?: never;
|
|
87996
|
+
delete?: never;
|
|
87997
|
+
options?: never;
|
|
87998
|
+
head?: never;
|
|
87999
|
+
patch?: never;
|
|
88000
|
+
trace?: never;
|
|
88001
|
+
};
|
|
88002
|
+
"/ads/attributed-sales": {
|
|
88003
|
+
parameters: {
|
|
88004
|
+
query?: never;
|
|
88005
|
+
header?: never;
|
|
88006
|
+
path?: never;
|
|
88007
|
+
cookie?: never;
|
|
88008
|
+
};
|
|
88009
|
+
/**
|
|
88010
|
+
* One campaign’s attributed conversions (the drill-down)
|
|
88011
|
+
* @description Proxies Atribu’s `campaigns/{id}/conversions` operation: every conversion credited to `campaign_id` under the window/model, each carrying its credited share (`credited_value`/`credited_weight`), its position in the touch path, and whether the credit is `is_inherited` (bridged lead→cash, never counted in ROAS).
|
|
88012
|
+
*
|
|
88013
|
+
* `customer_name`/`customer_email` are `null` unless the tenant’s delegated key also carries `customers:read` — every other field is visible under `campaigns:read` alone.
|
|
88014
|
+
*/
|
|
88015
|
+
get: {
|
|
88016
|
+
parameters: {
|
|
88017
|
+
query: {
|
|
88018
|
+
/** @description Window start (inclusive), YYYY-MM-DD. */
|
|
88019
|
+
from: string;
|
|
88020
|
+
/** @description Window end (inclusive), YYYY-MM-DD. */
|
|
88021
|
+
to: string;
|
|
88022
|
+
/** @description Atribu attribution model. Defaults to `last_touch`. */
|
|
88023
|
+
model?: string;
|
|
88024
|
+
/** @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. */
|
|
88025
|
+
sample?: "1" | "true";
|
|
88026
|
+
/** @description The campaign’s PLATFORM id — the `campaign_external_id` an `/ads/campaigns` row returns, never Atribu’s internal `campaign_id`. */
|
|
88027
|
+
campaign_id: string;
|
|
88028
|
+
};
|
|
88029
|
+
header?: never;
|
|
88030
|
+
path?: never;
|
|
88031
|
+
cookie?: never;
|
|
88032
|
+
};
|
|
88033
|
+
requestBody?: never;
|
|
88034
|
+
responses: {
|
|
88035
|
+
/** @description The campaign’s attributed conversions */
|
|
88036
|
+
200: {
|
|
88037
|
+
headers: {
|
|
88038
|
+
[name: string]: unknown;
|
|
88039
|
+
};
|
|
88040
|
+
content: {
|
|
88041
|
+
/**
|
|
88042
|
+
* @example {
|
|
88043
|
+
* "data": {
|
|
88044
|
+
* "data": [
|
|
88045
|
+
* {
|
|
88046
|
+
* "conversion_id": "a8a8a8a8-0000-4000-8000-000000000001",
|
|
88047
|
+
* "event_type": "closed_won",
|
|
88048
|
+
* "event_time": "2026-09-12T16:40:00.000Z",
|
|
88049
|
+
* "customer_profile_id": "a9a9a9a9-0000-4000-8000-000000000001",
|
|
88050
|
+
* "customer_key": null,
|
|
88051
|
+
* "customer_name": "María José",
|
|
88052
|
+
* "customer_email": null,
|
|
88053
|
+
* "value_amount": 1200000,
|
|
88054
|
+
* "revenue_type": "accepted_value",
|
|
88055
|
+
* "credited_value": 1200000,
|
|
88056
|
+
* "credited_weight": 1,
|
|
88057
|
+
* "touch_count": 3,
|
|
88058
|
+
* "path_length": 3,
|
|
88059
|
+
* "is_inherited": false
|
|
88060
|
+
* }
|
|
88061
|
+
* ]
|
|
88062
|
+
* }
|
|
88063
|
+
* }
|
|
88064
|
+
*/
|
|
88065
|
+
"application/json": {
|
|
88066
|
+
data: components["schemas"]["AdsAttributedSales"];
|
|
88067
|
+
};
|
|
88068
|
+
};
|
|
88069
|
+
};
|
|
88070
|
+
/** @description Validation error */
|
|
88071
|
+
400: {
|
|
88072
|
+
headers: {
|
|
88073
|
+
[name: string]: unknown;
|
|
88074
|
+
};
|
|
88075
|
+
content: {
|
|
88076
|
+
"application/json": components["schemas"]["Error"];
|
|
88077
|
+
};
|
|
88078
|
+
};
|
|
88079
|
+
/** @description Unauthorized */
|
|
88080
|
+
401: {
|
|
88081
|
+
headers: {
|
|
88082
|
+
[name: string]: unknown;
|
|
88083
|
+
};
|
|
88084
|
+
content: {
|
|
88085
|
+
"application/json": components["schemas"]["Error"];
|
|
88086
|
+
};
|
|
88087
|
+
};
|
|
88088
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
88089
|
+
402: {
|
|
88090
|
+
headers: {
|
|
88091
|
+
[name: string]: unknown;
|
|
88092
|
+
};
|
|
88093
|
+
content: {
|
|
88094
|
+
/**
|
|
88095
|
+
* @example {
|
|
88096
|
+
* "error": {
|
|
88097
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
88098
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
88099
|
+
* "details": {
|
|
88100
|
+
* "required": [
|
|
88101
|
+
* "vitrina_ads"
|
|
88102
|
+
* ],
|
|
88103
|
+
* "active": [],
|
|
88104
|
+
* "feature": "vitrina_ads",
|
|
88105
|
+
* "entitlement_state": "off"
|
|
88106
|
+
* }
|
|
88107
|
+
* }
|
|
88108
|
+
* }
|
|
88109
|
+
*/
|
|
88110
|
+
"application/json": components["schemas"]["Error"];
|
|
88111
|
+
};
|
|
88112
|
+
};
|
|
88113
|
+
/** @description Forbidden */
|
|
88114
|
+
403: {
|
|
88115
|
+
headers: {
|
|
88116
|
+
[name: string]: unknown;
|
|
88117
|
+
};
|
|
88118
|
+
content: {
|
|
88119
|
+
"application/json": components["schemas"]["Error"];
|
|
88120
|
+
};
|
|
88121
|
+
};
|
|
88122
|
+
/** @description Not found */
|
|
88123
|
+
404: {
|
|
88124
|
+
headers: {
|
|
88125
|
+
[name: string]: unknown;
|
|
88126
|
+
};
|
|
88127
|
+
content: {
|
|
88128
|
+
"application/json": components["schemas"]["Error"];
|
|
88129
|
+
};
|
|
88130
|
+
};
|
|
88131
|
+
/** @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. */
|
|
88132
|
+
409: {
|
|
88133
|
+
headers: {
|
|
88134
|
+
[name: string]: unknown;
|
|
88135
|
+
};
|
|
88136
|
+
content: {
|
|
88137
|
+
/**
|
|
88138
|
+
* @example {
|
|
88139
|
+
* "error": {
|
|
88140
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
88141
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
88142
|
+
* "details": {
|
|
88143
|
+
* "key_kind": "core"
|
|
88144
|
+
* }
|
|
88145
|
+
* }
|
|
88146
|
+
* }
|
|
88147
|
+
*/
|
|
88148
|
+
"application/json": components["schemas"]["Error"];
|
|
88149
|
+
};
|
|
88150
|
+
};
|
|
88151
|
+
/** @description Rate limited */
|
|
88152
|
+
429: {
|
|
88153
|
+
headers: {
|
|
88154
|
+
[name: string]: unknown;
|
|
88155
|
+
};
|
|
88156
|
+
content: {
|
|
88157
|
+
"application/json": components["schemas"]["Error"];
|
|
88158
|
+
};
|
|
88159
|
+
};
|
|
88160
|
+
};
|
|
88161
|
+
};
|
|
88162
|
+
put?: never;
|
|
88163
|
+
post?: never;
|
|
88164
|
+
delete?: never;
|
|
88165
|
+
options?: never;
|
|
88166
|
+
head?: never;
|
|
88167
|
+
patch?: never;
|
|
88168
|
+
trace?: never;
|
|
88169
|
+
};
|
|
88170
|
+
"/ads/creatives": {
|
|
88171
|
+
parameters: {
|
|
88172
|
+
query?: never;
|
|
88173
|
+
header?: never;
|
|
88174
|
+
path?: never;
|
|
88175
|
+
cookie?: never;
|
|
88176
|
+
};
|
|
88177
|
+
/**
|
|
88178
|
+
* Top-performing ads (cohort-normalized creative scoring)
|
|
88179
|
+
* @description Proxies Atribu’s `top-performers` operation — a ROLLING lookback (`window`), not a date range: that is the real endpoint’s own shape. Each ad carries three distinct measures, presented separately — `composite_score` (0-100, a transparent rule blend), `top_performer_likelihood` (0-1, a probability, never ROAS) and `attributed_revenue`/`roas` (real cash attribution, present when `truth_grade` is `attributed`).
|
|
88180
|
+
*
|
|
88181
|
+
* This is the PROFILE-scoped read — every Vitrina tenant’s delegated key is minted for exactly one Atribu profile, so it cannot call Atribu’s cross-profile `/workspaces/{id}/top-performers` (that route is session-bearer-only and answers `403 insufficient_scope` to any API key).
|
|
88182
|
+
*/
|
|
88183
|
+
get: {
|
|
88184
|
+
parameters: {
|
|
88185
|
+
query?: {
|
|
88186
|
+
/** @description A rolling lookback, not a date range — Atribu’s `top-performers` operation takes no `from`/`to`. Defaults to `28d`. */
|
|
88187
|
+
window?: "7d" | "14d" | "28d" | "lifetime";
|
|
88188
|
+
limit?: number;
|
|
88189
|
+
/** @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. */
|
|
88190
|
+
sample?: "1" | "true";
|
|
88191
|
+
};
|
|
88192
|
+
header?: never;
|
|
88193
|
+
path?: never;
|
|
88194
|
+
cookie?: never;
|
|
88195
|
+
};
|
|
88196
|
+
requestBody?: never;
|
|
88197
|
+
responses: {
|
|
88198
|
+
/** @description The window’s top-performing ads */
|
|
88199
|
+
200: {
|
|
88200
|
+
headers: {
|
|
88201
|
+
[name: string]: unknown;
|
|
88202
|
+
};
|
|
88203
|
+
content: {
|
|
88204
|
+
/**
|
|
88205
|
+
* @example {
|
|
88206
|
+
* "data": {
|
|
88207
|
+
* "data": [
|
|
88208
|
+
* {
|
|
88209
|
+
* "ad_external_id": "120212000000000009",
|
|
88210
|
+
* "ad_name": "Video testimonio 15s",
|
|
88211
|
+
* "campaign_name": "Leads · Septiembre",
|
|
88212
|
+
* "ad_set_name": "Santiago 25-45",
|
|
88213
|
+
* "creative_thumbnail_url": null,
|
|
88214
|
+
* "score_window": "28d",
|
|
88215
|
+
* "composite_score": 0.82,
|
|
88216
|
+
* "top_performer_likelihood": 0.71,
|
|
88217
|
+
* "maturity_stage": "mature",
|
|
88218
|
+
* "truth_grade": "attributed",
|
|
88219
|
+
* "primary_outcome_kind": "closed_won",
|
|
88220
|
+
* "spend": 150000,
|
|
88221
|
+
* "impressions": 48200,
|
|
88222
|
+
* "ctr": 1.9,
|
|
88223
|
+
* "attributed_revenue": 480000,
|
|
88224
|
+
* "roas": 3.2,
|
|
88225
|
+
* "fatigue_state": "active",
|
|
88226
|
+
* "fatigue_risk_tier": "low"
|
|
88227
|
+
* }
|
|
88228
|
+
* ]
|
|
88229
|
+
* }
|
|
88230
|
+
* }
|
|
88231
|
+
*/
|
|
88232
|
+
"application/json": {
|
|
88233
|
+
data: components["schemas"]["AdsCreatives"];
|
|
88234
|
+
};
|
|
88235
|
+
};
|
|
88236
|
+
};
|
|
88237
|
+
/** @description Validation error */
|
|
88238
|
+
400: {
|
|
88239
|
+
headers: {
|
|
88240
|
+
[name: string]: unknown;
|
|
88241
|
+
};
|
|
88242
|
+
content: {
|
|
88243
|
+
"application/json": components["schemas"]["Error"];
|
|
88244
|
+
};
|
|
88245
|
+
};
|
|
88246
|
+
/** @description Unauthorized */
|
|
88247
|
+
401: {
|
|
88248
|
+
headers: {
|
|
88249
|
+
[name: string]: unknown;
|
|
88250
|
+
};
|
|
88251
|
+
content: {
|
|
88252
|
+
"application/json": components["schemas"]["Error"];
|
|
88253
|
+
};
|
|
88254
|
+
};
|
|
88255
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
88256
|
+
402: {
|
|
88257
|
+
headers: {
|
|
88258
|
+
[name: string]: unknown;
|
|
88259
|
+
};
|
|
88260
|
+
content: {
|
|
88261
|
+
/**
|
|
88262
|
+
* @example {
|
|
88263
|
+
* "error": {
|
|
88264
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
88265
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
88266
|
+
* "details": {
|
|
88267
|
+
* "required": [
|
|
88268
|
+
* "vitrina_ads"
|
|
88269
|
+
* ],
|
|
88270
|
+
* "active": [],
|
|
88271
|
+
* "feature": "vitrina_ads",
|
|
88272
|
+
* "entitlement_state": "off"
|
|
88273
|
+
* }
|
|
88274
|
+
* }
|
|
88275
|
+
* }
|
|
88276
|
+
*/
|
|
88277
|
+
"application/json": components["schemas"]["Error"];
|
|
88278
|
+
};
|
|
88279
|
+
};
|
|
88280
|
+
/** @description Forbidden */
|
|
88281
|
+
403: {
|
|
88282
|
+
headers: {
|
|
88283
|
+
[name: string]: unknown;
|
|
88284
|
+
};
|
|
88285
|
+
content: {
|
|
88286
|
+
"application/json": components["schemas"]["Error"];
|
|
88287
|
+
};
|
|
88288
|
+
};
|
|
88289
|
+
/** @description Not found */
|
|
88290
|
+
404: {
|
|
88291
|
+
headers: {
|
|
88292
|
+
[name: string]: unknown;
|
|
88293
|
+
};
|
|
88294
|
+
content: {
|
|
88295
|
+
"application/json": components["schemas"]["Error"];
|
|
88296
|
+
};
|
|
88297
|
+
};
|
|
88298
|
+
/** @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. */
|
|
88299
|
+
409: {
|
|
88300
|
+
headers: {
|
|
88301
|
+
[name: string]: unknown;
|
|
88302
|
+
};
|
|
88303
|
+
content: {
|
|
88304
|
+
/**
|
|
88305
|
+
* @example {
|
|
88306
|
+
* "error": {
|
|
88307
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
88308
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
88309
|
+
* "details": {
|
|
88310
|
+
* "key_kind": "core"
|
|
88311
|
+
* }
|
|
88312
|
+
* }
|
|
88313
|
+
* }
|
|
88314
|
+
*/
|
|
88315
|
+
"application/json": components["schemas"]["Error"];
|
|
88316
|
+
};
|
|
88317
|
+
};
|
|
88318
|
+
/** @description Rate limited */
|
|
88319
|
+
429: {
|
|
88320
|
+
headers: {
|
|
88321
|
+
[name: string]: unknown;
|
|
88322
|
+
};
|
|
88323
|
+
content: {
|
|
88324
|
+
"application/json": components["schemas"]["Error"];
|
|
88325
|
+
};
|
|
88326
|
+
};
|
|
88327
|
+
};
|
|
88328
|
+
};
|
|
88329
|
+
put?: never;
|
|
88330
|
+
post?: never;
|
|
88331
|
+
delete?: never;
|
|
88332
|
+
options?: never;
|
|
88333
|
+
head?: never;
|
|
88334
|
+
patch?: never;
|
|
88335
|
+
trace?: never;
|
|
88336
|
+
};
|
|
88337
|
+
"/ads/health": {
|
|
88338
|
+
parameters: {
|
|
88339
|
+
query?: never;
|
|
88340
|
+
header?: never;
|
|
88341
|
+
path?: never;
|
|
88342
|
+
cookie?: never;
|
|
88343
|
+
};
|
|
88344
|
+
/**
|
|
88345
|
+
* Attribution trust, UTM quality and attribution coverage
|
|
88346
|
+
* @description One combined read over three Atribu operations, so a dashboard panel needs one call, not three:
|
|
88347
|
+
*
|
|
88348
|
+
* * `trust` — Atribu’s `trust` operation: how much of the profile’s cash is traceable to an ad (`traceable_pct_by_value`/`_by_count`), whether the instrumentation producing that number is sound (`instrumentation.tracking_healthy`), and which way the traceable half is moving (`traceable_roas_trend`). READ `instrumentation` BEFORE rendering `traceable_pct_by_value` as an indictment — a low number reads as "great organic" when tracking is healthy and "broken tracking" when it is not.
|
|
88349
|
+
* * `utm` — Atribu’s `quality/utm` operation: the cached UTM-health badge (malformed/missing/dangling-ad-id anomaly counts over the traffic side) plus the dangling-ad-ids rollup (attributed cash that cannot be placed in the ad hierarchy).
|
|
88350
|
+
* * `attribution_coverage` — Atribu’s `quality/attribution` operation: the conversion side — how many of the window’s conversions carry a real ad id, an `fbclid` only, or nothing, partitioning `total_conversions`.
|
|
88351
|
+
*
|
|
88352
|
+
* ⚠ Named `/attribution-coverage` in this ticket’s original prose — the live Atribu spec names this operation `quality/attribution`; there is no separate `/attribution-coverage` path. Same read, corrected name.
|
|
88353
|
+
*/
|
|
88354
|
+
get: {
|
|
88355
|
+
parameters: {
|
|
88356
|
+
query: {
|
|
88357
|
+
/** @description Window start (inclusive), YYYY-MM-DD. */
|
|
88358
|
+
from: string;
|
|
88359
|
+
/** @description Window end (inclusive), YYYY-MM-DD. */
|
|
88360
|
+
to: string;
|
|
88361
|
+
/** @description Atribu attribution model. Defaults to `last_touch`. */
|
|
88362
|
+
model?: string;
|
|
88363
|
+
/** @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. */
|
|
88364
|
+
sample?: "1" | "true";
|
|
88365
|
+
/** @description Instrumentation-health + UTM-badge cached window, days (1-30, capped by the Ephemeral Buffer’s retention). Defaults to 30. */
|
|
88366
|
+
days?: number;
|
|
88367
|
+
/** @description Traceable-ROAS trend window, days, split in half for the recent-vs-prior comparison. Defaults to 28. */
|
|
88368
|
+
window_days?: number;
|
|
88369
|
+
};
|
|
88370
|
+
header?: never;
|
|
88371
|
+
path?: never;
|
|
88372
|
+
cookie?: never;
|
|
88373
|
+
};
|
|
88374
|
+
requestBody?: never;
|
|
88375
|
+
responses: {
|
|
88376
|
+
/** @description Trust, UTM quality and attribution coverage, together */
|
|
88377
|
+
200: {
|
|
88378
|
+
headers: {
|
|
88379
|
+
[name: string]: unknown;
|
|
88380
|
+
};
|
|
88381
|
+
content: {
|
|
88382
|
+
/**
|
|
88383
|
+
* @example {
|
|
88384
|
+
* "data": {
|
|
88385
|
+
* "trust": {
|
|
88386
|
+
* "model": "last_touch",
|
|
88387
|
+
* "currency": "CLP",
|
|
88388
|
+
* "traceable_pct_by_count": 41.5,
|
|
88389
|
+
* "traceable_pct_by_value": 38.2,
|
|
88390
|
+
* "total_count": 53,
|
|
88391
|
+
* "total_value": 5000000,
|
|
88392
|
+
* "instrumentation": {
|
|
88393
|
+
* "score": 0.86,
|
|
88394
|
+
* "verdict": "healthy_tracking",
|
|
88395
|
+
* "tracking_healthy": true,
|
|
88396
|
+
* "coverage_interpretation": "La mayoría de las ventas llegan con su origen publicitario.",
|
|
88397
|
+
* "missing": []
|
|
88398
|
+
* },
|
|
88399
|
+
* "traceable_roas_trend": {
|
|
88400
|
+
* "recent_roas": 3.4,
|
|
88401
|
+
* "prior_roas": 2.9,
|
|
88402
|
+
* "recent_spend": 845200,
|
|
88403
|
+
* "recent_traceable_revenue": 2873680,
|
|
88404
|
+
* "days_with_cash": 11
|
|
88405
|
+
* }
|
|
88406
|
+
* },
|
|
88407
|
+
* "utm": {
|
|
88408
|
+
* "scan_window_days": 14,
|
|
88409
|
+
* "events_scanned": 312,
|
|
88410
|
+
* "high_count": 3,
|
|
88411
|
+
* "medium_count": 7,
|
|
88412
|
+
* "refreshed_at": "2026-09-22T06:00:00.000Z",
|
|
88413
|
+
* "dangling_ad_ids": {
|
|
88414
|
+
* "window_days": 28,
|
|
88415
|
+
* "model": "last_touch",
|
|
88416
|
+
* "dangling_conversions": 2,
|
|
88417
|
+
* "attributed_cash": 90000,
|
|
88418
|
+
* "reporting_currency": "CLP",
|
|
88419
|
+
* "distinct_ad_ids": 1
|
|
88420
|
+
* }
|
|
88421
|
+
* },
|
|
88422
|
+
* "attribution_coverage": {
|
|
88423
|
+
* "total_conversions": 200,
|
|
88424
|
+
* "with_full_utms": 162,
|
|
88425
|
+
* "with_fbclid_only": 18,
|
|
88426
|
+
* "with_no_tracking": 20,
|
|
88427
|
+
* "coverage_percent": 90
|
|
88428
|
+
* }
|
|
88429
|
+
* }
|
|
88430
|
+
* }
|
|
88431
|
+
*/
|
|
88432
|
+
"application/json": {
|
|
88433
|
+
data: components["schemas"]["AdsHealth"];
|
|
88434
|
+
};
|
|
88435
|
+
};
|
|
88436
|
+
};
|
|
88437
|
+
/** @description Validation error */
|
|
88438
|
+
400: {
|
|
88439
|
+
headers: {
|
|
88440
|
+
[name: string]: unknown;
|
|
88441
|
+
};
|
|
88442
|
+
content: {
|
|
88443
|
+
"application/json": components["schemas"]["Error"];
|
|
88444
|
+
};
|
|
88445
|
+
};
|
|
88446
|
+
/** @description Unauthorized */
|
|
88447
|
+
401: {
|
|
88448
|
+
headers: {
|
|
88449
|
+
[name: string]: unknown;
|
|
88450
|
+
};
|
|
88451
|
+
content: {
|
|
88452
|
+
"application/json": components["schemas"]["Error"];
|
|
88453
|
+
};
|
|
88454
|
+
};
|
|
88455
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
88456
|
+
402: {
|
|
88457
|
+
headers: {
|
|
88458
|
+
[name: string]: unknown;
|
|
88459
|
+
};
|
|
88460
|
+
content: {
|
|
88461
|
+
/**
|
|
88462
|
+
* @example {
|
|
88463
|
+
* "error": {
|
|
88464
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
88465
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
88466
|
+
* "details": {
|
|
88467
|
+
* "required": [
|
|
88468
|
+
* "vitrina_ads"
|
|
88469
|
+
* ],
|
|
88470
|
+
* "active": [],
|
|
88471
|
+
* "feature": "vitrina_ads",
|
|
88472
|
+
* "entitlement_state": "off"
|
|
88473
|
+
* }
|
|
88474
|
+
* }
|
|
88475
|
+
* }
|
|
88476
|
+
*/
|
|
88477
|
+
"application/json": components["schemas"]["Error"];
|
|
88478
|
+
};
|
|
88479
|
+
};
|
|
88480
|
+
/** @description Forbidden */
|
|
88481
|
+
403: {
|
|
88482
|
+
headers: {
|
|
88483
|
+
[name: string]: unknown;
|
|
88484
|
+
};
|
|
88485
|
+
content: {
|
|
88486
|
+
"application/json": components["schemas"]["Error"];
|
|
88487
|
+
};
|
|
88488
|
+
};
|
|
88489
|
+
/** @description Not found */
|
|
88490
|
+
404: {
|
|
88491
|
+
headers: {
|
|
88492
|
+
[name: string]: unknown;
|
|
88493
|
+
};
|
|
88494
|
+
content: {
|
|
88495
|
+
"application/json": components["schemas"]["Error"];
|
|
88496
|
+
};
|
|
88497
|
+
};
|
|
88498
|
+
/** @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. */
|
|
88499
|
+
409: {
|
|
88500
|
+
headers: {
|
|
88501
|
+
[name: string]: unknown;
|
|
88502
|
+
};
|
|
88503
|
+
content: {
|
|
88504
|
+
/**
|
|
88505
|
+
* @example {
|
|
88506
|
+
* "error": {
|
|
88507
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
88508
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
88509
|
+
* "details": {
|
|
88510
|
+
* "key_kind": "core"
|
|
88511
|
+
* }
|
|
88512
|
+
* }
|
|
88513
|
+
* }
|
|
88514
|
+
*/
|
|
88515
|
+
"application/json": components["schemas"]["Error"];
|
|
88516
|
+
};
|
|
88517
|
+
};
|
|
88518
|
+
/** @description Rate limited */
|
|
88519
|
+
429: {
|
|
88520
|
+
headers: {
|
|
88521
|
+
[name: string]: unknown;
|
|
88522
|
+
};
|
|
88523
|
+
content: {
|
|
88524
|
+
"application/json": components["schemas"]["Error"];
|
|
88525
|
+
};
|
|
88526
|
+
};
|
|
88527
|
+
};
|
|
88528
|
+
};
|
|
88529
|
+
put?: never;
|
|
88530
|
+
post?: never;
|
|
88531
|
+
delete?: never;
|
|
88532
|
+
options?: never;
|
|
88533
|
+
head?: never;
|
|
88534
|
+
patch?: never;
|
|
88535
|
+
trace?: never;
|
|
88536
|
+
};
|
|
88537
|
+
"/ads/briefing": {
|
|
88538
|
+
parameters: {
|
|
88539
|
+
query?: never;
|
|
88540
|
+
header?: never;
|
|
88541
|
+
path?: never;
|
|
88542
|
+
cookie?: never;
|
|
88543
|
+
};
|
|
88544
|
+
/**
|
|
88545
|
+
* The briefing: ≤3 sentences about a screen’s figures
|
|
88546
|
+
* @description A short Spanish briefing for one Ads screen, written from PINNED aggregate facts: every figure in `lead`/`lines` is quoted verbatim from `facts[].display`, and `facts` is returned alongside so a client can show «¿Por qué?». Facts are aggregates only — campaign and ad names, never a person.
|
|
88547
|
+
*
|
|
88548
|
+
* `source` says who wrote the sentences: `model` (a narrator bound by a guard that rejects any number, name or sentence outside the rules) or `template` (deterministic — first week, Meta disconnected, no spend reading, the model slow or rejected). Both read identically. A briefing is cached per facts hash for 24 h, so two tabs and a reload read the same text; when the model misses its budget the template answers and the model briefing is finished in the background for the next load.
|
|
88549
|
+
*
|
|
88550
|
+
* `lead.figure` names the number the lead is built around (`display` is its exact substring in `lead.text`). `lines[].ask` is a suggested follow-up question. `from`/`to` are required except for `creativos`, which takes the rolling `window`.
|
|
88551
|
+
*/
|
|
88552
|
+
get: {
|
|
88553
|
+
parameters: {
|
|
88554
|
+
query: {
|
|
88555
|
+
/** @description Which Ads screen the briefing is for. */
|
|
88556
|
+
screen: "resumen" | "campanas" | "atribuidos" | "creativos" | "salud";
|
|
88557
|
+
/** @description Window start (inclusive), YYYY-MM-DD. Required except for `creativos`. */
|
|
88558
|
+
from?: string;
|
|
88559
|
+
/** @description Window end (inclusive), YYYY-MM-DD. Required except for `creativos`. */
|
|
88560
|
+
to?: string;
|
|
88561
|
+
/** @description `creativos` only: the rolling lookback. Defaults to `28d`. */
|
|
88562
|
+
window?: "7d" | "14d" | "28d" | "lifetime";
|
|
88563
|
+
/** @description Attribution model. Defaults to `last_touch`. */
|
|
88564
|
+
model?: string;
|
|
88565
|
+
/** @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. */
|
|
88566
|
+
sample?: "1" | "true";
|
|
88567
|
+
};
|
|
88568
|
+
header?: never;
|
|
88569
|
+
path?: never;
|
|
88570
|
+
cookie?: never;
|
|
88571
|
+
};
|
|
88572
|
+
requestBody?: never;
|
|
88573
|
+
responses: {
|
|
88574
|
+
/** @description The screen’s briefing */
|
|
88575
|
+
200: {
|
|
88576
|
+
headers: {
|
|
88577
|
+
[name: string]: unknown;
|
|
88578
|
+
};
|
|
88579
|
+
content: {
|
|
88580
|
+
/**
|
|
88581
|
+
* @example {
|
|
88582
|
+
* "data": {
|
|
88583
|
+
* "screen": "resumen",
|
|
88584
|
+
* "window": {
|
|
88585
|
+
* "from": "2026-08-24",
|
|
88586
|
+
* "to": "2026-09-22"
|
|
88587
|
+
* },
|
|
88588
|
+
* "lead": {
|
|
88589
|
+
* "text": "Tus anuncios devolvieron **3,7×** lo invertido: $845.200 se convirtieron en $3.120.000 en presupuestos aceptados.",
|
|
88590
|
+
* "fact_keys": [
|
|
88591
|
+
* "roas",
|
|
88592
|
+
* "spend",
|
|
88593
|
+
* "revenue"
|
|
88594
|
+
* ],
|
|
88595
|
+
* "figure": {
|
|
88596
|
+
* "fact_key": "roas",
|
|
88597
|
+
* "value": 3.69,
|
|
88598
|
+
* "format": "times",
|
|
88599
|
+
* "display": "3,7×",
|
|
88600
|
+
* "offset": 27
|
|
88601
|
+
* }
|
|
88602
|
+
* },
|
|
88603
|
+
* "lines": [
|
|
88604
|
+
* {
|
|
88605
|
+
* "text": "La mejor campaña fue «Evaluación sin costo · Meta», con 5,4× de retorno, y 36,4% de tus tratamientos vino de anuncios.",
|
|
88606
|
+
* "fact_keys": [
|
|
88607
|
+
* "best_campaign_name",
|
|
88608
|
+
* "best_campaign_roas",
|
|
88609
|
+
* "ads_share"
|
|
88610
|
+
* ],
|
|
88611
|
+
* "ask": "¿Qué campaña me conviene subir?"
|
|
88612
|
+
* }
|
|
88613
|
+
* ],
|
|
88614
|
+
* "facts": [
|
|
88615
|
+
* {
|
|
88616
|
+
* "key": "roas",
|
|
88617
|
+
* "label": "Retorno",
|
|
88618
|
+
* "value": 3.69,
|
|
88619
|
+
* "display": "3,7×",
|
|
88620
|
+
* "format": "times",
|
|
88621
|
+
* "source": "overview.current.roas",
|
|
88622
|
+
* "privacy": "aggregate"
|
|
88623
|
+
* },
|
|
88624
|
+
* {
|
|
88625
|
+
* "key": "spend",
|
|
88626
|
+
* "label": "Inversión en anuncios",
|
|
88627
|
+
* "value": 845200,
|
|
88628
|
+
* "display": "$845.200",
|
|
88629
|
+
* "format": "clp",
|
|
88630
|
+
* "source": "overview.current.spend",
|
|
88631
|
+
* "privacy": "aggregate"
|
|
88632
|
+
* }
|
|
88633
|
+
* ],
|
|
88634
|
+
* "actions": [],
|
|
88635
|
+
* "source": "model",
|
|
88636
|
+
* "generated_at": "2026-09-22T16:40:12.000Z",
|
|
88637
|
+
* "vocabulary": "healthcare",
|
|
88638
|
+
* "sample": false
|
|
88639
|
+
* }
|
|
88640
|
+
* }
|
|
88641
|
+
*/
|
|
88642
|
+
"application/json": {
|
|
88643
|
+
data: components["schemas"]["AdsBriefing"];
|
|
88644
|
+
};
|
|
88645
|
+
};
|
|
88646
|
+
};
|
|
88647
|
+
/** @description Validation error */
|
|
88648
|
+
400: {
|
|
88649
|
+
headers: {
|
|
88650
|
+
[name: string]: unknown;
|
|
88651
|
+
};
|
|
88652
|
+
content: {
|
|
88653
|
+
"application/json": components["schemas"]["Error"];
|
|
88654
|
+
};
|
|
88655
|
+
};
|
|
88656
|
+
/** @description Unauthorized */
|
|
88657
|
+
401: {
|
|
88658
|
+
headers: {
|
|
88659
|
+
[name: string]: unknown;
|
|
88660
|
+
};
|
|
88661
|
+
content: {
|
|
88662
|
+
"application/json": components["schemas"]["Error"];
|
|
88663
|
+
};
|
|
88664
|
+
};
|
|
88665
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
88666
|
+
402: {
|
|
88667
|
+
headers: {
|
|
88668
|
+
[name: string]: unknown;
|
|
88669
|
+
};
|
|
88670
|
+
content: {
|
|
88671
|
+
/**
|
|
88672
|
+
* @example {
|
|
88673
|
+
* "error": {
|
|
88674
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
88675
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
88676
|
+
* "details": {
|
|
88677
|
+
* "required": [
|
|
88678
|
+
* "vitrina_ads"
|
|
88679
|
+
* ],
|
|
88680
|
+
* "active": [],
|
|
88681
|
+
* "feature": "vitrina_ads",
|
|
88682
|
+
* "entitlement_state": "off"
|
|
88683
|
+
* }
|
|
88684
|
+
* }
|
|
88685
|
+
* }
|
|
88686
|
+
*/
|
|
88687
|
+
"application/json": components["schemas"]["Error"];
|
|
88688
|
+
};
|
|
88689
|
+
};
|
|
88690
|
+
/** @description Forbidden */
|
|
88691
|
+
403: {
|
|
88692
|
+
headers: {
|
|
88693
|
+
[name: string]: unknown;
|
|
88694
|
+
};
|
|
88695
|
+
content: {
|
|
88696
|
+
"application/json": components["schemas"]["Error"];
|
|
88697
|
+
};
|
|
88698
|
+
};
|
|
88699
|
+
/** @description Not found */
|
|
88700
|
+
404: {
|
|
88701
|
+
headers: {
|
|
88702
|
+
[name: string]: unknown;
|
|
88703
|
+
};
|
|
88704
|
+
content: {
|
|
88705
|
+
"application/json": components["schemas"]["Error"];
|
|
88706
|
+
};
|
|
88707
|
+
};
|
|
88708
|
+
/** @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. */
|
|
88709
|
+
409: {
|
|
88710
|
+
headers: {
|
|
88711
|
+
[name: string]: unknown;
|
|
88712
|
+
};
|
|
88713
|
+
content: {
|
|
88714
|
+
/**
|
|
88715
|
+
* @example {
|
|
88716
|
+
* "error": {
|
|
88717
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
88718
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
88719
|
+
* "details": {
|
|
88720
|
+
* "key_kind": "core"
|
|
88721
|
+
* }
|
|
88722
|
+
* }
|
|
88723
|
+
* }
|
|
88724
|
+
*/
|
|
88725
|
+
"application/json": components["schemas"]["Error"];
|
|
88726
|
+
};
|
|
88727
|
+
};
|
|
88728
|
+
/** @description Rate limited */
|
|
88729
|
+
429: {
|
|
88730
|
+
headers: {
|
|
88731
|
+
[name: string]: unknown;
|
|
88732
|
+
};
|
|
88733
|
+
content: {
|
|
88734
|
+
"application/json": components["schemas"]["Error"];
|
|
88735
|
+
};
|
|
88736
|
+
};
|
|
88737
|
+
};
|
|
88738
|
+
};
|
|
88739
|
+
put?: never;
|
|
88740
|
+
post?: never;
|
|
88741
|
+
delete?: never;
|
|
88742
|
+
options?: never;
|
|
88743
|
+
head?: never;
|
|
88744
|
+
patch?: never;
|
|
88745
|
+
trace?: never;
|
|
88746
|
+
};
|
|
88747
|
+
"/ads/goal": {
|
|
88748
|
+
parameters: {
|
|
88749
|
+
query?: never;
|
|
88750
|
+
header?: never;
|
|
88751
|
+
path?: never;
|
|
88752
|
+
cookie?: never;
|
|
88753
|
+
};
|
|
88754
|
+
/**
|
|
88755
|
+
* The workspace’s monthly Ads goal
|
|
88756
|
+
* @description The goal the Ads hero measures pace against — results from ads, attributed value or return for the calendar month — or `null` when none is set. With `sample=1` answers the sample dataset’s goal.
|
|
88757
|
+
*/
|
|
88758
|
+
get: {
|
|
88759
|
+
parameters: {
|
|
88760
|
+
query?: {
|
|
88761
|
+
/** @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. */
|
|
88762
|
+
sample?: "1" | "true";
|
|
88763
|
+
};
|
|
88764
|
+
header?: never;
|
|
88765
|
+
path?: never;
|
|
88766
|
+
cookie?: never;
|
|
88767
|
+
};
|
|
88768
|
+
requestBody?: never;
|
|
88769
|
+
responses: {
|
|
88770
|
+
/** @description The goal, or `null` */
|
|
88771
|
+
200: {
|
|
88772
|
+
headers: {
|
|
88773
|
+
[name: string]: unknown;
|
|
88774
|
+
};
|
|
88775
|
+
content: {
|
|
88776
|
+
/**
|
|
88777
|
+
* @example {
|
|
88778
|
+
* "data": {
|
|
88779
|
+
* "kind": "outcomes",
|
|
88780
|
+
* "target": 30,
|
|
88781
|
+
* "period": "month",
|
|
88782
|
+
* "updated_at": "2026-09-01T12:00:00.000Z",
|
|
88783
|
+
* "updated_by": "20000000-0000-4000-8000-000000000001"
|
|
88784
|
+
* }
|
|
88785
|
+
* }
|
|
88786
|
+
*/
|
|
88787
|
+
"application/json": {
|
|
88788
|
+
data: components["schemas"]["AdsGoal"];
|
|
88789
|
+
};
|
|
88790
|
+
};
|
|
88791
|
+
};
|
|
88792
|
+
/** @description Validation error */
|
|
88793
|
+
400: {
|
|
88794
|
+
headers: {
|
|
88795
|
+
[name: string]: unknown;
|
|
88796
|
+
};
|
|
88797
|
+
content: {
|
|
88798
|
+
"application/json": components["schemas"]["Error"];
|
|
88799
|
+
};
|
|
88800
|
+
};
|
|
88801
|
+
/** @description Unauthorized */
|
|
88802
|
+
401: {
|
|
88803
|
+
headers: {
|
|
88804
|
+
[name: string]: unknown;
|
|
88805
|
+
};
|
|
88806
|
+
content: {
|
|
88807
|
+
"application/json": components["schemas"]["Error"];
|
|
88808
|
+
};
|
|
88809
|
+
};
|
|
88810
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
88811
|
+
402: {
|
|
88812
|
+
headers: {
|
|
88813
|
+
[name: string]: unknown;
|
|
88814
|
+
};
|
|
88815
|
+
content: {
|
|
88816
|
+
/**
|
|
88817
|
+
* @example {
|
|
88818
|
+
* "error": {
|
|
88819
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
88820
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
88821
|
+
* "details": {
|
|
88822
|
+
* "required": [
|
|
88823
|
+
* "vitrina_ads"
|
|
88824
|
+
* ],
|
|
88825
|
+
* "active": [],
|
|
88826
|
+
* "feature": "vitrina_ads",
|
|
88827
|
+
* "entitlement_state": "off"
|
|
88828
|
+
* }
|
|
88829
|
+
* }
|
|
88830
|
+
* }
|
|
88831
|
+
*/
|
|
88832
|
+
"application/json": components["schemas"]["Error"];
|
|
88833
|
+
};
|
|
88834
|
+
};
|
|
88835
|
+
/** @description Forbidden */
|
|
88836
|
+
403: {
|
|
88837
|
+
headers: {
|
|
88838
|
+
[name: string]: unknown;
|
|
88839
|
+
};
|
|
88840
|
+
content: {
|
|
88841
|
+
"application/json": components["schemas"]["Error"];
|
|
88842
|
+
};
|
|
88843
|
+
};
|
|
88844
|
+
/** @description Not found */
|
|
88845
|
+
404: {
|
|
88846
|
+
headers: {
|
|
88847
|
+
[name: string]: unknown;
|
|
88848
|
+
};
|
|
88849
|
+
content: {
|
|
88850
|
+
"application/json": components["schemas"]["Error"];
|
|
88851
|
+
};
|
|
88852
|
+
};
|
|
88853
|
+
/** @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. */
|
|
88854
|
+
409: {
|
|
88855
|
+
headers: {
|
|
88856
|
+
[name: string]: unknown;
|
|
88857
|
+
};
|
|
88858
|
+
content: {
|
|
88859
|
+
/**
|
|
88860
|
+
* @example {
|
|
88861
|
+
* "error": {
|
|
88862
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
88863
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
88864
|
+
* "details": {
|
|
88865
|
+
* "key_kind": "core"
|
|
88866
|
+
* }
|
|
88867
|
+
* }
|
|
88868
|
+
* }
|
|
88869
|
+
*/
|
|
88870
|
+
"application/json": components["schemas"]["Error"];
|
|
88871
|
+
};
|
|
88872
|
+
};
|
|
88873
|
+
/** @description Rate limited */
|
|
88874
|
+
429: {
|
|
88875
|
+
headers: {
|
|
88876
|
+
[name: string]: unknown;
|
|
88877
|
+
};
|
|
88878
|
+
content: {
|
|
88879
|
+
"application/json": components["schemas"]["Error"];
|
|
88880
|
+
};
|
|
88881
|
+
};
|
|
88882
|
+
};
|
|
88883
|
+
};
|
|
88884
|
+
/**
|
|
88885
|
+
* Set the monthly Ads goal
|
|
88886
|
+
* @description Replaces the goal. `target` > 0; a `roas` goal is at most 100, a `value` goal at most 10^10 CLP, an `outcomes` goal a whole number. The server stamps `updated_at`/`updated_by`. With `sample=1` the goal is validated and echoed with `persisted: false`, never stored.
|
|
88887
|
+
*/
|
|
88888
|
+
put: {
|
|
88889
|
+
parameters: {
|
|
88890
|
+
query?: {
|
|
88891
|
+
/** @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. */
|
|
88892
|
+
sample?: "1" | "true";
|
|
88893
|
+
};
|
|
88894
|
+
header?: never;
|
|
88895
|
+
path?: never;
|
|
88896
|
+
cookie?: never;
|
|
88897
|
+
};
|
|
88898
|
+
requestBody: {
|
|
88899
|
+
content: {
|
|
88900
|
+
/**
|
|
88901
|
+
* @example {
|
|
88902
|
+
* "kind": "outcomes",
|
|
88903
|
+
* "target": 30,
|
|
88904
|
+
* "period": "month"
|
|
88905
|
+
* }
|
|
88906
|
+
*/
|
|
88907
|
+
"application/json": {
|
|
88908
|
+
/**
|
|
88909
|
+
* @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
|
|
88910
|
+
* @enum {string}
|
|
88911
|
+
*/
|
|
88912
|
+
kind: "outcomes" | "value" | "roas";
|
|
88913
|
+
/** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
|
|
88914
|
+
target: number;
|
|
88915
|
+
/**
|
|
88916
|
+
* @description The only period: the calendar month.
|
|
88917
|
+
* @enum {string}
|
|
88918
|
+
*/
|
|
88919
|
+
period: "month";
|
|
88920
|
+
};
|
|
88921
|
+
};
|
|
88922
|
+
};
|
|
88923
|
+
responses: {
|
|
88924
|
+
/** @description The stored goal */
|
|
88925
|
+
200: {
|
|
88926
|
+
headers: {
|
|
88927
|
+
[name: string]: unknown;
|
|
88928
|
+
};
|
|
88929
|
+
content: {
|
|
88930
|
+
/**
|
|
88931
|
+
* @example {
|
|
88932
|
+
* "data": {
|
|
88933
|
+
* "kind": "outcomes",
|
|
88934
|
+
* "target": 30,
|
|
88935
|
+
* "period": "month",
|
|
88936
|
+
* "updated_at": "2026-09-23T15:00:00.000Z",
|
|
88937
|
+
* "updated_by": "20000000-0000-4000-8000-000000000001",
|
|
88938
|
+
* "persisted": true
|
|
88939
|
+
* }
|
|
88940
|
+
* }
|
|
88941
|
+
*/
|
|
88942
|
+
"application/json": {
|
|
88943
|
+
data: components["schemas"]["AdsGoal"] & Record<string, never>;
|
|
88944
|
+
};
|
|
88945
|
+
};
|
|
88946
|
+
};
|
|
88947
|
+
/** @description Validation error */
|
|
88948
|
+
400: {
|
|
88949
|
+
headers: {
|
|
88950
|
+
[name: string]: unknown;
|
|
88951
|
+
};
|
|
88952
|
+
content: {
|
|
88953
|
+
"application/json": components["schemas"]["Error"];
|
|
88954
|
+
};
|
|
88955
|
+
};
|
|
88956
|
+
/** @description Unauthorized */
|
|
88957
|
+
401: {
|
|
88958
|
+
headers: {
|
|
88959
|
+
[name: string]: unknown;
|
|
88960
|
+
};
|
|
88961
|
+
content: {
|
|
88962
|
+
"application/json": components["schemas"]["Error"];
|
|
88963
|
+
};
|
|
88964
|
+
};
|
|
88965
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
88966
|
+
402: {
|
|
88967
|
+
headers: {
|
|
88968
|
+
[name: string]: unknown;
|
|
88969
|
+
};
|
|
88970
|
+
content: {
|
|
88971
|
+
/**
|
|
88972
|
+
* @example {
|
|
88973
|
+
* "error": {
|
|
88974
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
88975
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
88976
|
+
* "details": {
|
|
88977
|
+
* "required": [
|
|
88978
|
+
* "vitrina_ads"
|
|
88979
|
+
* ],
|
|
88980
|
+
* "active": [],
|
|
88981
|
+
* "feature": "vitrina_ads",
|
|
88982
|
+
* "entitlement_state": "off"
|
|
88983
|
+
* }
|
|
88984
|
+
* }
|
|
88985
|
+
* }
|
|
88986
|
+
*/
|
|
88987
|
+
"application/json": components["schemas"]["Error"];
|
|
88988
|
+
};
|
|
88989
|
+
};
|
|
88990
|
+
/** @description Forbidden */
|
|
88991
|
+
403: {
|
|
88992
|
+
headers: {
|
|
88993
|
+
[name: string]: unknown;
|
|
88994
|
+
};
|
|
88995
|
+
content: {
|
|
88996
|
+
"application/json": components["schemas"]["Error"];
|
|
88997
|
+
};
|
|
88998
|
+
};
|
|
88999
|
+
/** @description Not found */
|
|
89000
|
+
404: {
|
|
89001
|
+
headers: {
|
|
89002
|
+
[name: string]: unknown;
|
|
89003
|
+
};
|
|
89004
|
+
content: {
|
|
89005
|
+
"application/json": components["schemas"]["Error"];
|
|
89006
|
+
};
|
|
89007
|
+
};
|
|
89008
|
+
/** @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. */
|
|
89009
|
+
409: {
|
|
89010
|
+
headers: {
|
|
89011
|
+
[name: string]: unknown;
|
|
89012
|
+
};
|
|
89013
|
+
content: {
|
|
89014
|
+
/**
|
|
89015
|
+
* @example {
|
|
89016
|
+
* "error": {
|
|
89017
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
89018
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
89019
|
+
* "details": {
|
|
89020
|
+
* "key_kind": "core"
|
|
89021
|
+
* }
|
|
89022
|
+
* }
|
|
89023
|
+
* }
|
|
89024
|
+
*/
|
|
89025
|
+
"application/json": components["schemas"]["Error"];
|
|
89026
|
+
};
|
|
89027
|
+
};
|
|
89028
|
+
/** @description Rate limited */
|
|
89029
|
+
429: {
|
|
89030
|
+
headers: {
|
|
89031
|
+
[name: string]: unknown;
|
|
89032
|
+
};
|
|
89033
|
+
content: {
|
|
89034
|
+
"application/json": components["schemas"]["Error"];
|
|
89035
|
+
};
|
|
89036
|
+
};
|
|
89037
|
+
};
|
|
89038
|
+
};
|
|
89039
|
+
post?: never;
|
|
89040
|
+
/**
|
|
89041
|
+
* Clear the monthly Ads goal
|
|
89042
|
+
* @description Removes the goal. Idempotent. With `sample=1` nothing is stored or removed.
|
|
89043
|
+
*/
|
|
89044
|
+
delete: {
|
|
89045
|
+
parameters: {
|
|
89046
|
+
query?: {
|
|
89047
|
+
/** @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. */
|
|
89048
|
+
sample?: "1" | "true";
|
|
89049
|
+
};
|
|
89050
|
+
header?: never;
|
|
89051
|
+
path?: never;
|
|
89052
|
+
cookie?: never;
|
|
89053
|
+
};
|
|
89054
|
+
requestBody?: never;
|
|
89055
|
+
responses: {
|
|
89056
|
+
/** @description Cleared */
|
|
89057
|
+
204: {
|
|
89058
|
+
headers: {
|
|
89059
|
+
[name: string]: unknown;
|
|
89060
|
+
};
|
|
89061
|
+
content?: never;
|
|
89062
|
+
};
|
|
89063
|
+
/** @description Validation error */
|
|
89064
|
+
400: {
|
|
89065
|
+
headers: {
|
|
89066
|
+
[name: string]: unknown;
|
|
89067
|
+
};
|
|
89068
|
+
content: {
|
|
89069
|
+
"application/json": components["schemas"]["Error"];
|
|
89070
|
+
};
|
|
89071
|
+
};
|
|
89072
|
+
/** @description Unauthorized */
|
|
89073
|
+
401: {
|
|
89074
|
+
headers: {
|
|
89075
|
+
[name: string]: unknown;
|
|
89076
|
+
};
|
|
89077
|
+
content: {
|
|
89078
|
+
"application/json": components["schemas"]["Error"];
|
|
89079
|
+
};
|
|
89080
|
+
};
|
|
89081
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
89082
|
+
402: {
|
|
89083
|
+
headers: {
|
|
89084
|
+
[name: string]: unknown;
|
|
89085
|
+
};
|
|
89086
|
+
content: {
|
|
89087
|
+
/**
|
|
89088
|
+
* @example {
|
|
89089
|
+
* "error": {
|
|
89090
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
89091
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
89092
|
+
* "details": {
|
|
89093
|
+
* "required": [
|
|
89094
|
+
* "vitrina_ads"
|
|
89095
|
+
* ],
|
|
89096
|
+
* "active": [],
|
|
89097
|
+
* "feature": "vitrina_ads",
|
|
89098
|
+
* "entitlement_state": "off"
|
|
89099
|
+
* }
|
|
89100
|
+
* }
|
|
89101
|
+
* }
|
|
89102
|
+
*/
|
|
89103
|
+
"application/json": components["schemas"]["Error"];
|
|
89104
|
+
};
|
|
89105
|
+
};
|
|
89106
|
+
/** @description Forbidden */
|
|
89107
|
+
403: {
|
|
89108
|
+
headers: {
|
|
89109
|
+
[name: string]: unknown;
|
|
89110
|
+
};
|
|
89111
|
+
content: {
|
|
89112
|
+
"application/json": components["schemas"]["Error"];
|
|
89113
|
+
};
|
|
89114
|
+
};
|
|
89115
|
+
/** @description Not found */
|
|
89116
|
+
404: {
|
|
89117
|
+
headers: {
|
|
89118
|
+
[name: string]: unknown;
|
|
89119
|
+
};
|
|
89120
|
+
content: {
|
|
89121
|
+
"application/json": components["schemas"]["Error"];
|
|
89122
|
+
};
|
|
89123
|
+
};
|
|
89124
|
+
/** @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. */
|
|
89125
|
+
409: {
|
|
89126
|
+
headers: {
|
|
89127
|
+
[name: string]: unknown;
|
|
89128
|
+
};
|
|
89129
|
+
content: {
|
|
89130
|
+
/**
|
|
89131
|
+
* @example {
|
|
89132
|
+
* "error": {
|
|
89133
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
89134
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
89135
|
+
* "details": {
|
|
89136
|
+
* "key_kind": "core"
|
|
89137
|
+
* }
|
|
89138
|
+
* }
|
|
89139
|
+
* }
|
|
89140
|
+
*/
|
|
89141
|
+
"application/json": components["schemas"]["Error"];
|
|
89142
|
+
};
|
|
89143
|
+
};
|
|
89144
|
+
/** @description Rate limited */
|
|
89145
|
+
429: {
|
|
89146
|
+
headers: {
|
|
89147
|
+
[name: string]: unknown;
|
|
89148
|
+
};
|
|
89149
|
+
content: {
|
|
89150
|
+
"application/json": components["schemas"]["Error"];
|
|
89151
|
+
};
|
|
89152
|
+
};
|
|
89153
|
+
};
|
|
89154
|
+
};
|
|
89155
|
+
options?: never;
|
|
89156
|
+
head?: never;
|
|
89157
|
+
patch?: never;
|
|
89158
|
+
trace?: never;
|
|
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
|
+
};
|
|
87754
89725
|
delete?: never;
|
|
87755
89726
|
options?: never;
|
|
87756
89727
|
head?: never;
|
|
87757
89728
|
patch?: never;
|
|
87758
89729
|
trace?: never;
|
|
87759
89730
|
};
|
|
87760
|
-
"/ads/
|
|
89731
|
+
"/ads/actions/executions/{id}": {
|
|
87761
89732
|
parameters: {
|
|
87762
89733
|
query?: never;
|
|
87763
89734
|
header?: never;
|
|
@@ -87765,29 +89736,25 @@ interface paths {
|
|
|
87765
89736
|
cookie?: never;
|
|
87766
89737
|
};
|
|
87767
89738
|
/**
|
|
87768
|
-
*
|
|
87769
|
-
* @description
|
|
87770
|
-
*
|
|
87771
|
-
* `campaign_external_id` on each row is the PLATFORM id — pass it as `campaign_id` to `/ads/attributed-sales` for the drill-down.
|
|
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.
|
|
87772
89741
|
*/
|
|
87773
89742
|
get: {
|
|
87774
89743
|
parameters: {
|
|
87775
|
-
query
|
|
87776
|
-
/** @description
|
|
87777
|
-
|
|
87778
|
-
/** @description Window end (inclusive), YYYY-MM-DD. */
|
|
87779
|
-
to: string;
|
|
87780
|
-
/** @description Atribu attribution model. Defaults to `last_touch`. */
|
|
87781
|
-
model?: string;
|
|
87782
|
-
limit?: number;
|
|
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";
|
|
87783
89747
|
};
|
|
87784
89748
|
header?: never;
|
|
87785
|
-
path
|
|
89749
|
+
path: {
|
|
89750
|
+
/** @description The execution id. */
|
|
89751
|
+
id: string;
|
|
89752
|
+
};
|
|
87786
89753
|
cookie?: never;
|
|
87787
89754
|
};
|
|
87788
89755
|
requestBody?: never;
|
|
87789
89756
|
responses: {
|
|
87790
|
-
/** @description The
|
|
89757
|
+
/** @description The execution */
|
|
87791
89758
|
200: {
|
|
87792
89759
|
headers: {
|
|
87793
89760
|
[name: string]: unknown;
|
|
@@ -87796,24 +89763,26 @@ interface paths {
|
|
|
87796
89763
|
/**
|
|
87797
89764
|
* @example {
|
|
87798
89765
|
* "data": {
|
|
87799
|
-
* "
|
|
87800
|
-
*
|
|
87801
|
-
*
|
|
87802
|
-
*
|
|
87803
|
-
*
|
|
87804
|
-
*
|
|
87805
|
-
*
|
|
87806
|
-
*
|
|
87807
|
-
*
|
|
87808
|
-
*
|
|
87809
|
-
*
|
|
87810
|
-
*
|
|
87811
|
-
*
|
|
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"
|
|
87812
89781
|
* }
|
|
87813
89782
|
* }
|
|
87814
89783
|
*/
|
|
87815
89784
|
"application/json": {
|
|
87816
|
-
data: components["schemas"]["
|
|
89785
|
+
data: components["schemas"]["AdsActionExecution"];
|
|
87817
89786
|
};
|
|
87818
89787
|
};
|
|
87819
89788
|
};
|
|
@@ -87917,39 +89886,39 @@ interface paths {
|
|
|
87917
89886
|
patch?: never;
|
|
87918
89887
|
trace?: never;
|
|
87919
89888
|
};
|
|
87920
|
-
"/ads/
|
|
89889
|
+
"/ads/actions/executions/{id}/rollback": {
|
|
87921
89890
|
parameters: {
|
|
87922
89891
|
query?: never;
|
|
87923
89892
|
header?: never;
|
|
87924
89893
|
path?: never;
|
|
87925
89894
|
cookie?: never;
|
|
87926
89895
|
};
|
|
89896
|
+
get?: never;
|
|
89897
|
+
put?: never;
|
|
87927
89898
|
/**
|
|
87928
|
-
*
|
|
87929
|
-
* @description
|
|
87930
|
-
*
|
|
87931
|
-
* `customer_name`/`customer_email` are `null` unless the tenant’s delegated key also carries `customers:read` — every other field is visible under `campaigns:read` alone.
|
|
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.
|
|
87932
89901
|
*/
|
|
87933
|
-
|
|
89902
|
+
post: {
|
|
87934
89903
|
parameters: {
|
|
87935
|
-
query
|
|
87936
|
-
/** @description
|
|
87937
|
-
|
|
87938
|
-
|
|
87939
|
-
|
|
87940
|
-
/** @description
|
|
87941
|
-
|
|
87942
|
-
|
|
87943
|
-
|
|
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;
|
|
87944
89915
|
};
|
|
87945
|
-
header?: never;
|
|
87946
|
-
path?: never;
|
|
87947
89916
|
cookie?: never;
|
|
87948
89917
|
};
|
|
87949
89918
|
requestBody?: never;
|
|
87950
89919
|
responses: {
|
|
87951
|
-
/** @description The
|
|
87952
|
-
|
|
89920
|
+
/** @description The rollback execution */
|
|
89921
|
+
202: {
|
|
87953
89922
|
headers: {
|
|
87954
89923
|
[name: string]: unknown;
|
|
87955
89924
|
};
|
|
@@ -87957,29 +89926,18 @@ interface paths {
|
|
|
87957
89926
|
/**
|
|
87958
89927
|
* @example {
|
|
87959
89928
|
* "data": {
|
|
87960
|
-
* "
|
|
87961
|
-
*
|
|
87962
|
-
* "conversion_id": "a8a8a8a8-0000-4000-8000-000000000001",
|
|
87963
|
-
* "event_type": "closed_won",
|
|
87964
|
-
* "event_time": "2026-09-12T16:40:00.000Z",
|
|
87965
|
-
* "customer_profile_id": "a9a9a9a9-0000-4000-8000-000000000001",
|
|
87966
|
-
* "customer_key": null,
|
|
87967
|
-
* "customer_name": "María José",
|
|
87968
|
-
* "customer_email": null,
|
|
87969
|
-
* "value_amount": 1200000,
|
|
87970
|
-
* "revenue_type": "accepted_value",
|
|
87971
|
-
* "credited_value": 1200000,
|
|
87972
|
-
* "credited_weight": 1,
|
|
87973
|
-
* "touch_count": 3,
|
|
87974
|
-
* "path_length": 3,
|
|
87975
|
-
* "is_inherited": false
|
|
87976
|
-
* }
|
|
87977
|
-
* ]
|
|
89929
|
+
* "execution_id": "e5e5e5e5-0000-4000-8000-000000000002",
|
|
89930
|
+
* "status": "queued"
|
|
87978
89931
|
* }
|
|
87979
89932
|
* }
|
|
87980
89933
|
*/
|
|
87981
89934
|
"application/json": {
|
|
87982
|
-
data:
|
|
89935
|
+
data: {
|
|
89936
|
+
/** Format: uuid */
|
|
89937
|
+
execution_id: string;
|
|
89938
|
+
/** @enum {string} */
|
|
89939
|
+
status: "queued" | "running" | "succeeded" | "failed" | "refused" | "rolled_back";
|
|
89940
|
+
};
|
|
87983
89941
|
};
|
|
87984
89942
|
};
|
|
87985
89943
|
};
|
|
@@ -88075,41 +90033,54 @@ interface paths {
|
|
|
88075
90033
|
};
|
|
88076
90034
|
};
|
|
88077
90035
|
};
|
|
88078
|
-
put?: never;
|
|
88079
|
-
post?: never;
|
|
88080
90036
|
delete?: never;
|
|
88081
90037
|
options?: never;
|
|
88082
90038
|
head?: never;
|
|
88083
90039
|
patch?: never;
|
|
88084
90040
|
trace?: never;
|
|
88085
90041
|
};
|
|
88086
|
-
"/ads/
|
|
90042
|
+
"/ads/actions/{key}/dismiss": {
|
|
88087
90043
|
parameters: {
|
|
88088
90044
|
query?: never;
|
|
88089
90045
|
header?: never;
|
|
88090
90046
|
path?: never;
|
|
88091
90047
|
cookie?: never;
|
|
88092
90048
|
};
|
|
90049
|
+
get?: never;
|
|
90050
|
+
put?: never;
|
|
88093
90051
|
/**
|
|
88094
|
-
*
|
|
88095
|
-
* @description
|
|
88096
|
-
*
|
|
88097
|
-
* This is the PROFILE-scoped read — every Vitrina tenant’s delegated key is minted for exactly one Atribu profile, so it cannot call Atribu’s cross-profile `/workspaces/{id}/top-performers` (that route is session-bearer-only and answers `403 insufficient_scope` to any API key).
|
|
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`).
|
|
88098
90054
|
*/
|
|
88099
|
-
|
|
90055
|
+
post: {
|
|
88100
90056
|
parameters: {
|
|
88101
|
-
query?:
|
|
88102
|
-
|
|
88103
|
-
|
|
88104
|
-
|
|
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;
|
|
88105
90065
|
};
|
|
88106
|
-
header?: never;
|
|
88107
|
-
path?: never;
|
|
88108
90066
|
cookie?: never;
|
|
88109
90067
|
};
|
|
88110
|
-
requestBody
|
|
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
|
+
};
|
|
88111
90082
|
responses: {
|
|
88112
|
-
/** @description
|
|
90083
|
+
/** @description Dismissed */
|
|
88113
90084
|
200: {
|
|
88114
90085
|
headers: {
|
|
88115
90086
|
[name: string]: unknown;
|
|
@@ -88118,33 +90089,17 @@ interface paths {
|
|
|
88118
90089
|
/**
|
|
88119
90090
|
* @example {
|
|
88120
90091
|
* "data": {
|
|
88121
|
-
* "
|
|
88122
|
-
*
|
|
88123
|
-
* "ad_external_id": "120212000000000009",
|
|
88124
|
-
* "ad_name": "Video testimonio 15s",
|
|
88125
|
-
* "campaign_name": "Leads · Septiembre",
|
|
88126
|
-
* "ad_set_name": "Santiago 25-45",
|
|
88127
|
-
* "creative_thumbnail_url": null,
|
|
88128
|
-
* "score_window": "28d",
|
|
88129
|
-
* "composite_score": 0.82,
|
|
88130
|
-
* "top_performer_likelihood": 0.71,
|
|
88131
|
-
* "maturity_stage": "mature",
|
|
88132
|
-
* "truth_grade": "attributed",
|
|
88133
|
-
* "primary_outcome_kind": "closed_won",
|
|
88134
|
-
* "spend": 150000,
|
|
88135
|
-
* "impressions": 48200,
|
|
88136
|
-
* "ctr": 1.9,
|
|
88137
|
-
* "attributed_revenue": 480000,
|
|
88138
|
-
* "roas": 3.2,
|
|
88139
|
-
* "fatigue_state": "active",
|
|
88140
|
-
* "fatigue_risk_tier": "low"
|
|
88141
|
-
* }
|
|
88142
|
-
* ]
|
|
90092
|
+
* "dismissed_until": "2026-09-30T15:00:00.000Z",
|
|
90093
|
+
* "persisted": true
|
|
88143
90094
|
* }
|
|
88144
90095
|
* }
|
|
88145
90096
|
*/
|
|
88146
90097
|
"application/json": {
|
|
88147
|
-
data:
|
|
90098
|
+
data: {
|
|
90099
|
+
dismissed_until: string;
|
|
90100
|
+
/** @description `false` in sample mode. */
|
|
90101
|
+
persisted: boolean;
|
|
90102
|
+
};
|
|
88148
90103
|
};
|
|
88149
90104
|
};
|
|
88150
90105
|
};
|
|
@@ -88240,15 +90195,13 @@ interface paths {
|
|
|
88240
90195
|
};
|
|
88241
90196
|
};
|
|
88242
90197
|
};
|
|
88243
|
-
put?: never;
|
|
88244
|
-
post?: never;
|
|
88245
90198
|
delete?: never;
|
|
88246
90199
|
options?: never;
|
|
88247
90200
|
head?: never;
|
|
88248
90201
|
patch?: never;
|
|
88249
90202
|
trace?: never;
|
|
88250
90203
|
};
|
|
88251
|
-
"/ads/
|
|
90204
|
+
"/ads/tracking/key": {
|
|
88252
90205
|
parameters: {
|
|
88253
90206
|
query?: never;
|
|
88254
90207
|
header?: never;
|
|
@@ -88256,36 +90209,23 @@ interface paths {
|
|
|
88256
90209
|
cookie?: never;
|
|
88257
90210
|
};
|
|
88258
90211
|
/**
|
|
88259
|
-
*
|
|
88260
|
-
* @description
|
|
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.
|
|
88261
90214
|
*
|
|
88262
|
-
*
|
|
88263
|
-
* * `utm` — Atribu’s `quality/utm` operation: the cached UTM-health badge (malformed/missing/dangling-ad-id anomaly counts over the traffic side) plus the dangling-ad-ids rollup (attributed cash that cannot be placed in the ad hierarchy).
|
|
88264
|
-
* * `attribution_coverage` — Atribu’s `quality/attribution` operation: the conversion side — how many of the window’s conversions carry a real ad id, an `fbclid` only, or nothing, partitioning `total_conversions`.
|
|
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.
|
|
88265
90216
|
*
|
|
88266
|
-
*
|
|
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`).
|
|
88267
90218
|
*/
|
|
88268
90219
|
get: {
|
|
88269
90220
|
parameters: {
|
|
88270
|
-
query
|
|
88271
|
-
/** @description Window start (inclusive), YYYY-MM-DD. */
|
|
88272
|
-
from: string;
|
|
88273
|
-
/** @description Window end (inclusive), YYYY-MM-DD. */
|
|
88274
|
-
to: string;
|
|
88275
|
-
/** @description Atribu attribution model. Defaults to `last_touch`. */
|
|
88276
|
-
model?: string;
|
|
88277
|
-
/** @description Instrumentation-health + UTM-badge cached window, days (1-30, capped by the Ephemeral Buffer’s retention). Defaults to 30. */
|
|
88278
|
-
days?: number;
|
|
88279
|
-
/** @description Traceable-ROAS trend window, days, split in half for the recent-vs-prior comparison. Defaults to 28. */
|
|
88280
|
-
window_days?: number;
|
|
88281
|
-
};
|
|
90221
|
+
query?: never;
|
|
88282
90222
|
header?: never;
|
|
88283
90223
|
path?: never;
|
|
88284
90224
|
cookie?: never;
|
|
88285
90225
|
};
|
|
88286
90226
|
requestBody?: never;
|
|
88287
90227
|
responses: {
|
|
88288
|
-
/** @description
|
|
90228
|
+
/** @description The tracking key and the tag to paste */
|
|
88289
90229
|
200: {
|
|
88290
90230
|
headers: {
|
|
88291
90231
|
[name: string]: unknown;
|
|
@@ -88294,55 +90234,17 @@ interface paths {
|
|
|
88294
90234
|
/**
|
|
88295
90235
|
* @example {
|
|
88296
90236
|
* "data": {
|
|
88297
|
-
* "
|
|
88298
|
-
*
|
|
88299
|
-
*
|
|
88300
|
-
*
|
|
88301
|
-
*
|
|
88302
|
-
*
|
|
88303
|
-
* "total_value": 5000000,
|
|
88304
|
-
* "instrumentation": {
|
|
88305
|
-
* "score": 0.86,
|
|
88306
|
-
* "verdict": "healthy_tracking",
|
|
88307
|
-
* "tracking_healthy": true,
|
|
88308
|
-
* "coverage_interpretation": "La mayoría de las ventas llegan con su origen publicitario.",
|
|
88309
|
-
* "missing": []
|
|
88310
|
-
* },
|
|
88311
|
-
* "traceable_roas_trend": {
|
|
88312
|
-
* "recent_roas": 3.4,
|
|
88313
|
-
* "prior_roas": 2.9,
|
|
88314
|
-
* "recent_spend": 845200,
|
|
88315
|
-
* "recent_traceable_revenue": 2873680,
|
|
88316
|
-
* "days_with_cash": 11
|
|
88317
|
-
* }
|
|
88318
|
-
* },
|
|
88319
|
-
* "utm": {
|
|
88320
|
-
* "scan_window_days": 14,
|
|
88321
|
-
* "events_scanned": 312,
|
|
88322
|
-
* "high_count": 3,
|
|
88323
|
-
* "medium_count": 7,
|
|
88324
|
-
* "refreshed_at": "2026-09-22T06:00:00.000Z",
|
|
88325
|
-
* "dangling_ad_ids": {
|
|
88326
|
-
* "window_days": 28,
|
|
88327
|
-
* "model": "last_touch",
|
|
88328
|
-
* "dangling_conversions": 2,
|
|
88329
|
-
* "attributed_cash": 90000,
|
|
88330
|
-
* "reporting_currency": "CLP",
|
|
88331
|
-
* "distinct_ad_ids": 1
|
|
88332
|
-
* }
|
|
88333
|
-
* },
|
|
88334
|
-
* "attribution_coverage": {
|
|
88335
|
-
* "total_conversions": 200,
|
|
88336
|
-
* "with_full_utms": 162,
|
|
88337
|
-
* "with_fbclid_only": 18,
|
|
88338
|
-
* "with_no_tracking": 20,
|
|
88339
|
-
* "coverage_percent": 90
|
|
88340
|
-
* }
|
|
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
|
|
88341
90243
|
* }
|
|
88342
90244
|
* }
|
|
88343
90245
|
*/
|
|
88344
90246
|
"application/json": {
|
|
88345
|
-
data: components["schemas"]["
|
|
90247
|
+
data: components["schemas"]["AdsTrackingKey"];
|
|
88346
90248
|
};
|
|
88347
90249
|
};
|
|
88348
90250
|
};
|
|
@@ -88446,7 +90348,7 @@ interface paths {
|
|
|
88446
90348
|
patch?: never;
|
|
88447
90349
|
trace?: never;
|
|
88448
90350
|
};
|
|
88449
|
-
"/ads/tracking/
|
|
90351
|
+
"/ads/tracking/installers/gtm": {
|
|
88450
90352
|
parameters: {
|
|
88451
90353
|
query?: never;
|
|
88452
90354
|
header?: never;
|
|
@@ -88454,23 +90356,25 @@ interface paths {
|
|
|
88454
90356
|
cookie?: never;
|
|
88455
90357
|
};
|
|
88456
90358
|
/**
|
|
88457
|
-
* The
|
|
88458
|
-
* @description
|
|
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`.
|
|
88459
90361
|
*
|
|
88460
|
-
* `
|
|
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.
|
|
88461
90363
|
*
|
|
88462
|
-
*
|
|
90364
|
+
* Same entitlement gate as `GET /ads/tracking/key`. Admin-scoped (`ads:read`).
|
|
88463
90365
|
*/
|
|
88464
90366
|
get: {
|
|
88465
90367
|
parameters: {
|
|
88466
|
-
query?:
|
|
90368
|
+
query?: {
|
|
90369
|
+
site_id?: string;
|
|
90370
|
+
};
|
|
88467
90371
|
header?: never;
|
|
88468
90372
|
path?: never;
|
|
88469
90373
|
cookie?: never;
|
|
88470
90374
|
};
|
|
88471
90375
|
requestBody?: never;
|
|
88472
90376
|
responses: {
|
|
88473
|
-
/** @description The
|
|
90377
|
+
/** @description The GTM Custom HTML installer payload */
|
|
88474
90378
|
200: {
|
|
88475
90379
|
headers: {
|
|
88476
90380
|
[name: string]: unknown;
|
|
@@ -88481,15 +90385,22 @@ interface paths {
|
|
|
88481
90385
|
* "data": {
|
|
88482
90386
|
* "key_id": "abababab-0000-4000-8000-000000000001",
|
|
88483
90387
|
* "public_key": "trk_live_abc123",
|
|
88484
|
-
* "
|
|
88485
|
-
* "
|
|
88486
|
-
* "
|
|
88487
|
-
* "
|
|
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
|
+
* ]
|
|
88488
90399
|
* }
|
|
88489
90400
|
* }
|
|
88490
90401
|
*/
|
|
88491
90402
|
"application/json": {
|
|
88492
|
-
data: components["schemas"]["
|
|
90403
|
+
data: components["schemas"]["AdsGtmInstaller"];
|
|
88493
90404
|
};
|
|
88494
90405
|
};
|
|
88495
90406
|
};
|
|
@@ -88593,7 +90504,7 @@ interface paths {
|
|
|
88593
90504
|
patch?: never;
|
|
88594
90505
|
trace?: never;
|
|
88595
90506
|
};
|
|
88596
|
-
"/ads/tracking/
|
|
90507
|
+
"/ads/tracking/status": {
|
|
88597
90508
|
parameters: {
|
|
88598
90509
|
query?: never;
|
|
88599
90510
|
header?: never;
|
|
@@ -88601,25 +90512,23 @@ interface paths {
|
|
|
88601
90512
|
cookie?: never;
|
|
88602
90513
|
};
|
|
88603
90514
|
/**
|
|
88604
|
-
*
|
|
88605
|
-
* @description
|
|
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.
|
|
88606
90517
|
*
|
|
88607
|
-
*
|
|
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.
|
|
88608
90519
|
*
|
|
88609
90520
|
* Same entitlement gate as `GET /ads/tracking/key`. Admin-scoped (`ads:read`).
|
|
88610
90521
|
*/
|
|
88611
90522
|
get: {
|
|
88612
90523
|
parameters: {
|
|
88613
|
-
query?:
|
|
88614
|
-
site_id?: string;
|
|
88615
|
-
};
|
|
90524
|
+
query?: never;
|
|
88616
90525
|
header?: never;
|
|
88617
90526
|
path?: never;
|
|
88618
90527
|
cookie?: never;
|
|
88619
90528
|
};
|
|
88620
90529
|
requestBody?: never;
|
|
88621
90530
|
responses: {
|
|
88622
|
-
/** @description The
|
|
90531
|
+
/** @description The tag detection status */
|
|
88623
90532
|
200: {
|
|
88624
90533
|
headers: {
|
|
88625
90534
|
[name: string]: unknown;
|
|
@@ -88628,24 +90537,16 @@ interface paths {
|
|
|
88628
90537
|
/**
|
|
88629
90538
|
* @example {
|
|
88630
90539
|
* "data": {
|
|
88631
|
-
* "
|
|
88632
|
-
* "
|
|
88633
|
-
* "
|
|
88634
|
-
* "
|
|
88635
|
-
* "
|
|
88636
|
-
* "snippet": "<script src=\"https://api.vitrinadev.com/tag.js?site=pk_live_3f9c2a\" async></script>",
|
|
88637
|
-
* "setup_checklist": [
|
|
88638
|
-
* "En Google Tag Manager, crea una etiqueta nueva de tipo «HTML personalizado».",
|
|
88639
|
-
* "Pega el fragmento de Vitrina (tag.js) tal cual.",
|
|
88640
|
-
* "Activador: All Pages.",
|
|
88641
|
-
* "Guarda la etiqueta y publica el contenedor.",
|
|
88642
|
-
* "El asistente y la medición se cargan desde este mismo tag.js: no agregues otro fragmento de Vitrina aparte."
|
|
88643
|
-
* ]
|
|
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"
|
|
88644
90545
|
* }
|
|
88645
90546
|
* }
|
|
88646
90547
|
*/
|
|
88647
90548
|
"application/json": {
|
|
88648
|
-
data: components["schemas"]["
|
|
90549
|
+
data: components["schemas"]["AdsTrackingStatus"];
|
|
88649
90550
|
};
|
|
88650
90551
|
};
|
|
88651
90552
|
};
|
|
@@ -88749,7 +90650,7 @@ interface paths {
|
|
|
88749
90650
|
patch?: never;
|
|
88750
90651
|
trace?: never;
|
|
88751
90652
|
};
|
|
88752
|
-
"/ads/
|
|
90653
|
+
"/ads/feed": {
|
|
88753
90654
|
parameters: {
|
|
88754
90655
|
query?: never;
|
|
88755
90656
|
header?: never;
|
|
@@ -88757,23 +90658,245 @@ interface paths {
|
|
|
88757
90658
|
cookie?: never;
|
|
88758
90659
|
};
|
|
88759
90660
|
/**
|
|
88760
|
-
*
|
|
88761
|
-
* @description
|
|
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»).
|
|
88762
90663
|
*
|
|
88763
|
-
*
|
|
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).
|
|
88764
90665
|
*
|
|
88765
|
-
*
|
|
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.
|
|
88766
90667
|
*/
|
|
88767
90668
|
get: {
|
|
88768
90669
|
parameters: {
|
|
88769
|
-
query
|
|
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";
|
|
90689
|
+
};
|
|
88770
90690
|
header?: never;
|
|
88771
90691
|
path?: never;
|
|
88772
90692
|
cookie?: never;
|
|
88773
90693
|
};
|
|
88774
90694
|
requestBody?: never;
|
|
88775
90695
|
responses: {
|
|
88776
|
-
/** @description
|
|
90696
|
+
/** @description A page of the feed, newest first */
|
|
90697
|
+
200: {
|
|
90698
|
+
headers: {
|
|
90699
|
+
[name: string]: unknown;
|
|
90700
|
+
};
|
|
90701
|
+
content: {
|
|
90702
|
+
/**
|
|
90703
|
+
* @example {
|
|
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"
|
|
90751
|
+
* }
|
|
90752
|
+
* }
|
|
90753
|
+
*/
|
|
90754
|
+
"application/json": {
|
|
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
|
+
};
|
|
90766
|
+
};
|
|
90767
|
+
};
|
|
90768
|
+
};
|
|
90769
|
+
/** @description Validation error */
|
|
90770
|
+
400: {
|
|
90771
|
+
headers: {
|
|
90772
|
+
[name: string]: unknown;
|
|
90773
|
+
};
|
|
90774
|
+
content: {
|
|
90775
|
+
"application/json": components["schemas"]["Error"];
|
|
90776
|
+
};
|
|
90777
|
+
};
|
|
90778
|
+
/** @description Unauthorized */
|
|
90779
|
+
401: {
|
|
90780
|
+
headers: {
|
|
90781
|
+
[name: string]: unknown;
|
|
90782
|
+
};
|
|
90783
|
+
content: {
|
|
90784
|
+
"application/json": components["schemas"]["Error"];
|
|
90785
|
+
};
|
|
90786
|
+
};
|
|
90787
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
90788
|
+
402: {
|
|
90789
|
+
headers: {
|
|
90790
|
+
[name: string]: unknown;
|
|
90791
|
+
};
|
|
90792
|
+
content: {
|
|
90793
|
+
/**
|
|
90794
|
+
* @example {
|
|
90795
|
+
* "error": {
|
|
90796
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
90797
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
90798
|
+
* "details": {
|
|
90799
|
+
* "required": [
|
|
90800
|
+
* "vitrina_ads"
|
|
90801
|
+
* ],
|
|
90802
|
+
* "active": [],
|
|
90803
|
+
* "feature": "vitrina_ads",
|
|
90804
|
+
* "entitlement_state": "off"
|
|
90805
|
+
* }
|
|
90806
|
+
* }
|
|
90807
|
+
* }
|
|
90808
|
+
*/
|
|
90809
|
+
"application/json": components["schemas"]["Error"];
|
|
90810
|
+
};
|
|
90811
|
+
};
|
|
90812
|
+
/** @description Forbidden */
|
|
90813
|
+
403: {
|
|
90814
|
+
headers: {
|
|
90815
|
+
[name: string]: unknown;
|
|
90816
|
+
};
|
|
90817
|
+
content: {
|
|
90818
|
+
"application/json": components["schemas"]["Error"];
|
|
90819
|
+
};
|
|
90820
|
+
};
|
|
90821
|
+
/** @description Not found */
|
|
90822
|
+
404: {
|
|
90823
|
+
headers: {
|
|
90824
|
+
[name: string]: unknown;
|
|
90825
|
+
};
|
|
90826
|
+
content: {
|
|
90827
|
+
"application/json": components["schemas"]["Error"];
|
|
90828
|
+
};
|
|
90829
|
+
};
|
|
90830
|
+
/** @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. */
|
|
90831
|
+
409: {
|
|
90832
|
+
headers: {
|
|
90833
|
+
[name: string]: unknown;
|
|
90834
|
+
};
|
|
90835
|
+
content: {
|
|
90836
|
+
/**
|
|
90837
|
+
* @example {
|
|
90838
|
+
* "error": {
|
|
90839
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
90840
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
90841
|
+
* "details": {
|
|
90842
|
+
* "key_kind": "core"
|
|
90843
|
+
* }
|
|
90844
|
+
* }
|
|
90845
|
+
* }
|
|
90846
|
+
*/
|
|
90847
|
+
"application/json": components["schemas"]["Error"];
|
|
90848
|
+
};
|
|
90849
|
+
};
|
|
90850
|
+
/** @description Rate limited */
|
|
90851
|
+
429: {
|
|
90852
|
+
headers: {
|
|
90853
|
+
[name: string]: unknown;
|
|
90854
|
+
};
|
|
90855
|
+
content: {
|
|
90856
|
+
"application/json": components["schemas"]["Error"];
|
|
90857
|
+
};
|
|
90858
|
+
};
|
|
90859
|
+
};
|
|
90860
|
+
};
|
|
90861
|
+
put?: never;
|
|
90862
|
+
post?: never;
|
|
90863
|
+
delete?: never;
|
|
90864
|
+
options?: never;
|
|
90865
|
+
head?: never;
|
|
90866
|
+
patch?: never;
|
|
90867
|
+
trace?: never;
|
|
90868
|
+
};
|
|
90869
|
+
"/ads/feed/{id}/journey": {
|
|
90870
|
+
parameters: {
|
|
90871
|
+
query?: never;
|
|
90872
|
+
header?: never;
|
|
90873
|
+
path?: never;
|
|
90874
|
+
cookie?: never;
|
|
90875
|
+
};
|
|
90876
|
+
/**
|
|
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).
|
|
90879
|
+
*/
|
|
90880
|
+
get: {
|
|
90881
|
+
parameters: {
|
|
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
|
+
};
|
|
90890
|
+
header?: never;
|
|
90891
|
+
path: {
|
|
90892
|
+
/** @description The feed item id (`data[].id`). */
|
|
90893
|
+
id: string;
|
|
90894
|
+
};
|
|
90895
|
+
cookie?: never;
|
|
90896
|
+
};
|
|
90897
|
+
requestBody?: never;
|
|
90898
|
+
responses: {
|
|
90899
|
+
/** @description The journey */
|
|
88777
90900
|
200: {
|
|
88778
90901
|
headers: {
|
|
88779
90902
|
[name: string]: unknown;
|
|
@@ -88782,16 +90905,44 @@ interface paths {
|
|
|
88782
90905
|
/**
|
|
88783
90906
|
* @example {
|
|
88784
90907
|
* "data": {
|
|
88785
|
-
* "
|
|
88786
|
-
*
|
|
88787
|
-
*
|
|
88788
|
-
*
|
|
88789
|
-
*
|
|
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"
|
|
88790
90941
|
* }
|
|
88791
90942
|
* }
|
|
88792
90943
|
*/
|
|
88793
90944
|
"application/json": {
|
|
88794
|
-
data: components["schemas"]["
|
|
90945
|
+
data: components["schemas"]["AdsJourney"];
|
|
88795
90946
|
};
|
|
88796
90947
|
};
|
|
88797
90948
|
};
|
|
@@ -104117,7 +106268,7 @@ interface paths {
|
|
|
104117
106268
|
put?: never;
|
|
104118
106269
|
/**
|
|
104119
106270
|
* Freeze a pack
|
|
104120
|
-
* @description Honours the catalog's `freeze_allowed` / `freeze_max_count` (
|
|
106271
|
+
* @description Honours the catalog's `freeze_allowed` / `freeze_max_count` (a clinic's bridal package may be configured never to freeze). A CLOSED window pushes `expires_at` out by its own length immediately; an OPEN one («hasta nuevo aviso») pays out when it is lifted, because its length is not known until then.
|
|
104121
106272
|
*
|
|
104122
106273
|
* **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
|
|
104123
106274
|
*/
|
|
@@ -107232,7 +109383,7 @@ interface components {
|
|
|
107232
109383
|
};
|
|
107233
109384
|
Author: {
|
|
107234
109385
|
/**
|
|
107235
|
-
* @description `member` = a workspace member (in the app, or through a personal token / connected app — see `via`); `api_key` = an API key, a workspace integration credential («CRM
|
|
109386
|
+
* @description `member` = a workspace member (in the app, or through a personal token / connected app — see `via`); `api_key` = an API key, a workspace integration credential («CRM propio (API)»); `ai_agent` = the AI agent; `system` = the platform itself; `contact` = the customer.
|
|
107236
109387
|
* @enum {string}
|
|
107237
109388
|
*/
|
|
107238
109389
|
kind: "member" | "api_key" | "ai_agent" | "system" | "contact";
|
|
@@ -107899,6 +110050,179 @@ interface components {
|
|
|
107899
110050
|
coverage_percent: number;
|
|
107900
110051
|
};
|
|
107901
110052
|
};
|
|
110053
|
+
AdsFact: {
|
|
110054
|
+
/** @description Stable fact key (`roas`, `best_campaign_name`, …) — a vocabulary name, not a resource id. */
|
|
110055
|
+
key: string;
|
|
110056
|
+
/** @description Spanish label in the workspace’s vocabulary. */
|
|
110057
|
+
label: string;
|
|
110058
|
+
/** @description Raw value; `null` = unknown (never zero). `pct` values are 0–100. */
|
|
110059
|
+
value: number | string | null;
|
|
110060
|
+
/** @description The exact es-CL string a sentence quotes (`3,7×`, `$845.200`, `—`). */
|
|
110061
|
+
display: string;
|
|
110062
|
+
/** @enum {string} */
|
|
110063
|
+
format: "clp" | "int" | "times" | "pct" | "text" | "date";
|
|
110064
|
+
/** @description Where the value was read. */
|
|
110065
|
+
source: string;
|
|
110066
|
+
/**
|
|
110067
|
+
* @description Facts never carry a person.
|
|
110068
|
+
* @enum {string}
|
|
110069
|
+
*/
|
|
110070
|
+
privacy: "aggregate";
|
|
110071
|
+
};
|
|
110072
|
+
AdsBriefing: {
|
|
110073
|
+
/** @enum {string} */
|
|
110074
|
+
screen: "resumen" | "campanas" | "atribuidos" | "creativos" | "salud";
|
|
110075
|
+
window: {
|
|
110076
|
+
from: string;
|
|
110077
|
+
to: string;
|
|
110078
|
+
window?: string;
|
|
110079
|
+
};
|
|
110080
|
+
lead: {
|
|
110081
|
+
/** @description One sentence, plain text; `**bold**` is the only markup. */
|
|
110082
|
+
text: string;
|
|
110083
|
+
/** @description The facts this sentence quotes. */
|
|
110084
|
+
fact_keys: string[];
|
|
110085
|
+
/** @description A suggested «Pregúntale» question this line invites. */
|
|
110086
|
+
ask?: string;
|
|
110087
|
+
figure: {
|
|
110088
|
+
fact_key: string;
|
|
110089
|
+
value: number | string | null;
|
|
110090
|
+
/** @enum {string} */
|
|
110091
|
+
format: "clp" | "int" | "times" | "pct" | "text" | "date";
|
|
110092
|
+
/** @description The substring of `lead.text` to count up. */
|
|
110093
|
+
display: string;
|
|
110094
|
+
/** @description Where that whole figure starts in `lead.text` — split there, not on the first occurrence of `display` (a `12` can also sit inside `$12.000`). */
|
|
110095
|
+
offset: number;
|
|
110096
|
+
} | null;
|
|
110097
|
+
};
|
|
110098
|
+
lines: {
|
|
110099
|
+
/** @description One sentence, plain text; `**bold**` is the only markup. */
|
|
110100
|
+
text: string;
|
|
110101
|
+
/** @description The facts this sentence quotes. */
|
|
110102
|
+
fact_keys: string[];
|
|
110103
|
+
/** @description A suggested «Pregúntale» question this line invites. */
|
|
110104
|
+
ask?: string;
|
|
110105
|
+
}[];
|
|
110106
|
+
facts: components["schemas"]["AdsFact"][];
|
|
110107
|
+
/** @description Ids of the actions the rail should surface first (may be empty). */
|
|
110108
|
+
actions: string[];
|
|
110109
|
+
/**
|
|
110110
|
+
* @description Who wrote the sentences — both read from the same pinned facts.
|
|
110111
|
+
* @enum {string}
|
|
110112
|
+
*/
|
|
110113
|
+
source: "model" | "template";
|
|
110114
|
+
generated_at: string;
|
|
110115
|
+
/** @enum {string} */
|
|
110116
|
+
vocabulary: "automotive" | "healthcare" | "generic";
|
|
110117
|
+
/** @description `true` when written from the sample dataset. */
|
|
110118
|
+
sample: boolean;
|
|
110119
|
+
};
|
|
110120
|
+
AdsGoal: {
|
|
110121
|
+
/** @enum {string} */
|
|
110122
|
+
kind: "outcomes" | "value" | "roas";
|
|
110123
|
+
target: number;
|
|
110124
|
+
/** @enum {string} */
|
|
110125
|
+
period: "month";
|
|
110126
|
+
updated_at: string | null;
|
|
110127
|
+
/** @description Who last set it (a member or API key id); `null` when unknown. */
|
|
110128
|
+
updated_by: string | null;
|
|
110129
|
+
/** @description `false` in sample mode: the goal was validated but not stored. */
|
|
110130
|
+
persisted?: boolean;
|
|
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
|
+
};
|
|
107902
110226
|
AdsTrackingKey: {
|
|
107903
110227
|
key_id: string;
|
|
107904
110228
|
public_key: string;
|
|
@@ -107924,6 +110248,59 @@ interface components {
|
|
|
107924
110248
|
/** @enum {string} */
|
|
107925
110249
|
source: "tracker" | "health";
|
|
107926
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
|
+
};
|
|
107927
110304
|
};
|
|
107928
110305
|
responses: never;
|
|
107929
110306
|
parameters: never;
|
|
@@ -107984,7 +110361,7 @@ declare function createClient(opts: CreateClientOptions): VitrinaClient;
|
|
|
107984
110361
|
* is regenerated — narrow on the ones you handle, never assume this
|
|
107985
110362
|
* list is exhaustive at runtime.
|
|
107986
110363
|
*/
|
|
107987
|
-
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';
|
|
107988
110365
|
declare const ERROR_CODES: readonly ErrorCode[];
|
|
107989
110366
|
|
|
107990
110367
|
/**
|