@vitrina/api 11.8.0 → 11.10.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.
Files changed (3) hide show
  1. package/dist/index.d.cts +1555 -10
  2. package/dist/index.d.ts +1555 -10
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -13154,6 +13154,228 @@ interface paths {
13154
13154
  patch?: never;
13155
13155
  trace?: never;
13156
13156
  };
13157
+ "/tenant/settings": {
13158
+ parameters: {
13159
+ query?: never;
13160
+ header?: never;
13161
+ path?: never;
13162
+ cookie?: never;
13163
+ };
13164
+ /**
13165
+ * Read tenant-level settings
13166
+ * @description The stored settings object, as saved through `PUT /tenant/settings`. Among its keys, `ads` holds the Vitrina Ads wizard choice: `{ tag_choice: "site" | "no_site" | null, tag_choice_at: string | null }` (`tag_choice_at` is stamped by the server on every write); absent when the workspace never answered the «Instalar el tag» step. Only the keys documented here are part of the API pública: the workspace's general identity (`name`, `timezone`, `language`, `currency`, `date_format`, `website`) and the Vitrina Ads choices under `ads`. A connected app receives exactly those keys; the workspace's own credentials may see further workspace-configuration keys, which are not contract and may change without notice.
13167
+ */
13168
+ get: {
13169
+ parameters: {
13170
+ query?: never;
13171
+ header?: never;
13172
+ path?: never;
13173
+ cookie?: never;
13174
+ };
13175
+ requestBody?: never;
13176
+ responses: {
13177
+ /** @description Tenant settings */
13178
+ 200: {
13179
+ headers: {
13180
+ [name: string]: unknown;
13181
+ };
13182
+ content: {
13183
+ /**
13184
+ * @example {
13185
+ * "data": {
13186
+ * "name": "Automotora Demo",
13187
+ * "timezone": "America/Santiago",
13188
+ * "language": "es",
13189
+ * "currency": "CLP",
13190
+ * "website": "https://www.automotora-demo.cl",
13191
+ * "ads": {
13192
+ * "tag_choice": "site",
13193
+ * "tag_choice_at": "2026-09-23T15:00:00.000Z",
13194
+ * "goal": {
13195
+ * "kind": "outcomes",
13196
+ * "target": 30,
13197
+ * "period": "month"
13198
+ * },
13199
+ * "goal_at": "2026-09-01T12:00:00.000Z",
13200
+ * "goal_by": "20000000-0000-4000-8000-000000000001"
13201
+ * }
13202
+ * }
13203
+ * }
13204
+ */
13205
+ "application/json": {
13206
+ data: components["schemas"]["TenantSettingsPublic"];
13207
+ };
13208
+ };
13209
+ };
13210
+ /** @description Validation error */
13211
+ 400: {
13212
+ headers: {
13213
+ [name: string]: unknown;
13214
+ };
13215
+ content: {
13216
+ "application/json": components["schemas"]["Error"];
13217
+ };
13218
+ };
13219
+ /** @description Unauthorized */
13220
+ 401: {
13221
+ headers: {
13222
+ [name: string]: unknown;
13223
+ };
13224
+ content: {
13225
+ "application/json": components["schemas"]["Error"];
13226
+ };
13227
+ };
13228
+ /** @description Forbidden */
13229
+ 403: {
13230
+ headers: {
13231
+ [name: string]: unknown;
13232
+ };
13233
+ content: {
13234
+ "application/json": components["schemas"]["Error"];
13235
+ };
13236
+ };
13237
+ /** @description Not found */
13238
+ 404: {
13239
+ headers: {
13240
+ [name: string]: unknown;
13241
+ };
13242
+ content: {
13243
+ "application/json": components["schemas"]["Error"];
13244
+ };
13245
+ };
13246
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13247
+ 409: {
13248
+ headers: {
13249
+ [name: string]: unknown;
13250
+ };
13251
+ content: {
13252
+ "application/json": components["schemas"]["Error"];
13253
+ };
13254
+ };
13255
+ /** @description Rate limited */
13256
+ 429: {
13257
+ headers: {
13258
+ [name: string]: unknown;
13259
+ };
13260
+ content: {
13261
+ "application/json": components["schemas"]["Error"];
13262
+ };
13263
+ };
13264
+ };
13265
+ };
13266
+ /**
13267
+ * Patch tenant-level settings
13268
+ * @description Shallow-merges the body into the stored settings and answers the result. `ads` is merged key by key (a write that sends only `ads.tag_choice` keeps `ads.goal`), and the server stamps `tag_choice_at` / `goal_at` / `goal_by` — a client never sends them (400). A connected app may write only `ads`; any other key is refused with 403 and nothing is written. Only the keys documented here are part of the API pública: the workspace's general identity (`name`, `timezone`, `language`, `currency`, `date_format`, `website`) and the Vitrina Ads choices under `ads`. A connected app receives exactly those keys; the workspace's own credentials may see further workspace-configuration keys, which are not contract and may change without notice.
13269
+ */
13270
+ put: {
13271
+ parameters: {
13272
+ query?: never;
13273
+ header?: never;
13274
+ path?: never;
13275
+ cookie?: never;
13276
+ };
13277
+ requestBody?: {
13278
+ content: {
13279
+ /**
13280
+ * @example {
13281
+ * "ads": {
13282
+ * "tag_choice": "site"
13283
+ * }
13284
+ * }
13285
+ */
13286
+ "application/json": components["schemas"]["TenantSettingsPublicWrite"];
13287
+ };
13288
+ };
13289
+ responses: {
13290
+ /** @description Tenant settings */
13291
+ 200: {
13292
+ headers: {
13293
+ [name: string]: unknown;
13294
+ };
13295
+ content: {
13296
+ /**
13297
+ * @example {
13298
+ * "data": {
13299
+ * "name": "Automotora Demo",
13300
+ * "timezone": "America/Santiago",
13301
+ * "language": "es",
13302
+ * "currency": "CLP",
13303
+ * "website": "https://www.automotora-demo.cl",
13304
+ * "ads": {
13305
+ * "tag_choice": "site",
13306
+ * "tag_choice_at": "2026-09-24T12:00:00.000Z"
13307
+ * }
13308
+ * }
13309
+ * }
13310
+ */
13311
+ "application/json": {
13312
+ data: components["schemas"]["TenantSettingsPublic"];
13313
+ };
13314
+ };
13315
+ };
13316
+ /** @description Validation error */
13317
+ 400: {
13318
+ headers: {
13319
+ [name: string]: unknown;
13320
+ };
13321
+ content: {
13322
+ "application/json": components["schemas"]["Error"];
13323
+ };
13324
+ };
13325
+ /** @description Unauthorized */
13326
+ 401: {
13327
+ headers: {
13328
+ [name: string]: unknown;
13329
+ };
13330
+ content: {
13331
+ "application/json": components["schemas"]["Error"];
13332
+ };
13333
+ };
13334
+ /** @description Forbidden */
13335
+ 403: {
13336
+ headers: {
13337
+ [name: string]: unknown;
13338
+ };
13339
+ content: {
13340
+ "application/json": components["schemas"]["Error"];
13341
+ };
13342
+ };
13343
+ /** @description Not found */
13344
+ 404: {
13345
+ headers: {
13346
+ [name: string]: unknown;
13347
+ };
13348
+ content: {
13349
+ "application/json": components["schemas"]["Error"];
13350
+ };
13351
+ };
13352
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13353
+ 409: {
13354
+ headers: {
13355
+ [name: string]: unknown;
13356
+ };
13357
+ content: {
13358
+ "application/json": components["schemas"]["Error"];
13359
+ };
13360
+ };
13361
+ /** @description Rate limited */
13362
+ 429: {
13363
+ headers: {
13364
+ [name: string]: unknown;
13365
+ };
13366
+ content: {
13367
+ "application/json": components["schemas"]["Error"];
13368
+ };
13369
+ };
13370
+ };
13371
+ };
13372
+ post?: never;
13373
+ delete?: never;
13374
+ options?: never;
13375
+ head?: never;
13376
+ patch?: never;
13377
+ trace?: never;
13378
+ };
13157
13379
  "/entitlements": {
13158
13380
  parameters: {
13159
13381
  query?: never;
@@ -28963,6 +29185,240 @@ interface paths {
28963
29185
  patch?: never;
28964
29186
  trace?: never;
28965
29187
  };
29188
+ "/billing/payment-method": {
29189
+ parameters: {
29190
+ query?: never;
29191
+ header?: never;
29192
+ path?: never;
29193
+ cookie?: never;
29194
+ };
29195
+ /**
29196
+ * Current payment provider + mandate status for the tenant
29197
+ * @description The workspace's chosen payment provider (`fintoc` for a PAC bank mandate, `mercadopago` for a tokenized card) and the status of its newest mandate: `active` means add-ons can be activated self-serve (`POST /entitlements/{feature}/activate`), `pending` means the Fintoc hosted setup was started but not finished. All three fields are `null` before any enrollment. Carries no payment instrument data — no card number, bank account or provider token is ever returned.
29198
+ */
29199
+ get: {
29200
+ parameters: {
29201
+ query?: never;
29202
+ header?: never;
29203
+ path?: never;
29204
+ cookie?: never;
29205
+ };
29206
+ requestBody?: never;
29207
+ responses: {
29208
+ /** @description Payment method status */
29209
+ 200: {
29210
+ headers: {
29211
+ [name: string]: unknown;
29212
+ };
29213
+ content: {
29214
+ /**
29215
+ * @example {
29216
+ * "data": {
29217
+ * "provider": "fintoc",
29218
+ * "status": "active",
29219
+ * "mandateId": "f1f1f1f1-0000-4000-8000-000000000001"
29220
+ * }
29221
+ * }
29222
+ */
29223
+ "application/json": {
29224
+ data: components["schemas"]["PaymentMethodStatus"];
29225
+ };
29226
+ };
29227
+ };
29228
+ /** @description Validation error */
29229
+ 400: {
29230
+ headers: {
29231
+ [name: string]: unknown;
29232
+ };
29233
+ content: {
29234
+ "application/json": components["schemas"]["Error"];
29235
+ };
29236
+ };
29237
+ /** @description Unauthorized */
29238
+ 401: {
29239
+ headers: {
29240
+ [name: string]: unknown;
29241
+ };
29242
+ content: {
29243
+ "application/json": components["schemas"]["Error"];
29244
+ };
29245
+ };
29246
+ /** @description Forbidden */
29247
+ 403: {
29248
+ headers: {
29249
+ [name: string]: unknown;
29250
+ };
29251
+ content: {
29252
+ "application/json": components["schemas"]["Error"];
29253
+ };
29254
+ };
29255
+ /** @description Not found */
29256
+ 404: {
29257
+ headers: {
29258
+ [name: string]: unknown;
29259
+ };
29260
+ content: {
29261
+ "application/json": components["schemas"]["Error"];
29262
+ };
29263
+ };
29264
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
29265
+ 409: {
29266
+ headers: {
29267
+ [name: string]: unknown;
29268
+ };
29269
+ content: {
29270
+ "application/json": components["schemas"]["Error"];
29271
+ };
29272
+ };
29273
+ /** @description Rate limited */
29274
+ 429: {
29275
+ headers: {
29276
+ [name: string]: unknown;
29277
+ };
29278
+ content: {
29279
+ "application/json": components["schemas"]["Error"];
29280
+ };
29281
+ };
29282
+ };
29283
+ };
29284
+ put?: never;
29285
+ post?: never;
29286
+ delete?: never;
29287
+ options?: never;
29288
+ head?: never;
29289
+ patch?: never;
29290
+ trace?: never;
29291
+ };
29292
+ "/billing/payment-method/setup": {
29293
+ parameters: {
29294
+ query?: never;
29295
+ header?: never;
29296
+ path?: never;
29297
+ cookie?: never;
29298
+ };
29299
+ get?: never;
29300
+ put?: never;
29301
+ /**
29302
+ * Connect a payment provider (Fintoc hosted PAC redirect, or MercadoPago tokenized card)
29303
+ * @description Makes `provider` the workspace's single payment account and creates its mandate. Fintoc answers `status: "pending"` with a `setupUrl` to send the owner to (the hosted PAC setup, which returns to `returnUrl`); MercadoPago takes a `cardToken` minted client-side by MercadoPago's own SDK — never a raw card number — and answers `status: "active"` with `setupUrl: null`. `email` (the payer) is required by both providers; `rut` (optional) goes on the Fintoc customer. Requires `billing:write`, which only the workspace owner holds.
29304
+ */
29305
+ post: {
29306
+ parameters: {
29307
+ query?: never;
29308
+ header?: {
29309
+ /** @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. */
29310
+ "Idempotency-Key"?: string;
29311
+ };
29312
+ path?: never;
29313
+ cookie?: never;
29314
+ };
29315
+ requestBody?: {
29316
+ content: {
29317
+ /**
29318
+ * @example {
29319
+ * "provider": "fintoc",
29320
+ * "returnUrl": "https://app.vitrinadev.com/settings/complementos",
29321
+ * "email": "facturacion@automotora-demo.cl",
29322
+ * "rut": "76.123.456-7"
29323
+ * }
29324
+ */
29325
+ "application/json": {
29326
+ /** @enum {string} */
29327
+ provider: "fintoc" | "mercadopago";
29328
+ /** Format: uri */
29329
+ returnUrl?: string;
29330
+ cardToken?: string;
29331
+ /** Format: email */
29332
+ email?: string;
29333
+ name?: string;
29334
+ rut?: string;
29335
+ };
29336
+ };
29337
+ };
29338
+ responses: {
29339
+ /** @description Enrollment started (Fintoc → setupUrl) or completed (MercadoPago → active) */
29340
+ 200: {
29341
+ headers: {
29342
+ [name: string]: unknown;
29343
+ };
29344
+ content: {
29345
+ /**
29346
+ * @example {
29347
+ * "data": {
29348
+ * "provider": "fintoc",
29349
+ * "status": "pending",
29350
+ * "mandateId": "f1f1f1f1-0000-4000-8000-000000000002",
29351
+ * "setupUrl": "https://pay.fintoc.com/subscriptions/setup/example"
29352
+ * }
29353
+ * }
29354
+ */
29355
+ "application/json": {
29356
+ data: components["schemas"]["PaymentMethodSetup"];
29357
+ };
29358
+ };
29359
+ };
29360
+ /** @description Validation error */
29361
+ 400: {
29362
+ headers: {
29363
+ [name: string]: unknown;
29364
+ };
29365
+ content: {
29366
+ "application/json": components["schemas"]["Error"];
29367
+ };
29368
+ };
29369
+ /** @description Unauthorized */
29370
+ 401: {
29371
+ headers: {
29372
+ [name: string]: unknown;
29373
+ };
29374
+ content: {
29375
+ "application/json": components["schemas"]["Error"];
29376
+ };
29377
+ };
29378
+ /** @description Forbidden */
29379
+ 403: {
29380
+ headers: {
29381
+ [name: string]: unknown;
29382
+ };
29383
+ content: {
29384
+ "application/json": components["schemas"]["Error"];
29385
+ };
29386
+ };
29387
+ /** @description Not found */
29388
+ 404: {
29389
+ headers: {
29390
+ [name: string]: unknown;
29391
+ };
29392
+ content: {
29393
+ "application/json": components["schemas"]["Error"];
29394
+ };
29395
+ };
29396
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
29397
+ 409: {
29398
+ headers: {
29399
+ [name: string]: unknown;
29400
+ };
29401
+ content: {
29402
+ "application/json": components["schemas"]["Error"];
29403
+ };
29404
+ };
29405
+ /** @description Rate limited */
29406
+ 429: {
29407
+ headers: {
29408
+ [name: string]: unknown;
29409
+ };
29410
+ content: {
29411
+ "application/json": components["schemas"]["Error"];
29412
+ };
29413
+ };
29414
+ };
29415
+ };
29416
+ delete?: never;
29417
+ options?: never;
29418
+ head?: never;
29419
+ patch?: never;
29420
+ trace?: never;
29421
+ };
28966
29422
  "/sale-notes": {
28967
29423
  parameters: {
28968
29424
  query?: never;
@@ -87655,6 +88111,8 @@ interface paths {
87655
88111
  model?: string;
87656
88112
  /** @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
88113
  sample?: "1" | "true";
88114
+ /** @description `day` ALSO answers `days[]` and `previous_days[]` — one point per calendar day of the window and of the previous window (the engine’s own day rows, never recomputed), beside the unchanged `current`/`previous` totals. Default `total`. */
88115
+ grain?: "total" | "day";
87658
88116
  /** @description Documentary only — `/ads/overview` always returns `previous` (the immediately-preceding window of equal length) alongside `current`; there is nothing to switch on. */
87659
88117
  compare?: "previous_period";
87660
88118
  };
@@ -87728,7 +88186,491 @@ interface paths {
87728
88186
  * "appointment_booked": 9,
87729
88187
  * "closed_won": 3
87730
88188
  * }
87731
- * }
88189
+ * },
88190
+ * "days": [
88191
+ * {
88192
+ * "date": "2026-08-24",
88193
+ * "spend": 31800,
88194
+ * "revenue": 120000,
88195
+ * "outcomes": 2,
88196
+ * "attributed_outcomes": 1,
88197
+ * "partial": false
88198
+ * },
88199
+ * {
88200
+ * "date": "2026-08-25",
88201
+ * "spend": 35700,
88202
+ * "revenue": 130000,
88203
+ * "outcomes": 3,
88204
+ * "attributed_outcomes": 2,
88205
+ * "partial": false
88206
+ * },
88207
+ * {
88208
+ * "date": "2026-08-26",
88209
+ * "spend": 28700,
88210
+ * "revenue": 110000,
88211
+ * "outcomes": 1,
88212
+ * "attributed_outcomes": 1,
88213
+ * "partial": false
88214
+ * },
88215
+ * {
88216
+ * "date": "2026-08-27",
88217
+ * "spend": 33400,
88218
+ * "revenue": 120000,
88219
+ * "outcomes": 2,
88220
+ * "attributed_outcomes": 1,
88221
+ * "partial": false
88222
+ * },
88223
+ * {
88224
+ * "date": "2026-08-28",
88225
+ * "spend": 30300,
88226
+ * "revenue": 110000,
88227
+ * "outcomes": 1,
88228
+ * "attributed_outcomes": 1,
88229
+ * "partial": false
88230
+ * },
88231
+ * {
88232
+ * "date": "2026-08-29",
88233
+ * "spend": 19700,
88234
+ * "revenue": 70000,
88235
+ * "outcomes": 1,
88236
+ * "attributed_outcomes": 1,
88237
+ * "partial": false
88238
+ * },
88239
+ * {
88240
+ * "date": "2026-08-30",
88241
+ * "spend": 22100,
88242
+ * "revenue": 80000,
88243
+ * "outcomes": 1,
88244
+ * "attributed_outcomes": 1,
88245
+ * "partial": false
88246
+ * },
88247
+ * {
88248
+ * "date": "2026-08-31",
88249
+ * "spend": 28700,
88250
+ * "revenue": 110000,
88251
+ * "outcomes": 1,
88252
+ * "attributed_outcomes": 1,
88253
+ * "partial": false
88254
+ * },
88255
+ * {
88256
+ * "date": "2026-09-01",
88257
+ * "spend": 33400,
88258
+ * "revenue": 120000,
88259
+ * "outcomes": 2,
88260
+ * "attributed_outcomes": 1,
88261
+ * "partial": false
88262
+ * },
88263
+ * {
88264
+ * "date": "2026-09-02",
88265
+ * "spend": 30300,
88266
+ * "revenue": 110000,
88267
+ * "outcomes": 1,
88268
+ * "attributed_outcomes": 1,
88269
+ * "partial": false
88270
+ * },
88271
+ * {
88272
+ * "date": "2026-09-03",
88273
+ * "spend": 31800,
88274
+ * "revenue": 120000,
88275
+ * "outcomes": 2,
88276
+ * "attributed_outcomes": 1,
88277
+ * "partial": false
88278
+ * },
88279
+ * {
88280
+ * "date": "2026-09-04",
88281
+ * "spend": 35700,
88282
+ * "revenue": 130000,
88283
+ * "outcomes": 2,
88284
+ * "attributed_outcomes": 1,
88285
+ * "partial": false
88286
+ * },
88287
+ * {
88288
+ * "date": "2026-09-05",
88289
+ * "spend": 17800,
88290
+ * "revenue": 70000,
88291
+ * "outcomes": 1,
88292
+ * "attributed_outcomes": 1,
88293
+ * "partial": false
88294
+ * },
88295
+ * {
88296
+ * "date": "2026-09-06",
88297
+ * "spend": 20700,
88298
+ * "revenue": 80000,
88299
+ * "outcomes": 1,
88300
+ * "attributed_outcomes": 1,
88301
+ * "partial": false
88302
+ * },
88303
+ * {
88304
+ * "date": "2026-09-07",
88305
+ * "spend": 30300,
88306
+ * "revenue": 110000,
88307
+ * "outcomes": 1,
88308
+ * "attributed_outcomes": 1,
88309
+ * "partial": false
88310
+ * },
88311
+ * {
88312
+ * "date": "2026-09-08",
88313
+ * "spend": 31800,
88314
+ * "revenue": 120000,
88315
+ * "outcomes": 1,
88316
+ * "attributed_outcomes": 1,
88317
+ * "partial": false
88318
+ * },
88319
+ * {
88320
+ * "date": "2026-09-09",
88321
+ * "spend": 35700,
88322
+ * "revenue": 130000,
88323
+ * "outcomes": 2,
88324
+ * "attributed_outcomes": 1,
88325
+ * "partial": false
88326
+ * },
88327
+ * {
88328
+ * "date": "2026-09-10",
88329
+ * "spend": 28700,
88330
+ * "revenue": 110000,
88331
+ * "outcomes": 1,
88332
+ * "attributed_outcomes": 1,
88333
+ * "partial": false
88334
+ * },
88335
+ * {
88336
+ * "date": "2026-09-11",
88337
+ * "spend": 33400,
88338
+ * "revenue": 120000,
88339
+ * "outcomes": 2,
88340
+ * "attributed_outcomes": 1,
88341
+ * "partial": false
88342
+ * },
88343
+ * {
88344
+ * "date": "2026-09-12",
88345
+ * "spend": 18800,
88346
+ * "revenue": 70000,
88347
+ * "outcomes": 1,
88348
+ * "attributed_outcomes": 1,
88349
+ * "partial": false
88350
+ * },
88351
+ * {
88352
+ * "date": "2026-09-13",
88353
+ * "spend": 19700,
88354
+ * "revenue": 70000,
88355
+ * "outcomes": 1,
88356
+ * "attributed_outcomes": 1,
88357
+ * "partial": false
88358
+ * },
88359
+ * {
88360
+ * "date": "2026-09-14",
88361
+ * "spend": 35700,
88362
+ * "revenue": 130000,
88363
+ * "outcomes": 2,
88364
+ * "attributed_outcomes": 1,
88365
+ * "partial": false
88366
+ * },
88367
+ * {
88368
+ * "date": "2026-09-15",
88369
+ * "spend": 28700,
88370
+ * "revenue": 110000,
88371
+ * "outcomes": 1,
88372
+ * "attributed_outcomes": 1,
88373
+ * "partial": false
88374
+ * },
88375
+ * {
88376
+ * "date": "2026-09-16",
88377
+ * "spend": 33400,
88378
+ * "revenue": 120000,
88379
+ * "outcomes": 2,
88380
+ * "attributed_outcomes": 1,
88381
+ * "partial": false
88382
+ * },
88383
+ * {
88384
+ * "date": "2026-09-17",
88385
+ * "spend": 30200,
88386
+ * "revenue": 110000,
88387
+ * "outcomes": 1,
88388
+ * "attributed_outcomes": 1,
88389
+ * "partial": false
88390
+ * },
88391
+ * {
88392
+ * "date": "2026-09-18",
88393
+ * "spend": 31800,
88394
+ * "revenue": 120000,
88395
+ * "outcomes": 1,
88396
+ * "attributed_outcomes": 1,
88397
+ * "partial": false
88398
+ * },
88399
+ * {
88400
+ * "date": "2026-09-19",
88401
+ * "spend": 22100,
88402
+ * "revenue": 80000,
88403
+ * "outcomes": 1,
88404
+ * "attributed_outcomes": 1,
88405
+ * "partial": false
88406
+ * },
88407
+ * {
88408
+ * "date": "2026-09-20",
88409
+ * "spend": 17800,
88410
+ * "revenue": 70000,
88411
+ * "outcomes": 1,
88412
+ * "attributed_outcomes": 1,
88413
+ * "partial": false
88414
+ * },
88415
+ * {
88416
+ * "date": "2026-09-21",
88417
+ * "spend": 33400,
88418
+ * "revenue": 120000,
88419
+ * "outcomes": 2,
88420
+ * "attributed_outcomes": 1,
88421
+ * "partial": false
88422
+ * },
88423
+ * {
88424
+ * "date": "2026-09-22",
88425
+ * "spend": 13600,
88426
+ * "revenue": 50000,
88427
+ * "outcomes": 1,
88428
+ * "attributed_outcomes": 1,
88429
+ * "partial": true
88430
+ * }
88431
+ * ],
88432
+ * "previous_days": [
88433
+ * {
88434
+ * "date": "2026-07-25",
88435
+ * "spend": null,
88436
+ * "revenue": 60000,
88437
+ * "outcomes": 1,
88438
+ * "attributed_outcomes": 1,
88439
+ * "partial": false
88440
+ * },
88441
+ * {
88442
+ * "date": "2026-07-26",
88443
+ * "spend": null,
88444
+ * "revenue": 70000,
88445
+ * "outcomes": 1,
88446
+ * "attributed_outcomes": 1,
88447
+ * "partial": false
88448
+ * },
88449
+ * {
88450
+ * "date": "2026-07-27",
88451
+ * "spend": null,
88452
+ * "revenue": 80000,
88453
+ * "outcomes": 1,
88454
+ * "attributed_outcomes": 1,
88455
+ * "partial": false
88456
+ * },
88457
+ * {
88458
+ * "date": "2026-07-28",
88459
+ * "spend": null,
88460
+ * "revenue": 100000,
88461
+ * "outcomes": 2,
88462
+ * "attributed_outcomes": 1,
88463
+ * "partial": false
88464
+ * },
88465
+ * {
88466
+ * "date": "2026-07-29",
88467
+ * "spend": null,
88468
+ * "revenue": 90000,
88469
+ * "outcomes": 1,
88470
+ * "attributed_outcomes": 1,
88471
+ * "partial": false
88472
+ * },
88473
+ * {
88474
+ * "date": "2026-07-30",
88475
+ * "spend": null,
88476
+ * "revenue": 90000,
88477
+ * "outcomes": 2,
88478
+ * "attributed_outcomes": 1,
88479
+ * "partial": false
88480
+ * },
88481
+ * {
88482
+ * "date": "2026-07-31",
88483
+ * "spend": null,
88484
+ * "revenue": 110000,
88485
+ * "outcomes": 3,
88486
+ * "attributed_outcomes": 2,
88487
+ * "partial": false
88488
+ * },
88489
+ * {
88490
+ * "date": "2026-08-01",
88491
+ * "spend": null,
88492
+ * "revenue": 50000,
88493
+ * "outcomes": 1,
88494
+ * "attributed_outcomes": 1,
88495
+ * "partial": false
88496
+ * },
88497
+ * {
88498
+ * "date": "2026-08-02",
88499
+ * "spend": null,
88500
+ * "revenue": 60000,
88501
+ * "outcomes": 1,
88502
+ * "attributed_outcomes": 1,
88503
+ * "partial": false
88504
+ * },
88505
+ * {
88506
+ * "date": "2026-08-03",
88507
+ * "spend": null,
88508
+ * "revenue": 90000,
88509
+ * "outcomes": 1,
88510
+ * "attributed_outcomes": 1,
88511
+ * "partial": false
88512
+ * },
88513
+ * {
88514
+ * "date": "2026-08-04",
88515
+ * "spend": null,
88516
+ * "revenue": 90000,
88517
+ * "outcomes": 2,
88518
+ * "attributed_outcomes": 1,
88519
+ * "partial": false
88520
+ * },
88521
+ * {
88522
+ * "date": "2026-08-05",
88523
+ * "spend": null,
88524
+ * "revenue": 110000,
88525
+ * "outcomes": 2,
88526
+ * "attributed_outcomes": 1,
88527
+ * "partial": false
88528
+ * },
88529
+ * {
88530
+ * "date": "2026-08-06",
88531
+ * "spend": null,
88532
+ * "revenue": 80000,
88533
+ * "outcomes": 1,
88534
+ * "attributed_outcomes": 1,
88535
+ * "partial": false
88536
+ * },
88537
+ * {
88538
+ * "date": "2026-08-07",
88539
+ * "spend": null,
88540
+ * "revenue": 100000,
88541
+ * "outcomes": 2,
88542
+ * "attributed_outcomes": 1,
88543
+ * "partial": false
88544
+ * },
88545
+ * {
88546
+ * "date": "2026-08-08",
88547
+ * "spend": null,
88548
+ * "revenue": 60000,
88549
+ * "outcomes": 1,
88550
+ * "attributed_outcomes": 1,
88551
+ * "partial": false
88552
+ * },
88553
+ * {
88554
+ * "date": "2026-08-09",
88555
+ * "spend": null,
88556
+ * "revenue": 60000,
88557
+ * "outcomes": 1,
88558
+ * "attributed_outcomes": 1,
88559
+ * "partial": false
88560
+ * },
88561
+ * {
88562
+ * "date": "2026-08-10",
88563
+ * "spend": null,
88564
+ * "revenue": 110000,
88565
+ * "outcomes": 2,
88566
+ * "attributed_outcomes": 1,
88567
+ * "partial": false
88568
+ * },
88569
+ * {
88570
+ * "date": "2026-08-11",
88571
+ * "spend": null,
88572
+ * "revenue": 80000,
88573
+ * "outcomes": 1,
88574
+ * "attributed_outcomes": 1,
88575
+ * "partial": false
88576
+ * },
88577
+ * {
88578
+ * "date": "2026-08-12",
88579
+ * "spend": null,
88580
+ * "revenue": 100000,
88581
+ * "outcomes": 2,
88582
+ * "attributed_outcomes": 1,
88583
+ * "partial": false
88584
+ * },
88585
+ * {
88586
+ * "date": "2026-08-13",
88587
+ * "spend": null,
88588
+ * "revenue": 90000,
88589
+ * "outcomes": 1,
88590
+ * "attributed_outcomes": 1,
88591
+ * "partial": false
88592
+ * },
88593
+ * {
88594
+ * "date": "2026-08-14",
88595
+ * "spend": null,
88596
+ * "revenue": 90000,
88597
+ * "outcomes": 2,
88598
+ * "attributed_outcomes": 1,
88599
+ * "partial": false
88600
+ * },
88601
+ * {
88602
+ * "date": "2026-08-15",
88603
+ * "spend": null,
88604
+ * "revenue": 70000,
88605
+ * "outcomes": 1,
88606
+ * "attributed_outcomes": 1,
88607
+ * "partial": false
88608
+ * },
88609
+ * {
88610
+ * "date": "2026-08-16",
88611
+ * "spend": null,
88612
+ * "revenue": 50000,
88613
+ * "outcomes": 1,
88614
+ * "attributed_outcomes": 1,
88615
+ * "partial": false
88616
+ * },
88617
+ * {
88618
+ * "date": "2026-08-17",
88619
+ * "spend": null,
88620
+ * "revenue": 100000,
88621
+ * "outcomes": 2,
88622
+ * "attributed_outcomes": 1,
88623
+ * "partial": false
88624
+ * },
88625
+ * {
88626
+ * "date": "2026-08-18",
88627
+ * "spend": null,
88628
+ * "revenue": 90000,
88629
+ * "outcomes": 1,
88630
+ * "attributed_outcomes": 1,
88631
+ * "partial": false
88632
+ * },
88633
+ * {
88634
+ * "date": "2026-08-19",
88635
+ * "spend": null,
88636
+ * "revenue": 90000,
88637
+ * "outcomes": 1,
88638
+ * "attributed_outcomes": 1,
88639
+ * "partial": false
88640
+ * },
88641
+ * {
88642
+ * "date": "2026-08-20",
88643
+ * "spend": null,
88644
+ * "revenue": 110000,
88645
+ * "outcomes": 2,
88646
+ * "attributed_outcomes": 1,
88647
+ * "partial": false
88648
+ * },
88649
+ * {
88650
+ * "date": "2026-08-21",
88651
+ * "spend": null,
88652
+ * "revenue": 80000,
88653
+ * "outcomes": 1,
88654
+ * "attributed_outcomes": 1,
88655
+ * "partial": false
88656
+ * },
88657
+ * {
88658
+ * "date": "2026-08-22",
88659
+ * "spend": null,
88660
+ * "revenue": 60000,
88661
+ * "outcomes": 1,
88662
+ * "attributed_outcomes": 1,
88663
+ * "partial": false
88664
+ * },
88665
+ * {
88666
+ * "date": "2026-08-23",
88667
+ * "spend": null,
88668
+ * "revenue": 60000,
88669
+ * "outcomes": 1,
88670
+ * "attributed_outcomes": 1,
88671
+ * "partial": false
88672
+ * }
88673
+ * ]
87732
88674
  * }
87733
88675
  * }
