@vitrina/api 17.116.0 → 17.117.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 +1137 -275
  2. package/dist/index.d.ts +1137 -275
  3. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -147350,7 +147350,7 @@ interface paths {
147350
147350
  };
147351
147351
  /**
147352
147352
  * Agenda for a window, any engine, by professional and branch
147353
- * @description Mirrored AND native appointments between `from` (inclusive) and `to` (EXCLUSIVE), bare `YYYY-MM-DD` days in the clinic's timezone; the window may not exceed 8 days. Cancelled citas are INCLUDED (the grid draws them muted). Unlike `GET /clinic/agenda`, `professional_id` and `location_id` are VITRINA uuids — `clinic_professional.id` and `location.id` — so one query serves a Medilink, a Reservo and a native clinic. Each row still carries the vendor's own ids under `vendor` for provenance: a row with `vendor.professional_id` set and `professional: null` is a roster gap, never a cita nobody is attending. `video` ({staff_link, join_opens_at, join_closes_at, waiting} or null) marks a videoconsulta: the camera icon, the professional's «Entrar» from join_opens_at, and «Esperando en video». Never calls the clinic API. `cancellation` ({by: patient|clinic|null, reason} or null) is set on a cancelled cita: who called it off and why. `flags` are the clinical alerts the clinic shows on the block: clinical-record content, returned to an API key or personal token only when it also holds `clinic_record:read`. `booking_kind` is the cita's Tipo de agendamiento: `new` (Nuevo: it would be a primera visita and the patient never booked before), `new_rebooked` (Nuevo · reagenda: a primera visita, but the patient had earlier bookings and never came) or `in_treatment` (En tratamiento: every other cita); null on a row that is not a patient's cita. It uses the primera-visita rule Vitrina Ads counts, so a patient back after 12 months without an attended cita is `new`. `origin` is the patient's Origen (`kind` `meta` with the ad, ad set and campaign names, or `organic`) — the attribution Vitrina Ads reports, one definition; null on a row that is not a patient's cita. Filter with `origin=meta|organic|unknown` and, for Meta, `origin_ad_id` (a Meta ad id): rows that are not a patient's cita never match. `is_diagnosis` marks a diagnosis cita — a primera visita (`booking_kind` `new` / `new_rebooked`), an entry prestación the clinic confirmed, or a cita the clinic named as an evaluación / diagnóstico (the prestación, or the vendor's tratamiento label) unless its prestación is confirmed not to be an entry; `diagnosis=true` returns only those. `booked_via` says how the cita was booked: `agent` (Vitrina's AI agent, with the conversation `channel`), `online` (the patient on a booking page), `whatsapp` (a person booked it within 48 h of a WhatsApp exchange with the patient), `staff` (a team member in Vitrina, `by`), `vendor` (keyed straight into the clinic's system) or `calendar`; `booked_at` is the vendor's own creation time when known. `paid_clp` is what THIS cita was paid (allocations to its own abono and performed prestaciones; never the patient's presupuesto cuotas), returned only to a caller holding `clinic_money:read`. `owed_clp` is everything the cita still owes (abono AND performed prestaciones: every open receivable on the cita, net of allocations) and `patient_owed_clp` everything its patient owes, future cuotas included — the same figure as the ficha's «Debe» (`GET /contacts/{id}/ledger` `outstanding_clp`); both null without `clinic_money:read`. `money` stays the abono alone. `unconfirmed` is true on a live cita (`status` `confirmed`) whose clinic status says the patient has not confirmed it yet («No confirmado»): draw it as «Sin confirmar». It is a confirmation flag beside `status`, never a lifecycle state — the cita still counts as booked everywhere `status` `confirmed` does. `visit_state` is THE cita's one status (lane L2, `GET /clinic/cita-statuses`): `key` is `scheduled` (Agendada), `confirmed` (Confirmada), `waiting` (Esperando), `in_room` (En box), `attended` (Atendida), `no_show` (No llegó) or `cancelled` (Anulada) — a call-off first, then an attended visit, then where the patient is (Vitrina's board, else the mirror's own estado), then whether she confirmed; `minutes` is how long she has waited, been in the box or (attended, still owing) been at the counter, and `stale` says that has gone on for 3 h or since an earlier day. `owes` marks an attended visit that still owes its own lines («Cobrar»): money is a mark, never a status. `overbooked` marks a cita staff booked as a sobrecupo. `status_actions` is `{current, offered}` on the same line: `offered` is what `POST /clinic/appointments/{id}/status` accepts from this caller now — never the current one, empty on a cancelled cita, a bloqueo or an own event, and for a caller without `clinic:write`; no visit-day move on a later day, `no_show` only from the cita's hour; a Medilink/Dentalink mirror offers only where the patient is and the cancel. `motivo` ({id, name} or null) is the motivo de atención a cita in Vitrina's own agenda was booked as — what the cita is called on the block, the drawer and the phone; `service` stays the prestación it is charged as. `professional.name` is «Nombre Apellidos».
147353
+ * @description Mirrored AND native appointments between `from` (inclusive) and `to` (EXCLUSIVE), bare `YYYY-MM-DD` days in the clinic's timezone; the window may not exceed 8 days. Cancelled citas are INCLUDED (the grid draws them muted). Unlike `GET /clinic/agenda`, `professional_id` and `location_id` are VITRINA uuids — `clinic_professional.id` and `location.id` — so one query serves a Medilink, a Reservo and a native clinic. Each row still carries the vendor's own ids under `vendor` for provenance: a row with `vendor.professional_id` set and `professional: null` is a roster gap, never a cita nobody is attending. `video` ({staff_link, join_opens_at, join_closes_at, waiting} or null) marks a videoconsulta: the camera icon, the professional's «Entrar» from join_opens_at, and «Esperando en video». Never calls the clinic API. `cancellation` ({by: patient|clinic|null, reason} or null) is set on a cancelled cita: who called it off and why. `flags` are the clinical alerts the clinic shows on the block: clinical-record content, returned to an API key or personal token only when it also holds `clinic_record:read`. `booking_kind` is the cita's Tipo de agendamiento: `new` (Nuevo: it would be a primera visita and the patient never booked before), `new_rebooked` (Nuevo · reagenda: a primera visita, but the patient had earlier bookings and never came) or `in_treatment` (En tratamiento: every other cita); null on a row that is not a patient's cita. It uses the primera-visita rule Vitrina Ads counts, so a patient back after 12 months without an attended cita is `new`. `origin` is the patient's Origen (`kind` `meta` with the ad, ad set and campaign names, or `organic`) — the attribution Vitrina Ads reports, one definition; null on a row that is not a patient's cita. Filter with `origin=meta|organic|unknown` and, for Meta, `origin_ad_id` (a Meta ad id): rows that are not a patient's cita never match. `is_diagnosis` marks a diagnosis cita — a primera visita (`booking_kind` `new` / `new_rebooked`), an entry prestación the clinic confirmed, or a cita the clinic named as an evaluación / diagnóstico (the prestación, or the vendor's tratamiento label) unless its prestación is confirmed not to be an entry; `diagnosis=true` returns only those. `booked_via` says how the cita was booked: `agent` (Vitrina's AI agent, with the conversation `channel`), `online` (the patient on a booking page), `whatsapp` (a person booked it within 48 h of a WhatsApp exchange with the patient), `staff` (a team member in Vitrina, `by`), `vendor` (keyed straight into the clinic's system) or `calendar`; `booked_at` is the vendor's own creation time when known. `paid_clp` is what THIS cita was paid (allocations to its own abono and performed prestaciones; never the patient's presupuesto cuotas), returned only to a caller holding `clinic_money:read`. `owed_clp` is everything the cita still owes (abono AND performed prestaciones: every open receivable on the cita, net of allocations) and `patient_owed_clp` everything its patient owes, future cuotas included — the same figure as the ficha's «Debe» (`GET /contacts/{id}/ledger` `outstanding_clp`); both null without `clinic_money:read`. `money` stays the abono alone. `unconfirmed` is true on a live cita (`status` `confirmed`) whose clinic status says the patient has not confirmed it yet («No confirmado»): draw it as «Sin confirmar». It is a confirmation flag beside `status`, never a lifecycle state — the cita still counts as booked everywhere `status` `confirmed` does. `visit_state` is THE cita's one status (lane L2, `GET /clinic/cita-statuses`): `key` is `scheduled` (Agendada), `confirmed` (Confirmada), `waiting` (Esperando), `in_room` (En box), `attended` (Atendida), `no_show` (No llegó) or `cancelled` (Anulada) — a call-off first, then an attended visit, then where the patient is (Vitrina's board, else the mirror's own estado), then whether she confirmed; `minutes` is how long she has waited, been in the box or (attended, still owing) been at the counter, and `stale` says that has gone on for 3 h or since an earlier day. `owes` marks an attended visit that still owes its own lines («Cobrar»): money is a mark, never a status. `overbooked` marks a cita booked as a sobrecupo and `overbook_reason` says why (the reason staff wrote, or `campaña` for a «Sobrecupo de campaña»; null otherwise). `status_actions` is `{current, offered}` on the same line: `offered` is what `POST /clinic/appointments/{id}/status` accepts from this caller now — never the current one, empty on a cancelled cita, a bloqueo or an own event, and for a caller without `clinic:write`; no visit-day move on a later day, `no_show` only from the cita's hour; a Medilink/Dentalink mirror offers only where the patient is and the cancel. `motivo` ({id, name} or null) is the motivo de atención a cita in Vitrina's own agenda was booked as — what the cita is called on the block, the drawer and the phone; `service` stays the prestación it is charged as. `professional.name` is «Nombre Apellidos».
147354
147354
  *
147355
147355
  * **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`.
147356
147356
  */
@@ -147411,6 +147411,7 @@ interface paths {
147411
147411
  * },
147412
147412
  * "owes": false,
147413
147413
  * "overbooked": false,
147414
+ * "overbook_reason": null,
147414
147415
  * "clinic_status_id": null,
147415
147416
  * "status_label": null,
147416
147417
  * "status_color": null,
@@ -148190,7 +148191,7 @@ interface paths {
148190
148191
  };