87734
88676
  */
@@ -87862,6 +88804,8 @@ interface paths {
87862
88804
  /** @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
88805
  sample?: "1" | "true";
87864
88806
  limit?: number;
88807
+ /** @description `1` adds each row’s `series[]`: one `{date, spend, outcome_count}` per day of the window (the last 92 days at most). */
88808
+ series?: "1" | "true";
87865
88809
  };
87866
88810
  header?: never;
87867
88811
  path?: never;
@@ -87888,7 +88832,164 @@ interface paths {
87888
88832
  * "outcome_value": 3120000,
87889
88833
  * "roas": 3.69,
87890
88834
  * "direct_cash_value": 2100000,
87891
- * "inherited_cash_value": 600000
88835
+ * "inherited_cash_value": 600000,
88836
+ * "top_ad": {
88837
+ * "external_id": "120212000000000009",
88838
+ * "name": "Video testimonio 15s",
88839
+ * "creative_thumbnail_url": "https://cdn.vitrinadev.com/examples/ads/video-testimonio-15s.jpg"
88840
+ * },
88841
+ * "series": [
88842
+ * {
88843
+ * "date": "2026-08-24",
88844
+ * "spend": 31800,
88845
+ * "outcome_count": 1
88846
+ * },
88847
+ * {
88848
+ * "date": "2026-08-25",
88849
+ * "spend": 35700,
88850
+ * "outcome_count": 2
88851
+ * },
88852
+ * {
88853
+ * "date": "2026-08-26",
88854
+ * "spend": 28700,
88855
+ * "outcome_count": 1
88856
+ * },
88857
+ * {
88858
+ * "date": "2026-08-27",
88859
+ * "spend": 33400,
88860
+ * "outcome_count": 1
88861
+ * },
88862
+ * {
88863
+ * "date": "2026-08-28",
88864
+ * "spend": 30300,
88865
+ * "outcome_count": 1
88866
+ * },
88867
+ * {
88868
+ * "date": "2026-08-29",
88869
+ * "spend": 19700,
88870
+ * "outcome_count": 1
88871
+ * },
88872
+ * {
88873
+ * "date": "2026-08-30",
88874
+ * "spend": 22100,
88875
+ * "outcome_count": 1
88876
+ * },
88877
+ * {
88878
+ * "date": "2026-08-31",
88879
+ * "spend": 28700,
88880
+ * "outcome_count": 1
88881
+ * },
88882
+ * {
88883
+ * "date": "2026-09-01",
88884
+ * "spend": 33400,
88885
+ * "outcome_count": 1
88886
+ * },
88887
+ * {
88888
+ * "date": "2026-09-02",
88889
+ * "spend": 30300,
88890
+ * "outcome_count": 1
88891
+ * },
88892
+ * {
88893
+ * "date": "2026-09-03",
88894
+ * "spend": 31800,
88895
+ * "outcome_count": 1
88896
+ * },
88897
+ * {
88898
+ * "date": "2026-09-04",
88899
+ * "spend": 35700,
88900
+ * "outcome_count": 1
88901
+ * },
88902
+ * {
88903
+ * "date": "2026-09-05",
88904
+ * "spend": 17800,
88905
+ * "outcome_count": 1
88906
+ * },
88907
+ * {
88908
+ * "date": "2026-09-06",
88909
+ * "spend": 20700,
88910
+ * "outcome_count": 1
88911
+ * },
88912
+ * {
88913
+ * "date": "2026-09-07",
88914
+ * "spend": 30300,
88915
+ * "outcome_count": 1
88916
+ * },
88917
+ * {
88918
+ * "date": "2026-09-08",
88919
+ * "spend": 31800,
88920
+ * "outcome_count": 1
88921
+ * },
88922
+ * {
88923
+ * "date": "2026-09-09",
88924
+ * "spend": 35700,
88925
+ * "outcome_count": 1
88926
+ * },
88927
+ * {
88928
+ * "date": "2026-09-10",
88929
+ * "spend": 28700,
88930
+ * "outcome_count": 1
88931
+ * },
88932
+ * {
88933
+ * "date": "2026-09-11",
88934
+ * "spend": 33400,
88935
+ * "outcome_count": 1
88936
+ * },
88937
+ * {
88938
+ * "date": "2026-09-12",
88939
+ * "spend": 18800,
88940
+ * "outcome_count": 1
88941
+ * },
88942
+ * {
88943
+ * "date": "2026-09-13",
88944
+ * "spend": 19700,
88945
+ * "outcome_count": 1
88946
+ * },
88947
+ * {
88948
+ * "date": "2026-09-14",
88949
+ * "spend": 35700,
88950
+ * "outcome_count": 1
88951
+ * },
88952
+ * {
88953
+ * "date": "2026-09-15",
88954
+ * "spend": 28700,
88955
+ * "outcome_count": 1
88956
+ * },
88957
+ * {
88958
+ * "date": "2026-09-16",
88959
+ * "spend": 33400,
88960
+ * "outcome_count": 1
88961
+ * },
88962
+ * {
88963
+ * "date": "2026-09-17",
88964
+ * "spend": 30200,
88965
+ * "outcome_count": 1
88966
+ * },
88967
+ * {
88968
+ * "date": "2026-09-18",
88969
+ * "spend": 31800,
88970
+ * "outcome_count": 1
88971
+ * },
88972
+ * {
88973
+ * "date": "2026-09-19",
88974
+ * "spend": 22100,
88975
+ * "outcome_count": 1
88976
+ * },
88977
+ * {
88978
+ * "date": "2026-09-20",
88979
+ * "spend": 17800,
88980
+ * "outcome_count": 1
88981
+ * },
88982
+ * {
88983
+ * "date": "2026-09-21",
88984
+ * "spend": 33400,
88985
+ * "outcome_count": 1
88986
+ * },
88987
+ * {
88988
+ * "date": "2026-09-22",
88989
+ * "spend": 13600,
88990
+ * "outcome_count": 1
88991
+ * }
88992
+ * ]
87892
88993
  * }
87893
88994
  * ]
87894
88995
  * }
@@ -88056,6 +89157,8 @@ interface paths {
88056
89157
  * "credited_weight": 1,
88057
89158
  * "touch_count": 3,
88058
89159
  * "path_length": 3,
89160
+ * "first_touch_time": "2026-09-06T21:14:00.000Z",
89161
+ * "last_touch_time": "2026-09-11T13:02:00.000Z",
88059
89162
  * "is_inherited": false
88060
89163
  * }
88061
89164
  * ]
@@ -88186,6 +89289,8 @@ interface paths {
88186
89289
  /** @description A rolling lookback, not a date range — Atribu’s `top-performers` operation takes no `from`/`to`. Defaults to `28d`. */
88187
89290
  window?: "7d" | "14d" | "28d" | "lifetime";
88188
89291
  limit?: number;
89292
+ /** @description `1` adds each row’s `series[]`: the last 14 days of `{date, spend, ctr}` (the first 50 rows; later rows answer `series: null`). */
89293
+ series?: "1" | "true";
88189
89294
  /** @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
89295
  sample?: "1" | "true";
88191
89296
  };
@@ -88209,6 +89314,10 @@ interface paths {
88209
89314
  * "ad_external_id": "120212000000000009",
88210
89315
  * "ad_name": "Video testimonio 15s",
88211
89316
  * "campaign_name": "Leads · Septiembre",
89317
+ * "campaign": {
89318
+ * "external_id": "120211000000000001",
89319
+ * "name": "Leads · Septiembre"
89320
+ * },
88212
89321
  * "ad_set_name": "Santiago 25-45",
88213
89322
  * "creative_thumbnail_url": null,
88214
89323
  * "score_window": "28d",
@@ -88223,7 +89332,79 @@ interface paths {
88223
89332
  * "attributed_revenue": 480000,
88224
89333
  * "roas": 3.2,
88225
89334
  * "fatigue_state": "active",
88226
- * "fatigue_risk_tier": "low"
89335
+ * "fatigue_risk_tier": "low",
89336
+ * "series": [
89337
+ * {
89338
+ * "date": "2026-09-09",
89339
+ * "spend": 6300,
89340
+ * "ctr": 1.79
89341
+ * },
89342
+ * {
89343
+ * "date": "2026-09-10",
89344
+ * "spend": 7000,
89345
+ * "ctr": 1.8
89346
+ * },
89347
+ * {
89348
+ * "date": "2026-09-11",
89349
+ * "spend": 5600,
89350
+ * "ctr": 1.82
89351
+ * },
89352
+ * {
89353
+ * "date": "2026-09-12",
89354
+ * "spend": 4100,
89355
+ * "ctr": 1.84
89356
+ * },
89357
+ * {
89358
+ * "date": "2026-09-13",
89359
+ * "spend": 3700,
89360
+ * "ctr": 1.86
89361
+ * },
89362
+ * {
89363
+ * "date": "2026-09-14",
89364
+ * "spend": 6300,
89365
+ * "ctr": 1.87
89366
+ * },
89367
+ * {
89368
+ * "date": "2026-09-15",
89369
+ * "spend": 7000,
89370
+ * "ctr": 1.89
89371
+ * },
89372
+ * {
89373
+ * "date": "2026-09-16",
89374
+ * "spend": 5600,
89375
+ * "ctr": 1.91
89376
+ * },
89377
+ * {
89378
+ * "date": "2026-09-17",
89379
+ * "spend": 6600,
89380
+ * "ctr": 1.93
89381
+ * },
89382
+ * {
89383
+ * "date": "2026-09-18",
89384
+ * "spend": 6000,
89385
+ * "ctr": 1.94
89386
+ * },
89387
+ * {
89388
+ * "date": "2026-09-19",
89389
+ * "spend": 3900,
89390
+ * "ctr": 1.96
89391
+ * },
89392
+ * {
89393
+ * "date": "2026-09-20",
89394
+ * "spend": 4300,
89395
+ * "ctr": 1.98
89396
+ * },
89397
+ * {
89398
+ * "date": "2026-09-21",
89399
+ * "spend": 5600,
89400
+ * "ctr": 2
89401
+ * },
89402
+ * {
89403
+ * "date": "2026-09-22",
89404
+ * "spend": 3000,
89405
+ * "ctr": 2.01
89406
+ * }
89407
+ * ]
88227
89408
  * }
88228
89409
  * ]
88229
89410
  * }
@@ -88420,11 +89601,16 @@ interface paths {
88420
89601
  * }
88421
89602
  * },
88422
89603
  * "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
89604
+ * "total_conversions": 44,
89605
+ * "with_full_utms": 27,
89606
+ * "with_fbclid_only": 5,
89607
+ * "with_no_tracking": 12,
89608
+ * "coverage_percent": 72.7
89609
+ * },
89610
+ * "outcomes_coverage": {
89611
+ * "outcomes": 42,
89612
+ * "attributed_outcomes": 31,
89613
+ * "coverage_percent": 73.8
88428
89614
  * }
88429
89615
  * }
88430
89616
  * }
@@ -89728,6 +90914,207 @@ interface paths {
89728
90914
  patch?: never;
89729
90915
  trace?: never;
89730
90916
  };
90917
+ "/ads/actions/executions": {
90918
+ parameters: {
90919
+ query?: never;
90920
+ header?: never;
90921
+ path?: never;
90922
+ cookie?: never;
90923
+ };
90924
+ /**
90925
+ * The actions journal («Lo que hice»)
90926
+ * @description Every action execution of the workspace (execute and rollback rows), newest first, each with what it touched (`target`) and who confirmed it (`created_by`, a display name — only for a caller holding `memberships:read`). `from`/`to` bound `created_at` by America/Santiago day; page with `before=<meta.next_before>`. Real mode lists real executions only; with `sample=1` it lists what was simulated plus two example rows of today (also readable on `GET /ads/actions/executions/{id}`; not undoable: `rollback_available: false`).
90927
+ */
90928
+ get: {
90929
+ parameters: {
90930
+ query?: {
90931
+ /** @description First day (inclusive, America/Santiago) on `created_at`. */
90932
+ from?: string;
90933
+ /** @description Last day (inclusive, America/Santiago) on `created_at`. */
90934
+ to?: string;
90935
+ /** @description Paging cursor: a previous page’s `meta.next_before`, verbatim. */
90936
+ before?: string;
90937
+ /** @description Rows per page (default 20, max 50). */
90938
+ limit?: number;
90939
+ /** @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. */
90940
+ sample?: "1" | "true";
90941
+ };
90942
+ header?: never;
90943
+ path?: never;
90944
+ cookie?: never;
90945
+ };
90946
+ requestBody?: never;
90947
+ responses: {
90948
+ /** @description A page of the journal */
90949
+ 200: {
90950
+ headers: {
90951
+ [name: string]: unknown;
90952
+ };
90953
+ content: {
90954
+ /**
90955
+ * @example {
90956
+ * "data": [
90957
+ * {
90958
+ * "id": "e5e5e5e5-0000-4000-8000-000000000003",
90959
+ * "action_key": "pause_ad:120212000000000006:2026-09-23",
90960
+ * "kind": "pause_ad",
90961
+ * "status": "succeeded",
90962
+ * "outcome": {
90963
+ * "summary": "Anuncio pausado en Meta.",
90964
+ * "engine_action_id": "f7f7f7f7-0000-4000-8000-000000000002",
90965
+ * "applied_at": "2026-09-23T16:20:04.000Z"
90966
+ * },
90967
+ * "error": null,
90968
+ * "rollback_available": true,
90969
+ * "rollback_of": null,
90970
+ * "simulated": false,
90971
+ * "created_at": "2026-09-23T16:20:01.000Z",
90972
+ * "finished_at": "2026-09-23T16:20:04.000Z",
90973
+ * "target": {
90974
+ * "level": "ad",
90975
+ * "external_id": "120212000000000006",
90976
+ * "name": "Blanqueamiento · Sonrisa"
90977
+ * },
90978
+ * "created_by": "Dueña Ejemplo"
90979
+ * },
90980
+ * {
90981
+ * "id": "e5e5e5e5-0000-4000-8000-000000000001",
90982
+ * "action_key": "budget_change:120211000000000077:2026-09-23",
90983
+ * "kind": "budget_change",
90984
+ * "status": "succeeded",
90985
+ * "outcome": {
90986
+ * "summary": "Cambio aplicado en Meta.",
90987
+ * "engine_action_id": "f7f7f7f7-0000-4000-8000-000000000001",
90988
+ * "applied_at": "2026-09-23T15:01:12.000Z"
90989
+ * },
90990
+ * "error": null,
90991
+ * "rollback_available": true,
90992
+ * "rollback_of": null,
90993
+ * "simulated": false,
90994
+ * "created_at": "2026-09-23T15:01:10.000Z",
90995
+ * "finished_at": "2026-09-23T15:01:12.000Z",
90996
+ * "target": {
90997
+ * "level": "ad_set",
90998
+ * "external_id": "120211000000000077",
90999
+ * "name": "Implantes · Las Condes"
91000
+ * },
91001
+ * "created_by": null
91002
+ * }
91003
+ * ],
91004
+ * "meta": {
91005
+ * "next_before": "2026-09-23T15:01:10.000000Z,e5e5e5e5-0000-4000-8000-000000000001"
91006
+ * }
91007
+ * }
91008
+ */
91009
+ "application/json": {
91010
+ data: components["schemas"]["AdsActionExecutionListItem"][];
91011
+ meta: {
91012
+ /** @description Opaque cursor (`<created_at>,<id>`): pass as `before`. */
91013
+ next_before: string | null;
91014
+ };
91015
+ };
91016
+ };
91017
+ };
91018
+ /** @description Validation error */
91019
+ 400: {
91020
+ headers: {
91021
+ [name: string]: unknown;
91022
+ };
91023
+ content: {
91024
+ "application/json": components["schemas"]["Error"];
91025
+ };
91026
+ };
91027
+ /** @description Unauthorized */
91028
+ 401: {
91029
+ headers: {
91030
+ [name: string]: unknown;
91031
+ };
91032
+ content: {
91033
+ "application/json": components["schemas"]["Error"];
91034
+ };
91035
+ };
91036
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
91037
+ 402: {
91038
+ headers: {
91039
+ [name: string]: unknown;
91040
+ };
91041
+ content: {
91042
+ /**
91043
+ * @example {
91044
+ * "error": {
91045
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
91046
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
91047
+ * "details": {
91048
+ * "required": [
91049
+ * "vitrina_ads"
91050
+ * ],
91051
+ * "active": [],
91052
+ * "feature": "vitrina_ads",
91053
+ * "entitlement_state": "off"
91054
+ * }
91055
+ * }
91056
+ * }
91057
+ */
91058
+ "application/json": components["schemas"]["Error"];
91059
+ };
91060
+ };
91061
+ /** @description Forbidden */
91062
+ 403: {
91063
+ headers: {
91064
+ [name: string]: unknown;
91065
+ };
91066
+ content: {
91067
+ "application/json": components["schemas"]["Error"];
91068
+ };
91069
+ };
91070
+ /** @description Not found */
91071
+ 404: {
91072
+ headers: {
91073
+ [name: string]: unknown;
91074
+ };
91075
+ content: {
91076
+ "application/json": components["schemas"]["Error"];
91077
+ };
91078
+ };
91079
+ /** @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. */
91080
+ 409: {
91081
+ headers: {
91082
+ [name: string]: unknown;
91083
+ };
91084
+ content: {
91085
+ /**
91086
+ * @example {
91087
+ * "error": {
91088
+ * "code": "ADS_KEY_NEEDS_REMINT",
91089
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
91090
+ * "details": {
91091
+ * "key_kind": "core"
91092
+ * }
91093
+ * }
91094
+ * }
91095
+ */
91096
+ "application/json": components["schemas"]["Error"];
91097
+ };
91098
+ };
91099
+ /** @description Rate limited */
91100
+ 429: {
91101
+ headers: {
91102
+ [name: string]: unknown;
91103
+ };
91104
+ content: {
91105
+ "application/json": components["schemas"]["Error"];
91106
+ };
91107
+ };
91108
+ };
91109
+ };
91110
+ put?: never;
91111
+ post?: never;
91112
+ delete?: never;
91113
+ options?: never;
91114
+ head?: never;
91115
+ patch?: never;
91116
+ trace?: never;
91117
+ };
89731
91118
  "/ads/actions/executions/{id}": {
89732
91119
  parameters: {
89733
91120
  query?: never;
@@ -90718,6 +92105,7 @@ interface paths {
90718
92105
  * "ad": {
90719
92106
  * "name": null,
90720
92107
  * "ad_set_name": null,
92108
+ * "creative_thumbnail_url": null,
90721
92109
  * "campaign": {
90722
92110
  * "external_id": "120211000000000001",
90723
92111
  * "name": "Ortodoncia invisible · Septiembre"
@@ -109402,6 +110790,99 @@ interface components {
109402
110790
  name: string;
109403
110791
  };
109404
110792
  };
110793
+ TenantSettingsPublic: {
110794
+ /** @description Workspace display name. */
110795
+ name?: string;
110796
+ /** @description IANA time zone, e.g. `America/Santiago`. */
110797
+ timezone?: string;
110798
+ /** @description Default language, e.g. `es`. */
110799
+ language?: string;
110800
+ /** @description ISO 4217 currency, e.g. `CLP`. */
110801
+ currency?: string;
110802
+ /** @enum {string} */
110803
+ date_format?: "latam" | "us" | "iso";
110804
+ /** @description The workspace's declared public website. */
110805
+ website?: string;
110806
+ /** @description Vitrina Ads workspace choices; absent until first answered. */
110807
+ ads?: {
110808
+ /**
110809
+ * @description How the «Instalar el tag» step was answered: `site` (the tag goes on the workspace website) or `no_site` (no website; skipped on purpose). Absent/`null` = never answered.
110810
+ * @enum {string|null}
110811
+ */
110812
+ tag_choice?: "site" | "no_site" | null;
110813
+ /**
110814
+ * Format: date-time
110815
+ * @description Server-stamped on every `tag_choice` write.
110816
+ */
110817
+ tag_choice_at?: string | null;
110818
+ /** @description The monthly goal the Ads hero measures pace against. */
110819
+ goal?: {
110820
+ /**
110821
+ * @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
110822
+ * @enum {string}
110823
+ */
110824
+ kind: "outcomes" | "value" | "roas";
110825
+ /** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
110826
+ target: number;
110827
+ /**
110828
+ * @description The only period: the calendar month.
110829
+ * @enum {string}
110830
+ */
110831
+ period: "month";
110832
+ } | null;
110833
+ /**
110834
+ * Format: date-time
110835
+ * @description Server-stamped on every `goal` write.
110836
+ */
110837
+ goal_at?: string | null;
110838
+ /** @description Who last wrote the goal: the member's user id, or the API key id. */
110839
+ goal_by?: string | null;
110840
+ /** @description `{ [action key]: until ISO }` — Ads actions hidden until that instant; expired entries are pruned on every write. */
110841
+ dismissed_actions?: {
110842
+ [key: string]: string;
110843
+ };
110844
+ };
110845
+ };
110846
+ TenantSettingsPublicWrite: {
110847
+ /** @description Vitrina Ads workspace choices. `tag_choice`: how the «Instalar el tag» step was answered — `site` (the tag goes on the workspace's website, pasted or through Google Tag Manager) or `no_site` (no website; step skipped on purpose); `null` clears it. `goal`: the monthly goal the Ads hero measures pace against (`{kind, target, period:'month'}`; `null` clears it — `PUT /ads/goal` is the dedicated door). `dismissed_actions`: `{ [action id]: until ISO }` merged onto the stored map (`null` removes an id; expired entries are pruned). Merged into the stored `ads` object; the server stamps `tag_choice_at` / `goal_at` / `goal_by` on every write, and `GET /tenant/settings` returns them under `ads`. */
110848
+ ads?: {
110849
+ /** @enum {string|null} */
110850
+ tag_choice?: "site" | "no_site" | null;
110851
+ goal?: {
110852
+ /**
110853
+ * @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
110854
+ * @enum {string}
110855
+ */
110856
+ kind: "outcomes" | "value" | "roas";
110857
+ /** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
110858
+ target: number;
110859
+ /**
110860
+ * @description The only period: the calendar month.
110861
+ * @enum {string}
110862
+ */
110863
+ period: "month";
110864
+ } | null;
110865
+ dismissed_actions?: {
110866
+ [key: string]: string | null;
110867
+ };
110868
+ };
110869
+ };
110870
+ PaymentMethodSetup: {
110871
+ /** @enum {string} */
110872
+ provider: "fintoc" | "mercadopago";
110873
+ /** @enum {string} */
110874
+ status: "pending" | "active";
110875
+ mandateId: string;
110876
+ /** Format: uri */
110877
+ setupUrl: string | null;
110878
+ };
110879
+ PaymentMethodStatus: {
110880
+ /** @enum {string|null} */
110881
+ provider: "fintoc" | "mercadopago" | null;
110882
+ /** @enum {string|null} */
110883
+ status: "pending" | "active" | "revoked" | "failed" | null;
110884
+ mandateId: string | null;
110885
+ };
109405
110886
  ClinicProfessional: {
109406
110887
  /** Format: uuid */
109407
110888
  id: string;
@@ -109894,6 +111375,17 @@ interface components {
109894
111375
  last_synced_at: string | null;
109895
111376
  };
109896
111377
  MetaAdsAdsResponse: components["schemas"]["MetaAdsAdsNotConnected"] | components["schemas"]["MetaAdsAdsConnected"];
111378
+ AdsOverviewDay: {
111379
+ date: string;
111380
+ /** @description `null` exactly when the engine could not scope spend. */
111381
+ spend: number | null;
111382
+ /** @description Attributed value that day. */
111383
+ revenue: number;
111384
+ outcomes: number;
111385
+ attributed_outcomes: number;
111386
+ /** @description `true` on the day still running (today, America/Santiago): end the solid line before it. */
111387
+ partial: boolean;
111388
+ };
109897
111389
  AdsOverview: {
109898
111390
  current: {
109899
111391
  spend: number | null;
@@ -109947,6 +111439,10 @@ interface components {
109947
111439
  [key: string]: number;
109948
111440
  };
109949
111441
  };
111442
+ /** @description `grain=day` only: every day of the window, oldest first. */
111443
+ days?: components["schemas"]["AdsOverviewDay"][];
111444
+ /** @description `grain=day` only: every day of the previous window of equal length. */
111445
+ previous_days?: components["schemas"]["AdsOverviewDay"][];
109950
111446
  };
109951
111447
  AdsCampaigns: {
109952
111448
  data: {
@@ -109959,6 +111455,20 @@ interface components {
109959
111455
  roas: number;
109960
111456
  direct_cash_value: number | null;
109961
111457
  inherited_cash_value: number | null;
111458
+ /** @description The campaign’s highest-spend ad among the top-50 scored ads of the creatives read (the rolling window nearest this range: 7d / 14d / 28d); `null` when unknown. */
111459
+ top_ad: {
111460
+ /** @description The ad’s platform (Meta) id. */
111461
+ external_id: string;
111462
+ name: string | null;
111463
+ creative_thumbnail_url: string | null;
111464
+ } | null;
111465
+ /** @description `series=1` only. `null` when the daily delivery read failed. A day without delivery is `spend: 0`. */
111466
+ series?: {
111467
+ date: string;
111468
+ spend: number;
111469
+ /** @description Conversions credited primarily to the campaign that day (each conversion counted once, on its largest-credit campaign). `null` when unknown: credit not available yet, the campaign outside the credited set read (top 25 by outcomes), or a day before the credit window (the last 92 days). Under a multi-touch model the days can sum to less than the row’s `outcome_count`. */
111470
+ outcome_count: number | null;
111471
+ }[] | null;
109962
111472
  }[];
109963
111473
  };
109964
111474
  AdsAttributedSales: {
@@ -109976,6 +111486,8 @@ interface components {
109976
111486
  credited_weight: number;
109977
111487
  touch_count: number;
109978
111488
  path_length: number | null;
111489
+ first_touch_time: string | null;
111490
+ last_touch_time: string | null;
109979
111491
  is_inherited: boolean;
109980
111492
  }[];
109981
111493
  };
@@ -109984,6 +111496,12 @@ interface components {
109984
111496
  ad_external_id: string;
109985
111497
  ad_name: string | null;
109986
111498
  campaign_name: string | null;
111499
+ /** @description The ad’s campaign; `null` when the engine does not say. */
111500
+ campaign: {
111501
+ /** @description The campaign’s platform id = an `/ads/campaigns` row’s `campaign_external_id`. Join by this, never by name. */
111502
+ external_id: string;
111503
+ name: string | null;
111504
+ } | null;
109987
111505
  ad_set_name: string | null;
109988
111506
  creative_thumbnail_url: string | null;
109989
111507
  score_window: string;
@@ -110001,6 +111519,13 @@ interface components {
110001
111519
  fatigue_state: "active" | "paused" | "degraded" | null;
110002
111520
  /** @enum {string|null} */
110003
111521
  fatigue_risk_tier: "low" | "medium" | "high" | "critical" | null;
111522
+ /** @description `series=1` only: the last 14 days (America/Santiago). `null` past the first 50 rows or when this ad’s daily read failed (never a zero-filled line for an unknown); `spend: 0` days are measured no-delivery days. */
111523
+ series?: {
111524
+ date: string;
111525
+ spend: number;
111526
+ /** @description Percent (clicks ÷ impressions × 100), like the row’s `ctr`; `null` on a day without impressions. */
111527
+ ctr: number | null;
111528
+ }[] | null;
110004
111529
  }[];
110005
111530
  };
110006
111531
  AdsHealth: {
@@ -110049,6 +111574,12 @@ interface components {
110049
111574
  with_no_tracking: number;
110050
111575
  coverage_percent: number;
110051
111576
  };
111577
+ /** @description THE population «cobertura» and «outcomes» share: the same counts `/ads/overview` answers for this window and model (`current.outcomes`, `current.attributed_outcomes`, `current.coverage_percent`). Salud prints this; `attribution_coverage` is the tracking-signal diagnostic (the engine’s attribution-eligible conversions and whether each carried a UTM / click id) — a different population, never shown as «de N». `null` when the overview read failed (the rest of the page stands). */
111578
+ outcomes_coverage: {
111579
+ outcomes: number;
111580
+ attributed_outcomes: number;
111581
+ coverage_percent: number;
111582
+ } | null;
110052
111583
  };
110053
111584
  AdsFact: {
110054
111585
  /** @description Stable fact key (`roas`, `best_campaign_name`, …) — a vocabulary name, not a resource id. */
@@ -110060,7 +111591,7 @@ interface components {
110060
111591
  /** @description The exact es-CL string a sentence quotes (`3,7×`, `$845.200`, `—`). */
110061
111592
  display: string;
110062
111593
  /** @enum {string} */
110063
- format: "clp" | "int" | "times" | "pct" | "text" | "date";
111594
+ format: "clp" | "int" | "times" | "pct" | "text" | "date" | "days";
110064
111595
  /** @description Where the value was read. */
110065
111596
  source: string;
110066
111597
  /**
@@ -110088,7 +111619,7 @@ interface components {
110088
111619
  fact_key: string;
110089
111620
  value: number | string | null;
110090
111621
  /** @enum {string} */
110091
- format: "clp" | "int" | "times" | "pct" | "text" | "date";
111622
+ format: "clp" | "int" | "times" | "pct" | "text" | "date" | "days";
110092
111623
  /** @description The substring of `lead.text` to count up. */
110093
111624
  display: string;
110094
111625
  /** @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`). */
@@ -110223,6 +111754,17 @@ interface components {
110223
111754
  created_at: string;
110224
111755
  finished_at: string | null;
110225
111756
  };
111757
+ AdsActionExecutionListItem: components["schemas"]["AdsActionExecution"] & {
111758
+ target: {
111759
+ /** @enum {string} */
111760
+ level: "ad" | "ad_set" | "campaign" | "profile";
111761
+ /** @description The Meta id of what was touched; `null` for a profile-level action. */
111762
+ external_id: string | null;
111763
+ name: string | null;
111764
+ };
111765
+ /** @description Display name of the member who confirmed it — only for a caller holding `memberships:read` (sample mode included, for the rows the owner simulated); `null` otherwise, for an API key, and on the two sample example rows. Write «Vitrina» for `null`. */
111766
+ created_by: string | null;
111767
+ };
110226
111768
  AdsTrackingKey: {
110227
111769
  key_id: string;
110228
111770
  public_key: string;
@@ -110240,6 +111782,7 @@ interface components {
110240
111782
  snippet: string;
110241
111783
  setup_checklist: string[];
110242
111784
  };
111785
+ /** @description No per-day series: tag events are counted over the last 24 hours only (`events_24h`); a day-by-day count is not available. */
110243
111786
  AdsTrackingStatus: {
110244
111787
  installed: boolean;
110245
111788
  last_seen_at: string | null;
@@ -110274,6 +111817,8 @@ interface components {
110274
111817
  ad: {
110275
111818
  name: string | null;
110276
111819
  ad_set_name: string | null;
111820
+ /** @description The ad’s thumbnail (Ads v3). `null` on real data today (the engine’s credit is campaign-grain — it names no ad) and in sample mode (the UI draws a placeholder); render the megaphone glyph for `null`. */
111821
+ creative_thumbnail_url: string | null;
110277
111822
  campaign: {
110278
111823
  /** @description The campaign’s PLATFORM id (what `campaign_id` filters on). */
110279
111824
  external_id: string;