148191
148192
  /**
148192
148193
  * Free slots, from whichever engine owns this diary
148193
- * @description One endpoint, three truths: a Medilink clinic gets its vendor's live answer, a Reservo clinic the local compute over its mirror, and a native clinic the professionals' work patterns minus exceptions, existing citas and room contention. Each slot carries an opaque `slot_ref` that pins the professional, the box and the branch — book it back verbatim. `allow_overbook` is a STAFF flag and defaults to false: an hour that only exists because the clinic permits sobrecupo is a receptionist's decision with a reason, never something a patient-facing read gives away. `professional_id` is the `id` returned by clinic_professionals_list, and each slot's `professional_id` is in that same id space. The window is half-open like every agenda read: `from` inclusive, `to` EXCLUSIVE. `truncated: true` means more free slots exist than were listed — days of the window left unread (see `searched_through`) or the `limit` cap (max 100) reached; narrow by `professional_id` / `especialidad` or shorten the window to see the rest. A ONE-day read with no slot says why in `empty_reason` (Vitrina's own diary; null elsewhere): `nobody_performs`, `nobody_works` (no horario that day), `professional_off` (the one professional asked for is off that day while others work), `closed` (bloqueos, feriados or vacaciones cover it), `past` or `all_taken`. `performed_by` names whose agendas were read when the visit narrowed them (its who-performs or specialty; null = everyone), so an empty day reads «este motivo solo lo atiende …». On a `complete` read of Vitrina's own diary that came back empty, `next_available` is the first later day with a free hour ({date, first_starts_at}); null otherwise.
148194
+ * @description One endpoint, three truths: a Medilink clinic gets its vendor's live answer, a Reservo clinic the local compute over its mirror, and a native clinic the professionals' work patterns minus exceptions, existing citas and room contention. Each slot carries an opaque `slot_ref` that pins the professional, the box and the branch — book it back verbatim. `allow_overbook` is a STAFF flag and defaults to false: an hour that only exists because the clinic permits sobrecupo is a receptionist's decision with a reason, never something a patient-facing read gives away. The one exception is a clinic that set «Sobrecupo de campaña» (`/clinic/agenda/campaign-overbook`): for an entry prestación, a share of the hours held by ad-origin evaluations is offered once more, to every reader, flagged `campaign_overbook: true` here; booked by its `slot_ref` it is stored as a sobrecupo with reason «campaña». `professional_id` is the `id` returned by clinic_professionals_list, and each slot's `professional_id` is in that same id space. The window is half-open like every agenda read: `from` inclusive, `to` EXCLUSIVE. `truncated: true` means more free slots exist than were listed — days of the window left unread (see `searched_through`) or the `limit` cap (max 100) reached; narrow by `professional_id` / `especialidad` or shorten the window to see the rest. A ONE-day read with no slot says why in `empty_reason` (Vitrina's own diary; null elsewhere): `nobody_performs`, `nobody_works` (no horario that day), `professional_off` (the one professional asked for is off that day while others work), `closed` (bloqueos, feriados or vacaciones cover it), `past` or `all_taken`. `performed_by` names whose agendas were read when the visit narrowed them (its who-performs or specialty; null = everyone), so an empty day reads «este motivo solo lo atiende …». On a `complete` read of Vitrina's own diary that came back empty, `next_available` is the first later day with a free hour ({date, first_starts_at}); null otherwise.
148194
148195
  *
148195
148196
  * **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`.
148196
148197
  */
@@ -148234,7 +148235,8 @@ interface paths {
148234
148235
  * "label": "jueves, 24 de septiembre, 09:00",
148235
148236
  * "slot_ref": "ncl1_eyJwIjoiZmZmZmZmZmYtMDAwMC00MDAwLTgwMDAtMDAwMDAwMDAwMDAxIiwibCI6ImIxYjFiMWIxLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMiIsInMiOiIyMDI2LTA5LTI0VDEyOjAwOjAwLjAwMFoiLCJlIjoiMjAyNi0wOS0yNFQxMjozMDowMC4wMDBaIn0",
148236
148237
  * "professional_id": "ffffffff-0000-4000-8000-000000000001",
148237
- * "professional_name": "Ana Rojas"
148238
+ * "professional_name": "Ana Rojas",
148239
+ * "campaign_overbook": false
148238
148240
  * },
148239
148241
  * {
148240
148242
  * "starts_at": "2026-09-24T12:30:00.000Z",
@@ -148242,7 +148244,8 @@ interface paths {
148242
148244
  * "label": "jueves, 24 de septiembre, 09:30",
148243
148245
  * "slot_ref": "ncl1_eyJwIjoiZmZmZmZmZmYtMDAwMC00MDAwLTgwMDAtMDAwMDAwMDAwMDAxIiwibCI6ImIxYjFiMWIxLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMiIsInMiOiIyMDI2LTA5LTI0VDEyOjMwOjAwLjAwMFoiLCJlIjoiMjAyNi0wOS0yNFQxMzowMDowMC4wMDBaIn0",
148244
148246
  * "professional_id": "ffffffff-0000-4000-8000-000000000001",
148245
- * "professional_name": "Ana Rojas"
148247
+ * "professional_name": "Ana Rojas",
148248
+ * "campaign_overbook": false
148246
148249
  * }
148247
148250
  * ],
148248
148251
  * "searched_through": "2026-09-24",
@@ -149407,7 +149410,7 @@ interface paths {
149407
149410
  patch?: never;
149408
149411
  trace?: never;
149409
149412
  };
149410
- "/clinic/migration/runs": {
149413
+ "/clinic/agenda/campaign-overbook": {
149411
149414
  parameters: {
149412
149415
  query?: never;
149413
149416
  header?: never;
@@ -149415,23 +149418,21 @@ interface paths {
149415
149418
  cookie?: never;
149416
149419
  };
149417
149420
  /**
149418
- * The clinic’s migration runs, newest first
149419
- * @description The clinic’s migration runs, newest first
149421
+ * Sobrecupo de campaña: the setting and the measured no-show rate
149422
+ * @description «Sobrecupo de campaña»: the clinic's own bet against the no-shows of ad patients. `percent` (0–100, 0 = off, the default) is the share of the hours held by an evaluation cita (an entry prestación) of a patient whose Origen is Meta that stays bookable once more, per professional and day — by the AI agent and the online booking page as well as staff — for any patient booking an entry prestación. At most one extra cita per held hour; floor(percent × that day's ad-origin evaluation citas) per professional and day; the earliest held hours first; a box is never double-booked; the horario's staff sobrecupo is neither required nor spent. The extra cita is stored as a sobrecupo with reason «campaña» (`overbooked: true`, `overbook_reason: "campaña"` on the feed). `no_show_guidance` is the clinic's measured no-show rate by Origen over the last 90 days, as the Inasistencias report counts it; Vitrina never sets the percentage. Only a clinic whose agenda runs in Vitrina can use it: on a mirrored agenda (Dentalink / Medilink / Reservo) `supported` is false with `unsupported_reason: "mirrored_agenda"` and nothing is offered.
149420
149423
  *
149421
149424
  * **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`.
149422
149425
  */
149423
149426
  get: {
149424
149427
  parameters: {
149425
- query?: {
149426
- limit?: number;
149427
- };
149428
+ query?: never;
149428
149429
  header?: never;
149429
149430
  path?: never;
149430
149431
  cookie?: never;
149431
149432
  };
149432
149433
  requestBody?: never;
149433
149434
  responses: {
149434
- /** @description MigrationRuns */
149435
+ /** @description Sobrecupo de campaña */
149435
149436
  200: {
149436
149437
  headers: {
149437
149438
  [name: string]: unknown;
@@ -149440,34 +149441,50 @@ interface paths {
149440
149441
  /**
149441
149442
  * @example {
149442
149443
  * "data": {
149443
- * "items": [
149444
- * {
149445
- * "id": "01929a5e-7c10-7d3e-9a41-5b8f2c6d1e07",
149446
- * "mode": "apply",
149447
- * "status": "completed",
149448
- * "status_label": "Completada",
149449
- * "families": [
149450
- * "patients",
149451
- * "appointments"
149452
- * ],
149453
- * "started_at": "2026-10-30T23:05:00.000Z",
149454
- * "finished_at": "2026-10-31T01:42:10.000Z",
149455
- * "totals": {
149456
- * "examined": 4213,
149457
- * "created": 3980,
149458
- * "unchanged": 190,
149459
- * "gaps": 43
149444
+ * "percent": 50,
149445
+ * "enabled": true,
149446
+ * "supported": true,
149447
+ * "unsupported_reason": null,
149448
+ * "engine": "native-clinic",
149449
+ * "no_show_guidance": {
149450
+ * "from": "2026-06-26",
149451
+ * "to": "2026-09-23",
149452
+ * "by_origin": [
149453
+ * {
149454
+ * "key": "meta",
149455
+ * "label": "Meta",
149456
+ * "attended": 62,
149457
+ * "no_show": 21,
149458
+ * "late_cancel": 4,
149459
+ * "cancelled": 11,
149460
+ * "cancelled_notice_unknown": 1,
149461
+ * "unknown": 0,
149462
+ * "closed": 94,
149463
+ * "no_show_pct": 25,
149464
+ * "late_cancel_pct": 40,
149465
+ * "attendance_pct": 66
149466
+ * },
149467
+ * {
149468
+ * "key": "organic",
149469
+ * "label": "Orgánico",
149470
+ * "attended": 140,
149471
+ * "no_show": 9,
149472
+ * "late_cancel": 3,
149473
+ * "cancelled": 15,
149474
+ * "cancelled_notice_unknown": 0,
149475
+ * "unknown": 0,
149476
+ * "closed": 164,
149477
+ * "no_show_pct": 6,
149478
+ * "late_cancel_pct": 20,
149479
+ * "attendance_pct": 85
149460
149480
  * }
149461
- * }
149462
- * ]
149481
+ * ]
149482
+ * }
149463
149483
  * }
149464
149484
  * }
149465
149485
  */
149466
149486
  "application/json": {
149467
- data?: unknown;
149468
- meta?: {
149469
- [key: string]: unknown;
149470
- };
149487
+ data: components["schemas"]["ClinicCampaignOverbookSetting"];
149471
149488
  };
149472
149489
  };
149473
149490
  };
@@ -149527,206 +149544,31 @@ interface paths {
149527
149544
  };
149528
149545
  };
149529
149546
  };
149530
- put?: never;
149531
- post?: never;
149532
- delete?: never;
149533
- options?: never;
149534
- head?: never;
149535
- patch?: never;
149536
- trace?: never;
149537
- };
149538
- "/clinic/migration/runs/{id}": {
149539
- parameters: {
149540
- query?: never;
149541
- header?: never;
149542
- path?: never;
149543
- cookie?: never;
149544
- };
149545
149547
  /**
149546
- * One migration run: progress per family, gaps by reason
149547
- * @description Per family: status, phase, counts (examined / created / converted / updated / unchanged / kept_native / collapsed / skipped / gaps), progress against the latest dry-run, vendor requests. The gap summary counts what could not come across by reason, with Spanish labels. Counts and reason codes only — never a patient.
149548
+ * Set the Sobrecupo de campaña percentage
149549
+ * @description «Sobrecupo de campaña»: the clinic's own bet against the no-shows of ad patients. `percent` (0–100, 0 = off, the default) is the share of the hours held by an evaluation cita (an entry prestación) of a patient whose Origen is Meta that stays bookable once more, per professional and day — by the AI agent and the online booking page as well as staff — for any patient booking an entry prestación. At most one extra cita per held hour; floor(percent × that day's ad-origin evaluation citas) per professional and day; the earliest held hours first; a box is never double-booked; the horario's staff sobrecupo is neither required nor spent. The extra cita is stored as a sobrecupo with reason «campaña» (`overbooked: true`, `overbook_reason: "campaña"` on the feed). `no_show_guidance` is the clinic's measured no-show rate by Origen over the last 90 days, as the Inasistencias report counts it; Vitrina never sets the percentage. Only a clinic whose agenda runs in Vitrina can use it: on a mirrored agenda (Dentalink / Medilink / Reservo) `supported` is false with `unsupported_reason: "mirrored_agenda"` and nothing is offered. Owner or admin (`schedule_config:write`); audited. Turning it on for a mirrored agenda answers 409 `mirrored_agenda`; turning it off always works.
149548
149550
  *
149549
149551
  * **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`.
149550
149552
  */
149551
- get: {
149553
+ put: {
149552
149554
  parameters: {
149553
149555
  query?: never;
149554
149556
  header?: never;
149555
- path: {
149556
- id: string;
149557
- };
149557
+ path?: never;
149558
149558
  cookie?: never;
149559
149559
  };
149560
- requestBody?: never;
149561
- responses: {
149562
- /** @description MigrationRun */
149563
- 200: {
149564
- headers: {
149565
- [name: string]: unknown;
149566
- };
149567
- content: {
149568
- /**
149569
- * @example {
149570
- * "data": {
149571
- * "id": "01929a5e-7c10-7d3e-9a41-5b8f2c6d1e07",
149572
- * "mode": "apply",
149573
- * "status": "completed",
149574
- * "status_label": "Completada",
149575
- * "families": [
149576
- * {
149577
- * "family": "patients",
149578
- * "label": "Fichas administrativas de pacientes (con cargas)",
149579
- * "status": "done",
149580
- * "status_label": "Lista",
149581
- * "reason": null,
149582
- * "reason_label": null,
149583
- * "phase": null,
149584
- * "phase_label": null,
149585
- * "counts": {
149586
- * "examined": 1480,
149587
- * "created": 1402,
149588
- * "unchanged": 60,
149589
- * "gaps": 18
149590
- * },
149591
- * "progress": {
149592
- * "examined": 1480,
149593
- * "expected": 1480
149594
- * },
149595
- * "vendor_requests": 31,
149596
- * "failures": 0,
149597
- * "started_at": "2026-10-30T23:05:02.000Z",
149598
- * "finished_at": "2026-10-30T23:31:40.000Z"
149599
- * }
149600
- * ],
149601
- * "totals": {
149602
- * "examined": 1480,
149603
- * "created": 1402,
149604
- * "unchanged": 60,
149605
- * "gaps": 18
149606
- * },
149607
- * "gaps": [
149608
- * {
149609
- * "family": "patients",
149610
- * "reason": "native_rut_match",
149611
- * "reason_label": "Ya existe en Vitrina una ficha creada aquí con el mismo RUT: no se duplicó ni se fusionó.",
149612
- * "count": 18
149613
- * }
149614
- * ],
149615
- * "history_from": "2021-01-01",
149616
- * "window_ends_at": "2026-11-01T21:00:00.000Z",
149617
- * "started_at": "2026-10-30T23:05:00.000Z",
149618
- * "finished_at": "2026-10-30T23:31:40.000Z",
149619
- * "last_progress_at": "2026-10-30T23:31:40.000Z",
149620
- * "job_deleted_at": "2026-10-30T23:31:41.000Z",
149621
- * "instruction": {
149622
- * "version": "clinic-migration-instruction/2026-09-28",
149623
- * "sha256": "b1946ac92492d2347c6235b4d2611184b1946ac92492d2347c6235b4d2611184",
149624
- * "text": "Instruyo a Vitrina copiar desde Dentalink las fichas administrativas de pacientes …",
149625
- * "instructed_by_user_id": "20000000-0000-4000-8000-000000000001",
149626
- * "instructed_at": "2026-10-30T23:04:40.000Z",
149627
- * "document_reference": null
149628
- * },
149629
- * "error": null
149630
- * }
149631
- * }
149632
- */
149633
- "application/json": {
149634
- data?: unknown;
149635
- meta?: {
149636
- [key: string]: unknown;
149637
- };
149638
- };
149639
- };
149640
- };
149641
- /** @description Validation error */
149642
- 400: {
149643
- headers: {
149644
- [name: string]: unknown;
149645
- };
149646
- content: {
149647
- "application/json": components["schemas"]["Error"];
149648
- };
149649
- };
149650
- /** @description Unauthorized */
149651
- 401: {
149652
- headers: {
149653
- [name: string]: unknown;
149654
- };
149655
- content: {
149656
- "application/json": components["schemas"]["Error"];
149657
- };
149658
- };
149659
- /** @description Forbidden */
149660
- 403: {
149661
- headers: {
149662
- [name: string]: unknown;
149663
- };
149664
- content: {
149665
- "application/json": components["schemas"]["Error"];
149666
- };
149667
- };
149668
- /** @description Not found */
149669
- 404: {
149670
- headers: {
149671
- [name: string]: unknown;
149672
- };
149673
- content: {
149674
- "application/json": components["schemas"]["Error"];
149675
- };
149676
- };
149677
- /** @description Conflict (incl. Idempotency-Key reuse with different body) */
149678
- 409: {
149679
- headers: {
149680
- [name: string]: unknown;
149681
- };
149682
- content: {
149683
- "application/json": components["schemas"]["Error"];
149684
- };
149685
- };
149686
- /** @description Rate limited */
149687
- 429: {
149688
- headers: {
149689
- [name: string]: unknown;
149690
- };
149691
- content: {
149692
- "application/json": components["schemas"]["Error"];
149693
- };
149694
- };
149695
- };
149696
- };
149697
- put?: never;
149698
- post?: never;
149699
- delete?: never;
149700
- options?: never;
149701
- head?: never;
149702
- patch?: never;
149703
- trace?: never;
149704
- };
149705
- "/clinic/appointments/{id}/services": {
149706
- parameters: {
149707
- query?: never;
149708
- header?: never;
149709
- path?: never;
149710
- cookie?: never;
149711
- };
149712
- /**
149713
- * A cita's prestaciones, with what each one owes
149714
- * @description The prestación lines of one cita (`clinic_appointment_service`): catalog name, quantity, the unit price and discount FROZEN on the line, `total_clp` (quantity × unit price − discount; 0 when unpriced), whether it was performed, the plan item it performs, and `obligation_status` — the line's own debt: `none` (not performed, or already charged through an accepted presupuesto or a pack), `open` (owed, possibly partly paid), `paid` (fully paid) or `void` (cancelled). `suggested_line` (the cita was booked by motivo and has no prestación yet) is the motivo's usual prestación quoted for this patient (what adding it would charge), for staff to confirm by adding it; null otherwise. `first_visit_free` (on a line and on `suggested_line`) is true when the price is $0 because the prestación's «1.ª vez sin costo» fired for this patient. `total_clp` is what the visit charges: a line its pack pays counts $0. `nothing_to_charge` says why a visit with prestaciones charges nothing (`paid_by_pack`, `first_visit_free`, `already_paid` — every charging line is paid, `in_budget` — the work is an accepted presupuesto's, whose saldo is what is owed), null otherwise — «Cobrar» has nothing to offer for it; a cita with no line yet whose `suggested_line` is a $0 «1.ª vez sin costo» says `first_visit_free` too. `paid_by_pack` is true when a pack the patient bought pays for the line: it is charged nothing on its own and attending the cita uses one of the pack's sessions. `in_budget` is the folio of the accepted presupuesto that already charges the line (the plan row it performs is priced there): it opens no charge of its own. `editable` is false with `reason` `vendor_engine` for a Dentalink / Medilink / Reservo cita (its prestaciones live in the vendor's tratamiento), `cancelled` for a cancelled cita, `not_a_clinic_cita` for any other appointment. Never calls the clinic API.
149715
- *
149716
- * **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`.
149717
- */
149718
- get: {
149719
- parameters: {
149720
- query?: never;
149721
- header?: never;
149722
- path: {
149723
- id: string;
149560
+ requestBody?: {
149561
+ content: {
149562
+ /**
149563
+ * @example {
149564
+ * "percent": 50
149565
+ * }
149566
+ */
149567
+ "application/json": components["schemas"]["ClinicCampaignOverbookBody"];
149724
149568
  };
149725
- cookie?: never;
149726
149569
  };
149727
- requestBody?: never;
149728
149570
  responses: {
149729
- /** @description Cita prestaciones */
149571
+ /** @description Sobrecupo de campaña */
149730
149572
  200: {
149731
149573
  headers: {
149732
149574
  [name: string]: unknown;
@@ -149735,62 +149577,500 @@ interface paths {
149735
149577
  /**
149736
149578
  * @example {
149737
149579
  * "data": {
149738
- * "editable": true,
149739
- * "reason": null,
149740
- * "lines": [
149741
- * {
149742
- * "id": "9c1a0001-0000-4000-8000-000000000001",
149743
- * "clinic_service_id": "9c1a0002-0000-4000-8000-000000000001",
149744
- * "nombre": "Limpieza dental",
149745
- * "quantity": 1,
149746
- * "unit_price_clp": 35000,
149747
- * "discount_clp": 0,
149748
- * "total_clp": 35000,
149749
- * "performed": true,
149750
- * "performed_at": "2026-10-21T15:40:00.000Z",
149751
- * "professional_id": "9c1a0003-0000-4000-8000-000000000001",
149752
- * "tooth_or_zone": null,
149753
- * "where_label": null,
149754
- * "treatment_plan_item_id": null,
149755
- * "obligation_status": "open",
149756
- * "paid_by_pack": false,
149757
- * "first_visit_free": false
149758
- * },
149759
- * {
149760
- * "id": "9c1a0001-0000-4000-8000-000000000002",
149761
- * "clinic_service_id": "9c1a0002-0000-4000-8000-000000000002",
149762
- * "nombre": "Resina compuesta",
149763
- * "quantity": 2,
149764
- * "unit_price_clp": 45000,
149765
- * "discount_clp": 10000,
149766
- * "total_clp": 80000,
149767
- * "performed": false,
149768
- * "performed_at": null,
149769
- * "professional_id": "9c1a0003-0000-4000-8000-000000000001",
149770
- * "tooth_or_zone": {
149771
- * "fdi": [
149772
- * 16,
149773
- * 17
149774
- * ]
149580
+ * "percent": 50,
149581
+ * "enabled": true,
149582
+ * "supported": true,
149583
+ * "unsupported_reason": null,
149584
+ * "engine": "native-clinic",
149585
+ * "no_show_guidance": {
149586
+ * "from": "2026-06-26",
149587
+ * "to": "2026-09-23",
149588
+ * "by_origin": [
149589
+ * {
149590
+ * "key": "meta",
149591
+ * "label": "Meta",
149592
+ * "attended": 62,
149593
+ * "no_show": 21,
149594
+ * "late_cancel": 4,
149595
+ * "cancelled": 11,
149596
+ * "cancelled_notice_unknown": 1,
149597
+ * "unknown": 0,
149598
+ * "closed": 94,
149599
+ * "no_show_pct": 25,
149600
+ * "late_cancel_pct": 40,
149601
+ * "attendance_pct": 66
149775
149602
  * },
149776
- * "where_label": "Dientes 16, 17",
149777
- * "treatment_plan_item_id": "9c1a0004-0000-4000-8000-000000000001",
149778
- * "obligation_status": "none",
149779
- * "paid_by_pack": false,
149780
- * "first_visit_free": false
149781
- * }
149782
- * ],
149783
- * "total_clp": 115000,
149784
- * "nothing_to_charge": null,
149785
- * "suggested_line": null
149603
+ * {
149604
+ * "key": "organic",
149605
+ * "label": "Orgánico",
149606
+ * "attended": 140,
149607
+ * "no_show": 9,
149608
+ * "late_cancel": 3,
149609
+ * "cancelled": 15,
149610
+ * "cancelled_notice_unknown": 0,
149611
+ * "unknown": 0,
149612
+ * "closed": 164,
149613
+ * "no_show_pct": 6,
149614
+ * "late_cancel_pct": 20,
149615
+ * "attendance_pct": 85
149616
+ * }
149617
+ * ]
149618
+ * }
149786
149619
  * }
149787
149620
  * }
149788
149621
  */
149789
149622
  "application/json": {
149790
- data?: unknown;
149791
- meta?: {
149792
- [key: string]: unknown;
149793
- };
149623
+ data: components["schemas"]["ClinicCampaignOverbookSetting"];
149624
+ };
149625
+ };
149626
+ };
149627
+ /** @description Validation error */
149628
+ 400: {
149629
+ headers: {
149630
+ [name: string]: unknown;
149631
+ };
149632
+ content: {
149633
+ "application/json": components["schemas"]["Error"];
149634
+ };
149635
+ };
149636
+ /** @description Unauthorized */
149637
+ 401: {
149638
+ headers: {
149639
+ [name: string]: unknown;
149640
+ };
149641
+ content: {
149642
+ "application/json": components["schemas"]["Error"];
149643
+ };
149644
+ };
149645
+ /** @description Forbidden */
149646
+ 403: {
149647
+ headers: {
149648
+ [name: string]: unknown;
149649
+ };
149650
+ content: {
149651
+ "application/json": components["schemas"]["Error"];
149652
+ };
149653
+ };
149654
+ /** @description Not found */
149655
+ 404: {
149656
+ headers: {
149657
+ [name: string]: unknown;
149658
+ };
149659
+ content: {
149660
+ "application/json": components["schemas"]["Error"];
149661
+ };
149662
+ };
149663
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
149664
+ 409: {
149665
+ headers: {
149666
+ [name: string]: unknown;
149667
+ };
149668
+ content: {
149669
+ "application/json": components["schemas"]["Error"];
149670
+ };
149671
+ };
149672
+ /** @description Rate limited */
149673
+ 429: {
149674
+ headers: {
149675
+ [name: string]: unknown;
149676
+ };
149677
+ content: {
149678
+ "application/json": components["schemas"]["Error"];
149679
+ };
149680
+ };
149681
+ };
149682
+ };
149683
+ post?: never;
149684
+ delete?: never;
149685
+ options?: never;
149686
+ head?: never;
149687
+ patch?: never;
149688
+ trace?: never;
149689
+ };
149690
+ "/clinic/migration/runs": {
149691
+ parameters: {
149692
+ query?: never;
149693
+ header?: never;
149694
+ path?: never;
149695
+ cookie?: never;
149696
+ };
149697
+ /**
149698
+ * The clinic’s migration runs, newest first
149699
+ * @description The clinic’s migration runs, newest first
149700
+ *
149701
+ * **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`.
149702
+ */
149703
+ get: {
149704
+ parameters: {
149705
+ query?: {
149706
+ limit?: number;
149707
+ };
149708
+ header?: never;
149709
+ path?: never;
149710
+ cookie?: never;
149711
+ };
149712
+ requestBody?: never;
149713
+ responses: {
149714
+ /** @description MigrationRuns */
149715
+ 200: {
149716
+ headers: {
149717
+ [name: string]: unknown;
149718
+ };
149719
+ content: {
149720
+ /**
149721
+ * @example {
149722
+ * "data": {
149723
+ * "items": [
149724
+ * {
149725
+ * "id": "01929a5e-7c10-7d3e-9a41-5b8f2c6d1e07",
149726
+ * "mode": "apply",
149727
+ * "status": "completed",
149728
+ * "status_label": "Completada",
149729
+ * "families": [
149730
+ * "patients",
149731
+ * "appointments"
149732
+ * ],
149733
+ * "started_at": "2026-10-30T23:05:00.000Z",
149734
+ * "finished_at": "2026-10-31T01:42:10.000Z",
149735
+ * "totals": {
149736
+ * "examined": 4213,
149737
+ * "created": 3980,
149738
+ * "unchanged": 190,
149739
+ * "gaps": 43
149740
+ * }
149741
+ * }
149742
+ * ]
149743
+ * }
149744
+ * }
149745
+ */
149746
+ "application/json": {
149747
+ data?: unknown;
149748
+ meta?: {
149749
+ [key: string]: unknown;
149750
+ };
149751
+ };
149752
+ };
149753
+ };
149754
+ /** @description Validation error */
149755
+ 400: {
149756
+ headers: {
149757
+ [name: string]: unknown;
149758
+ };
149759
+ content: {
149760
+ "application/json": components["schemas"]["Error"];
149761
+ };
149762
+ };
149763
+ /** @description Unauthorized */
149764
+ 401: {
149765
+ headers: {
149766
+ [name: string]: unknown;
149767
+ };
149768
+ content: {
149769
+ "application/json": components["schemas"]["Error"];
149770
+ };
149771
+ };
149772
+ /** @description Forbidden */
149773
+ 403: {
149774
+ headers: {
149775
+ [name: string]: unknown;
149776
+ };
149777
+ content: {
149778
+ "application/json": components["schemas"]["Error"];
149779
+ };
149780
+ };
149781
+ /** @description Not found */
149782
+ 404: {
149783
+ headers: {
149784
+ [name: string]: unknown;
149785
+ };
149786
+ content: {
149787
+ "application/json": components["schemas"]["Error"];
149788
+ };
149789
+ };
149790
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
149791
+ 409: {
149792
+ headers: {
149793
+ [name: string]: unknown;
149794
+ };
149795
+ content: {
149796
+ "application/json": components["schemas"]["Error"];
149797
+ };
149798
+ };
149799
+ /** @description Rate limited */
149800
+ 429: {
149801
+ headers: {
149802
+ [name: string]: unknown;
149803
+ };
149804
+ content: {
149805
+ "application/json": components["schemas"]["Error"];
149806
+ };
149807
+ };
149808
+ };
149809
+ };
149810
+ put?: never;
149811
+ post?: never;
149812
+ delete?: never;
149813
+ options?: never;
149814
+ head?: never;
149815
+ patch?: never;
149816
+ trace?: never;
149817
+ };
149818
+ "/clinic/migration/runs/{id}": {
149819
+ parameters: {
149820
+ query?: never;
149821
+ header?: never;
149822
+ path?: never;
149823
+ cookie?: never;
149824
+ };
149825
+ /**
149826
+ * One migration run: progress per family, gaps by reason
149827
+ * @description Per family: status, phase, counts (examined / created / converted / updated / unchanged / kept_native / collapsed / skipped / gaps), progress against the latest dry-run, vendor requests. The gap summary counts what could not come across by reason, with Spanish labels. Counts and reason codes only — never a patient.
149828
+ *
149829
+ * **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`.
149830
+ */
149831
+ get: {
149832
+ parameters: {
149833
+ query?: never;
149834
+ header?: never;
149835
+ path: {
149836
+ id: string;
149837
+ };
149838
+ cookie?: never;
149839
+ };
149840
+ requestBody?: never;
149841
+ responses: {
149842
+ /** @description MigrationRun */
149843
+ 200: {
149844
+ headers: {
149845
+ [name: string]: unknown;
149846
+ };
149847
+ content: {
149848
+ /**
149849
+ * @example {
149850
+ * "data": {
149851
+ * "id": "01929a5e-7c10-7d3e-9a41-5b8f2c6d1e07",
149852
+ * "mode": "apply",
149853
+ * "status": "completed",
149854
+ * "status_label": "Completada",
149855
+ * "families": [
149856
+ * {
149857
+ * "family": "patients",
149858
+ * "label": "Fichas administrativas de pacientes (con cargas)",
149859
+ * "status": "done",
149860
+ * "status_label": "Lista",
149861
+ * "reason": null,
149862
+ * "reason_label": null,
149863
+ * "phase": null,
149864
+ * "phase_label": null,
149865
+ * "counts": {
149866
+ * "examined": 1480,
149867
+ * "created": 1402,
149868
+ * "unchanged": 60,
149869
+ * "gaps": 18
149870
+ * },
149871
+ * "progress": {
149872
+ * "examined": 1480,
149873
+ * "expected": 1480
149874
+ * },
149875
+ * "vendor_requests": 31,
149876
+ * "failures": 0,
149877
+ * "started_at": "2026-10-30T23:05:02.000Z",
149878
+ * "finished_at": "2026-10-30T23:31:40.000Z"
149879
+ * }
149880
+ * ],
149881
+ * "totals": {
149882
+ * "examined": 1480,
149883
+ * "created": 1402,
149884
+ * "unchanged": 60,
149885
+ * "gaps": 18
149886
+ * },
149887
+ * "gaps": [
149888
+ * {
149889
+ * "family": "patients",
149890
+ * "reason": "native_rut_match",
149891
+ * "reason_label": "Ya existe en Vitrina una ficha creada aquí con el mismo RUT: no se duplicó ni se fusionó.",
149892
+ * "count": 18
149893
+ * }
149894
+ * ],
149895
+ * "history_from": "2021-01-01",
149896
+ * "window_ends_at": "2026-11-01T21:00:00.000Z",
149897
+ * "started_at": "2026-10-30T23:05:00.000Z",
149898
+ * "finished_at": "2026-10-30T23:31:40.000Z",
149899
+ * "last_progress_at": "2026-10-30T23:31:40.000Z",
149900
+ * "job_deleted_at": "2026-10-30T23:31:41.000Z",
149901
+ * "instruction": {
149902
+ * "version": "clinic-migration-instruction/2026-09-28",
149903
+ * "sha256": "b1946ac92492d2347c6235b4d2611184b1946ac92492d2347c6235b4d2611184",
149904
+ * "text": "Instruyo a Vitrina copiar desde Dentalink las fichas administrativas de pacientes …",
149905
+ * "instructed_by_user_id": "20000000-0000-4000-8000-000000000001",
149906
+ * "instructed_at": "2026-10-30T23:04:40.000Z",
149907
+ * "document_reference": null
149908
+ * },
149909
+ * "error": null
149910
+ * }
149911
+ * }
149912
+ */
149913
+ "application/json": {
149914
+ data?: unknown;
149915
+ meta?: {
149916
+ [key: string]: unknown;
149917
+ };
149918
+ };
149919
+ };
149920
+ };
149921
+ /** @description Validation error */
149922
+ 400: {
149923
+ headers: {
149924
+ [name: string]: unknown;
149925
+ };
149926
+ content: {
149927
+ "application/json": components["schemas"]["Error"];
149928
+ };
149929
+ };
149930
+ /** @description Unauthorized */
149931
+ 401: {
149932
+ headers: {
149933
+ [name: string]: unknown;
149934
+ };
149935
+ content: {
149936
+ "application/json": components["schemas"]["Error"];
149937
+ };
149938
+ };
149939
+ /** @description Forbidden */
149940
+ 403: {
149941
+ headers: {
149942
+ [name: string]: unknown;
149943
+ };
149944
+ content: {
149945
+ "application/json": components["schemas"]["Error"];
149946
+ };
149947
+ };
149948
+ /** @description Not found */
149949
+ 404: {
149950
+ headers: {
149951
+ [name: string]: unknown;
149952
+ };
149953
+ content: {
149954
+ "application/json": components["schemas"]["Error"];
149955
+ };
149956
+ };
149957
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
149958
+ 409: {
149959
+ headers: {
149960
+ [name: string]: unknown;
149961
+ };
149962
+ content: {
149963
+ "application/json": components["schemas"]["Error"];
149964
+ };
149965
+ };
149966
+ /** @description Rate limited */
149967
+ 429: {
149968
+ headers: {
149969
+ [name: string]: unknown;
149970
+ };
149971
+ content: {
149972
+ "application/json": components["schemas"]["Error"];
149973
+ };
149974
+ };
149975
+ };
149976
+ };
149977
+ put?: never;
149978
+ post?: never;
149979
+ delete?: never;
149980
+ options?: never;
149981
+ head?: never;
149982
+ patch?: never;
149983
+ trace?: never;
149984
+ };
149985
+ "/clinic/appointments/{id}/services": {
149986
+ parameters: {
149987
+ query?: never;
149988
+ header?: never;
149989
+ path?: never;
149990
+ cookie?: never;
149991
+ };
149992
+ /**
149993
+ * A cita's prestaciones, with what each one owes
149994
+ * @description The prestación lines of one cita (`clinic_appointment_service`): catalog name, quantity, the unit price and discount FROZEN on the line, `total_clp` (quantity × unit price − discount; 0 when unpriced), whether it was performed, the plan item it performs, and `obligation_status` — the line's own debt: `none` (not performed, or already charged through an accepted presupuesto or a pack), `open` (owed, possibly partly paid), `paid` (fully paid) or `void` (cancelled). `suggested_line` (the cita was booked by motivo and has no prestación yet) is the motivo's usual prestación quoted for this patient (what adding it would charge), for staff to confirm by adding it; null otherwise. `first_visit_free` (on a line and on `suggested_line`) is true when the price is $0 because the prestación's «1.ª vez sin costo» fired for this patient. `total_clp` is what the visit charges: a line its pack pays counts $0. `nothing_to_charge` says why a visit with prestaciones charges nothing (`paid_by_pack`, `first_visit_free`, `already_paid` — every charging line is paid, `in_budget` — the work is an accepted presupuesto's, whose saldo is what is owed), null otherwise — «Cobrar» has nothing to offer for it; a cita with no line yet whose `suggested_line` is a $0 «1.ª vez sin costo» says `first_visit_free` too. `paid_by_pack` is true when a pack the patient bought pays for the line: it is charged nothing on its own and attending the cita uses one of the pack's sessions. `in_budget` is the folio of the accepted presupuesto that already charges the line (the plan row it performs is priced there): it opens no charge of its own. `editable` is false with `reason` `vendor_engine` for a Dentalink / Medilink / Reservo cita (its prestaciones live in the vendor's tratamiento), `cancelled` for a cancelled cita, `not_a_clinic_cita` for any other appointment. Never calls the clinic API.
149995
+ *
149996
+ * **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`.
149997
+ */
149998
+ get: {
149999
+ parameters: {
150000
+ query?: never;
150001
+ header?: never;
150002
+ path: {
150003
+ id: string;
150004
+ };
150005
+ cookie?: never;
150006
+ };
150007
+ requestBody?: never;
150008
+ responses: {
150009
+ /** @description Cita prestaciones */
150010
+ 200: {
150011
+ headers: {
150012
+ [name: string]: unknown;
150013
+ };
150014
+ content: {
150015
+ /**
150016
+ * @example {
150017
+ * "data": {
150018
+ * "editable": true,
150019
+ * "reason": null,
150020
+ * "lines": [
150021
+ * {
150022
+ * "id": "9c1a0001-0000-4000-8000-000000000001",
150023
+ * "clinic_service_id": "9c1a0002-0000-4000-8000-000000000001",
150024
+ * "nombre": "Limpieza dental",
150025
+ * "quantity": 1,
150026
+ * "unit_price_clp": 35000,
150027
+ * "discount_clp": 0,
150028
+ * "total_clp": 35000,
150029
+ * "performed": true,
150030
+ * "performed_at": "2026-10-21T15:40:00.000Z",
150031
+ * "professional_id": "9c1a0003-0000-4000-8000-000000000001",
150032
+ * "tooth_or_zone": null,
150033
+ * "where_label": null,
150034
+ * "treatment_plan_item_id": null,
150035
+ * "obligation_status": "open",
150036
+ * "paid_by_pack": false,
150037
+ * "first_visit_free": false
150038
+ * },
150039
+ * {
150040
+ * "id": "9c1a0001-0000-4000-8000-000000000002",
150041
+ * "clinic_service_id": "9c1a0002-0000-4000-8000-000000000002",
150042
+ * "nombre": "Resina compuesta",
150043
+ * "quantity": 2,
150044
+ * "unit_price_clp": 45000,
150045
+ * "discount_clp": 10000,
150046
+ * "total_clp": 80000,
150047
+ * "performed": false,
150048
+ * "performed_at": null,
150049
+ * "professional_id": "9c1a0003-0000-4000-8000-000000000001",
150050
+ * "tooth_or_zone": {
150051
+ * "fdi": [
150052
+ * 16,
150053
+ * 17
150054
+ * ]
150055
+ * },
150056
+ * "where_label": "Dientes 16, 17",
150057
+ * "treatment_plan_item_id": "9c1a0004-0000-4000-8000-000000000001",
150058
+ * "obligation_status": "none",
150059
+ * "paid_by_pack": false,
150060
+ * "first_visit_free": false
150061
+ * }
150062
+ * ],
150063
+ * "total_clp": 115000,
150064
+ * "nothing_to_charge": null,
150065
+ * "suggested_line": null
150066
+ * }
150067
+ * }
150068
+ */
150069
+ "application/json": {
150070
+ data?: unknown;
150071
+ meta?: {
150072
+ [key: string]: unknown;
150073
+ };
149794
150074
  };
149795
150075
  };
149796
150076
  };
@@ -220048,7 +220328,7 @@ interface paths {
220048
220328
  };
220049
220329
  /**
220050
220330
  * What blocks publishing the draft
220051
- * @description Checks the open draft the way publishing does. `blockers` stop `POST /sequences/{id}/publish`; `warnings` do not. Each problem has a machine-readable `code`, the `step_id` it is about (null for the whole draft), a Spanish `message` and a `fix`: `kind` is `draft_template` (have the AI write the missing WhatsApp template: `POST /followups/recontacto/template-draft`), `connect_channel`, `request_review`, `remove_step`, `change_channel`, `pick_agent` or `contact_support`, with a `target` (the same vocabulary as notifications) when there is a screen for it. Blocker codes: `no_fitting_approved_template` (a WhatsApp step past the 24 h window with no approved template Vitrina can fill), `channel_not_connected` (WhatsApp, email, Instagram), `step_type_unavailable` (a channel the workspace cannot use yet, e.g. SMS), `agent_unavailable` (the chosen AI agent is no longer active), `agent_not_supported` (an agent set on «Al llegar» or «Avisos»), `review_required`. Warning codes: `instagram_past_24h`, `whatsapp_past_24h_without_template`. Steps that never send (mode `skip`, a situation switched off) are not checked. Never calls a model. 404 when there is no draft. Requires `followups:read`.
220331
+ * @description Checks the open draft the way publishing does. `blockers` stop `POST /sequences/{id}/publish`; `warnings` do not. Each problem has a machine-readable `code`, the `step_id` it is about (null for the whole draft), a Spanish `message` and a `fix`: `kind` is `draft_template` (have the AI write the missing WhatsApp template: `POST /followups/recontacto/template-draft`), `connect_channel`, `request_review`, `remove_step`, `change_channel`, `pick_agent`, `pick_media` (choose another library file for a «Paso de video»), `review_template` (open the video step’s template review) or `contact_support`, with a `target` (the same vocabulary as notifications) when there is a screen for it. Blocker codes: `no_fitting_approved_template` (a WhatsApp step past the 24 h window with no approved template Vitrina can fill), `channel_not_connected` (WhatsApp, email, Instagram), `step_type_unavailable` (a channel the workspace cannot use yet, e.g. SMS), `agent_unavailable` (the chosen AI agent is no longer active), `agent_not_supported` (an agent set on «Al llegar» or «Avisos»), `review_required`; for a «Paso de video» (content `media_file`): `media_step_channel_unsupported` (not WhatsApp or same chat), `media_asset_deleted`, `media_asset_expired`, `media_asset_consent_missing`, `media_asset_kind_unsupported` (audio, or not an image, video or PDF), `media_asset_too_large` (over 16 MB), `media_caption_field_unknown`, `media_caption_field_unavailable` (an appointment field without entry `appointment_booked`). Warning codes: `instagram_past_24h`, `whatsapp_past_24h_without_template`, `media_step_past_24h`, `media_step_window_uncertain` (a before-the-appointment wait), `media_asset_scheduled`; and, once the video step’s template is read (vitrina-app#8073, replacing the two window warnings), one per template state that does not send outside the window: `media_template_missing`, `media_template_draft`, `media_template_in_review`, `media_template_rejected` (names Meta’s reason), `media_template_recategorised`, `media_template_paused`, `media_template_disabled` (fix `review_template`: open the template review, `GET /sequences/{id}/media-templates`), `media_template_caption_invalid` (the caption breaks Meta’s template rules), `media_template_file_unsupported` (`pick_media`) and `media_template_name_required`. Steps that never send (mode `skip`, a situation switched off) are not checked. Never calls a model. 404 when there is no draft. Requires `followups:read`.
220052
220332
  */
220053
220333
  get: {
220054
220334
  parameters: {
@@ -222784,6 +223064,459 @@ interface paths {
222784
223064
  patch?: never;
222785
223065
  trace?: never;
222786
223066
  };
223067
+ "/sequences/media-templates": {
223068
+ parameters: {
223069
+ query?: never;
223070
+ header?: never;
223071
+ path?: never;
223072
+ cookie?: never;
223073
+ };
223074
+ /**
223075
+ * List the video-step templates of the workspace
223076
+ * @description A «Paso de video» (content `media_file`) goes out OUTSIDE WhatsApp’s 24 h window as an approved template whose header is the step’s library file and whose body is its caption (fields as NAMED variables). Publishing drafts one per step and content (file version + caption + language; republishing the same content creates nothing, a new file or caption supersedes the old draft for the step). Vitrina never submits it: the workspace does, here. Category MARKETING (a sequence send is marketing-basis; the kernel refuses it on a UTILITY template); `review.price_per_send` is Meta’s list rate for Chile. Until Meta approves it the step is skipped outside the window (`media_template_*` reasons); inside the window the plain file goes.
223077
+ *
223078
+ * Every live sequence with a video step, one entry per published video step, with the review data. Requires `followups:read`.
223079
+ */
223080
+ get: {
223081
+ parameters: {
223082
+ query?: never;
223083
+ header?: never;
223084
+ path?: never;
223085
+ cookie?: never;
223086
+ };
223087
+ requestBody?: never;
223088
+ responses: {
223089
+ /** @description The templates */
223090
+ 200: {
223091
+ headers: {
223092
+ [name: string]: unknown;
223093
+ };
223094
+ content: {
223095
+ /**
223096
+ * @example {
223097
+ * "data": [
223098
+ * {
223099
+ * "id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e12",
223100
+ * "sequence_id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
223101
+ * "sequence_name": "Seguimiento de cotización",
223102
+ * "step_key": "step-2",
223103
+ * "state": "draft",
223104
+ * "state_message": "La plantilla de este paso está lista para que la revises y la envíes a Meta. Hasta que Meta la apruebe, fuera de las 24 horas el paso se salta.",
223105
+ * "can_submit": true,
223106
+ * "submit_blocked_reason": null,
223107
+ * "template": null,
223108
+ * "review": {
223109
+ * "language": "es",
223110
+ * "category": "MARKETING",
223111
+ * "category_note": "Marketing. Los mensajes de una secuencia se envían como marketing, así que la plantilla se pide en esa categoría y solo le llega a quien no se haya dado de baja de tus mensajes. Meta puede cambiar la categoría al revisarla; si la aprueba en otra, Vitrina no la envía.",
223112
+ * "price_per_send": {
223113
+ * "market": "CL",
223114
+ * "currency": "USD",
223115
+ * "category": "marketing",
223116
+ * "amount": 0.0889,
223117
+ * "as_of": "2026-11-01",
223118
+ * "label": "Cada envío de esta plantilla cuesta cerca de US$0,0889, la tarifa de Meta para una plantilla de marketing a un número de Chile. Meta lo cobra a tu cuenta de WhatsApp."
223119
+ * },
223120
+ * "header": {
223121
+ * "format": "VIDEO",
223122
+ * "asset_id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e13",
223123
+ * "asset_name": "Presentación del tratamiento",
223124
+ * "mime_type": "video/mp4",
223125
+ * "byte_size": 4200000
223126
+ * },
223127
+ * "body_text": "Hola {{nombre}}, mira cómo es tu primera visita.",
223128
+ * "body_preview": "Hola María, mira cómo es tu primera visita.",
223129
+ * "variables": [
223130
+ * {
223131
+ * "name": "nombre",
223132
+ * "field": "nombre",
223133
+ * "label": "Nombre",
223134
+ * "example": "María"
223135
+ * }
223136
+ * ],
223137
+ * "caption_issues": [],
223138
+ * "problem_message": null,
223139
+ * "name_note": "Fuera de las 24 horas este paso sale como plantilla y una plantilla no puede dejar {{nombre}} vacío: a quien no tenga su nombre guardado no se le envía fuera de las 24 horas."
223140
+ * }
223141
+ * }
223142
+ * ]
223143
+ * }
223144
+ */
223145
+ "application/json": {
223146
+ data: components["schemas"]["SequenceMediaTemplate"][];
223147
+ };
223148
+ };
223149
+ };
223150
+ /** @description Validation error */
223151
+ 400: {
223152
+ headers: {
223153
+ [name: string]: unknown;
223154
+ };
223155
+ content: {
223156
+ "application/json": components["schemas"]["Error"];
223157
+ };
223158
+ };
223159
+ /** @description Unauthorized */
223160
+ 401: {
223161
+ headers: {
223162
+ [name: string]: unknown;
223163
+ };
223164
+ content: {
223165
+ "application/json": components["schemas"]["Error"];
223166
+ };
223167
+ };
223168
+ /** @description Forbidden */
223169
+ 403: {
223170
+ headers: {
223171
+ [name: string]: unknown;
223172
+ };
223173
+ content: {
223174
+ "application/json": components["schemas"]["Error"];
223175
+ };
223176
+ };
223177
+ /** @description Not found */
223178
+ 404: {
223179
+ headers: {
223180
+ [name: string]: unknown;
223181
+ };
223182
+ content: {
223183
+ "application/json": components["schemas"]["Error"];
223184
+ };
223185
+ };
223186
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
223187
+ 409: {
223188
+ headers: {
223189
+ [name: string]: unknown;
223190
+ };
223191
+ content: {
223192
+ "application/json": components["schemas"]["Error"];
223193
+ };
223194
+ };
223195
+ /** @description Rate limited */
223196
+ 429: {
223197
+ headers: {
223198
+ [name: string]: unknown;
223199
+ };
223200
+ content: {
223201
+ "application/json": components["schemas"]["Error"];
223202
+ };
223203
+ };
223204
+ };
223205
+ };
223206
+ put?: never;
223207
+ post?: never;
223208
+ delete?: never;
223209
+ options?: never;
223210
+ head?: never;
223211
+ patch?: never;
223212
+ trace?: never;
223213
+ };
223214
+ "/sequences/{id}/media-templates": {
223215
+ parameters: {
223216
+ query?: never;
223217
+ header?: never;
223218
+ path?: never;
223219
+ cookie?: never;
223220
+ };
223221
+ /**
223222
+ * List a sequence’s video-step templates
223223
+ * @description A «Paso de video» (content `media_file`) goes out OUTSIDE WhatsApp’s 24 h window as an approved template whose header is the step’s library file and whose body is its caption (fields as NAMED variables). Publishing drafts one per step and content (file version + caption + language; republishing the same content creates nothing, a new file or caption supersedes the old draft for the step). Vitrina never submits it: the workspace does, here. Category MARKETING (a sequence send is marketing-basis; the kernel refuses it on a UTILITY template); `review.price_per_send` is Meta’s list rate for Chile. Until Meta approves it the step is skipped outside the window (`media_template_*` reasons); inside the window the plain file goes.
223224
+ *
223225
+ * One entry per video step of the PUBLISHED version (empty when unpublished). Requires `followups:read`.
223226
+ */
223227
+ get: {
223228
+ parameters: {
223229
+ query?: never;
223230
+ header?: never;
223231
+ path: {
223232
+ id: string;
223233
+ };
223234
+ cookie?: never;
223235
+ };
223236
+ requestBody?: never;
223237
+ responses: {
223238
+ /** @description The templates */
223239
+ 200: {
223240
+ headers: {
223241
+ [name: string]: unknown;
223242
+ };
223243
+ content: {
223244
+ /**
223245
+ * @example {
223246
+ * "data": [
223247
+ * {
223248
+ * "id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e12",
223249
+ * "sequence_id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
223250
+ * "sequence_name": "Seguimiento de cotización",
223251
+ * "step_key": "step-2",
223252
+ * "state": "draft",
223253
+ * "state_message": "La plantilla de este paso está lista para que la revises y la envíes a Meta. Hasta que Meta la apruebe, fuera de las 24 horas el paso se salta.",
223254
+ * "can_submit": true,
223255
+ * "submit_blocked_reason": null,
223256
+ * "template": null,
223257
+ * "review": {
223258
+ * "language": "es",
223259
+ * "category": "MARKETING",
223260
+ * "category_note": "Marketing. Los mensajes de una secuencia se envían como marketing, así que la plantilla se pide en esa categoría y solo le llega a quien no se haya dado de baja de tus mensajes. Meta puede cambiar la categoría al revisarla; si la aprueba en otra, Vitrina no la envía.",
223261
+ * "price_per_send": {
223262
+ * "market": "CL",
223263
+ * "currency": "USD",
223264
+ * "category": "marketing",
223265
+ * "amount": 0.0889,
223266
+ * "as_of": "2026-11-01",
223267
+ * "label": "Cada envío de esta plantilla cuesta cerca de US$0,0889, la tarifa de Meta para una plantilla de marketing a un número de Chile. Meta lo cobra a tu cuenta de WhatsApp."
223268
+ * },
223269
+ * "header": {
223270
+ * "format": "VIDEO",
223271
+ * "asset_id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e13",
223272
+ * "asset_name": "Presentación del tratamiento",
223273
+ * "mime_type": "video/mp4",
223274
+ * "byte_size": 4200000
223275
+ * },
223276
+ * "body_text": "Hola {{nombre}}, mira cómo es tu primera visita.",
223277
+ * "body_preview": "Hola María, mira cómo es tu primera visita.",
223278
+ * "variables": [
223279
+ * {
223280
+ * "name": "nombre",
223281
+ * "field": "nombre",
223282
+ * "label": "Nombre",
223283
+ * "example": "María"
223284
+ * }
223285
+ * ],
223286
+ * "caption_issues": [],
223287
+ * "problem_message": null,
223288
+ * "name_note": "Fuera de las 24 horas este paso sale como plantilla y una plantilla no puede dejar {{nombre}} vacío: a quien no tenga su nombre guardado no se le envía fuera de las 24 horas."
223289
+ * }
223290
+ * }
223291
+ * ]
223292
+ * }
223293
+ */
223294
+ "application/json": {
223295
+ data: components["schemas"]["SequenceMediaTemplate"][];
223296
+ };
223297
+ };
223298
+ };
223299
+ /** @description Validation error */
223300
+ 400: {
223301
+ headers: {
223302
+ [name: string]: unknown;
223303
+ };
223304
+ content: {
223305
+ "application/json": components["schemas"]["Error"];
223306
+ };
223307
+ };
223308
+ /** @description Unauthorized */
223309
+ 401: {
223310
+ headers: {
223311
+ [name: string]: unknown;
223312
+ };
223313
+ content: {
223314
+ "application/json": components["schemas"]["Error"];
223315
+ };
223316
+ };
223317
+ /** @description Forbidden */
223318
+ 403: {
223319
+ headers: {
223320
+ [name: string]: unknown;
223321
+ };
223322
+ content: {
223323
+ "application/json": components["schemas"]["Error"];
223324
+ };
223325
+ };
223326
+ /** @description Not found */
223327
+ 404: {
223328
+ headers: {
223329
+ [name: string]: unknown;
223330
+ };
223331
+ content: {
223332
+ "application/json": components["schemas"]["Error"];
223333
+ };
223334
+ };
223335
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
223336
+ 409: {
223337
+ headers: {
223338
+ [name: string]: unknown;
223339
+ };
223340
+ content: {
223341
+ "application/json": components["schemas"]["Error"];
223342
+ };
223343
+ };
223344
+ /** @description Rate limited */
223345
+ 429: {
223346
+ headers: {
223347
+ [name: string]: unknown;
223348
+ };
223349
+ content: {
223350
+ "application/json": components["schemas"]["Error"];
223351
+ };
223352
+ };
223353
+ };
223354
+ };
223355
+ put?: never;
223356
+ post?: never;
223357
+ delete?: never;
223358
+ options?: never;
223359
+ head?: never;
223360
+ patch?: never;
223361
+ trace?: never;
223362
+ };
223363
+ "/sequences/{id}/media-templates/{step_key}/submit": {
223364
+ parameters: {
223365
+ query?: never;
223366
+ header?: never;
223367
+ path?: never;
223368
+ cookie?: never;
223369
+ };
223370
+ get?: never;
223371
+ put?: never;
223372
+ /**
223373
+ * Submit a video step’s template to Meta
223374
+ * @description A «Paso de video» (content `media_file`) goes out OUTSIDE WhatsApp’s 24 h window as an approved template whose header is the step’s library file and whose body is its caption (fields as NAMED variables). Publishing drafts one per step and content (file version + caption + language; republishing the same content creates nothing, a new file or caption supersedes the old draft for the step). Vitrina never submits it: the workspace does, here. Category MARKETING (a sequence send is marketing-basis; the kernel refuses it on a UTILITY template); `review.price_per_send` is Meta’s list rate for Chile. Until Meta approves it the step is skipped outside the window (`media_template_*` reasons); inside the window the plain file goes.
223375
+ *
223376
+ * The workspace’s own act: copies the library file once to a public header link and files the template with Meta (a sandbox captures it). 409 `media_template_not_submittable` (with `details.state`) when it is in review, approved, rejected, paused, disabled, recategorised, when the caption or file cannot be a template, or WhatsApp is not connected. 404 when the published version has no video step with that key. Requires `followups:write`.
223377
+ */
223378
+ post: {
223379
+ parameters: {
223380
+ query?: never;
223381
+ header?: {
223382
+ /** @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. */
223383
+ "Idempotency-Key"?: string;
223384
+ };
223385
+ path: {
223386
+ id: string;
223387
+ step_key: string;
223388
+ };
223389
+ cookie?: never;
223390
+ };
223391
+ requestBody?: never;
223392
+ responses: {
223393
+ /** @description The template after submitting */
223394
+ 200: {
223395
+ headers: {
223396
+ [name: string]: unknown;
223397
+ };
223398
+ content: {
223399
+ /**
223400
+ * @example {
223401
+ * "data": {
223402
+ * "id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e12",
223403
+ * "sequence_id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
223404
+ * "sequence_name": "Seguimiento de cotización",
223405
+ * "step_key": "step-2",
223406
+ * "state": "in_review",
223407
+ * "state_message": "La plantilla de este paso está lista para que la revises y la envíes a Meta. Hasta que Meta la apruebe, fuera de las 24 horas el paso se salta.",
223408
+ * "can_submit": false,
223409
+ * "submit_blocked_reason": null,
223410
+ * "template": {
223411
+ * "id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e14",
223412
+ * "name": "secuencia_video_3f9a1c",
223413
+ * "status": "PENDING",
223414
+ * "category": "MARKETING",
223415
+ * "rejection_reason": null
223416
+ * },
223417
+ * "review": {
223418
+ * "language": "es",
223419
+ * "category": "MARKETING",
223420
+ * "category_note": "Marketing. Los mensajes de una secuencia se envían como marketing, así que la plantilla se pide en esa categoría y solo le llega a quien no se haya dado de baja de tus mensajes. Meta puede cambiar la categoría al revisarla; si la aprueba en otra, Vitrina no la envía.",
223421
+ * "price_per_send": {
223422
+ * "market": "CL",
223423
+ * "currency": "USD",
223424
+ * "category": "marketing",
223425
+ * "amount": 0.0889,
223426
+ * "as_of": "2026-11-01",
223427
+ * "label": "Cada envío de esta plantilla cuesta cerca de US$0,0889, la tarifa de Meta para una plantilla de marketing a un número de Chile. Meta lo cobra a tu cuenta de WhatsApp."
223428
+ * },
223429
+ * "header": {
223430
+ * "format": "VIDEO",
223431
+ * "asset_id": "0192f0b2-1a2b-7c3d-8e4f-5a6b7c8d9e13",
223432
+ * "asset_name": "Presentación del tratamiento",
223433
+ * "mime_type": "video/mp4",
223434
+ * "byte_size": 4200000
223435
+ * },
223436
+ * "body_text": "Hola {{nombre}}, mira cómo es tu primera visita.",
223437
+ * "body_preview": "Hola María, mira cómo es tu primera visita.",
223438
+ * "variables": [
223439
+ * {
223440
+ * "name": "nombre",
223441
+ * "field": "nombre",
223442
+ * "label": "Nombre",
223443
+ * "example": "María"
223444
+ * }
223445
+ * ],
223446
+ * "caption_issues": [],
223447
+ * "problem_message": null,
223448
+ * "name_note": "Fuera de las 24 horas este paso sale como plantilla y una plantilla no puede dejar {{nombre}} vacío: a quien no tenga su nombre guardado no se le envía fuera de las 24 horas."
223449
+ * }
223450
+ * }
223451
+ * }
223452
+ */
223453
+ "application/json": {
223454
+ data: components["schemas"]["SequenceMediaTemplate"];
223455
+ };
223456
+ };
223457
+ };
223458
+ /** @description Validation error */
223459
+ 400: {
223460
+ headers: {
223461
+ [name: string]: unknown;
223462
+ };
223463
+ content: {
223464
+ "application/json": components["schemas"]["Error"];
223465
+ };
223466
+ };
223467
+ /** @description Unauthorized */
223468
+ 401: {
223469
+ headers: {
223470
+ [name: string]: unknown;
223471
+ };
223472
+ content: {
223473
+ "application/json": components["schemas"]["Error"];
223474
+ };
223475
+ };
223476
+ /** @description Forbidden */
223477
+ 403: {
223478
+ headers: {
223479
+ [name: string]: unknown;
223480
+ };
223481
+ content: {
223482
+ "application/json": components["schemas"]["Error"];
223483
+ };
223484
+ };
223485
+ /** @description Not found */
223486
+ 404: {
223487
+ headers: {
223488
+ [name: string]: unknown;
223489
+ };
223490
+ content: {
223491
+ "application/json": components["schemas"]["Error"];
223492
+ };
223493
+ };
223494
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
223495
+ 409: {
223496
+ headers: {
223497
+ [name: string]: unknown;
223498
+ };
223499
+ content: {
223500
+ "application/json": components["schemas"]["Error"];
223501
+ };
223502
+ };
223503
+ /** @description Rate limited */
223504
+ 429: {
223505
+ headers: {
223506
+ [name: string]: unknown;
223507
+ };
223508
+ content: {
223509
+ "application/json": components["schemas"]["Error"];
223510
+ };
223511
+ };
223512
+ };
223513
+ };
223514
+ delete?: never;
223515
+ options?: never;
223516
+ head?: never;
223517
+ patch?: never;
223518
+ trace?: never;
223519
+ };
222787
223520
  "/sequences/templates": {
222788
223521
  parameters: {
222789
223522
  query?: never;
@@ -337717,6 +338450,39 @@ interface components {
337717
338450
  };
337718
338451
  }[];
337719
338452
  };
338453
+ ClinicCampaignOverbookSetting: {
338454
+ percent: number;
338455
+ enabled: boolean;
338456
+ supported: boolean;
338457
+ /** @enum {string|null} */
338458
+ unsupported_reason: "mirrored_agenda" | "engine_unavailable" | null;
338459
+ engine: string | null;
338460
+ no_show_guidance: {
338461
+ from: string;
338462
+ to: string;
338463
+ by_origin: {
338464
+ key: string;
338465
+ label: string | null;
338466
+ attended: number;
338467
+ no_show: number;
338468
+ late_cancel: number;
338469
+ cancelled: number;
338470
+ cancelled_notice_unknown: number;
338471
+ unknown: number;
338472
+ closed: number;
338473
+ no_show_pct: number | null;
338474
+ late_cancel_pct: number | null;
338475
+ attendance_pct: number | null;
338476
+ }[];
338477
+ } | null;
338478
+ };
338479
+ ClinicCampaignOverbookBody: {
338480
+ /**
338481
+ * @description Share of the hours held by Meta-origin evaluation citas that stays bookable once more, per professional and day. 0 = off.
338482
+ * @example 50
338483
+ */
338484
+ percent: number;
338485
+ };
337720
338486
  ClinicWaitlistDemand: {
337721
338487
  window: {
337722
338488
  days: number;
@@ -339842,6 +340608,16 @@ interface components {
339842
340608
  /** Format: uuid */
339843
340609
  followup_id: string;
339844
340610
  trigger_key: string;
340611
+ } | {
340612
+ /** @enum {string} */
340613
+ type: "media_file";
340614
+ /**
340615
+ * Format: uuid
340616
+ * @description The media library file (`GET /media-assets/{id}`).
340617
+ */
340618
+ asset_id: string;
340619
+ /** @description Sent as written. Fields: `{{nombre}}` (first name; dropped when unknown), `{{cita.fecha}}` and `{{cita.hora}}` (only with entry `appointment_booked`). Empty = the file alone. */
340620
+ caption: string;
339845
340621
  };
339846
340622
  config_ref: {
339847
340623
  /** @enum {string} */
@@ -340381,6 +341157,16 @@ interface components {
340381
341157
  /** Format: uuid */
340382
341158
  followup_id: string;
340383
341159
  trigger_key: string;
341160
+ } | {
341161
+ /** @enum {string} */
341162
+ type: "media_file";
341163
+ /**
341164
+ * Format: uuid
341165
+ * @description The media library file (`GET /media-assets/{id}`).
341166
+ */
341167
+ asset_id: string;
341168
+ /** @description Sent as written. Fields: `{{nombre}}` (first name; dropped when unknown), `{{cita.fecha}}` and `{{cita.hora}}` (only with entry `appointment_booked`). Empty = the file alone. */
341169
+ caption: string;
340384
341170
  };
340385
341171
  /** @description Where a built-in step is stored (keep it as read); null for a step added in the draft. */
340386
341172
  config_ref: {
@@ -340695,7 +341481,7 @@ interface components {
340695
341481
  message: string;
340696
341482
  fix: {
340697
341483
  /** @enum {string} */
340698
- kind: "draft_template" | "connect_channel" | "request_review" | "remove_step" | "change_channel" | "pick_agent" | "contact_support";
341484
+ kind: "draft_template" | "connect_channel" | "request_review" | "remove_step" | "change_channel" | "pick_agent" | "pick_media" | "review_template" | "contact_support";
340699
341485
  target?: components["schemas"]["NotificationTarget"];
340700
341486
  };
340701
341487
  };
@@ -340839,6 +341625,72 @@ interface components {
340839
341625
  via?: string | null;
340840
341626
  } | null;
340841
341627
  };
341628
+ SequenceMediaTemplate: {
341629
+ /** @description The draft (null while the step has no draft for its current content: it is made on publish, or on submit). */
341630
+ id: string | null;
341631
+ sequence_id: string;
341632
+ sequence_name: string | null;
341633
+ step_key: string;
341634
+ /**
341635
+ * @description Where the template stands for the step’s CURRENT content (file version + caption + language). Only `approved` sends outside the window; inside it the plain file goes in every state.
341636
+ * @enum {string}
341637
+ */
341638
+ state: "unavailable" | "none" | "draft" | "in_review" | "approved" | "recategorised" | "rejected" | "paused" | "disabled";
341639
+ /** @description One Spanish sentence about the state, for the owner. */
341640
+ state_message: string;
341641
+ can_submit: boolean;
341642
+ submit_blocked_reason: string | null;
341643
+ /** @description The submitted template (the Meta mirror row). */
341644
+ template: {
341645
+ id: string;
341646
+ name: string;
341647
+ status: string;
341648
+ category: string;
341649
+ rejection_reason: string | null;
341650
+ } | null;
341651
+ review: {
341652
+ language: string;
341653
+ /** @enum {string} */
341654
+ category: "MARKETING";
341655
+ category_note: string;
341656
+ price_per_send: {
341657
+ /** @enum {string} */
341658
+ market: "CL";
341659
+ /** @enum {string} */
341660
+ currency: "USD";
341661
+ category: string;
341662
+ amount: number;
341663
+ as_of: string;
341664
+ label: string;
341665
+ };
341666
+ header: {
341667
+ /** @enum {string|null} */
341668
+ format: "VIDEO" | "IMAGE" | "DOCUMENT" | null;
341669
+ asset_id: string;
341670
+ asset_name: string | null;
341671
+ mime_type: string | null;
341672
+ byte_size: number | null;
341673
+ };
341674
+ /** @description The body as submitted: the caption with NAMED variables (`{{nombre}}`, `{{cita_fecha}}`, `{{cita_hora}}`). */
341675
+ body_text: string;
341676
+ body_preview: string;
341677
+ variables: {
341678
+ name: string;
341679
+ /** @enum {string} */
341680
+ field: "nombre" | "cita.fecha" | "cita.hora";
341681
+ label: string;
341682
+ example: string;
341683
+ }[];
341684
+ caption_issues: {
341685
+ /** @enum {string} */
341686
+ code: "empty" | "too_long" | "missing_required" | "unknown_variable" | "numbered_variable" | "repeated_variable" | "starts_with_variable" | "ends_with_variable" | "adjacent_variables" | "stray_brace" | "too_many_variables" | "promotional";
341687
+ message: string;
341688
+ slot?: string;
341689
+ }[];
341690
+ problem_message: string | null;
341691
+ name_note: string | null;
341692
+ };
341693
+ };
340842
341694
  SequenceTemplate: {
340843
341695
  /** @enum {string} */
340844
341696
  key: "blank" | "quote_followup" | "reactivate" | "signup_not_paid" | "installments" | "appointment_reminder";
@@ -340936,6 +341788,16 @@ interface components {
340936
341788
  /** Format: uuid */
340937
341789
  followup_id: string;
340938
341790
  trigger_key: string;
341791
+ } | {
341792
+ /** @enum {string} */
341793
+ type: "media_file";
341794
+ /**
341795
+ * Format: uuid
341796
+ * @description The media library file (`GET /media-assets/{id}`).
341797
+ */
341798
+ asset_id: string;
341799
+ /** @description Sent as written. Fields: `{{nombre}}` (first name; dropped when unknown), `{{cita.fecha}}` and `{{cita.hora}}` (only with entry `appointment_booked`). Empty = the file alone. */
341800
+ caption: string;
340939
341801
  };
340940
341802
  /** @description Where a built-in step is stored (keep it as read); null for a step added in the draft. */
340941
341803
  config_ref: {