@vitrina/api 13.4.0 → 13.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +2111 -120
- package/dist/index.d.ts +2111 -120
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7451,7 +7451,7 @@ interface paths {
|
|
|
7451
7451
|
};
|
|
7452
7452
|
/**
|
|
7453
7453
|
* Get the funnel report
|
|
7454
|
-
* @description The board's Pasos del embudo (ADR 0132) with the number of leads that reached each one in the period, the conversion from the step before, the split by stage inside each step, and Perdido apart. Counts only: this is the door the aggregates-only Consultor seat reads, next to `leads:read`. WHAT A COUNT MEANS. The cohort is the leads of the board CREATED in the period (`from` to `to`, both days inclusive, in the workspace clock). A lead counts in a step when it has ever stood on a stage of that step OR OF A LATER ONE — from its stage history, or from its current stage when it has none — so a lead that skipped a step still counts for the steps before it, and every cohort lead counts in the first step. The cohort is fixed by the creation date but how far it got is read as of now: a lead created in the period and sold next month counts in the last step the next time you look. `current` is where the cohort stands today. `lost` is the cohort leads standing on a lost stage today, split by the step they were lost from; `step_key: null` is history that cannot say (never guessed into a step). `sum(steps[].current) + lost.total + unplaced = cohort`.
|
|
7454
|
+
* @description The board's Pasos del embudo (ADR 0132) with the number of leads that reached each one in the period, the conversion from the step before, the split by stage inside each step, and Perdido apart. Counts only: this is the door the aggregates-only Consultor seat reads, next to `boards` lists the sales boards that can be read (id + name) so a board picker needs no other scope; `pipeline_id` selects one. The last step (Venta) carries `money`: what its people paid since their lead was created (`null` = more than 2 000 people, or unknown). `leads:read`. WHAT A COUNT MEANS. The cohort is the leads of the board CREATED in the period (`from` to `to`, both days inclusive, in the workspace clock). A lead counts in a step when it has ever stood on a stage of that step OR OF A LATER ONE — from its stage history, or from its current stage when it has none — so a lead that skipped a step still counts for the steps before it, and every cohort lead counts in the first step. The cohort is fixed by the creation date but how far it got is read as of now: a lead created in the period and sold next month counts in the last step the next time you look. `current` is where the cohort stands today. `lost` is the cohort leads standing on a lost stage today, split by the step they were lost from; `step_key: null` is history that cannot say (never guessed into a step). `sum(steps[].current) + lost.total + unplaced = cohort`.
|
|
7455
7455
|
*/
|
|
7456
7456
|
get: {
|
|
7457
7457
|
parameters: {
|
|
@@ -7517,7 +7517,8 @@ interface paths {
|
|
|
7517
7517
|
* "current": 14,
|
|
7518
7518
|
* "conversion_from_previous": 0.4,
|
|
7519
7519
|
* "conversion_from_start": 0.4,
|
|
7520
|
-
* "stages": []
|
|
7520
|
+
* "stages": [],
|
|
7521
|
+
* "money": 3450000
|
|
7521
7522
|
* }
|
|
7522
7523
|
* ],
|
|
7523
7524
|
* "lost": {
|
|
@@ -7544,7 +7545,191 @@ interface paths {
|
|
|
7544
7545
|
* "stages": []
|
|
7545
7546
|
* },
|
|
7546
7547
|
* "unplaced": 0,
|
|
7547
|
-
* "unplaced_stages": []
|
|
7548
|
+
* "unplaced_stages": [],
|
|
7549
|
+
* "boards": [
|
|
7550
|
+
* {
|
|
7551
|
+
* "id": "0b1c2d3e-0000-4000-8000-000000000001",
|
|
7552
|
+
* "name": "Tratamientos"
|
|
7553
|
+
* }
|
|
7554
|
+
* ]
|
|
7555
|
+
* }
|
|
7556
|
+
* }
|
|
7557
|
+
*/
|
|
7558
|
+
"application/json": {
|
|
7559
|
+
data?: unknown;
|
|
7560
|
+
meta?: {
|
|
7561
|
+
[key: string]: unknown;
|
|
7562
|
+
};
|
|
7563
|
+
};
|
|
7564
|
+
};
|
|
7565
|
+
};
|
|
7566
|
+
/** @description Validation error */
|
|
7567
|
+
400: {
|
|
7568
|
+
headers: {
|
|
7569
|
+
[name: string]: unknown;
|
|
7570
|
+
};
|
|
7571
|
+
content: {
|
|
7572
|
+
"application/json": components["schemas"]["Error"];
|
|
7573
|
+
};
|
|
7574
|
+
};
|
|
7575
|
+
/** @description Unauthorized */
|
|
7576
|
+
401: {
|
|
7577
|
+
headers: {
|
|
7578
|
+
[name: string]: unknown;
|
|
7579
|
+
};
|
|
7580
|
+
content: {
|
|
7581
|
+
"application/json": components["schemas"]["Error"];
|
|
7582
|
+
};
|
|
7583
|
+
};
|
|
7584
|
+
/** @description Forbidden */
|
|
7585
|
+
403: {
|
|
7586
|
+
headers: {
|
|
7587
|
+
[name: string]: unknown;
|
|
7588
|
+
};
|
|
7589
|
+
content: {
|
|
7590
|
+
"application/json": components["schemas"]["Error"];
|
|
7591
|
+
};
|
|
7592
|
+
};
|
|
7593
|
+
/** @description Not found */
|
|
7594
|
+
404: {
|
|
7595
|
+
headers: {
|
|
7596
|
+
[name: string]: unknown;
|
|
7597
|
+
};
|
|
7598
|
+
content: {
|
|
7599
|
+
"application/json": components["schemas"]["Error"];
|
|
7600
|
+
};
|
|
7601
|
+
};
|
|
7602
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
7603
|
+
409: {
|
|
7604
|
+
headers: {
|
|
7605
|
+
[name: string]: unknown;
|
|
7606
|
+
};
|
|
7607
|
+
content: {
|
|
7608
|
+
"application/json": components["schemas"]["Error"];
|
|
7609
|
+
};
|
|
7610
|
+
};
|
|
7611
|
+
/** @description Rate limited */
|
|
7612
|
+
429: {
|
|
7613
|
+
headers: {
|
|
7614
|
+
[name: string]: unknown;
|
|
7615
|
+
};
|
|
7616
|
+
content: {
|
|
7617
|
+
"application/json": components["schemas"]["Error"];
|
|
7618
|
+
};
|
|
7619
|
+
};
|
|
7620
|
+
};
|
|
7621
|
+
};
|
|
7622
|
+
put?: never;
|
|
7623
|
+
post?: never;
|
|
7624
|
+
delete?: never;
|
|
7625
|
+
options?: never;
|
|
7626
|
+
head?: never;
|
|
7627
|
+
patch?: never;
|
|
7628
|
+
trace?: never;
|
|
7629
|
+
};
|
|
7630
|
+
"/funnel-report/by-linea": {
|
|
7631
|
+
parameters: {
|
|
7632
|
+
query?: never;
|
|
7633
|
+
header?: never;
|
|
7634
|
+
path?: never;
|
|
7635
|
+
cookie?: never;
|
|
7636
|
+
};
|
|
7637
|
+
/**
|
|
7638
|
+
* Get the funnel report split by Línea
|
|
7639
|
+
* @description One row per Línea of the clinic (and «Sin línea», `linea_id: null`, when leads carry none), each with how many of ITS cohort leads reached every step and stand there today. Same cohort and counting rules as `GET /funnel-report` with one more grouping, so the rows add up to it: for every step, `sum(lineas[].steps[].reached) = ` that step’s `reached` in the unsplit report, and `sum(lineas[].cohort) = cohort`. Open a cell’s people with `GET /funnel-report/people` and the same period plus `linea_id` (`none` for «Sin línea»). Counts only (the Consultor seat reads it). WHAT A COUNT MEANS. The cohort is the leads of the board CREATED in the period (`from` to `to`, both days inclusive, in the workspace clock). A lead counts in a step when it has ever stood on a stage of that step OR OF A LATER ONE — from its stage history, or from its current stage when it has none — so a lead that skipped a step still counts for the steps before it, and every cohort lead counts in the first step. The cohort is fixed by the creation date but how far it got is read as of now: a lead created in the period and sold next month counts in the last step the next time you look. `current` is where the cohort stands today. `lost` is the cohort leads standing on a lost stage today, split by the step they were lost from; `step_key: null` is history that cannot say (never guessed into a step). `sum(steps[].current) + lost.total + unplaced = cohort`.
|
|
7640
|
+
*/
|
|
7641
|
+
get: {
|
|
7642
|
+
parameters: {
|
|
7643
|
+
query?: {
|
|
7644
|
+
/** @description The board to read. Defaults to the workspace's sales board. */
|
|
7645
|
+
pipeline_id?: string;
|
|
7646
|
+
/** @description First day of the period, inclusive. Defaults to 29 days before `to`. */
|
|
7647
|
+
from?: string;
|
|
7648
|
+
/** @description Last day of the period, INCLUSIVE. Defaults to today in the workspace's clock. */
|
|
7649
|
+
to?: string;
|
|
7650
|
+
/** @description Origen of the patient: `meta` (came from a Meta ad), `organic` (a linked contact with no ad touch) or `unknown` («Sin dato»: no linked contact). Same attribution as Vitrina Ads' people from ads. */
|
|
7651
|
+
origin?: "meta" | "organic" | "unknown";
|
|
7652
|
+
/** @description Narrow `origin=meta` to one Meta ad (its platform ad id). */
|
|
7653
|
+
origin_ad_id?: string;
|
|
7654
|
+
};
|
|
7655
|
+
header?: never;
|
|
7656
|
+
path?: never;
|
|
7657
|
+
cookie?: never;
|
|
7658
|
+
};
|
|
7659
|
+
requestBody?: never;
|
|
7660
|
+
responses: {
|
|
7661
|
+
/** @description Funnel report by Línea */
|
|
7662
|
+
200: {
|
|
7663
|
+
headers: {
|
|
7664
|
+
[name: string]: unknown;
|
|
7665
|
+
};
|
|
7666
|
+
content: {
|
|
7667
|
+
/**
|
|
7668
|
+
* @example {
|
|
7669
|
+
* "data": {
|
|
7670
|
+
* "pipeline_id": "0b1c2d3e-0000-4000-8000-000000000001",
|
|
7671
|
+
* "period": {
|
|
7672
|
+
* "from": "2026-09-10",
|
|
7673
|
+
* "to": "2026-10-09",
|
|
7674
|
+
* "timezone": "America/Santiago"
|
|
7675
|
+
* },
|
|
7676
|
+
* "cohort": 120,
|
|
7677
|
+
* "steps": [
|
|
7678
|
+
* {
|
|
7679
|
+
* "key": "no_appointment",
|
|
7680
|
+
* "name": "Sin cita",
|
|
7681
|
+
* "position": 0
|
|
7682
|
+
* },
|
|
7683
|
+
* {
|
|
7684
|
+
* "key": "scheduled",
|
|
7685
|
+
* "name": "Agendado",
|
|
7686
|
+
* "position": 1
|
|
7687
|
+
* }
|
|
7688
|
+
* ],
|
|
7689
|
+
* "lineas": [
|
|
7690
|
+
* {
|
|
7691
|
+
* "linea_id": "0b1c2d3e-0000-4000-8000-0000000000b1",
|
|
7692
|
+
* "nombre": "Implantes",
|
|
7693
|
+
* "cohort": 70,
|
|
7694
|
+
* "steps": [
|
|
7695
|
+
* {
|
|
7696
|
+
* "key": "no_appointment",
|
|
7697
|
+
* "reached": 70,
|
|
7698
|
+
* "current": 30,
|
|
7699
|
+
* "conversion_from_previous": null
|
|
7700
|
+
* },
|
|
7701
|
+
* {
|
|
7702
|
+
* "key": "scheduled",
|
|
7703
|
+
* "reached": 35,
|
|
7704
|
+
* "current": 10,
|
|
7705
|
+
* "conversion_from_previous": 0.5
|
|
7706
|
+
* }
|
|
7707
|
+
* ],
|
|
7708
|
+
* "lost": 12,
|
|
7709
|
+
* "unplaced": 0
|
|
7710
|
+
* },
|
|
7711
|
+
* {
|
|
7712
|
+
* "linea_id": null,
|
|
7713
|
+
* "nombre": null,
|
|
7714
|
+
* "cohort": 50,
|
|
7715
|
+
* "steps": [
|
|
7716
|
+
* {
|
|
7717
|
+
* "key": "no_appointment",
|
|
7718
|
+
* "reached": 50,
|
|
7719
|
+
* "current": 31,
|
|
7720
|
+
* "conversion_from_previous": null
|
|
7721
|
+
* },
|
|
7722
|
+
* {
|
|
7723
|
+
* "key": "scheduled",
|
|
7724
|
+
* "reached": 13,
|
|
7725
|
+
* "current": 4,
|
|
7726
|
+
* "conversion_from_previous": 0.26
|
|
7727
|
+
* }
|
|
7728
|
+
* ],
|
|
7729
|
+
* "lost": 10,
|
|
7730
|
+
* "unplaced": 0
|
|
7731
|
+
* }
|
|
7732
|
+
* ]
|
|
7548
7733
|
* }
|
|
7549
7734
|
* }
|
|
7550
7735
|
*/
|
|
@@ -7629,7 +7814,7 @@ interface paths {
|
|
|
7629
7814
|
};
|
|
7630
7815
|
/**
|
|
7631
7816
|
* List the people behind a funnel count
|
|
7632
|
-
* @description The leads behind one number of `GET /funnel-report`, read through the same cohort and the same rules, so the list always has as many rows as the count says (`total`). `measure=reached&step=` is a step headline; `measure=current` is who stands there today; `measure=lost` is Perdido (narrow with `step`, or `lost_from_unknown=true`); `measure=unplaced` is the leads on a stage that belongs to no step. Add `stage_id` for one stage of a step. Newest activity first. Needs `leads:read`; the contact name
|
|
7817
|
+
* @description The leads behind one number of `GET /funnel-report`, read through the same cohort and the same rules, so the list always has as many rows as the count says (`total`). `measure=reached&step=` is a step headline; `measure=current` is who stands there today; `measure=lost` is Perdido (narrow with `step`, or `lost_from_unknown=true`); `measure=unplaced` is the leads on a stage that belongs to no step. Add `stage_id` for one stage of a step. Newest activity first. Needs `leads:read`; the contact name and phone ride only with `contacts:read`. D60: each person also carries `score` and `score_reason` («qué pasó»), `lost_reason` («motivo»), the next cita (else the last, `cita_at`/`cita_status`), `paid` (CLP the clinic recorded since the lead was created) and, for a clinic, `origin` (Meta naming the ad, Orgánico, Sin dato). WHAT A COUNT MEANS. The cohort is the leads of the board CREATED in the period (`from` to `to`, both days inclusive, in the workspace clock). A lead counts in a step when it has ever stood on a stage of that step OR OF A LATER ONE — from its stage history, or from its current stage when it has none — so a lead that skipped a step still counts for the steps before it, and every cohort lead counts in the first step. The cohort is fixed by the creation date but how far it got is read as of now: a lead created in the period and sold next month counts in the last step the next time you look. `current` is where the cohort stands today. `lost` is the cohort leads standing on a lost stage today, split by the step they were lost from; `step_key: null` is history that cannot say (never guessed into a step). `sum(steps[].current) + lost.total + unplaced = cohort`.
|
|
7633
7818
|
*/
|
|
7634
7819
|
get: {
|
|
7635
7820
|
parameters: {
|
|
@@ -7694,7 +7879,24 @@ interface paths {
|
|
|
7694
7879
|
* "last_activity_at": "2026-10-08T09:30:00.000Z",
|
|
7695
7880
|
* "last_move_at": "2026-09-20T16:00:00.000Z",
|
|
7696
7881
|
* "last_move_stage_name": "Evaluación agendada",
|
|
7697
|
-
* "reached_step_key": "scheduled"
|
|
7882
|
+
* "reached_step_key": "scheduled",
|
|
7883
|
+
* "phone": "+56 9 1234 5678",
|
|
7884
|
+
* "score": 72,
|
|
7885
|
+
* "score_reason": "Pidió hora para evaluación de implante; preguntó por cuotas.",
|
|
7886
|
+
* "lost_reason": null,
|
|
7887
|
+
* "cita_at": "2026-10-14T13:00:00.000Z",
|
|
7888
|
+
* "cita_status": "confirmed",
|
|
7889
|
+
* "paid": 45000,
|
|
7890
|
+
* "origin": {
|
|
7891
|
+
* "kind": "meta",
|
|
7892
|
+
* "label": "Meta · Implantes 2",
|
|
7893
|
+
* "ad_id": "120210000000000101",
|
|
7894
|
+
* "ad_name": "Implantes 2",
|
|
7895
|
+
* "ad_set_name": "INTERESES",
|
|
7896
|
+
* "campaign_name": "IMPLANTES",
|
|
7897
|
+
* "first_touch_at": "2026-09-12T14:01:00.000Z",
|
|
7898
|
+
* "via": "first_message"
|
|
7899
|
+
* }
|
|
7698
7900
|
* }
|
|
7699
7901
|
* ]
|
|
7700
7902
|
* }
|
|
@@ -12506,7 +12708,7 @@ interface paths {
|
|
|
12506
12708
|
"application/json": {
|
|
12507
12709
|
/** Format: uri */
|
|
12508
12710
|
url?: string;
|
|
12509
|
-
events?: ("*" | "ai_agent.publish" | "ai_agent_graph.publish" | "agent_scenario_run.completed" | "agent_scenario_suite.completed" | "conversation.created" | "conversation.assigned" | "conversation.resolved" | "message.received" | "message.sent" | "ticket.opened" | "ticket.reopened" | "ticket.resolved" | "ticket.closed" | "sla.breached" | "kb.source.create" | "kb.source.embed" | "kb.source.update" | "kb.source.delete" | "kb_file.uploaded" | "kb_file.deleted" | "skill.created" | "skill.updated" | "skill.deleted" | "custom_tool.created" | "custom_tool.updated" | "custom_tool.deleted" | "macro.applied" | "cost.budget_alert" | "runtime.budget_exceeded" | "lead.created" | "lead.stage_changed" | "lead.pipeline_changed" | "lead.assigned" | "lead.won" | "lead.lost" | "lead.unqualified" | "stock.synced" | "stock.source_retired" | "vehicle.published" | "vehicle.unpublished" | "vehicle.publish_failed" | "vehicle.created" | "vehicle.attachment.created" | "mercadolibre.order" | "mercadolibre.vis_lead" | "chileautos.lead" | "yapo.lead" | "website.lead" | "consignment.candidate.created" | "quote.issued" | "quote.voided" | "quote.extended" | "quote.archived" | "reservation.created" | "reservation.voided" | "reservation.abono_disposed" | "reservation.converted" | "sale_note.issued" | "sale_note.approved" | "sale_note.voided" | "purchase_note.issued" | "purchase_note.corrected" | "purchase_note.voided" | "payment.recorded" | "consignment.created" | "consignment.returned" | "consignment.sold" | "credit_application.recorded" | "credit_application.submitted" | "credit_application.decided" | "credit_application.withdrawn" | "price_approval.requested" | "price_approval.decided" | "contact.created" | "contact.updated" | "contact.merged" | "appointment.booked" | "appointment.rescheduled" | "appointment.cancelled" | "appointment.completed" | "appointment.no_show" | "appointment.reminded" | "appointment.imported" | "campaign.sent" | "campaign.paused" | "sending_domain.verified" | "coach.proposals_ready" | "coach.finding_ready" | "voice.autonomous_call" | "safety_hold.placed" | "safety_hold.ack_overdue" | "safety_hold.first_response_overdue" | "team.created" | "team.updated" | "team.deleted" | "custom_role.created" | "custom_role.updated" | "custom_role.deleted" | "macro.created" | "macro.updated" | "macro.deleted" | "assignment_rule.created" | "assignment_rule.updated" | "assignment_rule.deleted" | "sla_policy.created" | "sla_policy.updated" | "sla_policy.deleted" | "automation_trigger.created" | "automation_trigger.updated" | "automation_trigger.deleted" | "sending_domain.created" | "sending_domain.deleted" | "whatsapp_template.created" | "whatsapp_template.status_changed" | "whatsapp_template.deleted" | "whatsapp_flow.created" | "whatsapp_flow.published" | "whatsapp_flow.deprecated" | "whatsapp_flow.deleted" | "whatsapp_flow.completed" | "channel.connected" | "channel.updated" | "channel.disconnected" | "membership.created" | "membership.updated" | "membership.removed" | "clinic_professional.created" | "clinic_professional.updated" | "clinic_professional.deleted" | "clinic_service.created" | "clinic_service.updated" | "clinic_service.deleted" | "clinic_price_list.updated" | "clinic_pack_purchase.created" | "clinic_pack_purchase.session_consumed" | "clinic_pack_purchase.cancelled" | "clinic_budget.created" | "clinic_budget.sent" | "clinic_budget.accepted" | "clinic_budget.rejected" | "clinic_budget.voided" | "clinic_budget.mirror_changed" | "clinic_cash_session.opened" | "clinic_cash_session.closed" | "clinic_patient.created" | "clinic_patient.updated" | "clinic_patient.deleted" | "clinic_patient.merged" | "clinic_encounter.opened" | "clinic_encounter.closed" | "clinic_note.signed" | "clinic_note.amended" | "clinic_consent.signed" | "clinic_consent.revoked" | "clinic_document.uploaded" | "clinic_document.deleted" | "clinic_privacy_request.completed")[];
|
|
12711
|
+
events?: ("*" | "ai_agent.publish" | "ai_agent_graph.publish" | "agent_scenario_run.completed" | "agent_scenario_suite.completed" | "conversation.created" | "conversation.assigned" | "conversation.resolved" | "message.received" | "message.sent" | "ticket.opened" | "ticket.reopened" | "ticket.resolved" | "ticket.closed" | "sla.breached" | "kb.source.create" | "kb.source.embed" | "kb.source.update" | "kb.source.delete" | "kb_file.uploaded" | "kb_file.deleted" | "skill.created" | "skill.updated" | "skill.deleted" | "custom_tool.created" | "custom_tool.updated" | "custom_tool.deleted" | "macro.applied" | "cost.budget_alert" | "runtime.budget_exceeded" | "lead.created" | "lead.stage_changed" | "lead.pipeline_changed" | "lead.assigned" | "lead.won" | "lead.lost" | "lead.unqualified" | "stock.synced" | "stock.source_retired" | "vehicle.published" | "vehicle.unpublished" | "vehicle.publish_failed" | "vehicle.created" | "vehicle.attachment.created" | "mercadolibre.order" | "mercadolibre.vis_lead" | "chileautos.lead" | "yapo.lead" | "website.lead" | "demo_lead.created" | "demo_lead.pending_scheduling" | "demo_lead.routed" | "demo_booking.booked" | "demo_booking.rescheduled" | "demo_booking.cancelled" | "demo_booking.held" | "demo_booking.no_show" | "consignment.candidate.created" | "quote.issued" | "quote.voided" | "quote.extended" | "quote.archived" | "reservation.created" | "reservation.voided" | "reservation.abono_disposed" | "reservation.converted" | "sale_note.issued" | "sale_note.approved" | "sale_note.voided" | "purchase_note.issued" | "purchase_note.corrected" | "purchase_note.voided" | "payment.recorded" | "consignment.created" | "consignment.returned" | "consignment.sold" | "credit_application.recorded" | "credit_application.submitted" | "credit_application.decided" | "credit_application.withdrawn" | "price_approval.requested" | "price_approval.decided" | "contact.created" | "contact.updated" | "contact.merged" | "appointment.booked" | "appointment.rescheduled" | "appointment.cancelled" | "appointment.completed" | "appointment.no_show" | "appointment.reminded" | "appointment.imported" | "campaign.sent" | "campaign.paused" | "sending_domain.verified" | "coach.proposals_ready" | "coach.finding_ready" | "voice.autonomous_call" | "safety_hold.placed" | "safety_hold.ack_overdue" | "safety_hold.first_response_overdue" | "team.created" | "team.updated" | "team.deleted" | "custom_role.created" | "custom_role.updated" | "custom_role.deleted" | "macro.created" | "macro.updated" | "macro.deleted" | "assignment_rule.created" | "assignment_rule.updated" | "assignment_rule.deleted" | "sla_policy.created" | "sla_policy.updated" | "sla_policy.deleted" | "automation_trigger.created" | "automation_trigger.updated" | "automation_trigger.deleted" | "sending_domain.created" | "sending_domain.deleted" | "whatsapp_template.created" | "whatsapp_template.status_changed" | "whatsapp_template.deleted" | "whatsapp_flow.created" | "whatsapp_flow.published" | "whatsapp_flow.deprecated" | "whatsapp_flow.deleted" | "whatsapp_flow.completed" | "channel.connected" | "channel.updated" | "channel.disconnected" | "membership.created" | "membership.updated" | "membership.removed" | "clinic_professional.created" | "clinic_professional.updated" | "clinic_professional.deleted" | "clinic_service.created" | "clinic_service.updated" | "clinic_service.deleted" | "clinic_price_list.updated" | "clinic_pack_purchase.created" | "clinic_pack_purchase.session_consumed" | "clinic_pack_purchase.cancelled" | "clinic_budget.created" | "clinic_budget.sent" | "clinic_budget.accepted" | "clinic_budget.rejected" | "clinic_budget.voided" | "clinic_budget.mirror_changed" | "clinic_cash_session.opened" | "clinic_cash_session.closed" | "clinic_patient.created" | "clinic_patient.updated" | "clinic_patient.deleted" | "clinic_patient.merged" | "clinic_encounter.opened" | "clinic_encounter.closed" | "clinic_note.signed" | "clinic_note.amended" | "clinic_consent.signed" | "clinic_consent.revoked" | "clinic_document.uploaded" | "clinic_document.deleted" | "clinic_privacy_request.completed")[];
|
|
12510
12712
|
enabled?: boolean;
|
|
12511
12713
|
description?: string | null;
|
|
12512
12714
|
/** @description «Incluir datos del recurso». `false` (the default) = every delivery is the notice: resource, changes, author, time and `url`, with `data_omitted: "not_requested"`. `true` = each delivery also carries `data` when, at dispatch time, this subscription's OWNER — whoever created it or last changed its url, events or this flag — holds the resource read scope (`read_scope` in the catalogue) and sees every record; otherwise `data_omitted` says why. An event about a dato sensible is always the notice. */
|
|
@@ -82393,53 +82595,910 @@ interface paths {
|
|
|
82393
82595
|
};
|
|
82394
82596
|
trace?: never;
|
|
82395
82597
|
};
|
|
82396
|
-
"/appointments/{id}/cancel": {
|
|
82598
|
+
"/appointments/{id}/cancel": {
|
|
82599
|
+
parameters: {
|
|
82600
|
+
query?: never;
|
|
82601
|
+
header?: never;
|
|
82602
|
+
path?: never;
|
|
82603
|
+
cookie?: never;
|
|
82604
|
+
};
|
|
82605
|
+
get?: never;
|
|
82606
|
+
put?: never;
|
|
82607
|
+
/**
|
|
82608
|
+
* Cancel an appointment
|
|
82609
|
+
* @description Sets `cancelled`, drops the pending reminder, removes the mirrored calendar event, fires `appointment.cancelled` and frees the slot for the follow-up trigger. Idempotent — cancelling an already-cancelled appointment answers 200 with the row and does none of it again.
|
|
82610
|
+
*
|
|
82611
|
+
* **Two scopes: `appointments:delete` AND `messages:send`.** The first is the split that lets a workspace grant "may book and reschedule" without granting "may un-book" (`appointments:write` reaches neither). The second is because a MESSAGE LEAVES VITRINA here, which is what every sending operation costs (ADR 0106 §3.2) — a credential that may cancel but holds no authority to write to anybody gets a 403.
|
|
82612
|
+
*
|
|
82613
|
+
* **It messages the customer.** The workspace is the one calling this off, so the cancellation notice goes out on the appointment’s originating conversation, in the workspace language and timezone. That send is best-effort and stamped for idempotency — it never fails the call and never goes out twice — and it is skipped entirely when the appointment has no conversation behind it. It is a transactional confirmation Vitrina composes about a booking the person made, not a send this caller authors, so it does not go through the política de envíos verdicts: a Bloqueo there would leave somebody turning up to a cancelled appointment.
|
|
82614
|
+
*
|
|
82615
|
+
* **`reason` is not stored, but it IS shown**: the text is appended to that customer notice, and nowhere else. Nothing persists it on the appointment, so put the internal explanation in a note on the lead or conversation if it needs to survive — and write `reason` as something the customer may read.
|
|
82616
|
+
*
|
|
82617
|
+
* An appointment imported FROM Google is not deleted upstream — the calendar owns those, so the cancellation is local and the event stays on the customer’s calendar.
|
|
82618
|
+
*/
|
|
82619
|
+
post: {
|
|
82620
|
+
parameters: {
|
|
82621
|
+
query?: never;
|
|
82622
|
+
header?: {
|
|
82623
|
+
/** @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. */
|
|
82624
|
+
"Idempotency-Key"?: string;
|
|
82625
|
+
};
|
|
82626
|
+
path: {
|
|
82627
|
+
id: string;
|
|
82628
|
+
};
|
|
82629
|
+
cookie?: never;
|
|
82630
|
+
};
|
|
82631
|
+
requestBody?: {
|
|
82632
|
+
content: {
|
|
82633
|
+
/**
|
|
82634
|
+
* @example {
|
|
82635
|
+
* "reason": "Reprogramamos por disponibilidad del equipo."
|
|
82636
|
+
* }
|
|
82637
|
+
*/
|
|
82638
|
+
"application/json": {
|
|
82639
|
+
reason?: string;
|
|
82640
|
+
};
|
|
82641
|
+
};
|
|
82642
|
+
};
|
|
82643
|
+
responses: {
|
|
82644
|
+
/** @description The cancelled appointment */
|
|
82645
|
+
200: {
|
|
82646
|
+
headers: {
|
|
82647
|
+
[name: string]: unknown;
|
|
82648
|
+
};
|
|
82649
|
+
content: {
|
|
82650
|
+
/**
|
|
82651
|
+
* @example {
|
|
82652
|
+
* "data": {
|
|
82653
|
+
* "id": "dddddddd-0000-4000-8000-000000000001",
|
|
82654
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
82655
|
+
* "lead_id": null,
|
|
82656
|
+
* "contact_id": "22222222-0000-4000-8000-000000000001",
|
|
82657
|
+
* "conversation_id": null,
|
|
82658
|
+
* "vehicle_id": null,
|
|
82659
|
+
* "appointment_type_id": "eeee0000-0000-4000-8000-000000000001",
|
|
82660
|
+
* "owner_user_id": "11111111-0000-4000-8000-000000000001",
|
|
82661
|
+
* "location_id": "b1b1b1b1-0000-4000-8000-000000000001",
|
|
82662
|
+
* "professional_id": null,
|
|
82663
|
+
* "resource_id": null,
|
|
82664
|
+
* "kind": "external",
|
|
82665
|
+
* "source": "human",
|
|
82666
|
+
* "engine": "native",
|
|
82667
|
+
* "external_id": null,
|
|
82668
|
+
* "status": "cancelled",
|
|
82669
|
+
* "status_epoch": 2,
|
|
82670
|
+
* "clinic_status_id": null,
|
|
82671
|
+
* "arrival_state": "scheduled",
|
|
82672
|
+
* "arrived_at": null,
|
|
82673
|
+
* "in_room_at": null,
|
|
82674
|
+
* "done_at": null,
|
|
82675
|
+
* "series_id": null,
|
|
82676
|
+
* "series_index": null,
|
|
82677
|
+
* "booking_landing_id": null,
|
|
82678
|
+
* "attribution": null,
|
|
82679
|
+
* "starts_at": "2026-10-01T14:00:00.000Z",
|
|
82680
|
+
* "ends_at": "2026-10-01T14:45:00.000Z",
|
|
82681
|
+
* "hold_expires_at": null,
|
|
82682
|
+
* "google_event_id": null,
|
|
82683
|
+
* "google_ical_uid": null,
|
|
82684
|
+
* "google_updated_at": null,
|
|
82685
|
+
* "google_etag": null,
|
|
82686
|
+
* "reminder_at": "2026-10-01T12:00:00.000Z",
|
|
82687
|
+
* "reminder_sent_at": null,
|
|
82688
|
+
* "reminder_job_id": "appt-reminder-dddddddd-0000-4000-8000-000000000001",
|
|
82689
|
+
* "customer_name": "Camila R.",
|
|
82690
|
+
* "notes": "Primera visita.",
|
|
82691
|
+
* "metadata": {},
|
|
82692
|
+
* "display_seq": 3,
|
|
82693
|
+
* "display_id": "A-3",
|
|
82694
|
+
* "created_at": "2026-09-22T12:50:37.046Z",
|
|
82695
|
+
* "updated_at": "2026-09-22T12:50:37.080Z"
|
|
82696
|
+
* }
|
|
82697
|
+
* }
|
|
82698
|
+
*/
|
|
82699
|
+
"application/json": {
|
|
82700
|
+
data?: unknown;
|
|
82701
|
+
meta?: {
|
|
82702
|
+
[key: string]: unknown;
|
|
82703
|
+
};
|
|
82704
|
+
};
|
|
82705
|
+
};
|
|
82706
|
+
};
|
|
82707
|
+
/** @description Validation error */
|
|
82708
|
+
400: {
|
|
82709
|
+
headers: {
|
|
82710
|
+
[name: string]: unknown;
|
|
82711
|
+
};
|
|
82712
|
+
content: {
|
|
82713
|
+
"application/json": components["schemas"]["Error"];
|
|
82714
|
+
};
|
|
82715
|
+
};
|
|
82716
|
+
/** @description Unauthorized */
|
|
82717
|
+
401: {
|
|
82718
|
+
headers: {
|
|
82719
|
+
[name: string]: unknown;
|
|
82720
|
+
};
|
|
82721
|
+
content: {
|
|
82722
|
+
"application/json": components["schemas"]["Error"];
|
|
82723
|
+
};
|
|
82724
|
+
};
|
|
82725
|
+
/** @description Forbidden */
|
|
82726
|
+
403: {
|
|
82727
|
+
headers: {
|
|
82728
|
+
[name: string]: unknown;
|
|
82729
|
+
};
|
|
82730
|
+
content: {
|
|
82731
|
+
"application/json": components["schemas"]["Error"];
|
|
82732
|
+
};
|
|
82733
|
+
};
|
|
82734
|
+
/** @description Not found */
|
|
82735
|
+
404: {
|
|
82736
|
+
headers: {
|
|
82737
|
+
[name: string]: unknown;
|
|
82738
|
+
};
|
|
82739
|
+
content: {
|
|
82740
|
+
"application/json": components["schemas"]["Error"];
|
|
82741
|
+
};
|
|
82742
|
+
};
|
|
82743
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
82744
|
+
409: {
|
|
82745
|
+
headers: {
|
|
82746
|
+
[name: string]: unknown;
|
|
82747
|
+
};
|
|
82748
|
+
content: {
|
|
82749
|
+
"application/json": components["schemas"]["Error"];
|
|
82750
|
+
};
|
|
82751
|
+
};
|
|
82752
|
+
/** @description Rate limited */
|
|
82753
|
+
429: {
|
|
82754
|
+
headers: {
|
|
82755
|
+
[name: string]: unknown;
|
|
82756
|
+
};
|
|
82757
|
+
content: {
|
|
82758
|
+
"application/json": components["schemas"]["Error"];
|
|
82759
|
+
};
|
|
82760
|
+
};
|
|
82761
|
+
};
|
|
82762
|
+
};
|
|
82763
|
+
delete?: never;
|
|
82764
|
+
options?: never;
|
|
82765
|
+
head?: never;
|
|
82766
|
+
patch?: never;
|
|
82767
|
+
trace?: never;
|
|
82768
|
+
};
|
|
82769
|
+
"/appointments/reminders/plan": {
|
|
82770
|
+
parameters: {
|
|
82771
|
+
query?: never;
|
|
82772
|
+
header?: never;
|
|
82773
|
+
path?: never;
|
|
82774
|
+
cookie?: never;
|
|
82775
|
+
};
|
|
82776
|
+
/**
|
|
82777
|
+
* Get the appointment reminder ladder
|
|
82778
|
+
* @description The rungs, the single-sender declaration, whether anything is being sent right now (`live`) and `blocked_reason` when it is not. A rung has an `event` (`before_start` by default, `booked` for the welcome right after booking, `no_show` for the rebook with three fresh slots), an `email` mode (`never` / `fallback` / `also`, the twin with a .ics) and optional per-kind WhatsApp `templates` (`demo`, `clinic`, `visit`, `generic`). Off for every tenant until its owner saves a plan and declares Vitrina the single sender.
|
|
82779
|
+
*/
|
|
82780
|
+
get: {
|
|
82781
|
+
parameters: {
|
|
82782
|
+
query?: never;
|
|
82783
|
+
header?: never;
|
|
82784
|
+
path?: never;
|
|
82785
|
+
cookie?: never;
|
|
82786
|
+
};
|
|
82787
|
+
requestBody?: never;
|
|
82788
|
+
responses: {
|
|
82789
|
+
/** @description Reminder plan */
|
|
82790
|
+
200: {
|
|
82791
|
+
headers: {
|
|
82792
|
+
[name: string]: unknown;
|
|
82793
|
+
};
|
|
82794
|
+
content: {
|
|
82795
|
+
/**
|
|
82796
|
+
* @example {
|
|
82797
|
+
* "data": {
|
|
82798
|
+
* "id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b10",
|
|
82799
|
+
* "name": "Recordatorios de cita",
|
|
82800
|
+
* "rungs": [
|
|
82801
|
+
* {
|
|
82802
|
+
* "key": "welcome",
|
|
82803
|
+
* "event": "booked",
|
|
82804
|
+
* "offset_hours": 0,
|
|
82805
|
+
* "channel": "whatsapp",
|
|
82806
|
+
* "email": "also",
|
|
82807
|
+
* "template_name": null,
|
|
82808
|
+
* "templates": {
|
|
82809
|
+
* "demo": "demo_confirmada_v1"
|
|
82810
|
+
* },
|
|
82811
|
+
* "asks_confirmation": false,
|
|
82812
|
+
* "include_reschedule_link": true
|
|
82813
|
+
* },
|
|
82814
|
+
* {
|
|
82815
|
+
* "key": "h24",
|
|
82816
|
+
* "offset_hours": 24,
|
|
82817
|
+
* "channel": "whatsapp",
|
|
82818
|
+
* "email": "fallback",
|
|
82819
|
+
* "template_name": "recordatorio_24h",
|
|
82820
|
+
* "asks_confirmation": true,
|
|
82821
|
+
* "include_reschedule_link": true
|
|
82822
|
+
* },
|
|
82823
|
+
* {
|
|
82824
|
+
* "key": "h2",
|
|
82825
|
+
* "offset_hours": 2,
|
|
82826
|
+
* "channel": "whatsapp",
|
|
82827
|
+
* "template_name": "recordatorio_2h",
|
|
82828
|
+
* "asks_confirmation": false,
|
|
82829
|
+
* "include_reschedule_link": false
|
|
82830
|
+
* },
|
|
82831
|
+
* {
|
|
82832
|
+
* "key": "no_show",
|
|
82833
|
+
* "event": "no_show",
|
|
82834
|
+
* "offset_hours": 0.17,
|
|
82835
|
+
* "channel": "whatsapp",
|
|
82836
|
+
* "email": "fallback",
|
|
82837
|
+
* "template_name": "reagendar",
|
|
82838
|
+
* "asks_confirmation": false,
|
|
82839
|
+
* "include_reschedule_link": true
|
|
82840
|
+
* }
|
|
82841
|
+
* ],
|
|
82842
|
+
* "active": true,
|
|
82843
|
+
* "single_sender_confirmed_at": "2026-10-11T12:00:00.000Z",
|
|
82844
|
+
* "single_sender_confirmed_by": null,
|
|
82845
|
+
* "vendor_sends_reminders": false,
|
|
82846
|
+
* "live": true,
|
|
82847
|
+
* "blocked_reason": null,
|
|
82848
|
+
* "defaults": [],
|
|
82849
|
+
* "updated_at": "2026-10-11T12:00:00.000Z",
|
|
82850
|
+
* "confirm_status_id": null,
|
|
82851
|
+
* "confirm_status": null,
|
|
82852
|
+
* "create_contacts_from_patient_phone": false
|
|
82853
|
+
* }
|
|
82854
|
+
* }
|
|
82855
|
+
*/
|
|
82856
|
+
"application/json": {
|
|
82857
|
+
data?: unknown;
|
|
82858
|
+
meta?: {
|
|
82859
|
+
[key: string]: unknown;
|
|
82860
|
+
};
|
|
82861
|
+
};
|
|
82862
|
+
};
|
|
82863
|
+
};
|
|
82864
|
+
/** @description Validation error */
|
|
82865
|
+
400: {
|
|
82866
|
+
headers: {
|
|
82867
|
+
[name: string]: unknown;
|
|
82868
|
+
};
|
|
82869
|
+
content: {
|
|
82870
|
+
"application/json": components["schemas"]["Error"];
|
|
82871
|
+
};
|
|
82872
|
+
};
|
|
82873
|
+
/** @description Unauthorized */
|
|
82874
|
+
401: {
|
|
82875
|
+
headers: {
|
|
82876
|
+
[name: string]: unknown;
|
|
82877
|
+
};
|
|
82878
|
+
content: {
|
|
82879
|
+
"application/json": components["schemas"]["Error"];
|
|
82880
|
+
};
|
|
82881
|
+
};
|
|
82882
|
+
/** @description Forbidden */
|
|
82883
|
+
403: {
|
|
82884
|
+
headers: {
|
|
82885
|
+
[name: string]: unknown;
|
|
82886
|
+
};
|
|
82887
|
+
content: {
|
|
82888
|
+
"application/json": components["schemas"]["Error"];
|
|
82889
|
+
};
|
|
82890
|
+
};
|
|
82891
|
+
/** @description Not found */
|
|
82892
|
+
404: {
|
|
82893
|
+
headers: {
|
|
82894
|
+
[name: string]: unknown;
|
|
82895
|
+
};
|
|
82896
|
+
content: {
|
|
82897
|
+
"application/json": components["schemas"]["Error"];
|
|
82898
|
+
};
|
|
82899
|
+
};
|
|
82900
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
82901
|
+
409: {
|
|
82902
|
+
headers: {
|
|
82903
|
+
[name: string]: unknown;
|
|
82904
|
+
};
|
|
82905
|
+
content: {
|
|
82906
|
+
"application/json": components["schemas"]["Error"];
|
|
82907
|
+
};
|
|
82908
|
+
};
|
|
82909
|
+
/** @description Rate limited */
|
|
82910
|
+
429: {
|
|
82911
|
+
headers: {
|
|
82912
|
+
[name: string]: unknown;
|
|
82913
|
+
};
|
|
82914
|
+
content: {
|
|
82915
|
+
"application/json": components["schemas"]["Error"];
|
|
82916
|
+
};
|
|
82917
|
+
};
|
|
82918
|
+
};
|
|
82919
|
+
};
|
|
82920
|
+
/**
|
|
82921
|
+
* Save the appointment reminder ladder
|
|
82922
|
+
* @description Replaces the rungs. 400 `single_sender_not_confirmed` when `active` is requested without the declaration. Outside the 24 h WhatsApp window a rung needs an APPROVED template on the number (named variables: `nombre`, `fecha`, `hora`, `anfitrion`, `reunion`, `enlace`, `opcion_1`..`opcion_3`); with `email: "fallback"` a missing template falls back to email instead of staying silent.
|
|
82923
|
+
*/
|
|
82924
|
+
put: {
|
|
82925
|
+
parameters: {
|
|
82926
|
+
query?: never;
|
|
82927
|
+
header?: never;
|
|
82928
|
+
path?: never;
|
|
82929
|
+
cookie?: never;
|
|
82930
|
+
};
|
|
82931
|
+
requestBody?: {
|
|
82932
|
+
content: {
|
|
82933
|
+
/**
|
|
82934
|
+
* @example {
|
|
82935
|
+
* "rungs": [
|
|
82936
|
+
* {
|
|
82937
|
+
* "key": "welcome",
|
|
82938
|
+
* "event": "booked",
|
|
82939
|
+
* "offset_hours": 0,
|
|
82940
|
+
* "channel": "whatsapp",
|
|
82941
|
+
* "email": "also",
|
|
82942
|
+
* "template_name": null,
|
|
82943
|
+
* "templates": {
|
|
82944
|
+
* "demo": "demo_confirmada_v1"
|
|
82945
|
+
* },
|
|
82946
|
+
* "asks_confirmation": false,
|
|
82947
|
+
* "include_reschedule_link": true
|
|
82948
|
+
* },
|
|
82949
|
+
* {
|
|
82950
|
+
* "key": "h24",
|
|
82951
|
+
* "offset_hours": 24,
|
|
82952
|
+
* "channel": "whatsapp",
|
|
82953
|
+
* "email": "fallback",
|
|
82954
|
+
* "template_name": "recordatorio_24h",
|
|
82955
|
+
* "asks_confirmation": true,
|
|
82956
|
+
* "include_reschedule_link": true
|
|
82957
|
+
* },
|
|
82958
|
+
* {
|
|
82959
|
+
* "key": "h2",
|
|
82960
|
+
* "offset_hours": 2,
|
|
82961
|
+
* "channel": "whatsapp",
|
|
82962
|
+
* "template_name": "recordatorio_2h",
|
|
82963
|
+
* "asks_confirmation": false,
|
|
82964
|
+
* "include_reschedule_link": false
|
|
82965
|
+
* },
|
|
82966
|
+
* {
|
|
82967
|
+
* "key": "no_show",
|
|
82968
|
+
* "event": "no_show",
|
|
82969
|
+
* "offset_hours": 0.17,
|
|
82970
|
+
* "channel": "whatsapp",
|
|
82971
|
+
* "email": "fallback",
|
|
82972
|
+
* "template_name": "reagendar",
|
|
82973
|
+
* "asks_confirmation": false,
|
|
82974
|
+
* "include_reschedule_link": true
|
|
82975
|
+
* }
|
|
82976
|
+
* ],
|
|
82977
|
+
* "active": true
|
|
82978
|
+
* }
|
|
82979
|
+
*/
|
|
82980
|
+
"application/json": {
|
|
82981
|
+
name?: string;
|
|
82982
|
+
rungs: {
|
|
82983
|
+
key: string;
|
|
82984
|
+
offset_hours: number;
|
|
82985
|
+
/** @enum {string} */
|
|
82986
|
+
event?: "before_start" | "booked" | "no_show";
|
|
82987
|
+
/** @enum {string} */
|
|
82988
|
+
email?: "never" | "fallback" | "also";
|
|
82989
|
+
templates?: {
|
|
82990
|
+
demo?: string;
|
|
82991
|
+
clinic?: string;
|
|
82992
|
+
visit?: string;
|
|
82993
|
+
generic?: string;
|
|
82994
|
+
};
|
|
82995
|
+
/**
|
|
82996
|
+
* @default whatsapp
|
|
82997
|
+
* @enum {string}
|
|
82998
|
+
*/
|
|
82999
|
+
channel?: "whatsapp" | "email";
|
|
83000
|
+
template_name?: string | null;
|
|
83001
|
+
/** @default false */
|
|
83002
|
+
asks_confirmation?: boolean;
|
|
83003
|
+
/** @default true */
|
|
83004
|
+
include_reschedule_link?: boolean;
|
|
83005
|
+
}[];
|
|
83006
|
+
active: boolean;
|
|
83007
|
+
vendor_sends_reminders?: boolean;
|
|
83008
|
+
/** Format: uuid */
|
|
83009
|
+
confirm_status_id?: string | null;
|
|
83010
|
+
create_contacts_from_patient_phone?: boolean;
|
|
83011
|
+
quiet_hours_enforced?: boolean;
|
|
83012
|
+
};
|
|
83013
|
+
};
|
|
83014
|
+
};
|
|
83015
|
+
responses: {
|
|
83016
|
+
/** @description Reminder plan */
|
|
83017
|
+
200: {
|
|
83018
|
+
headers: {
|
|
83019
|
+
[name: string]: unknown;
|
|
83020
|
+
};
|
|
83021
|
+
content: {
|
|
83022
|
+
/**
|
|
83023
|
+
* @example {
|
|
83024
|
+
* "data": {
|
|
83025
|
+
* "id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b10",
|
|
83026
|
+
* "name": "Recordatorios de cita",
|
|
83027
|
+
* "rungs": [
|
|
83028
|
+
* {
|
|
83029
|
+
* "key": "welcome",
|
|
83030
|
+
* "event": "booked",
|
|
83031
|
+
* "offset_hours": 0,
|
|
83032
|
+
* "channel": "whatsapp",
|
|
83033
|
+
* "email": "also",
|
|
83034
|
+
* "template_name": null,
|
|
83035
|
+
* "templates": {
|
|
83036
|
+
* "demo": "demo_confirmada_v1"
|
|
83037
|
+
* },
|
|
83038
|
+
* "asks_confirmation": false,
|
|
83039
|
+
* "include_reschedule_link": true
|
|
83040
|
+
* },
|
|
83041
|
+
* {
|
|
83042
|
+
* "key": "h24",
|
|
83043
|
+
* "offset_hours": 24,
|
|
83044
|
+
* "channel": "whatsapp",
|
|
83045
|
+
* "email": "fallback",
|
|
83046
|
+
* "template_name": "recordatorio_24h",
|
|
83047
|
+
* "asks_confirmation": true,
|
|
83048
|
+
* "include_reschedule_link": true
|
|
83049
|
+
* },
|
|
83050
|
+
* {
|
|
83051
|
+
* "key": "h2",
|
|
83052
|
+
* "offset_hours": 2,
|
|
83053
|
+
* "channel": "whatsapp",
|
|
83054
|
+
* "template_name": "recordatorio_2h",
|
|
83055
|
+
* "asks_confirmation": false,
|
|
83056
|
+
* "include_reschedule_link": false
|
|
83057
|
+
* },
|
|
83058
|
+
* {
|
|
83059
|
+
* "key": "no_show",
|
|
83060
|
+
* "event": "no_show",
|
|
83061
|
+
* "offset_hours": 0.17,
|
|
83062
|
+
* "channel": "whatsapp",
|
|
83063
|
+
* "email": "fallback",
|
|
83064
|
+
* "template_name": "reagendar",
|
|
83065
|
+
* "asks_confirmation": false,
|
|
83066
|
+
* "include_reschedule_link": true
|
|
83067
|
+
* }
|
|
83068
|
+
* ],
|
|
83069
|
+
* "active": true,
|
|
83070
|
+
* "single_sender_confirmed_at": "2026-10-11T12:00:00.000Z",
|
|
83071
|
+
* "single_sender_confirmed_by": null,
|
|
83072
|
+
* "vendor_sends_reminders": false,
|
|
83073
|
+
* "live": true,
|
|
83074
|
+
* "blocked_reason": null,
|
|
83075
|
+
* "defaults": [],
|
|
83076
|
+
* "updated_at": "2026-10-11T12:00:00.000Z",
|
|
83077
|
+
* "confirm_status_id": null,
|
|
83078
|
+
* "confirm_status": null,
|
|
83079
|
+
* "create_contacts_from_patient_phone": false
|
|
83080
|
+
* }
|
|
83081
|
+
* }
|
|
83082
|
+
*/
|
|
83083
|
+
"application/json": {
|
|
83084
|
+
data?: unknown;
|
|
83085
|
+
meta?: {
|
|
83086
|
+
[key: string]: unknown;
|
|
83087
|
+
};
|
|
83088
|
+
};
|
|
83089
|
+
};
|
|
83090
|
+
};
|
|
83091
|
+
/** @description Validation error */
|
|
83092
|
+
400: {
|
|
83093
|
+
headers: {
|
|
83094
|
+
[name: string]: unknown;
|
|
83095
|
+
};
|
|
83096
|
+
content: {
|
|
83097
|
+
"application/json": components["schemas"]["Error"];
|
|
83098
|
+
};
|
|
83099
|
+
};
|
|
83100
|
+
/** @description Unauthorized */
|
|
83101
|
+
401: {
|
|
83102
|
+
headers: {
|
|
83103
|
+
[name: string]: unknown;
|
|
83104
|
+
};
|
|
83105
|
+
content: {
|
|
83106
|
+
"application/json": components["schemas"]["Error"];
|
|
83107
|
+
};
|
|
83108
|
+
};
|
|
83109
|
+
/** @description Forbidden */
|
|
83110
|
+
403: {
|
|
83111
|
+
headers: {
|
|
83112
|
+
[name: string]: unknown;
|
|
83113
|
+
};
|
|
83114
|
+
content: {
|
|
83115
|
+
"application/json": components["schemas"]["Error"];
|
|
83116
|
+
};
|
|
83117
|
+
};
|
|
83118
|
+
/** @description Not found */
|
|
83119
|
+
404: {
|
|
83120
|
+
headers: {
|
|
83121
|
+
[name: string]: unknown;
|
|
83122
|
+
};
|
|
83123
|
+
content: {
|
|
83124
|
+
"application/json": components["schemas"]["Error"];
|
|
83125
|
+
};
|
|
83126
|
+
};
|
|
83127
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
83128
|
+
409: {
|
|
83129
|
+
headers: {
|
|
83130
|
+
[name: string]: unknown;
|
|
83131
|
+
};
|
|
83132
|
+
content: {
|
|
83133
|
+
"application/json": components["schemas"]["Error"];
|
|
83134
|
+
};
|
|
83135
|
+
};
|
|
83136
|
+
/** @description Rate limited */
|
|
83137
|
+
429: {
|
|
83138
|
+
headers: {
|
|
83139
|
+
[name: string]: unknown;
|
|
83140
|
+
};
|
|
83141
|
+
content: {
|
|
83142
|
+
"application/json": components["schemas"]["Error"];
|
|
83143
|
+
};
|
|
83144
|
+
};
|
|
83145
|
+
};
|
|
83146
|
+
};
|
|
83147
|
+
post?: never;
|
|
83148
|
+
delete?: never;
|
|
83149
|
+
options?: never;
|
|
83150
|
+
head?: never;
|
|
83151
|
+
patch?: never;
|
|
83152
|
+
trace?: never;
|
|
83153
|
+
};
|
|
83154
|
+
"/appointments/reminders/plan/confirm-single-sender": {
|
|
83155
|
+
parameters: {
|
|
83156
|
+
query?: never;
|
|
83157
|
+
header?: never;
|
|
83158
|
+
path?: never;
|
|
83159
|
+
cookie?: never;
|
|
83160
|
+
};
|
|
83161
|
+
get?: never;
|
|
83162
|
+
put?: never;
|
|
83163
|
+
/**
|
|
83164
|
+
* Declare Vitrina the single sender of reminders
|
|
83165
|
+
* @description Records who declared that no other system reminds these people (the only thing that makes an active ladder legal). Reversible with POST /appointments/reminders/plan/revoke-single-sender.
|
|
83166
|
+
*/
|
|
83167
|
+
post: {
|
|
83168
|
+
parameters: {
|
|
83169
|
+
query?: never;
|
|
83170
|
+
header?: {
|
|
83171
|
+
/** @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. */
|
|
83172
|
+
"Idempotency-Key"?: string;
|
|
83173
|
+
};
|
|
83174
|
+
path?: never;
|
|
83175
|
+
cookie?: never;
|
|
83176
|
+
};
|
|
83177
|
+
requestBody?: never;
|
|
83178
|
+
responses: {
|
|
83179
|
+
/** @description Reminder plan */
|
|
83180
|
+
200: {
|
|
83181
|
+
headers: {
|
|
83182
|
+
[name: string]: unknown;
|
|
83183
|
+
};
|
|
83184
|
+
content: {
|
|
83185
|
+
/**
|
|
83186
|
+
* @example {
|
|
83187
|
+
* "data": {
|
|
83188
|
+
* "id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b10",
|
|
83189
|
+
* "name": "Recordatorios de cita",
|
|
83190
|
+
* "rungs": [
|
|
83191
|
+
* {
|
|
83192
|
+
* "key": "welcome",
|
|
83193
|
+
* "event": "booked",
|
|
83194
|
+
* "offset_hours": 0,
|
|
83195
|
+
* "channel": "whatsapp",
|
|
83196
|
+
* "email": "also",
|
|
83197
|
+
* "template_name": null,
|
|
83198
|
+
* "templates": {
|
|
83199
|
+
* "demo": "demo_confirmada_v1"
|
|
83200
|
+
* },
|
|
83201
|
+
* "asks_confirmation": false,
|
|
83202
|
+
* "include_reschedule_link": true
|
|
83203
|
+
* },
|
|
83204
|
+
* {
|
|
83205
|
+
* "key": "h24",
|
|
83206
|
+
* "offset_hours": 24,
|
|
83207
|
+
* "channel": "whatsapp",
|
|
83208
|
+
* "email": "fallback",
|
|
83209
|
+
* "template_name": "recordatorio_24h",
|
|
83210
|
+
* "asks_confirmation": true,
|
|
83211
|
+
* "include_reschedule_link": true
|
|
83212
|
+
* },
|
|
83213
|
+
* {
|
|
83214
|
+
* "key": "h2",
|
|
83215
|
+
* "offset_hours": 2,
|
|
83216
|
+
* "channel": "whatsapp",
|
|
83217
|
+
* "template_name": "recordatorio_2h",
|
|
83218
|
+
* "asks_confirmation": false,
|
|
83219
|
+
* "include_reschedule_link": false
|
|
83220
|
+
* },
|
|
83221
|
+
* {
|
|
83222
|
+
* "key": "no_show",
|
|
83223
|
+
* "event": "no_show",
|
|
83224
|
+
* "offset_hours": 0.17,
|
|
83225
|
+
* "channel": "whatsapp",
|
|
83226
|
+
* "email": "fallback",
|
|
83227
|
+
* "template_name": "reagendar",
|
|
83228
|
+
* "asks_confirmation": false,
|
|
83229
|
+
* "include_reschedule_link": true
|
|
83230
|
+
* }
|
|
83231
|
+
* ],
|
|
83232
|
+
* "active": true,
|
|
83233
|
+
* "single_sender_confirmed_at": "2026-10-11T12:00:00.000Z",
|
|
83234
|
+
* "single_sender_confirmed_by": null,
|
|
83235
|
+
* "vendor_sends_reminders": false,
|
|
83236
|
+
* "live": true,
|
|
83237
|
+
* "blocked_reason": null,
|
|
83238
|
+
* "defaults": [],
|
|
83239
|
+
* "updated_at": "2026-10-11T12:00:00.000Z",
|
|
83240
|
+
* "confirm_status_id": null,
|
|
83241
|
+
* "confirm_status": null,
|
|
83242
|
+
* "create_contacts_from_patient_phone": false
|
|
83243
|
+
* }
|
|
83244
|
+
* }
|
|
83245
|
+
*/
|
|
83246
|
+
"application/json": {
|
|
83247
|
+
data?: unknown;
|
|
83248
|
+
meta?: {
|
|
83249
|
+
[key: string]: unknown;
|
|
83250
|
+
};
|
|
83251
|
+
};
|
|
83252
|
+
};
|
|
83253
|
+
};
|
|
83254
|
+
/** @description Validation error */
|
|
83255
|
+
400: {
|
|
83256
|
+
headers: {
|
|
83257
|
+
[name: string]: unknown;
|
|
83258
|
+
};
|
|
83259
|
+
content: {
|
|
83260
|
+
"application/json": components["schemas"]["Error"];
|
|
83261
|
+
};
|
|
83262
|
+
};
|
|
83263
|
+
/** @description Unauthorized */
|
|
83264
|
+
401: {
|
|
83265
|
+
headers: {
|
|
83266
|
+
[name: string]: unknown;
|
|
83267
|
+
};
|
|
83268
|
+
content: {
|
|
83269
|
+
"application/json": components["schemas"]["Error"];
|
|
83270
|
+
};
|
|
83271
|
+
};
|
|
83272
|
+
/** @description Forbidden */
|
|
83273
|
+
403: {
|
|
83274
|
+
headers: {
|
|
83275
|
+
[name: string]: unknown;
|
|
83276
|
+
};
|
|
83277
|
+
content: {
|
|
83278
|
+
"application/json": components["schemas"]["Error"];
|
|
83279
|
+
};
|
|
83280
|
+
};
|
|
83281
|
+
/** @description Not found */
|
|
83282
|
+
404: {
|
|
83283
|
+
headers: {
|
|
83284
|
+
[name: string]: unknown;
|
|
83285
|
+
};
|
|
83286
|
+
content: {
|
|
83287
|
+
"application/json": components["schemas"]["Error"];
|
|
83288
|
+
};
|
|
83289
|
+
};
|
|
83290
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
83291
|
+
409: {
|
|
83292
|
+
headers: {
|
|
83293
|
+
[name: string]: unknown;
|
|
83294
|
+
};
|
|
83295
|
+
content: {
|
|
83296
|
+
"application/json": components["schemas"]["Error"];
|
|
83297
|
+
};
|
|
83298
|
+
};
|
|
83299
|
+
/** @description Rate limited */
|
|
83300
|
+
429: {
|
|
83301
|
+
headers: {
|
|
83302
|
+
[name: string]: unknown;
|
|
83303
|
+
};
|
|
83304
|
+
content: {
|
|
83305
|
+
"application/json": components["schemas"]["Error"];
|
|
83306
|
+
};
|
|
83307
|
+
};
|
|
83308
|
+
};
|
|
83309
|
+
};
|
|
83310
|
+
delete?: never;
|
|
83311
|
+
options?: never;
|
|
83312
|
+
head?: never;
|
|
83313
|
+
patch?: never;
|
|
83314
|
+
trace?: never;
|
|
83315
|
+
};
|
|
83316
|
+
"/appointments/reminders/plan/revoke-single-sender": {
|
|
83317
|
+
parameters: {
|
|
83318
|
+
query?: never;
|
|
83319
|
+
header?: never;
|
|
83320
|
+
path?: never;
|
|
83321
|
+
cookie?: never;
|
|
83322
|
+
};
|
|
83323
|
+
get?: never;
|
|
83324
|
+
put?: never;
|
|
83325
|
+
/**
|
|
83326
|
+
* Stop sending reminders
|
|
83327
|
+
* @description Clears the declaration and deactivates the ladder in the same write.
|
|
83328
|
+
*/
|
|
83329
|
+
post: {
|
|
83330
|
+
parameters: {
|
|
83331
|
+
query?: never;
|
|
83332
|
+
header?: {
|
|
83333
|
+
/** @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. */
|
|
83334
|
+
"Idempotency-Key"?: string;
|
|
83335
|
+
};
|
|
83336
|
+
path?: never;
|
|
83337
|
+
cookie?: never;
|
|
83338
|
+
};
|
|
83339
|
+
requestBody?: never;
|
|
83340
|
+
responses: {
|
|
83341
|
+
/** @description Reminder plan */
|
|
83342
|
+
200: {
|
|
83343
|
+
headers: {
|
|
83344
|
+
[name: string]: unknown;
|
|
83345
|
+
};
|
|
83346
|
+
content: {
|
|
83347
|
+
/**
|
|
83348
|
+
* @example {
|
|
83349
|
+
* "data": {
|
|
83350
|
+
* "id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b10",
|
|
83351
|
+
* "name": "Recordatorios de cita",
|
|
83352
|
+
* "rungs": [
|
|
83353
|
+
* {
|
|
83354
|
+
* "key": "welcome",
|
|
83355
|
+
* "event": "booked",
|
|
83356
|
+
* "offset_hours": 0,
|
|
83357
|
+
* "channel": "whatsapp",
|
|
83358
|
+
* "email": "also",
|
|
83359
|
+
* "template_name": null,
|
|
83360
|
+
* "templates": {
|
|
83361
|
+
* "demo": "demo_confirmada_v1"
|
|
83362
|
+
* },
|
|
83363
|
+
* "asks_confirmation": false,
|
|
83364
|
+
* "include_reschedule_link": true
|
|
83365
|
+
* },
|
|
83366
|
+
* {
|
|
83367
|
+
* "key": "h24",
|
|
83368
|
+
* "offset_hours": 24,
|
|
83369
|
+
* "channel": "whatsapp",
|
|
83370
|
+
* "email": "fallback",
|
|
83371
|
+
* "template_name": "recordatorio_24h",
|
|
83372
|
+
* "asks_confirmation": true,
|
|
83373
|
+
* "include_reschedule_link": true
|
|
83374
|
+
* },
|
|
83375
|
+
* {
|
|
83376
|
+
* "key": "h2",
|
|
83377
|
+
* "offset_hours": 2,
|
|
83378
|
+
* "channel": "whatsapp",
|
|
83379
|
+
* "template_name": "recordatorio_2h",
|
|
83380
|
+
* "asks_confirmation": false,
|
|
83381
|
+
* "include_reschedule_link": false
|
|
83382
|
+
* },
|
|
83383
|
+
* {
|
|
83384
|
+
* "key": "no_show",
|
|
83385
|
+
* "event": "no_show",
|
|
83386
|
+
* "offset_hours": 0.17,
|
|
83387
|
+
* "channel": "whatsapp",
|
|
83388
|
+
* "email": "fallback",
|
|
83389
|
+
* "template_name": "reagendar",
|
|
83390
|
+
* "asks_confirmation": false,
|
|
83391
|
+
* "include_reschedule_link": true
|
|
83392
|
+
* }
|
|
83393
|
+
* ],
|
|
83394
|
+
* "active": true,
|
|
83395
|
+
* "single_sender_confirmed_at": "2026-10-11T12:00:00.000Z",
|
|
83396
|
+
* "single_sender_confirmed_by": null,
|
|
83397
|
+
* "vendor_sends_reminders": false,
|
|
83398
|
+
* "live": true,
|
|
83399
|
+
* "blocked_reason": null,
|
|
83400
|
+
* "defaults": [],
|
|
83401
|
+
* "updated_at": "2026-10-11T12:00:00.000Z",
|
|
83402
|
+
* "confirm_status_id": null,
|
|
83403
|
+
* "confirm_status": null,
|
|
83404
|
+
* "create_contacts_from_patient_phone": false
|
|
83405
|
+
* }
|
|
83406
|
+
* }
|
|
83407
|
+
*/
|
|
83408
|
+
"application/json": {
|
|
83409
|
+
data?: unknown;
|
|
83410
|
+
meta?: {
|
|
83411
|
+
[key: string]: unknown;
|
|
83412
|
+
};
|
|
83413
|
+
};
|
|
83414
|
+
};
|
|
83415
|
+
};
|
|
83416
|
+
/** @description Validation error */
|
|
83417
|
+
400: {
|
|
83418
|
+
headers: {
|
|
83419
|
+
[name: string]: unknown;
|
|
83420
|
+
};
|
|
83421
|
+
content: {
|
|
83422
|
+
"application/json": components["schemas"]["Error"];
|
|
83423
|
+
};
|
|
83424
|
+
};
|
|
83425
|
+
/** @description Unauthorized */
|
|
83426
|
+
401: {
|
|
83427
|
+
headers: {
|
|
83428
|
+
[name: string]: unknown;
|
|
83429
|
+
};
|
|
83430
|
+
content: {
|
|
83431
|
+
"application/json": components["schemas"]["Error"];
|
|
83432
|
+
};
|
|
83433
|
+
};
|
|
83434
|
+
/** @description Forbidden */
|
|
83435
|
+
403: {
|
|
83436
|
+
headers: {
|
|
83437
|
+
[name: string]: unknown;
|
|
83438
|
+
};
|
|
83439
|
+
content: {
|
|
83440
|
+
"application/json": components["schemas"]["Error"];
|
|
83441
|
+
};
|
|
83442
|
+
};
|
|
83443
|
+
/** @description Not found */
|
|
83444
|
+
404: {
|
|
83445
|
+
headers: {
|
|
83446
|
+
[name: string]: unknown;
|
|
83447
|
+
};
|
|
83448
|
+
content: {
|
|
83449
|
+
"application/json": components["schemas"]["Error"];
|
|
83450
|
+
};
|
|
83451
|
+
};
|
|
83452
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
83453
|
+
409: {
|
|
83454
|
+
headers: {
|
|
83455
|
+
[name: string]: unknown;
|
|
83456
|
+
};
|
|
83457
|
+
content: {
|
|
83458
|
+
"application/json": components["schemas"]["Error"];
|
|
83459
|
+
};
|
|
83460
|
+
};
|
|
83461
|
+
/** @description Rate limited */
|
|
83462
|
+
429: {
|
|
83463
|
+
headers: {
|
|
83464
|
+
[name: string]: unknown;
|
|
83465
|
+
};
|
|
83466
|
+
content: {
|
|
83467
|
+
"application/json": components["schemas"]["Error"];
|
|
83468
|
+
};
|
|
83469
|
+
};
|
|
83470
|
+
};
|
|
83471
|
+
};
|
|
83472
|
+
delete?: never;
|
|
83473
|
+
options?: never;
|
|
83474
|
+
head?: never;
|
|
83475
|
+
patch?: never;
|
|
83476
|
+
trace?: never;
|
|
83477
|
+
};
|
|
83478
|
+
"/appointments/reminders": {
|
|
82397
83479
|
parameters: {
|
|
82398
83480
|
query?: never;
|
|
82399
83481
|
header?: never;
|
|
82400
83482
|
path?: never;
|
|
82401
83483
|
cookie?: never;
|
|
82402
83484
|
};
|
|
82403
|
-
get?: never;
|
|
82404
|
-
put?: never;
|
|
82405
83485
|
/**
|
|
82406
|
-
*
|
|
82407
|
-
* @description
|
|
82408
|
-
*
|
|
82409
|
-
* **Two scopes: `appointments:delete` AND `messages:send`.** The first is the split that lets a workspace grant "may book and reschedule" without granting "may un-book" (`appointments:write` reaches neither). The second is because a MESSAGE LEAVES VITRINA here, which is what every sending operation costs (ADR 0106 §3.2) — a credential that may cancel but holds no authority to write to anybody gets a 403.
|
|
82410
|
-
*
|
|
82411
|
-
* **It messages the customer.** The workspace is the one calling this off, so the cancellation notice goes out on the appointment’s originating conversation, in the workspace language and timezone. That send is best-effort and stamped for idempotency — it never fails the call and never goes out twice — and it is skipped entirely when the appointment has no conversation behind it. It is a transactional confirmation Vitrina composes about a booking the person made, not a send this caller authors, so it does not go through the política de envíos verdicts: a Bloqueo there would leave somebody turning up to a cancelled appointment.
|
|
82412
|
-
*
|
|
82413
|
-
* **`reason` is not stored, but it IS shown**: the text is appended to that customer notice, and nowhere else. Nothing persists it on the appointment, so put the internal explanation in a note on the lead or conversation if it needs to survive — and write `reason` as something the customer may read.
|
|
82414
|
-
*
|
|
82415
|
-
* An appointment imported FROM Google is not deleted upstream — the calendar owns those, so the cancellation is local and the event stays on the customer’s calendar.
|
|
83486
|
+
* List sent appointment reminders
|
|
83487
|
+
* @description The send ledger: one row per appointment per rung (and per email twin, keyed `<rung>_email`) with the outcome, the reason when skipped, the manage link that went out and the person's confirm/cancel reply.
|
|
82416
83488
|
*/
|
|
82417
|
-
|
|
83489
|
+
get: {
|
|
82418
83490
|
parameters: {
|
|
82419
|
-
query?:
|
|
82420
|
-
|
|
82421
|
-
|
|
82422
|
-
"Idempotency-Key"?: string;
|
|
82423
|
-
};
|
|
82424
|
-
path: {
|
|
82425
|
-
id: string;
|
|
83491
|
+
query?: {
|
|
83492
|
+
limit?: number;
|
|
83493
|
+
offset?: number | null;
|
|
82426
83494
|
};
|
|
83495
|
+
header?: never;
|
|
83496
|
+
path?: never;
|
|
82427
83497
|
cookie?: never;
|
|
82428
83498
|
};
|
|
82429
|
-
requestBody?:
|
|
82430
|
-
content: {
|
|
82431
|
-
/**
|
|
82432
|
-
* @example {
|
|
82433
|
-
* "reason": "Reprogramamos por disponibilidad del equipo."
|
|
82434
|
-
* }
|
|
82435
|
-
*/
|
|
82436
|
-
"application/json": {
|
|
82437
|
-
reason?: string;
|
|
82438
|
-
};
|
|
82439
|
-
};
|
|
82440
|
-
};
|
|
83499
|
+
requestBody?: never;
|
|
82441
83500
|
responses: {
|
|
82442
|
-
/** @description
|
|
83501
|
+
/** @description Appointment reminders */
|
|
82443
83502
|
200: {
|
|
82444
83503
|
headers: {
|
|
82445
83504
|
[name: string]: unknown;
|
|
@@ -82448,49 +83507,29 @@ interface paths {
|
|
|
82448
83507
|
/**
|
|
82449
83508
|
* @example {
|
|
82450
83509
|
* "data": {
|
|
82451
|
-
* "
|
|
82452
|
-
*
|
|
82453
|
-
*
|
|
82454
|
-
*
|
|
82455
|
-
*
|
|
82456
|
-
*
|
|
82457
|
-
*
|
|
82458
|
-
*
|
|
82459
|
-
*
|
|
82460
|
-
*
|
|
82461
|
-
*
|
|
82462
|
-
*
|
|
82463
|
-
*
|
|
82464
|
-
*
|
|
82465
|
-
*
|
|
82466
|
-
*
|
|
82467
|
-
*
|
|
82468
|
-
*
|
|
82469
|
-
*
|
|
82470
|
-
*
|
|
82471
|
-
*
|
|
82472
|
-
*
|
|
82473
|
-
*
|
|
82474
|
-
* "series_index": null,
|
|
82475
|
-
* "booking_landing_id": null,
|
|
82476
|
-
* "attribution": null,
|
|
82477
|
-
* "starts_at": "2026-10-01T14:00:00.000Z",
|
|
82478
|
-
* "ends_at": "2026-10-01T14:45:00.000Z",
|
|
82479
|
-
* "hold_expires_at": null,
|
|
82480
|
-
* "google_event_id": null,
|
|
82481
|
-
* "google_ical_uid": null,
|
|
82482
|
-
* "google_updated_at": null,
|
|
82483
|
-
* "google_etag": null,
|
|
82484
|
-
* "reminder_at": "2026-10-01T12:00:00.000Z",
|
|
82485
|
-
* "reminder_sent_at": null,
|
|
82486
|
-
* "reminder_job_id": "appt-reminder-dddddddd-0000-4000-8000-000000000001",
|
|
82487
|
-
* "customer_name": "Camila R.",
|
|
82488
|
-
* "notes": "Primera visita.",
|
|
82489
|
-
* "metadata": {},
|
|
82490
|
-
* "display_seq": 3,
|
|
82491
|
-
* "display_id": "A-3",
|
|
82492
|
-
* "created_at": "2026-09-22T12:50:37.046Z",
|
|
82493
|
-
* "updated_at": "2026-09-22T12:50:37.080Z"
|
|
83510
|
+
* "items": [
|
|
83511
|
+
* {
|
|
83512
|
+
* "id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b11",
|
|
83513
|
+
* "appointment_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b12",
|
|
83514
|
+
* "rung_key": "welcome",
|
|
83515
|
+
* "offset_minutes": 0,
|
|
83516
|
+
* "channel": "whatsapp",
|
|
83517
|
+
* "asks_confirmation": false,
|
|
83518
|
+
* "template_name": "demo_confirmada_v1",
|
|
83519
|
+
* "status": "sent",
|
|
83520
|
+
* "reason_code": null,
|
|
83521
|
+
* "detail": null,
|
|
83522
|
+
* "conversation_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b13",
|
|
83523
|
+
* "sent_at": "2026-10-11T12:01:00.000Z",
|
|
83524
|
+
* "manage_url": null,
|
|
83525
|
+
* "reply_kind": null,
|
|
83526
|
+
* "reply_text": null,
|
|
83527
|
+
* "replied_at": null,
|
|
83528
|
+
* "applied_status_id": null,
|
|
83529
|
+
* "apply_error": null,
|
|
83530
|
+
* "created_at": "2026-10-11T12:01:00.000Z"
|
|
83531
|
+
* }
|
|
83532
|
+
* ]
|
|
82494
83533
|
* }
|
|
82495
83534
|
* }
|
|
82496
83535
|
*/
|
|
@@ -82558,6 +83597,8 @@ interface paths {
|
|
|
82558
83597
|
};
|
|
82559
83598
|
};
|
|
82560
83599
|
};
|
|
83600
|
+
put?: never;
|
|
83601
|
+
post?: never;
|
|
82561
83602
|
delete?: never;
|
|
82562
83603
|
options?: never;
|
|
82563
83604
|
head?: never;
|
|
@@ -100583,7 +101624,7 @@ interface paths {
|
|
|
100583
101624
|
};
|
|
100584
101625
|
/**
|
|
100585
101626
|
* Ingresos: producción, presupuestado and recaudación by day
|
|
100586
|
-
* @description «Ingresos» (D56) for a Dentalink / Medilink clinic (revenue mirror on; otherwise `state: unavailable`). Per day: producción (performed plan lines by fecha de realización), presupuestado (plans issued, header total, evaluación included, as the vendor's panel) and recaudación (live payments by fecha de recepción), each split `nuevos` (the patient's primera visita starts in that month) vs `tratamiento`. `hoy` carries today's three numbers whatever the window. `by_professional`: producción by PERFORMER; presupuestos, aceptación and monto aceptado by the QUOTING professional under Números comerciales' acceptance rule ($0 and evaluación-only presupuestos out); abonado = paid so far on the plans issued in the period; new patients presented / accepted. Default window: the current month to today. With `professional_id` recaudación is `null` (a payment names no professional). Requires `clinic_money:read
|
|
101627
|
+
* @description «Ingresos» (D56) for a Dentalink / Medilink clinic (revenue mirror on; otherwise `state: unavailable`). Per day: producción (performed plan lines by fecha de realización), presupuestado (plans issued, header total, evaluación included, as the vendor's panel) and recaudación (live payments by fecha de recepción), each split `nuevos` (the patient's primera visita starts in that month) vs `tratamiento`. `hoy` carries today's three numbers whatever the window. `by_professional`: producción by PERFORMER; presupuestos, aceptación and monto aceptado by the QUOTING professional under Números comerciales' acceptance rule ($0 and evaluación-only presupuestos out); abonado = paid so far on the plans issued in the period; new patients presented / accepted. Default window: the current month to today. With `professional_id` recaudación is `null` (a payment names no professional). Every day and the totals also carry `by_origen` (D77): the three flows split Meta / Orgánico / Sin dato by the shared person-origin resolver; `origin` narrows the whole report to one Origen. Requires `clinic_money:read`, or `clinic_insights:read` (the Consultor seat, D76: the payload is aggregates only). Accepts `from` / `to` (bare `YYYY-MM-DD`, `to` INCLUSIVE), `location_id` and `professional_id`. The default window is the 90 days ending today in the clinic's own zone. A `professional_id` that is not yours is a 404, never an empty report. Also reachable with `clinic_insights:read` — the aggregates-only «Consultor» role (spec #2441 D11) — in addition to the scope named above. A caller WITHOUT the report’s own scope never receives a patient-identifiable row (`inasistencias.citas` and `packs.expiring` come back empty with `aggregate_only: true` and `rows_withheld` naming the field) and reads the minimum-count floor: always the last 3 closed calendar months with no professional or sucursal filter, whatever was asked (`suppression.filters_ignored`); a count or CLP resting on 1–4 cases is `null`; a rate over fewer than 5 cases, or whose numerator is withheld, is `null`; list rows that add up to a shown total get complementary suppression and leave the list (`suppression.withheld_rows`); per-professional/prestación/weekday outcome rows and per-channel confirmation rows carry rates only; producción serves no per-prestación rows (they nest inside the categorías); clinic-wide cash over whole months stays while its slices are floored. `suppression.min_count` is the floor.
|
|
100587
101628
|
*
|
|
100588
101629
|
* **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`.
|
|
100589
101630
|
*/
|
|
@@ -100598,6 +101639,8 @@ interface paths {
|
|
|
100598
101639
|
location_id?: string;
|
|
100599
101640
|
/** @description One profesional. A foreign id is a 404, never an empty report. */
|
|
100600
101641
|
professional_id?: string;
|
|
101642
|
+
/** @description Narrow every figure to the people of one Origen: `meta` (came from a Meta ad), `organic` (a linked contact with no ad touch) or `unknown` («Sin dato»: no contact is linked). Same resolver as the agenda's Origen filter. */
|
|
101643
|
+
origin?: "meta" | "organic" | "unknown";
|
|
100601
101644
|
};
|
|
100602
101645
|
header?: never;
|
|
100603
101646
|
path?: never;
|
|
@@ -100620,6 +101663,7 @@ interface paths {
|
|
|
100620
101663
|
* "timezone": "America/Santiago",
|
|
100621
101664
|
* "location_id": null,
|
|
100622
101665
|
* "professional_id": null,
|
|
101666
|
+
* "origin": null,
|
|
100623
101667
|
* "state": "ready",
|
|
100624
101668
|
* "state_reason": null,
|
|
100625
101669
|
* "source": {
|
|
@@ -100661,6 +101705,23 @@ interface paths {
|
|
|
100661
101705
|
* "nuevos_clp": 811084,
|
|
100662
101706
|
* "tratamiento_clp": 2496908,
|
|
100663
101707
|
* "pagos": 21
|
|
101708
|
+
* },
|
|
101709
|
+
* "by_origen": {
|
|
101710
|
+
* "meta": {
|
|
101711
|
+
* "produccion_clp": 1204000,
|
|
101712
|
+
* "presupuestado_clp": 1830000,
|
|
101713
|
+
* "recaudado_clp": 1020000
|
|
101714
|
+
* },
|
|
101715
|
+
* "organic": {
|
|
101716
|
+
* "produccion_clp": 2210982,
|
|
101717
|
+
* "presupuestado_clp": 2301028,
|
|
101718
|
+
* "recaudado_clp": 1987992
|
|
101719
|
+
* },
|
|
101720
|
+
* "unknown": {
|
|
101721
|
+
* "produccion_clp": 256000,
|
|
101722
|
+
* "presupuestado_clp": 250000,
|
|
101723
|
+
* "recaudado_clp": 300000
|
|
101724
|
+
* }
|
|
100664
101725
|
* }
|
|
100665
101726
|
* },
|
|
100666
101727
|
* "days": [
|
|
@@ -100683,6 +101744,23 @@ interface paths {
|
|
|
100683
101744
|
* "nuevos_clp": 811084,
|
|
100684
101745
|
* "tratamiento_clp": 2496908,
|
|
100685
101746
|
* "pagos": 21
|
|
101747
|
+
* },
|
|
101748
|
+
* "by_origen": {
|
|
101749
|
+
* "meta": {
|
|
101750
|
+
* "produccion_clp": 1204000,
|
|
101751
|
+
* "presupuestado_clp": 1830000,
|
|
101752
|
+
* "recaudado_clp": 1020000
|
|
101753
|
+
* },
|
|
101754
|
+
* "organic": {
|
|
101755
|
+
* "produccion_clp": 2210982,
|
|
101756
|
+
* "presupuestado_clp": 2301028,
|
|
101757
|
+
* "recaudado_clp": 1987992
|
|
101758
|
+
* },
|
|
101759
|
+
* "unknown": {
|
|
101760
|
+
* "produccion_clp": 256000,
|
|
101761
|
+
* "presupuestado_clp": 250000,
|
|
101762
|
+
* "recaudado_clp": 300000
|
|
101763
|
+
* }
|
|
100686
101764
|
* }
|
|
100687
101765
|
* }
|
|
100688
101766
|
* ],
|
|
@@ -100795,7 +101873,7 @@ interface paths {
|
|
|
100795
101873
|
};
|
|
100796
101874
|
/**
|
|
100797
101875
|
* Ingresos: doctor × month comparison
|
|
100798
|
-
* @description The last `months` calendar months (default 6, at most 12, the current one to today): per month the clinic's producción, recaudación, presupuestos, aceptación and monto aceptado; per doctor the same by month (producción by performer, the rest by the quoting professional over the presupuestos issued that month). Requires `clinic_money:read
|
|
101876
|
+
* @description The last `months` calendar months (default 6, at most 12, the current one to today): per month the clinic's producción, recaudación, presupuestos, aceptación and monto aceptado; per doctor the same by month (producción by performer, the rest by the quoting professional over the presupuestos issued that month). Requires `clinic_money:read` or `clinic_insights:read` (aggregates only).
|
|
100799
101877
|
*
|
|
100800
101878
|
* **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`.
|
|
100801
101879
|
*/
|
|
@@ -100940,7 +102018,7 @@ interface paths {
|
|
|
100940
102018
|
};
|
|
100941
102019
|
/**
|
|
100942
102020
|
* Ingresos: one day opened (its plans, payments and producción)
|
|
100943
|
-
* @description The plans issued and payments received on one clinic day, each marked `nuevo` / `tratamiento`, plans with the Números comerciales verdict, plus producción per performer. Patient names only for a caller allowed to see identity (`contacts:read` + `clinic:read`, plus `clinic_patients:read` for an API credential); otherwise `patient.name` is `null`. Requires `clinic_money:read
|
|
102021
|
+
* @description The plans issued and payments received on one clinic day, each marked `nuevo` / `tratamiento`, plans with the Números comerciales verdict, plus producción per performer. Patient names only for a caller allowed to see identity (`contacts:read` + `clinic:read`, plus `clinic_patients:read` for an API credential); otherwise `patient.name` is `null`. Each row carries the Origen of its patient (`origen`). Requires `clinic_money:read`, or `clinic_insights:read`, which never gets a patient reference (`patient.id` and `patient.name` are `null`).
|
|
100944
102022
|
*
|
|
100945
102023
|
* **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`.
|
|
100946
102024
|
*/
|
|
@@ -100979,6 +102057,7 @@ interface paths {
|
|
|
100979
102057
|
* "abonado_clp": 120000,
|
|
100980
102058
|
* "deuda_clp": 520000,
|
|
100981
102059
|
* "tipo": "nuevo",
|
|
102060
|
+
* "origen": "meta",
|
|
100982
102061
|
* "aceptado": true
|
|
100983
102062
|
* }
|
|
100984
102063
|
* ],
|
|
@@ -100991,7 +102070,8 @@ interface paths {
|
|
|
100991
102070
|
* "name": "Paciente de ejemplo"
|
|
100992
102071
|
* },
|
|
100993
102072
|
* "amount_clp": 120000,
|
|
100994
|
-
* "tipo": "nuevo"
|
|
102073
|
+
* "tipo": "nuevo",
|
|
102074
|
+
* "origen": "meta"
|
|
100995
102075
|
* }
|
|
100996
102076
|
* ],
|
|
100997
102077
|
* "produccion": [
|
|
@@ -101789,7 +102869,7 @@ interface paths {
|
|
|
101789
102869
|
};
|
|
101790
102870
|
/**
|
|
101791
102871
|
* The month's Meta mensual and its progress
|
|
101792
|
-
* @description Requires `clinic_money:read
|
|
102872
|
+
* @description Requires `clinic_money:read` or `clinic_insights:read` (the Consultor seat: the payload is aggregates only, D76). The owner's four targets for the month (primeras visitas booked, cierres, cobrado = recaudación in CLP, producción in CLP; `null` = not set) with what has been achieved so far: primeras visitas = citas created in the month whose Tipo de agendamiento is Nuevo or Nuevo · reagenda; cierres as Números comerciales counts them; cobrado = payments received; producción = performed plan lines by fecha de realización, as «Ingresos» (`null` without the revenue mirror). For the current month, `pace` carries the ritmo diario and, per figure, `week_need` («esta semana hay que generar») and `projection` (the end-of-month projection at the current pace: `gap` = projected − target). The ritmo diario is a catch-up pace: (meta − achieved before today) ÷ working days left, today included, each day weighed by its opening hours against the clinic's longest day (a 9–14 Saturday next to 9–19 weekdays weighs 0.5), times today's weight (`per_day`). Working days come from the clinic's opening hours and holidays, in the clinic's timezone. A figure with no target has a count and no pace. This is not the Ads goal, which is marketing's own.
|
|
101793
102873
|
*
|
|
101794
102874
|
* **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`.
|
|
101795
102875
|
*/
|
|
@@ -101820,13 +102900,15 @@ interface paths {
|
|
|
101820
102900
|
* "primeras_visitas": 40,
|
|
101821
102901
|
* "cierres": 12,
|
|
101822
102902
|
* "cobrado_clp": 18000000,
|
|
102903
|
+
* "produccion_clp": 60000000,
|
|
101823
102904
|
* "updated_at": "2026-10-01T13:05:00.000Z",
|
|
101824
102905
|
* "updated_by": null
|
|
101825
102906
|
* },
|
|
101826
102907
|
* "achieved": {
|
|
101827
102908
|
* "primeras_visitas": 18,
|
|
101828
102909
|
* "cierres": 5,
|
|
101829
|
-
* "cobrado_clp": 7450000
|
|
102910
|
+
* "cobrado_clp": 7450000,
|
|
102911
|
+
* "produccion_clp": 21300000
|
|
101830
102912
|
* },
|
|
101831
102913
|
* "working_days": {
|
|
101832
102914
|
* "total": 21,
|
|
@@ -101855,7 +102937,13 @@ interface paths {
|
|
|
101855
102937
|
* "working_days_left": 10,
|
|
101856
102938
|
* "weighted_days_left": 9.5,
|
|
101857
102939
|
* "day_weight": 1,
|
|
101858
|
-
* "per_day": 3
|
|
102940
|
+
* "per_day": 3,
|
|
102941
|
+
* "week_need": 12,
|
|
102942
|
+
* "projection": {
|
|
102943
|
+
* "projected": 36,
|
|
102944
|
+
* "gap": -4,
|
|
102945
|
+
* "meets_target": false
|
|
102946
|
+
* }
|
|
101859
102947
|
* },
|
|
101860
102948
|
* "cierres": null,
|
|
101861
102949
|
* "cobrado_clp": {
|
|
@@ -101866,7 +102954,29 @@ interface paths {
|
|
|
101866
102954
|
* "working_days_left": 10,
|
|
101867
102955
|
* "weighted_days_left": 9.5,
|
|
101868
102956
|
* "day_weight": 1,
|
|
101869
|
-
* "per_day": 1110527
|
|
102957
|
+
* "per_day": 1110527,
|
|
102958
|
+
* "week_need": 5550000,
|
|
102959
|
+
* "projection": {
|
|
102960
|
+
* "projected": 15900000,
|
|
102961
|
+
* "gap": -2100000,
|
|
102962
|
+
* "meets_target": false
|
|
102963
|
+
* }
|
|
102964
|
+
* },
|
|
102965
|
+
* "produccion_clp": {
|
|
102966
|
+
* "status": "open",
|
|
102967
|
+
* "target": 60000000,
|
|
102968
|
+
* "achieved_before_today": 21300000,
|
|
102969
|
+
* "remaining": 38700000,
|
|
102970
|
+
* "working_days_left": 10,
|
|
102971
|
+
* "weighted_days_left": 9.5,
|
|
102972
|
+
* "day_weight": 1,
|
|
102973
|
+
* "per_day": 3927000,
|
|
102974
|
+
* "week_need": 19600000,
|
|
102975
|
+
* "projection": {
|
|
102976
|
+
* "projected": 52400000,
|
|
102977
|
+
* "gap": -7600000,
|
|
102978
|
+
* "meets_target": false
|
|
102979
|
+
* }
|
|
101870
102980
|
* }
|
|
101871
102981
|
* }
|
|
101872
102982
|
* }
|
|
@@ -101881,6 +102991,7 @@ interface paths {
|
|
|
101881
102991
|
primeras_visitas: number | null;
|
|
101882
102992
|
cierres: number | null;
|
|
101883
102993
|
cobrado_clp: number | null;
|
|
102994
|
+
produccion_clp: number | null;
|
|
101884
102995
|
updated_at: string | null;
|
|
101885
102996
|
updated_by: string | null;
|
|
101886
102997
|
};
|
|
@@ -101888,6 +102999,8 @@ interface paths {
|
|
|
101888
102999
|
primeras_visitas: number;
|
|
101889
103000
|
cierres: number;
|
|
101890
103001
|
cobrado_clp: number;
|
|
103002
|
+
/** @description `null` without the revenue mirror. */
|
|
103003
|
+
produccion_clp: number | null;
|
|
101891
103004
|
};
|
|
101892
103005
|
working_days: {
|
|
101893
103006
|
total: number;
|
|
@@ -101910,6 +103023,14 @@ interface paths {
|
|
|
101910
103023
|
weighted_days_left: number;
|
|
101911
103024
|
day_weight: number;
|
|
101912
103025
|
per_day: number | null;
|
|
103026
|
+
/** @description «Esta semana hay que generar»: the share of the remaining target the rest of this week carries (today through Sunday or the month end), weighed by opening hours. `null` unless `open`. */
|
|
103027
|
+
week_need: number | null;
|
|
103028
|
+
/** @description End-of-month projection at the current pace (what was achieved before today per weighted working day gone, carried over the weighted days left). `gap` = projected − target; `null` while no working day has gone. */
|
|
103029
|
+
projection: {
|
|
103030
|
+
projected: number;
|
|
103031
|
+
gap: number;
|
|
103032
|
+
meets_target: boolean;
|
|
103033
|
+
} | null;
|
|
101913
103034
|
} | null;
|
|
101914
103035
|
cierres: {
|
|
101915
103036
|
/** @enum {string} */
|
|
@@ -101921,6 +103042,14 @@ interface paths {
|
|
|
101921
103042
|
weighted_days_left: number;
|
|
101922
103043
|
day_weight: number;
|
|
101923
103044
|
per_day: number | null;
|
|
103045
|
+
/** @description «Esta semana hay que generar»: the share of the remaining target the rest of this week carries (today through Sunday or the month end), weighed by opening hours. `null` unless `open`. */
|
|
103046
|
+
week_need: number | null;
|
|
103047
|
+
/** @description End-of-month projection at the current pace (what was achieved before today per weighted working day gone, carried over the weighted days left). `gap` = projected − target; `null` while no working day has gone. */
|
|
103048
|
+
projection: {
|
|
103049
|
+
projected: number;
|
|
103050
|
+
gap: number;
|
|
103051
|
+
meets_target: boolean;
|
|
103052
|
+
} | null;
|
|
101924
103053
|
} | null;
|
|
101925
103054
|
cobrado_clp: {
|
|
101926
103055
|
/** @enum {string} */
|
|
@@ -101932,6 +103061,33 @@ interface paths {
|
|
|
101932
103061
|
weighted_days_left: number;
|
|
101933
103062
|
day_weight: number;
|
|
101934
103063
|
per_day: number | null;
|
|
103064
|
+
/** @description «Esta semana hay que generar»: the share of the remaining target the rest of this week carries (today through Sunday or the month end), weighed by opening hours. `null` unless `open`. */
|
|
103065
|
+
week_need: number | null;
|
|
103066
|
+
/** @description End-of-month projection at the current pace (what was achieved before today per weighted working day gone, carried over the weighted days left). `gap` = projected − target; `null` while no working day has gone. */
|
|
103067
|
+
projection: {
|
|
103068
|
+
projected: number;
|
|
103069
|
+
gap: number;
|
|
103070
|
+
meets_target: boolean;
|
|
103071
|
+
} | null;
|
|
103072
|
+
} | null;
|
|
103073
|
+
produccion_clp: {
|
|
103074
|
+
/** @enum {string} */
|
|
103075
|
+
status: "open" | "met" | "missed";
|
|
103076
|
+
target: number;
|
|
103077
|
+
achieved_before_today: number;
|
|
103078
|
+
remaining: number;
|
|
103079
|
+
working_days_left: number;
|
|
103080
|
+
weighted_days_left: number;
|
|
103081
|
+
day_weight: number;
|
|
103082
|
+
per_day: number | null;
|
|
103083
|
+
/** @description «Esta semana hay que generar»: the share of the remaining target the rest of this week carries (today through Sunday or the month end), weighed by opening hours. `null` unless `open`. */
|
|
103084
|
+
week_need: number | null;
|
|
103085
|
+
/** @description End-of-month projection at the current pace (what was achieved before today per weighted working day gone, carried over the weighted days left). `gap` = projected − target; `null` while no working day has gone. */
|
|
103086
|
+
projection: {
|
|
103087
|
+
projected: number;
|
|
103088
|
+
gap: number;
|
|
103089
|
+
meets_target: boolean;
|
|
103090
|
+
} | null;
|
|
101935
103091
|
} | null;
|
|
101936
103092
|
} | null;
|
|
101937
103093
|
};
|
|
@@ -101996,7 +103152,7 @@ interface paths {
|
|
|
101996
103152
|
};
|
|
101997
103153
|
/**
|
|
101998
103154
|
* Set the month's Meta mensual
|
|
101999
|
-
* @description Requires `clinic_admin:write`. Replaces the month's targets: a figure left out or `null` is cleared. Answers with the same targets and progress as the GET.
|
|
103155
|
+
* @description Requires `clinic_admin:write`. Replaces the month's targets: a figure left out or `null` is cleared (except `produccion_clp`, which keeps its value when left out). Answers with the same targets and progress as the GET.
|
|
102000
103156
|
*
|
|
102001
103157
|
* **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`.
|
|
102002
103158
|
*/
|
|
@@ -102015,13 +103171,15 @@ interface paths {
|
|
|
102015
103171
|
* @example {
|
|
102016
103172
|
* "primeras_visitas": 40,
|
|
102017
103173
|
* "cierres": 12,
|
|
102018
|
-
* "cobrado_clp": 18000000
|
|
103174
|
+
* "cobrado_clp": 18000000,
|
|
103175
|
+
* "produccion_clp": 60000000
|
|
102019
103176
|
* }
|
|
102020
103177
|
*/
|
|
102021
103178
|
"application/json": {
|
|
102022
103179
|
primeras_visitas?: number | null;
|
|
102023
103180
|
cierres?: number | null;
|
|
102024
103181
|
cobrado_clp?: number | null;
|
|
103182
|
+
produccion_clp?: number | null;
|
|
102025
103183
|
};
|
|
102026
103184
|
};
|
|
102027
103185
|
};
|
|
@@ -102042,13 +103200,15 @@ interface paths {
|
|
|
102042
103200
|
* "primeras_visitas": 40,
|
|
102043
103201
|
* "cierres": 12,
|
|
102044
103202
|
* "cobrado_clp": 18000000,
|
|
103203
|
+
* "produccion_clp": 60000000,
|
|
102045
103204
|
* "updated_at": "2026-10-01T13:05:00.000Z",
|
|
102046
103205
|
* "updated_by": null
|
|
102047
103206
|
* },
|
|
102048
103207
|
* "achieved": {
|
|
102049
103208
|
* "primeras_visitas": 18,
|
|
102050
103209
|
* "cierres": 5,
|
|
102051
|
-
* "cobrado_clp": 7450000
|
|
103210
|
+
* "cobrado_clp": 7450000,
|
|
103211
|
+
* "produccion_clp": 21300000
|
|
102052
103212
|
* },
|
|
102053
103213
|
* "working_days": {
|
|
102054
103214
|
* "total": 21,
|
|
@@ -102077,7 +103237,13 @@ interface paths {
|
|
|
102077
103237
|
* "working_days_left": 10,
|
|
102078
103238
|
* "weighted_days_left": 9.5,
|
|
102079
103239
|
* "day_weight": 1,
|
|
102080
|
-
* "per_day": 3
|
|
103240
|
+
* "per_day": 3,
|
|
103241
|
+
* "week_need": 12,
|
|
103242
|
+
* "projection": {
|
|
103243
|
+
* "projected": 36,
|
|
103244
|
+
* "gap": -4,
|
|
103245
|
+
* "meets_target": false
|
|
103246
|
+
* }
|
|
102081
103247
|
* },
|
|
102082
103248
|
* "cierres": null,
|
|
102083
103249
|
* "cobrado_clp": {
|
|
@@ -102088,7 +103254,29 @@ interface paths {
|
|
|
102088
103254
|
* "working_days_left": 10,
|
|
102089
103255
|
* "weighted_days_left": 9.5,
|
|
102090
103256
|
* "day_weight": 1,
|
|
102091
|
-
* "per_day": 1110527
|
|
103257
|
+
* "per_day": 1110527,
|
|
103258
|
+
* "week_need": 5550000,
|
|
103259
|
+
* "projection": {
|
|
103260
|
+
* "projected": 15900000,
|
|
103261
|
+
* "gap": -2100000,
|
|
103262
|
+
* "meets_target": false
|
|
103263
|
+
* }
|
|
103264
|
+
* },
|
|
103265
|
+
* "produccion_clp": {
|
|
103266
|
+
* "status": "open",
|
|
103267
|
+
* "target": 60000000,
|
|
103268
|
+
* "achieved_before_today": 21300000,
|
|
103269
|
+
* "remaining": 38700000,
|
|
103270
|
+
* "working_days_left": 10,
|
|
103271
|
+
* "weighted_days_left": 9.5,
|
|
103272
|
+
* "day_weight": 1,
|
|
103273
|
+
* "per_day": 3927000,
|
|
103274
|
+
* "week_need": 19600000,
|
|
103275
|
+
* "projection": {
|
|
103276
|
+
* "projected": 52400000,
|
|
103277
|
+
* "gap": -7600000,
|
|
103278
|
+
* "meets_target": false
|
|
103279
|
+
* }
|
|
102092
103280
|
* }
|
|
102093
103281
|
* }
|
|
102094
103282
|
* }
|
|
@@ -102103,6 +103291,7 @@ interface paths {
|
|
|
102103
103291
|
primeras_visitas: number | null;
|
|
102104
103292
|
cierres: number | null;
|
|
102105
103293
|
cobrado_clp: number | null;
|
|
103294
|
+
produccion_clp: number | null;
|
|
102106
103295
|
updated_at: string | null;
|
|
102107
103296
|
updated_by: string | null;
|
|
102108
103297
|
};
|
|
@@ -102110,6 +103299,8 @@ interface paths {
|
|
|
102110
103299
|
primeras_visitas: number;
|
|
102111
103300
|
cierres: number;
|
|
102112
103301
|
cobrado_clp: number;
|
|
103302
|
+
/** @description `null` without the revenue mirror. */
|
|
103303
|
+
produccion_clp: number | null;
|
|
102113
103304
|
};
|
|
102114
103305
|
working_days: {
|
|
102115
103306
|
total: number;
|
|
@@ -102132,6 +103323,14 @@ interface paths {
|
|
|
102132
103323
|
weighted_days_left: number;
|
|
102133
103324
|
day_weight: number;
|
|
102134
103325
|
per_day: number | null;
|
|
103326
|
+
/** @description «Esta semana hay que generar»: the share of the remaining target the rest of this week carries (today through Sunday or the month end), weighed by opening hours. `null` unless `open`. */
|
|
103327
|
+
week_need: number | null;
|
|
103328
|
+
/** @description End-of-month projection at the current pace (what was achieved before today per weighted working day gone, carried over the weighted days left). `gap` = projected − target; `null` while no working day has gone. */
|
|
103329
|
+
projection: {
|
|
103330
|
+
projected: number;
|
|
103331
|
+
gap: number;
|
|
103332
|
+
meets_target: boolean;
|
|
103333
|
+
} | null;
|
|
102135
103334
|
} | null;
|
|
102136
103335
|
cierres: {
|
|
102137
103336
|
/** @enum {string} */
|
|
@@ -102143,6 +103342,14 @@ interface paths {
|
|
|
102143
103342
|
weighted_days_left: number;
|
|
102144
103343
|
day_weight: number;
|
|
102145
103344
|
per_day: number | null;
|
|
103345
|
+
/** @description «Esta semana hay que generar»: the share of the remaining target the rest of this week carries (today through Sunday or the month end), weighed by opening hours. `null` unless `open`. */
|
|
103346
|
+
week_need: number | null;
|
|
103347
|
+
/** @description End-of-month projection at the current pace (what was achieved before today per weighted working day gone, carried over the weighted days left). `gap` = projected − target; `null` while no working day has gone. */
|
|
103348
|
+
projection: {
|
|
103349
|
+
projected: number;
|
|
103350
|
+
gap: number;
|
|
103351
|
+
meets_target: boolean;
|
|
103352
|
+
} | null;
|
|
102146
103353
|
} | null;
|
|
102147
103354
|
cobrado_clp: {
|
|
102148
103355
|
/** @enum {string} */
|
|
@@ -102154,6 +103361,33 @@ interface paths {
|
|
|
102154
103361
|
weighted_days_left: number;
|
|
102155
103362
|
day_weight: number;
|
|
102156
103363
|
per_day: number | null;
|
|
103364
|
+
/** @description «Esta semana hay que generar»: the share of the remaining target the rest of this week carries (today through Sunday or the month end), weighed by opening hours. `null` unless `open`. */
|
|
103365
|
+
week_need: number | null;
|
|
103366
|
+
/** @description End-of-month projection at the current pace (what was achieved before today per weighted working day gone, carried over the weighted days left). `gap` = projected − target; `null` while no working day has gone. */
|
|
103367
|
+
projection: {
|
|
103368
|
+
projected: number;
|
|
103369
|
+
gap: number;
|
|
103370
|
+
meets_target: boolean;
|
|
103371
|
+
} | null;
|
|
103372
|
+
} | null;
|
|
103373
|
+
produccion_clp: {
|
|
103374
|
+
/** @enum {string} */
|
|
103375
|
+
status: "open" | "met" | "missed";
|
|
103376
|
+
target: number;
|
|
103377
|
+
achieved_before_today: number;
|
|
103378
|
+
remaining: number;
|
|
103379
|
+
working_days_left: number;
|
|
103380
|
+
weighted_days_left: number;
|
|
103381
|
+
day_weight: number;
|
|
103382
|
+
per_day: number | null;
|
|
103383
|
+
/** @description «Esta semana hay que generar»: the share of the remaining target the rest of this week carries (today through Sunday or the month end), weighed by opening hours. `null` unless `open`. */
|
|
103384
|
+
week_need: number | null;
|
|
103385
|
+
/** @description End-of-month projection at the current pace (what was achieved before today per weighted working day gone, carried over the weighted days left). `gap` = projected − target; `null` while no working day has gone. */
|
|
103386
|
+
projection: {
|
|
103387
|
+
projected: number;
|
|
103388
|
+
gap: number;
|
|
103389
|
+
meets_target: boolean;
|
|
103390
|
+
} | null;
|
|
102157
103391
|
} | null;
|
|
102158
103392
|
} | null;
|
|
102159
103393
|
};
|
|
@@ -105108,7 +106342,7 @@ interface paths {
|
|
|
105108
106342
|
parameters: {
|
|
105109
106343
|
query: {
|
|
105110
106344
|
/** @description The outcome stage to preview. One the workspace sends (a stage outside its vertical → 404). */
|
|
105111
|
-
stage: "lead_created" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
106345
|
+
stage: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
105112
106346
|
/** @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. */
|
|
105113
106347
|
sample?: "1" | "true";
|
|
105114
106348
|
};
|
|
@@ -105340,7 +106574,7 @@ interface paths {
|
|
|
105340
106574
|
* @description Which stage the test imitates (its rule and event name). Defaults to the Purchase stage, else the first stage that reaches Meta.
|
|
105341
106575
|
* @enum {string}
|
|
105342
106576
|
*/
|
|
105343
|
-
stage?: "lead_created" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
106577
|
+
stage?: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
105344
106578
|
/** @description The code Meta shows in Events Manager → Test Events. Omit it and one is generated: a test ALWAYS carries a code, so it lands in Test Events only and never counts as a real event. */
|
|
105345
106579
|
test_event_code?: string;
|
|
105346
106580
|
/**
|
|
@@ -139675,6 +140909,148 @@ interface paths {
|
|
|
139675
140909
|
patch?: never;
|
|
139676
140910
|
trace?: never;
|
|
139677
140911
|
};
|
|
140912
|
+
"/ads/paid-funnel": {
|
|
140913
|
+
parameters: {
|
|
140914
|
+
query?: never;
|
|
140915
|
+
header?: never;
|
|
140916
|
+
path?: never;
|
|
140917
|
+
cookie?: never;
|
|
140918
|
+
};
|
|
140919
|
+
/**
|
|
140920
|
+
* Paid funnel: spend, leads, qualified, booked, held and paid per arm, campaign, ad set and ad
|
|
140921
|
+
* @description The scoreboard that judges a paid test on cost per demo HELD. Per row: people at each step (lead → ICP-qualified → demo booked → demo held → first paid invoice), the cost of each step, contacted within 24 h, lead-to-booked, show rate and qualified share, for one destination `arm` (`whatsapp`, `instant_form`, `website`, `other`; an ad with spend and nobody is `unassigned`). Steps are read from the outcome ledger the Meta events leave from, so a column equals the events sent for the same period (`basis=event`; `reconciliation.events` prints them). People with no id at the level sit on the arm’s `unattributed` row, so rows sum to `totals`; `reconciliation.spend_matches` checks Σ spend against `/ads/overview`. A failed read is `null`, never 0.
|
|
140922
|
+
*/
|
|
140923
|
+
get: {
|
|
140924
|
+
parameters: {
|
|
140925
|
+
query: {
|
|
140926
|
+
/** @description Window start (inclusive), YYYY-MM-DD, Santiago. */
|
|
140927
|
+
from: string;
|
|
140928
|
+
/** @description Window end (inclusive), YYYY-MM-DD, Santiago. */
|
|
140929
|
+
to: string;
|
|
140930
|
+
/** @description `arm` (WhatsApp / Instant Form / website), `campaign`, `ad_set` or `ad`. `arms` is always returned whatever the level. */
|
|
140931
|
+
level?: "arm" | "campaign" | "ad_set" | "ad";
|
|
140932
|
+
/** @description `cohort` (default): the people whose lead fell in the window, every later step counted whenever it happened. `event`: every column is the number of people whose event of that step fell in the window, so each equals the events sent to Meta for the same period. */
|
|
140933
|
+
basis?: "cohort" | "event";
|
|
140934
|
+
/** @description The attribution model for the spend read. Default `last_touch`. */
|
|
140935
|
+
model?: string;
|
|
140936
|
+
};
|
|
140937
|
+
header?: never;
|
|
140938
|
+
path?: never;
|
|
140939
|
+
cookie?: never;
|
|
140940
|
+
};
|
|
140941
|
+
requestBody?: never;
|
|
140942
|
+
responses: {
|
|
140943
|
+
/** @description The funnel at the requested level */
|
|
140944
|
+
200: {
|
|
140945
|
+
headers: {
|
|
140946
|
+
[name: string]: unknown;
|
|
140947
|
+
};
|
|
140948
|
+
content: {
|
|
140949
|
+
"application/json": {
|
|
140950
|
+
data: components["schemas"]["AdsDemoFunnel"];
|
|
140951
|
+
};
|
|
140952
|
+
};
|
|
140953
|
+
};
|
|
140954
|
+
/** @description Validation error */
|
|
140955
|
+
400: {
|
|
140956
|
+
headers: {
|
|
140957
|
+
[name: string]: unknown;
|
|
140958
|
+
};
|
|
140959
|
+
content: {
|
|
140960
|
+
"application/json": components["schemas"]["Error"];
|
|
140961
|
+
};
|
|
140962
|
+
};
|
|
140963
|
+
/** @description Unauthorized */
|
|
140964
|
+
401: {
|
|
140965
|
+
headers: {
|
|
140966
|
+
[name: string]: unknown;
|
|
140967
|
+
};
|
|
140968
|
+
content: {
|
|
140969
|
+
"application/json": components["schemas"]["Error"];
|
|
140970
|
+
};
|
|
140971
|
+
};
|
|
140972
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
140973
|
+
402: {
|
|
140974
|
+
headers: {
|
|
140975
|
+
[name: string]: unknown;
|
|
140976
|
+
};
|
|
140977
|
+
content: {
|
|
140978
|
+
/**
|
|
140979
|
+
* @example {
|
|
140980
|
+
* "error": {
|
|
140981
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
140982
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
140983
|
+
* "details": {
|
|
140984
|
+
* "required": [
|
|
140985
|
+
* "vitrina_ads"
|
|
140986
|
+
* ],
|
|
140987
|
+
* "active": [],
|
|
140988
|
+
* "feature": "vitrina_ads",
|
|
140989
|
+
* "entitlement_state": "off"
|
|
140990
|
+
* }
|
|
140991
|
+
* }
|
|
140992
|
+
* }
|
|
140993
|
+
*/
|
|
140994
|
+
"application/json": components["schemas"]["Error"];
|
|
140995
|
+
};
|
|
140996
|
+
};
|
|
140997
|
+
/** @description Forbidden */
|
|
140998
|
+
403: {
|
|
140999
|
+
headers: {
|
|
141000
|
+
[name: string]: unknown;
|
|
141001
|
+
};
|
|
141002
|
+
content: {
|
|
141003
|
+
"application/json": components["schemas"]["Error"];
|
|
141004
|
+
};
|
|
141005
|
+
};
|
|
141006
|
+
/** @description Not found */
|
|
141007
|
+
404: {
|
|
141008
|
+
headers: {
|
|
141009
|
+
[name: string]: unknown;
|
|
141010
|
+
};
|
|
141011
|
+
content: {
|
|
141012
|
+
"application/json": components["schemas"]["Error"];
|
|
141013
|
+
};
|
|
141014
|
+
};
|
|
141015
|
+
/** @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. */
|
|
141016
|
+
409: {
|
|
141017
|
+
headers: {
|
|
141018
|
+
[name: string]: unknown;
|
|
141019
|
+
};
|
|
141020
|
+
content: {
|
|
141021
|
+
/**
|
|
141022
|
+
* @example {
|
|
141023
|
+
* "error": {
|
|
141024
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
141025
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
141026
|
+
* "details": {
|
|
141027
|
+
* "key_kind": "core"
|
|
141028
|
+
* }
|
|
141029
|
+
* }
|
|
141030
|
+
* }
|
|
141031
|
+
*/
|
|
141032
|
+
"application/json": components["schemas"]["Error"];
|
|
141033
|
+
};
|
|
141034
|
+
};
|
|
141035
|
+
/** @description Rate limited */
|
|
141036
|
+
429: {
|
|
141037
|
+
headers: {
|
|
141038
|
+
[name: string]: unknown;
|
|
141039
|
+
};
|
|
141040
|
+
content: {
|
|
141041
|
+
"application/json": components["schemas"]["Error"];
|
|
141042
|
+
};
|
|
141043
|
+
};
|
|
141044
|
+
};
|
|
141045
|
+
};
|
|
141046
|
+
put?: never;
|
|
141047
|
+
post?: never;
|
|
141048
|
+
delete?: never;
|
|
141049
|
+
options?: never;
|
|
141050
|
+
head?: never;
|
|
141051
|
+
patch?: never;
|
|
141052
|
+
trace?: never;
|
|
141053
|
+
};
|
|
139678
141054
|
"/ads/overview": {
|
|
139679
141055
|
parameters: {
|
|
139680
141056
|
query?: never;
|
|
@@ -141482,6 +142858,8 @@ interface paths {
|
|
|
141482
142858
|
from?: string;
|
|
141483
142859
|
/** @description With `from`: the page period’s end. */
|
|
141484
142860
|
to?: string;
|
|
142861
|
+
/** @description Narrow to the ads of one Línea of the clinic (its id from the Líneas list), or `none` for the ads no rule places in any Línea. An ad belongs to the Línea the clinic’s rules give its campaign, ad set and ad names. Ranks, ratios and totals of the remaining rows are unchanged; `limit` applies before the filter. */
|
|
142862
|
+
linea_id?: string | "none";
|
|
141485
142863
|
/** @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. */
|
|
141486
142864
|
sample?: "1" | "true";
|
|
141487
142865
|
};
|
|
@@ -141732,6 +143110,8 @@ interface paths {
|
|
|
141732
143110
|
window?: "7d" | "14d" | "28d" | "lifetime";
|
|
141733
143111
|
/** @description The attribution model. Defaults to `last_touch`. */
|
|
141734
143112
|
model?: string;
|
|
143113
|
+
/** @description Narrow to the ads of one Línea of the clinic (its id from the Líneas list), or `none` for the ads no rule places in any Línea. An ad belongs to the Línea the clinic’s rules give its campaign, ad set and ad names. Ranks, ratios and totals of the remaining rows are unchanged; `limit` applies before the filter. */
|
|
143114
|
+
linea_id?: string | "none";
|
|
141735
143115
|
/** @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. */
|
|
141736
143116
|
sample?: "1" | "true";
|
|
141737
143117
|
};
|
|
@@ -141916,6 +143296,225 @@ interface paths {
|
|
|
141916
143296
|
patch?: never;
|
|
141917
143297
|
trace?: never;
|
|
141918
143298
|
};
|
|
143299
|
+
"/ads/lineas": {
|
|
143300
|
+
parameters: {
|
|
143301
|
+
query?: never;
|
|
143302
|
+
header?: never;
|
|
143303
|
+
path?: never;
|
|
143304
|
+
cookie?: never;
|
|
143305
|
+
};
|
|
143306
|
+
/**
|
|
143307
|
+
* Ads by Línea: spend, people and attributed cash per Línea
|
|
143308
|
+
* @description The per-ad scorecard (`/ads/scorecard`) summed by the Línea of each ad (D53). An ad belongs to the Línea the clinic’s own rules give its campaign, ad set and ad names (the same rules that set a lead’s Línea at first touch); an ad no rule places is «Sin línea» (`linea_id: null`). Same covered window, same numbers: the Líneas plus «Sin línea» add up to `totals`, which is the scorecard’s own sum. Every live Línea is listed, with zeros when no ad of the window belongs to it. Empty `lineas` for a workspace that is not a clinic. To list one Línea’s ads, send its id as `linea_id` to `/ads/scorecard` or `/ads/creatives`.
|
|
143309
|
+
*/
|
|
143310
|
+
get: {
|
|
143311
|
+
parameters: {
|
|
143312
|
+
query: {
|
|
143313
|
+
/** @description Window start (inclusive), YYYY-MM-DD. */
|
|
143314
|
+
from: string;
|
|
143315
|
+
/** @description Window end (inclusive), YYYY-MM-DD. */
|
|
143316
|
+
to: string;
|
|
143317
|
+
/** @description The attribution model. Defaults to `last_touch`. */
|
|
143318
|
+
model?: string;
|
|
143319
|
+
/** @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. */
|
|
143320
|
+
sample?: "1" | "true";
|
|
143321
|
+
};
|
|
143322
|
+
header?: never;
|
|
143323
|
+
path?: never;
|
|
143324
|
+
cookie?: never;
|
|
143325
|
+
};
|
|
143326
|
+
requestBody?: never;
|
|
143327
|
+
responses: {
|
|
143328
|
+
/** @description Ads grouped by Línea */
|
|
143329
|
+
200: {
|
|
143330
|
+
headers: {
|
|
143331
|
+
[name: string]: unknown;
|
|
143332
|
+
};
|
|
143333
|
+
content: {
|
|
143334
|
+
/**
|
|
143335
|
+
* @example {
|
|
143336
|
+
* "data": {
|
|
143337
|
+
* "window": {
|
|
143338
|
+
* "from": "2026-09-20",
|
|
143339
|
+
* "to": "2026-09-30",
|
|
143340
|
+
* "days": 11
|
|
143341
|
+
* },
|
|
143342
|
+
* "coverage": null,
|
|
143343
|
+
* "lineas": [
|
|
143344
|
+
* {
|
|
143345
|
+
* "linea_id": "0b1c2d3e-0000-4000-8000-0000000000b1",
|
|
143346
|
+
* "nombre": "Implantes",
|
|
143347
|
+
* "ads": 2,
|
|
143348
|
+
* "spend": 100935,
|
|
143349
|
+
* "people": 96,
|
|
143350
|
+
* "booked": 4,
|
|
143351
|
+
* "attended": 0,
|
|
143352
|
+
* "accepted": {
|
|
143353
|
+
* "count": 2,
|
|
143354
|
+
* "value": 1357355
|
|
143355
|
+
* },
|
|
143356
|
+
* "cash": {
|
|
143357
|
+
* "first": 18990,
|
|
143358
|
+
* "recurring": 0,
|
|
143359
|
+
* "total": 18990,
|
|
143360
|
+
* "payments": 2
|
|
143361
|
+
* },
|
|
143362
|
+
* "ratios": {
|
|
143363
|
+
* "accepted_return": 13.45,
|
|
143364
|
+
* "cash_return": 0.19,
|
|
143365
|
+
* "first_payment_return": 0.19,
|
|
143366
|
+
* "cost_per_person": 1051
|
|
143367
|
+
* }
|
|
143368
|
+
* },
|
|
143369
|
+
* {
|
|
143370
|
+
* "linea_id": null,
|
|
143371
|
+
* "nombre": null,
|
|
143372
|
+
* "ads": 1,
|
|
143373
|
+
* "spend": 120088,
|
|
143374
|
+
* "people": 37,
|
|
143375
|
+
* "booked": 0,
|
|
143376
|
+
* "attended": 0,
|
|
143377
|
+
* "accepted": null,
|
|
143378
|
+
* "cash": null,
|
|
143379
|
+
* "ratios": {
|
|
143380
|
+
* "accepted_return": null,
|
|
143381
|
+
* "cash_return": null,
|
|
143382
|
+
* "first_payment_return": null,
|
|
143383
|
+
* "cost_per_person": 3246
|
|
143384
|
+
* }
|
|
143385
|
+
* }
|
|
143386
|
+
* ],
|
|
143387
|
+
* "totals": {
|
|
143388
|
+
* "ads": 3,
|
|
143389
|
+
* "spend": 221023,
|
|
143390
|
+
* "people": 133,
|
|
143391
|
+
* "booked": 4,
|
|
143392
|
+
* "attended": 0,
|
|
143393
|
+
* "accepted": {
|
|
143394
|
+
* "count": 2,
|
|
143395
|
+
* "value": 1357355
|
|
143396
|
+
* },
|
|
143397
|
+
* "cash": {
|
|
143398
|
+
* "first": 18990,
|
|
143399
|
+
* "recurring": 0,
|
|
143400
|
+
* "total": 18990,
|
|
143401
|
+
* "payments": 2
|
|
143402
|
+
* },
|
|
143403
|
+
* "ratios": {
|
|
143404
|
+
* "accepted_return": 6.14,
|
|
143405
|
+
* "cash_return": 0.09,
|
|
143406
|
+
* "first_payment_return": 0.09,
|
|
143407
|
+
* "cost_per_person": 1662
|
|
143408
|
+
* }
|
|
143409
|
+
* }
|
|
143410
|
+
* }
|
|
143411
|
+
* }
|
|
143412
|
+
*/
|
|
143413
|
+
"application/json": {
|
|
143414
|
+
data: components["schemas"]["AdsByLinea"];
|
|
143415
|
+
};
|
|
143416
|
+
};
|
|
143417
|
+
};
|
|
143418
|
+
/** @description Validation error */
|
|
143419
|
+
400: {
|
|
143420
|
+
headers: {
|
|
143421
|
+
[name: string]: unknown;
|
|
143422
|
+
};
|
|
143423
|
+
content: {
|
|
143424
|
+
"application/json": components["schemas"]["Error"];
|
|
143425
|
+
};
|
|
143426
|
+
};
|
|
143427
|
+
/** @description Unauthorized */
|
|
143428
|
+
401: {
|
|
143429
|
+
headers: {
|
|
143430
|
+
[name: string]: unknown;
|
|
143431
|
+
};
|
|
143432
|
+
content: {
|
|
143433
|
+
"application/json": components["schemas"]["Error"];
|
|
143434
|
+
};
|
|
143435
|
+
};
|
|
143436
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
143437
|
+
402: {
|
|
143438
|
+
headers: {
|
|
143439
|
+
[name: string]: unknown;
|
|
143440
|
+
};
|
|
143441
|
+
content: {
|
|
143442
|
+
/**
|
|
143443
|
+
* @example {
|
|
143444
|
+
* "error": {
|
|
143445
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
143446
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
143447
|
+
* "details": {
|
|
143448
|
+
* "required": [
|
|
143449
|
+
* "vitrina_ads"
|
|
143450
|
+
* ],
|
|
143451
|
+
* "active": [],
|
|
143452
|
+
* "feature": "vitrina_ads",
|
|
143453
|
+
* "entitlement_state": "off"
|
|
143454
|
+
* }
|
|
143455
|
+
* }
|
|
143456
|
+
* }
|
|
143457
|
+
*/
|
|
143458
|
+
"application/json": components["schemas"]["Error"];
|
|
143459
|
+
};
|
|
143460
|
+
};
|
|
143461
|
+
/** @description Forbidden */
|
|
143462
|
+
403: {
|
|
143463
|
+
headers: {
|
|
143464
|
+
[name: string]: unknown;
|
|
143465
|
+
};
|
|
143466
|
+
content: {
|
|
143467
|
+
"application/json": components["schemas"]["Error"];
|
|
143468
|
+
};
|
|
143469
|
+
};
|
|
143470
|
+
/** @description Not found */
|
|
143471
|
+
404: {
|
|
143472
|
+
headers: {
|
|
143473
|
+
[name: string]: unknown;
|
|
143474
|
+
};
|
|
143475
|
+
content: {
|
|
143476
|
+
"application/json": components["schemas"]["Error"];
|
|
143477
|
+
};
|
|
143478
|
+
};
|
|
143479
|
+
/** @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. */
|
|
143480
|
+
409: {
|
|
143481
|
+
headers: {
|
|
143482
|
+
[name: string]: unknown;
|
|
143483
|
+
};
|
|
143484
|
+
content: {
|
|
143485
|
+
/**
|
|
143486
|
+
* @example {
|
|
143487
|
+
* "error": {
|
|
143488
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
143489
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
143490
|
+
* "details": {
|
|
143491
|
+
* "key_kind": "core"
|
|
143492
|
+
* }
|
|
143493
|
+
* }
|
|
143494
|
+
* }
|
|
143495
|
+
*/
|
|
143496
|
+
"application/json": components["schemas"]["Error"];
|
|
143497
|
+
};
|
|
143498
|
+
};
|
|
143499
|
+
/** @description Rate limited */
|
|
143500
|
+
429: {
|
|
143501
|
+
headers: {
|
|
143502
|
+
[name: string]: unknown;
|
|
143503
|
+
};
|
|
143504
|
+
content: {
|
|
143505
|
+
"application/json": components["schemas"]["Error"];
|
|
143506
|
+
};
|
|
143507
|
+
};
|
|
143508
|
+
};
|
|
143509
|
+
};
|
|
143510
|
+
put?: never;
|
|
143511
|
+
post?: never;
|
|
143512
|
+
delete?: never;
|
|
143513
|
+
options?: never;
|
|
143514
|
+
head?: never;
|
|
143515
|
+
patch?: never;
|
|
143516
|
+
trace?: never;
|
|
143517
|
+
};
|
|
141919
143518
|
"/ads/booking-rate": {
|
|
141920
143519
|
parameters: {
|
|
141921
143520
|
query?: never;
|
|
@@ -148102,7 +149701,7 @@ interface paths {
|
|
|
148102
149701
|
/** @description Window end (inclusive, Santiago day), YYYY-MM-DD. */
|
|
148103
149702
|
to: string;
|
|
148104
149703
|
/** @description Only outcomes of this stage. */
|
|
148105
|
-
stage?: "lead_created" | "web_form" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received";
|
|
149704
|
+
stage?: "lead_created" | "web_form" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received";
|
|
148106
149705
|
/** @description `1` keeps only outcomes the engine credited to a campaign (the enrichment covers the requested window, up to 92 days back; check `meta.enrichment`). */
|
|
148107
149706
|
only_ads?: "1" | "true";
|
|
148108
149707
|
/** @description Only outcomes credited to this campaign (its PLATFORM id). */
|
|
@@ -148239,7 +149838,7 @@ interface paths {
|
|
|
148239
149838
|
recorded_from: string | null;
|
|
148240
149839
|
by_stage: {
|
|
148241
149840
|
/** @enum {string} */
|
|
148242
|
-
stage: "lead_created" | "web_form" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
149841
|
+
stage: "lead_created" | "web_form" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
148243
149842
|
total: number;
|
|
148244
149843
|
from_ads: number;
|
|
148245
149844
|
kept: number;
|
|
@@ -174993,7 +176592,7 @@ interface components {
|
|
|
174993
176592
|
};
|
|
174994
176593
|
WebhookEventDoc: {
|
|
174995
176594
|
/** @enum {string} */
|
|
174996
|
-
name: "ai_agent.publish" | "ai_agent_graph.publish" | "agent_scenario_run.completed" | "agent_scenario_suite.completed" | "conversation.created" | "conversation.assigned" | "conversation.resolved" | "message.received" | "message.sent" | "ticket.opened" | "ticket.reopened" | "ticket.resolved" | "ticket.closed" | "sla.breached" | "kb.source.create" | "kb.source.embed" | "kb.source.update" | "kb.source.delete" | "kb_file.uploaded" | "kb_file.deleted" | "skill.created" | "skill.updated" | "skill.deleted" | "custom_tool.created" | "custom_tool.updated" | "custom_tool.deleted" | "macro.applied" | "cost.budget_alert" | "runtime.budget_exceeded" | "lead.created" | "lead.stage_changed" | "lead.pipeline_changed" | "lead.assigned" | "lead.won" | "lead.lost" | "lead.unqualified" | "stock.synced" | "stock.source_retired" | "vehicle.published" | "vehicle.unpublished" | "vehicle.publish_failed" | "vehicle.created" | "vehicle.attachment.created" | "mercadolibre.order" | "mercadolibre.vis_lead" | "chileautos.lead" | "yapo.lead" | "website.lead" | "consignment.candidate.created" | "quote.issued" | "quote.voided" | "quote.extended" | "quote.archived" | "reservation.created" | "reservation.voided" | "reservation.abono_disposed" | "reservation.converted" | "sale_note.issued" | "sale_note.approved" | "sale_note.voided" | "purchase_note.issued" | "purchase_note.corrected" | "purchase_note.voided" | "payment.recorded" | "consignment.created" | "consignment.returned" | "consignment.sold" | "credit_application.recorded" | "credit_application.submitted" | "credit_application.decided" | "credit_application.withdrawn" | "price_approval.requested" | "price_approval.decided" | "contact.created" | "contact.updated" | "contact.merged" | "appointment.booked" | "appointment.rescheduled" | "appointment.cancelled" | "appointment.completed" | "appointment.no_show" | "appointment.reminded" | "appointment.imported" | "campaign.sent" | "campaign.paused" | "sending_domain.verified" | "coach.proposals_ready" | "coach.finding_ready" | "voice.autonomous_call" | "safety_hold.placed" | "safety_hold.ack_overdue" | "safety_hold.first_response_overdue" | "team.created" | "team.updated" | "team.deleted" | "custom_role.created" | "custom_role.updated" | "custom_role.deleted" | "macro.created" | "macro.updated" | "macro.deleted" | "assignment_rule.created" | "assignment_rule.updated" | "assignment_rule.deleted" | "sla_policy.created" | "sla_policy.updated" | "sla_policy.deleted" | "automation_trigger.created" | "automation_trigger.updated" | "automation_trigger.deleted" | "sending_domain.created" | "sending_domain.deleted" | "whatsapp_template.created" | "whatsapp_template.status_changed" | "whatsapp_template.deleted" | "whatsapp_flow.created" | "whatsapp_flow.published" | "whatsapp_flow.deprecated" | "whatsapp_flow.deleted" | "whatsapp_flow.completed" | "channel.connected" | "channel.updated" | "channel.disconnected" | "membership.created" | "membership.updated" | "membership.removed" | "clinic_professional.created" | "clinic_professional.updated" | "clinic_professional.deleted" | "clinic_service.created" | "clinic_service.updated" | "clinic_service.deleted" | "clinic_price_list.updated" | "clinic_pack_purchase.created" | "clinic_pack_purchase.session_consumed" | "clinic_pack_purchase.cancelled" | "clinic_budget.created" | "clinic_budget.sent" | "clinic_budget.accepted" | "clinic_budget.rejected" | "clinic_budget.voided" | "clinic_budget.mirror_changed" | "clinic_cash_session.opened" | "clinic_cash_session.closed" | "clinic_patient.created" | "clinic_patient.updated" | "clinic_patient.deleted" | "clinic_patient.merged" | "clinic_encounter.opened" | "clinic_encounter.closed" | "clinic_note.signed" | "clinic_note.amended" | "clinic_consent.signed" | "clinic_consent.revoked" | "clinic_document.uploaded" | "clinic_document.deleted" | "clinic_privacy_request.completed";
|
|
176595
|
+
name: "ai_agent.publish" | "ai_agent_graph.publish" | "agent_scenario_run.completed" | "agent_scenario_suite.completed" | "conversation.created" | "conversation.assigned" | "conversation.resolved" | "message.received" | "message.sent" | "ticket.opened" | "ticket.reopened" | "ticket.resolved" | "ticket.closed" | "sla.breached" | "kb.source.create" | "kb.source.embed" | "kb.source.update" | "kb.source.delete" | "kb_file.uploaded" | "kb_file.deleted" | "skill.created" | "skill.updated" | "skill.deleted" | "custom_tool.created" | "custom_tool.updated" | "custom_tool.deleted" | "macro.applied" | "cost.budget_alert" | "runtime.budget_exceeded" | "lead.created" | "lead.stage_changed" | "lead.pipeline_changed" | "lead.assigned" | "lead.won" | "lead.lost" | "lead.unqualified" | "stock.synced" | "stock.source_retired" | "vehicle.published" | "vehicle.unpublished" | "vehicle.publish_failed" | "vehicle.created" | "vehicle.attachment.created" | "mercadolibre.order" | "mercadolibre.vis_lead" | "chileautos.lead" | "yapo.lead" | "website.lead" | "demo_lead.created" | "demo_lead.pending_scheduling" | "demo_lead.routed" | "demo_booking.booked" | "demo_booking.rescheduled" | "demo_booking.cancelled" | "demo_booking.held" | "demo_booking.no_show" | "consignment.candidate.created" | "quote.issued" | "quote.voided" | "quote.extended" | "quote.archived" | "reservation.created" | "reservation.voided" | "reservation.abono_disposed" | "reservation.converted" | "sale_note.issued" | "sale_note.approved" | "sale_note.voided" | "purchase_note.issued" | "purchase_note.corrected" | "purchase_note.voided" | "payment.recorded" | "consignment.created" | "consignment.returned" | "consignment.sold" | "credit_application.recorded" | "credit_application.submitted" | "credit_application.decided" | "credit_application.withdrawn" | "price_approval.requested" | "price_approval.decided" | "contact.created" | "contact.updated" | "contact.merged" | "appointment.booked" | "appointment.rescheduled" | "appointment.cancelled" | "appointment.completed" | "appointment.no_show" | "appointment.reminded" | "appointment.imported" | "campaign.sent" | "campaign.paused" | "sending_domain.verified" | "coach.proposals_ready" | "coach.finding_ready" | "voice.autonomous_call" | "safety_hold.placed" | "safety_hold.ack_overdue" | "safety_hold.first_response_overdue" | "team.created" | "team.updated" | "team.deleted" | "custom_role.created" | "custom_role.updated" | "custom_role.deleted" | "macro.created" | "macro.updated" | "macro.deleted" | "assignment_rule.created" | "assignment_rule.updated" | "assignment_rule.deleted" | "sla_policy.created" | "sla_policy.updated" | "sla_policy.deleted" | "automation_trigger.created" | "automation_trigger.updated" | "automation_trigger.deleted" | "sending_domain.created" | "sending_domain.deleted" | "whatsapp_template.created" | "whatsapp_template.status_changed" | "whatsapp_template.deleted" | "whatsapp_flow.created" | "whatsapp_flow.published" | "whatsapp_flow.deprecated" | "whatsapp_flow.deleted" | "whatsapp_flow.completed" | "channel.connected" | "channel.updated" | "channel.disconnected" | "membership.created" | "membership.updated" | "membership.removed" | "clinic_professional.created" | "clinic_professional.updated" | "clinic_professional.deleted" | "clinic_service.created" | "clinic_service.updated" | "clinic_service.deleted" | "clinic_price_list.updated" | "clinic_pack_purchase.created" | "clinic_pack_purchase.session_consumed" | "clinic_pack_purchase.cancelled" | "clinic_budget.created" | "clinic_budget.sent" | "clinic_budget.accepted" | "clinic_budget.rejected" | "clinic_budget.voided" | "clinic_budget.mirror_changed" | "clinic_cash_session.opened" | "clinic_cash_session.closed" | "clinic_patient.created" | "clinic_patient.updated" | "clinic_patient.deleted" | "clinic_patient.merged" | "clinic_encounter.opened" | "clinic_encounter.closed" | "clinic_note.signed" | "clinic_note.amended" | "clinic_consent.signed" | "clinic_consent.revoked" | "clinic_document.uploaded" | "clinic_document.deleted" | "clinic_privacy_request.completed";
|
|
174997
176596
|
/** @description The schema version of this event type — every delivery carries it as `version`. Bumped only on a breaking change to `data`. */
|
|
174998
176597
|
version: number;
|
|
174999
176598
|
/** @description What the event is about — the `resource.type` of every delivery (`lead`, `vehicle`, `contact`, …). */
|
|
@@ -175060,7 +176659,7 @@ interface components {
|
|
|
175060
176659
|
CreateWebhookBody: {
|
|
175061
176660
|
/** Format: uri */
|
|
175062
176661
|
url: string;
|
|
175063
|
-
events: ("*" | "ai_agent.publish" | "ai_agent_graph.publish" | "agent_scenario_run.completed" | "agent_scenario_suite.completed" | "conversation.created" | "conversation.assigned" | "conversation.resolved" | "message.received" | "message.sent" | "ticket.opened" | "ticket.reopened" | "ticket.resolved" | "ticket.closed" | "sla.breached" | "kb.source.create" | "kb.source.embed" | "kb.source.update" | "kb.source.delete" | "kb_file.uploaded" | "kb_file.deleted" | "skill.created" | "skill.updated" | "skill.deleted" | "custom_tool.created" | "custom_tool.updated" | "custom_tool.deleted" | "macro.applied" | "cost.budget_alert" | "runtime.budget_exceeded" | "lead.created" | "lead.stage_changed" | "lead.pipeline_changed" | "lead.assigned" | "lead.won" | "lead.lost" | "lead.unqualified" | "stock.synced" | "stock.source_retired" | "vehicle.published" | "vehicle.unpublished" | "vehicle.publish_failed" | "vehicle.created" | "vehicle.attachment.created" | "mercadolibre.order" | "mercadolibre.vis_lead" | "chileautos.lead" | "yapo.lead" | "website.lead" | "consignment.candidate.created" | "quote.issued" | "quote.voided" | "quote.extended" | "quote.archived" | "reservation.created" | "reservation.voided" | "reservation.abono_disposed" | "reservation.converted" | "sale_note.issued" | "sale_note.approved" | "sale_note.voided" | "purchase_note.issued" | "purchase_note.corrected" | "purchase_note.voided" | "payment.recorded" | "consignment.created" | "consignment.returned" | "consignment.sold" | "credit_application.recorded" | "credit_application.submitted" | "credit_application.decided" | "credit_application.withdrawn" | "price_approval.requested" | "price_approval.decided" | "contact.created" | "contact.updated" | "contact.merged" | "appointment.booked" | "appointment.rescheduled" | "appointment.cancelled" | "appointment.completed" | "appointment.no_show" | "appointment.reminded" | "appointment.imported" | "campaign.sent" | "campaign.paused" | "sending_domain.verified" | "coach.proposals_ready" | "coach.finding_ready" | "voice.autonomous_call" | "safety_hold.placed" | "safety_hold.ack_overdue" | "safety_hold.first_response_overdue" | "team.created" | "team.updated" | "team.deleted" | "custom_role.created" | "custom_role.updated" | "custom_role.deleted" | "macro.created" | "macro.updated" | "macro.deleted" | "assignment_rule.created" | "assignment_rule.updated" | "assignment_rule.deleted" | "sla_policy.created" | "sla_policy.updated" | "sla_policy.deleted" | "automation_trigger.created" | "automation_trigger.updated" | "automation_trigger.deleted" | "sending_domain.created" | "sending_domain.deleted" | "whatsapp_template.created" | "whatsapp_template.status_changed" | "whatsapp_template.deleted" | "whatsapp_flow.created" | "whatsapp_flow.published" | "whatsapp_flow.deprecated" | "whatsapp_flow.deleted" | "whatsapp_flow.completed" | "channel.connected" | "channel.updated" | "channel.disconnected" | "membership.created" | "membership.updated" | "membership.removed" | "clinic_professional.created" | "clinic_professional.updated" | "clinic_professional.deleted" | "clinic_service.created" | "clinic_service.updated" | "clinic_service.deleted" | "clinic_price_list.updated" | "clinic_pack_purchase.created" | "clinic_pack_purchase.session_consumed" | "clinic_pack_purchase.cancelled" | "clinic_budget.created" | "clinic_budget.sent" | "clinic_budget.accepted" | "clinic_budget.rejected" | "clinic_budget.voided" | "clinic_budget.mirror_changed" | "clinic_cash_session.opened" | "clinic_cash_session.closed" | "clinic_patient.created" | "clinic_patient.updated" | "clinic_patient.deleted" | "clinic_patient.merged" | "clinic_encounter.opened" | "clinic_encounter.closed" | "clinic_note.signed" | "clinic_note.amended" | "clinic_consent.signed" | "clinic_consent.revoked" | "clinic_document.uploaded" | "clinic_document.deleted" | "clinic_privacy_request.completed")[];
|
|
176662
|
+
events: ("*" | "ai_agent.publish" | "ai_agent_graph.publish" | "agent_scenario_run.completed" | "agent_scenario_suite.completed" | "conversation.created" | "conversation.assigned" | "conversation.resolved" | "message.received" | "message.sent" | "ticket.opened" | "ticket.reopened" | "ticket.resolved" | "ticket.closed" | "sla.breached" | "kb.source.create" | "kb.source.embed" | "kb.source.update" | "kb.source.delete" | "kb_file.uploaded" | "kb_file.deleted" | "skill.created" | "skill.updated" | "skill.deleted" | "custom_tool.created" | "custom_tool.updated" | "custom_tool.deleted" | "macro.applied" | "cost.budget_alert" | "runtime.budget_exceeded" | "lead.created" | "lead.stage_changed" | "lead.pipeline_changed" | "lead.assigned" | "lead.won" | "lead.lost" | "lead.unqualified" | "stock.synced" | "stock.source_retired" | "vehicle.published" | "vehicle.unpublished" | "vehicle.publish_failed" | "vehicle.created" | "vehicle.attachment.created" | "mercadolibre.order" | "mercadolibre.vis_lead" | "chileautos.lead" | "yapo.lead" | "website.lead" | "demo_lead.created" | "demo_lead.pending_scheduling" | "demo_lead.routed" | "demo_booking.booked" | "demo_booking.rescheduled" | "demo_booking.cancelled" | "demo_booking.held" | "demo_booking.no_show" | "consignment.candidate.created" | "quote.issued" | "quote.voided" | "quote.extended" | "quote.archived" | "reservation.created" | "reservation.voided" | "reservation.abono_disposed" | "reservation.converted" | "sale_note.issued" | "sale_note.approved" | "sale_note.voided" | "purchase_note.issued" | "purchase_note.corrected" | "purchase_note.voided" | "payment.recorded" | "consignment.created" | "consignment.returned" | "consignment.sold" | "credit_application.recorded" | "credit_application.submitted" | "credit_application.decided" | "credit_application.withdrawn" | "price_approval.requested" | "price_approval.decided" | "contact.created" | "contact.updated" | "contact.merged" | "appointment.booked" | "appointment.rescheduled" | "appointment.cancelled" | "appointment.completed" | "appointment.no_show" | "appointment.reminded" | "appointment.imported" | "campaign.sent" | "campaign.paused" | "sending_domain.verified" | "coach.proposals_ready" | "coach.finding_ready" | "voice.autonomous_call" | "safety_hold.placed" | "safety_hold.ack_overdue" | "safety_hold.first_response_overdue" | "team.created" | "team.updated" | "team.deleted" | "custom_role.created" | "custom_role.updated" | "custom_role.deleted" | "macro.created" | "macro.updated" | "macro.deleted" | "assignment_rule.created" | "assignment_rule.updated" | "assignment_rule.deleted" | "sla_policy.created" | "sla_policy.updated" | "sla_policy.deleted" | "automation_trigger.created" | "automation_trigger.updated" | "automation_trigger.deleted" | "sending_domain.created" | "sending_domain.deleted" | "whatsapp_template.created" | "whatsapp_template.status_changed" | "whatsapp_template.deleted" | "whatsapp_flow.created" | "whatsapp_flow.published" | "whatsapp_flow.deprecated" | "whatsapp_flow.deleted" | "whatsapp_flow.completed" | "channel.connected" | "channel.updated" | "channel.disconnected" | "membership.created" | "membership.updated" | "membership.removed" | "clinic_professional.created" | "clinic_professional.updated" | "clinic_professional.deleted" | "clinic_service.created" | "clinic_service.updated" | "clinic_service.deleted" | "clinic_price_list.updated" | "clinic_pack_purchase.created" | "clinic_pack_purchase.session_consumed" | "clinic_pack_purchase.cancelled" | "clinic_budget.created" | "clinic_budget.sent" | "clinic_budget.accepted" | "clinic_budget.rejected" | "clinic_budget.voided" | "clinic_budget.mirror_changed" | "clinic_cash_session.opened" | "clinic_cash_session.closed" | "clinic_patient.created" | "clinic_patient.updated" | "clinic_patient.deleted" | "clinic_patient.merged" | "clinic_encounter.opened" | "clinic_encounter.closed" | "clinic_note.signed" | "clinic_note.amended" | "clinic_consent.signed" | "clinic_consent.revoked" | "clinic_document.uploaded" | "clinic_document.deleted" | "clinic_privacy_request.completed")[];
|
|
175064
176663
|
description?: string | null;
|
|
175065
176664
|
/** @description «Incluir datos del recurso». `false` (the default) = every delivery is the notice: resource, changes, author, time and `url`, with `data_omitted: "not_requested"`. `true` = each delivery also carries `data` when, at dispatch time, this subscription's OWNER — whoever created it or last changed its url, events or this flag — holds the resource read scope (`read_scope` in the catalogue) and sees every record; otherwise `data_omitted` says why. An event about a dato sensible is always the notice. */
|
|
175066
176665
|
include_data?: boolean;
|
|
@@ -176230,6 +177829,11 @@ interface components {
|
|
|
176230
177829
|
location_id: string | null;
|
|
176231
177830
|
/** Format: uuid */
|
|
176232
177831
|
professional_id: string | null;
|
|
177832
|
+
/**
|
|
177833
|
+
* @description The Origen filter applied; `null` = everyone.
|
|
177834
|
+
* @enum {string|null}
|
|
177835
|
+
*/
|
|
177836
|
+
origin: "meta" | "organic" | "unknown" | null;
|
|
176233
177837
|
/** @enum {string} */
|
|
176234
177838
|
state: "ready" | "unavailable";
|
|
176235
177839
|
state_reason: string | null;
|
|
@@ -176273,6 +177877,24 @@ interface components {
|
|
|
176273
177877
|
tratamiento_clp: number;
|
|
176274
177878
|
pagos: number;
|
|
176275
177879
|
} | null;
|
|
177880
|
+
/** @description Producción, presupuestado and recaudación by Origen (D77): `meta`, `organic`, `unknown` («Sin dato»). `recaudado_clp` is `null` with `professional_id`. The whole object is `null` when the Origen could not be read (never guessed as `unknown`). */
|
|
177881
|
+
by_origen: {
|
|
177882
|
+
meta?: {
|
|
177883
|
+
produccion_clp: number;
|
|
177884
|
+
presupuestado_clp: number;
|
|
177885
|
+
recaudado_clp: number | null;
|
|
177886
|
+
};
|
|
177887
|
+
organic?: {
|
|
177888
|
+
produccion_clp: number;
|
|
177889
|
+
presupuestado_clp: number;
|
|
177890
|
+
recaudado_clp: number | null;
|
|
177891
|
+
};
|
|
177892
|
+
unknown?: {
|
|
177893
|
+
produccion_clp: number;
|
|
177894
|
+
presupuestado_clp: number;
|
|
177895
|
+
recaudado_clp: number | null;
|
|
177896
|
+
};
|
|
177897
|
+
} | null;
|
|
176276
177898
|
};
|
|
176277
177899
|
days: {
|
|
176278
177900
|
produccion: {
|
|
@@ -176297,6 +177919,24 @@ interface components {
|
|
|
176297
177919
|
tratamiento_clp: number;
|
|
176298
177920
|
pagos: number;
|
|
176299
177921
|
} | null;
|
|
177922
|
+
/** @description Producción, presupuestado and recaudación by Origen (D77): `meta`, `organic`, `unknown` («Sin dato»). `recaudado_clp` is `null` with `professional_id`. The whole object is `null` when the Origen could not be read (never guessed as `unknown`). */
|
|
177923
|
+
by_origen: {
|
|
177924
|
+
meta?: {
|
|
177925
|
+
produccion_clp: number;
|
|
177926
|
+
presupuestado_clp: number;
|
|
177927
|
+
recaudado_clp: number | null;
|
|
177928
|
+
};
|
|
177929
|
+
organic?: {
|
|
177930
|
+
produccion_clp: number;
|
|
177931
|
+
presupuestado_clp: number;
|
|
177932
|
+
recaudado_clp: number | null;
|
|
177933
|
+
};
|
|
177934
|
+
unknown?: {
|
|
177935
|
+
produccion_clp: number;
|
|
177936
|
+
presupuestado_clp: number;
|
|
177937
|
+
recaudado_clp: number | null;
|
|
177938
|
+
};
|
|
177939
|
+
} | null;
|
|
176300
177940
|
day: string;
|
|
176301
177941
|
}[];
|
|
176302
177942
|
clinic: {
|
|
@@ -176374,7 +178014,7 @@ interface components {
|
|
|
176374
178014
|
plans: {
|
|
176375
178015
|
/** Format: uuid */
|
|
176376
178016
|
plan_id: string;
|
|
176377
|
-
/** @description `name` only for a caller allowed to see patient identity (`contacts:read` + `clinic:read`, plus `clinic_patients:read` for an API credential). */
|
|
178017
|
+
/** @description `name` only for a caller allowed to see patient identity (`contacts:read` + `clinic:read`, plus `clinic_patients:read` for an API credential). A caller on `clinic_insights:read` alone gets `id` and `name` both `null`. */
|
|
176378
178018
|
patient: {
|
|
176379
178019
|
/** Format: uuid */
|
|
176380
178020
|
id: string | null;
|
|
@@ -176388,6 +178028,8 @@ interface components {
|
|
|
176388
178028
|
deuda_clp: number;
|
|
176389
178029
|
/** @enum {string} */
|
|
176390
178030
|
tipo: "nuevo" | "tratamiento";
|
|
178031
|
+
/** @enum {string|null} */
|
|
178032
|
+
origen: "meta" | "organic" | "unknown" | null;
|
|
176391
178033
|
/** @description Números comerciales' verdict; `null` for a $0 or evaluación-only plan. */
|
|
176392
178034
|
aceptado: boolean | null;
|
|
176393
178035
|
}[];
|
|
@@ -176395,7 +178037,7 @@ interface components {
|
|
|
176395
178037
|
/** Format: uuid */
|
|
176396
178038
|
payment_id: string;
|
|
176397
178039
|
time: string | null;
|
|
176398
|
-
/** @description `name` only for a caller allowed to see patient identity (`contacts:read` + `clinic:read`, plus `clinic_patients:read` for an API credential). */
|
|
178040
|
+
/** @description `name` only for a caller allowed to see patient identity (`contacts:read` + `clinic:read`, plus `clinic_patients:read` for an API credential). A caller on `clinic_insights:read` alone gets `id` and `name` both `null`. */
|
|
176399
178041
|
patient: {
|
|
176400
178042
|
/** Format: uuid */
|
|
176401
178043
|
id: string | null;
|
|
@@ -176404,6 +178046,8 @@ interface components {
|
|
|
176404
178046
|
amount_clp: number;
|
|
176405
178047
|
/** @enum {string} */
|
|
176406
178048
|
tipo: "nuevo" | "tratamiento";
|
|
178049
|
+
/** @enum {string|null} */
|
|
178050
|
+
origen: "meta" | "organic" | "unknown" | null;
|
|
176407
178051
|
}[];
|
|
176408
178052
|
produccion: {
|
|
176409
178053
|
/** Format: uuid */
|
|
@@ -177036,7 +178680,7 @@ interface components {
|
|
|
177036
178680
|
vertical: string | null;
|
|
177037
178681
|
rules: {
|
|
177038
178682
|
/** @enum {string} */
|
|
177039
|
-
stage: "lead_created" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
178683
|
+
stage: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
177040
178684
|
/**
|
|
177041
178685
|
* @description `unchanged` = the rule already held this body; nothing was written.
|
|
177042
178686
|
* @enum {string}
|
|
@@ -177110,7 +178754,7 @@ interface components {
|
|
|
177110
178754
|
} | null;
|
|
177111
178755
|
stages: {
|
|
177112
178756
|
/** @enum {string} */
|
|
177113
|
-
stage: "lead_created" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
178757
|
+
stage: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
177114
178758
|
/** @description The stage in the workspace’s words. */
|
|
177115
178759
|
label: string;
|
|
177116
178760
|
/** @description What Meta receives. */
|
|
@@ -177270,7 +178914,7 @@ interface components {
|
|
|
177270
178914
|
/** @description Advice only — Vitrina never changes an ad set’s goal: the earliest stage reached by 1–40 % of new contacts over 28 days, once there are ≥ 50 (what Meta learns best from with this volume); `default` = not enough data yet, the usual answer for the business type. Never a standard event on a health-restricted dataset. */
|
|
177271
178915
|
recommended_optimization_stage: {
|
|
177272
178916
|
/** @enum {string} */
|
|
177273
|
-
stage: "lead_created" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
178917
|
+
stage: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
177274
178918
|
/** @enum {string} */
|
|
177275
178919
|
reason: "rate_band" | "default";
|
|
177276
178920
|
rate: number | null;
|
|
@@ -177309,7 +178953,7 @@ interface components {
|
|
|
177309
178953
|
};
|
|
177310
178954
|
AdsSendPreviewEvent: {
|
|
177311
178955
|
/** @enum {string} */
|
|
177312
|
-
stage: "lead_created" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
178956
|
+
stage: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
177313
178957
|
/**
|
|
177314
178958
|
* @description `example` when the workspace has no event of this stage yet.
|
|
177315
178959
|
* @enum {string}
|
|
@@ -177367,7 +179011,7 @@ interface components {
|
|
|
177367
179011
|
/** @description Search for it in Events Manager → Test Events. */
|
|
177368
179012
|
event_id: string | null;
|
|
177369
179013
|
/** @enum {string|null} */
|
|
177370
|
-
stage: "lead_created" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received" | null;
|
|
179014
|
+
stage: "lead_created" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received" | null;
|
|
177371
179015
|
meta_event: string | null;
|
|
177372
179016
|
quality_warning: boolean;
|
|
177373
179017
|
test_events_link: string | null;
|
|
@@ -178045,6 +179689,8 @@ interface components {
|
|
|
178045
179689
|
accepted_value?: number | null;
|
|
178046
179690
|
/** @description How many accepted presupuestos / closed sales `accepted_value` is. Totals and campaign rows: the engine-credited list Resumen sums. */
|
|
178047
179691
|
accepted_count?: number | null;
|
|
179692
|
+
/** @description D60 · «Con diagnóstico»: people whose conversation the entity opened and who got a presupuesto presented. Absent = unknown. */
|
|
179693
|
+
diagnosed?: number | null;
|
|
178048
179694
|
/** @description `accepted_value` ÷ spend («Retorno en presupuestos»). `null` = unknown or no spend. */
|
|
178049
179695
|
accepted_return?: number | null;
|
|
178050
179696
|
patient_return?: components["schemas"]["AdsPatientReturn"];
|
|
@@ -178112,6 +179758,8 @@ interface components {
|
|
|
178112
179758
|
accepted_value?: number | null;
|
|
178113
179759
|
/** @description How many accepted presupuestos / closed sales `accepted_value` is. Totals and campaign rows: the engine-credited list Resumen sums. */
|
|
178114
179760
|
accepted_count?: number | null;
|
|
179761
|
+
/** @description D60 · «Con diagnóstico»: people whose conversation the entity opened and who got a presupuesto presented. Absent = unknown. */
|
|
179762
|
+
diagnosed?: number | null;
|
|
178115
179763
|
/** @description `accepted_value` ÷ spend («Retorno en presupuestos»). `null` = unknown or no spend. */
|
|
178116
179764
|
accepted_return?: number | null;
|
|
178117
179765
|
patient_return?: components["schemas"]["AdsPatientReturn"];
|
|
@@ -178194,6 +179842,8 @@ interface components {
|
|
|
178194
179842
|
accepted_value?: number | null;
|
|
178195
179843
|
/** @description How many accepted presupuestos / closed sales `accepted_value` is. Totals and campaign rows: the engine-credited list Resumen sums. */
|
|
178196
179844
|
accepted_count?: number | null;
|
|
179845
|
+
/** @description D60 · «Con diagnóstico»: people whose conversation the entity opened and who got a presupuesto presented. Absent = unknown. */
|
|
179846
|
+
diagnosed?: number | null;
|
|
178197
179847
|
/** @description `accepted_value` ÷ spend («Retorno en presupuestos»). `null` = unknown or no spend. */
|
|
178198
179848
|
accepted_return?: number | null;
|
|
178199
179849
|
patient_return?: components["schemas"]["AdsPatientReturn"];
|
|
@@ -178233,6 +179883,124 @@ interface components {
|
|
|
178233
179883
|
/** @description The public Facebook watch page: the fallback link. */
|
|
178234
179884
|
watch_url: string | null;
|
|
178235
179885
|
};
|
|
179886
|
+
AdsDemoFunnelRow: {
|
|
179887
|
+
/** @enum {string} */
|
|
179888
|
+
arm: "whatsapp" | "instant_form" | "website" | "other" | "unassigned";
|
|
179889
|
+
/** @description Meta id at this level; `null` on an arm row and on the «sin atribución» row. */
|
|
179890
|
+
external_id: string | null;
|
|
179891
|
+
name: string | null;
|
|
179892
|
+
parent: {
|
|
179893
|
+
external_id: string | null;
|
|
179894
|
+
name: string | null;
|
|
179895
|
+
} | null;
|
|
179896
|
+
/** @description The arm’s people with no id at this level. */
|
|
179897
|
+
unattributed: boolean;
|
|
179898
|
+
/** @description People with a lead (`lead_created`). */
|
|
179899
|
+
leads: number;
|
|
179900
|
+
/** @description Of those, ICP-qualified (`lead_qualified`). */
|
|
179901
|
+
qualified: number;
|
|
179902
|
+
/** @description People with a demo booked (`appointment_booked`). */
|
|
179903
|
+
booked: number;
|
|
179904
|
+
/** @description People whose demo was held (`appointment_attended`). */
|
|
179905
|
+
held: number;
|
|
179906
|
+
/** @description People with a first paid invoice (`first_payment`). */
|
|
179907
|
+
paid: number;
|
|
179908
|
+
/** @description Leads that got a reply (agent, human or API) within 24 h of the lead. */
|
|
179909
|
+
contacted_24h: number;
|
|
179910
|
+
/** @description `null` = unknown or none on this row. */
|
|
179911
|
+
spend: number | null;
|
|
179912
|
+
costs: {
|
|
179913
|
+
per_lead: number | null;
|
|
179914
|
+
per_qualified: number | null;
|
|
179915
|
+
per_booked: number | null;
|
|
179916
|
+
/** @description THE metric the A/B is judged on (D5). */
|
|
179917
|
+
per_held: number | null;
|
|
179918
|
+
per_paid: number | null;
|
|
179919
|
+
};
|
|
179920
|
+
rates: {
|
|
179921
|
+
/** @description qualified ÷ leads */
|
|
179922
|
+
qualified_share: number | null;
|
|
179923
|
+
/** @description contacted within 24 h ÷ leads */
|
|
179924
|
+
contacted_24h_rate: number | null;
|
|
179925
|
+
/** @description booked ÷ leads */
|
|
179926
|
+
lead_to_booked: number | null;
|
|
179927
|
+
/** @description held ÷ booked */
|
|
179928
|
+
show_rate: number | null;
|
|
179929
|
+
};
|
|
179930
|
+
};
|
|
179931
|
+
AdsDemoFunnel: {
|
|
179932
|
+
/** @enum {string} */
|
|
179933
|
+
level: "arm" | "campaign" | "ad_set" | "ad";
|
|
179934
|
+
/** @enum {string} */
|
|
179935
|
+
basis: "cohort" | "event";
|
|
179936
|
+
window: {
|
|
179937
|
+
from: string;
|
|
179938
|
+
to: string;
|
|
179939
|
+
};
|
|
179940
|
+
rows: components["schemas"]["AdsDemoFunnelRow"][];
|
|
179941
|
+
arms: components["schemas"]["AdsDemoFunnelRow"][];
|
|
179942
|
+
totals: {
|
|
179943
|
+
/** @description People with a lead (`lead_created`). */
|
|
179944
|
+
leads: number;
|
|
179945
|
+
/** @description Of those, ICP-qualified (`lead_qualified`). */
|
|
179946
|
+
qualified: number;
|
|
179947
|
+
/** @description People with a demo booked (`appointment_booked`). */
|
|
179948
|
+
booked: number;
|
|
179949
|
+
/** @description People whose demo was held (`appointment_attended`). */
|
|
179950
|
+
held: number;
|
|
179951
|
+
/** @description People with a first paid invoice (`first_payment`). */
|
|
179952
|
+
paid: number;
|
|
179953
|
+
/** @description Leads that got a reply (agent, human or API) within 24 h of the lead. */
|
|
179954
|
+
contacted_24h: number;
|
|
179955
|
+
spend: number | null;
|
|
179956
|
+
costs: {
|
|
179957
|
+
per_lead: number | null;
|
|
179958
|
+
per_qualified: number | null;
|
|
179959
|
+
per_booked: number | null;
|
|
179960
|
+
/** @description THE metric the A/B is judged on (D5). */
|
|
179961
|
+
per_held: number | null;
|
|
179962
|
+
per_paid: number | null;
|
|
179963
|
+
};
|
|
179964
|
+
rates: {
|
|
179965
|
+
/** @description qualified ÷ leads */
|
|
179966
|
+
qualified_share: number | null;
|
|
179967
|
+
/** @description contacted within 24 h ÷ leads */
|
|
179968
|
+
contacted_24h_rate: number | null;
|
|
179969
|
+
/** @description booked ÷ leads */
|
|
179970
|
+
lead_to_booked: number | null;
|
|
179971
|
+
/** @description held ÷ booked */
|
|
179972
|
+
show_rate: number | null;
|
|
179973
|
+
};
|
|
179974
|
+
};
|
|
179975
|
+
reconciliation: {
|
|
179976
|
+
overview_spend: number | null;
|
|
179977
|
+
spend_matches: boolean | null;
|
|
179978
|
+
events: {
|
|
179979
|
+
lead_created: {
|
|
179980
|
+
events: number;
|
|
179981
|
+
people: number;
|
|
179982
|
+
};
|
|
179983
|
+
lead_qualified: {
|
|
179984
|
+
events: number;
|
|
179985
|
+
people: number;
|
|
179986
|
+
};
|
|
179987
|
+
appointment_booked: {
|
|
179988
|
+
events: number;
|
|
179989
|
+
people: number;
|
|
179990
|
+
};
|
|
179991
|
+
appointment_attended: {
|
|
179992
|
+
events: number;
|
|
179993
|
+
people: number;
|
|
179994
|
+
};
|
|
179995
|
+
first_payment: {
|
|
179996
|
+
events: number;
|
|
179997
|
+
people: number;
|
|
179998
|
+
};
|
|
179999
|
+
} | null;
|
|
180000
|
+
counts_match: boolean | null;
|
|
180001
|
+
leads_without_ad: number;
|
|
180002
|
+
};
|
|
180003
|
+
};
|
|
178236
180004
|
/** @description «Retorno total de pacientes de anuncios (primer pago + cuotas)» over the money-covered window. On `current` only; `null` = unknown (the credit is still warming). */
|
|
178237
180005
|
AdsPatientReturnTotal: components["schemas"]["AdsPatientReturn"] & ({
|
|
178238
180006
|
/** @description Median days from the ad touch that counts it to each person’s first payment, over the first payments of the period. */
|
|
@@ -178942,10 +180710,10 @@ interface components {
|
|
|
178942
180710
|
};
|
|
178943
180711
|
coverage: components["schemas"]["AdsCoverage"] & (Record<string, never> | null);
|
|
178944
180712
|
/**
|
|
178945
|
-
* @description What the ranking sorts by first: the accepted-quote return, or cash once the window holds `cash_evidence.min_payments` payments.
|
|
180713
|
+
* @description What the ranking sorts by first: `expected` for a clinic with its economics known (each ad on its expected return, or its cash once it has 5 payments of its own — D63); otherwise the accepted-quote return, or cash once the window holds `cash_evidence.min_payments` payments.
|
|
178946
180714
|
* @enum {string}
|
|
178947
180715
|
*/
|
|
178948
|
-
basis: "accepted" | "cash";
|
|
180716
|
+
basis: "accepted" | "cash" | "expected";
|
|
178949
180717
|
cash_evidence: {
|
|
178950
180718
|
payments: number;
|
|
178951
180719
|
min_payments: number;
|
|
@@ -178956,6 +180724,27 @@ interface components {
|
|
|
178956
180724
|
days: number;
|
|
178957
180725
|
min_days: number;
|
|
178958
180726
|
};
|
|
180727
|
+
/** @description The account’s booking rate from ads. */
|
|
180728
|
+
funnel?: {
|
|
180729
|
+
people: number;
|
|
180730
|
+
booked: number;
|
|
180731
|
+
rate: number;
|
|
180732
|
+
interval: {
|
|
180733
|
+
low: number;
|
|
180734
|
+
high: number;
|
|
180735
|
+
};
|
|
180736
|
+
/** @description Surely under the 10 % clinic floor (D66). */
|
|
180737
|
+
leaking: boolean;
|
|
180738
|
+
} | null;
|
|
180739
|
+
/** @description The clinic economics behind the expected values: cash per evaluated new patient (per Línea and overall) and the show rate. */
|
|
180740
|
+
economics?: {
|
|
180741
|
+
show_rate: number | null;
|
|
180742
|
+
account_value: number | null;
|
|
180743
|
+
by_linea: {
|
|
180744
|
+
linea_id: string;
|
|
180745
|
+
value: number;
|
|
180746
|
+
}[];
|
|
180747
|
+
} | null;
|
|
178959
180748
|
rows: {
|
|
178960
180749
|
ad_external_id: string;
|
|
178961
180750
|
ad_name: string | null;
|
|
@@ -179002,11 +180791,80 @@ interface components {
|
|
|
179002
180791
|
first_payment_return: number | null;
|
|
179003
180792
|
/** @description The spend of the people window ÷ `people` (CLP) — the same division as a campaign’s «por persona». */
|
|
179004
180793
|
cost_per_person: number | null;
|
|
179005
|
-
|
|
180794
|
+
/** @description The expected value of the ad’s bookings ÷ spend (×, D63): bookings × its Línea’s cash per evaluated new patient × the clinic’s show rate. */
|
|
180795
|
+
expected_return?: number | null;
|
|
180796
|
+
/** @description Spend ÷ bookings (CLP, «costo por cita agendada»). */
|
|
180797
|
+
cost_per_booking?: number | null;
|
|
180798
|
+
};
|
|
180799
|
+
/** @description The Línea the clinic’s rules place the ad in (D53). */
|
|
180800
|
+
linea_id?: string | null;
|
|
180801
|
+
/** @description How sure Vitrina is about the ad and what its bookings are worth (D63/D64): bookings first, cash once the ad has 5 payments of its own. */
|
|
180802
|
+
judgement?: {
|
|
180803
|
+
/** @description booked ÷ people (0–1). */
|
|
180804
|
+
booking_rate: number | null;
|
|
180805
|
+
/** @description 95 % Wilson interval of the booking rate. */
|
|
180806
|
+
booking_interval: {
|
|
180807
|
+
low: number;
|
|
180808
|
+
high: number;
|
|
180809
|
+
} | null;
|
|
180810
|
+
/** @description The other ads of its Línea (or of the account when the Línea has too few people) the ad is judged against. */
|
|
180811
|
+
comparator: {
|
|
180812
|
+
rate: number;
|
|
180813
|
+
people: number;
|
|
180814
|
+
booked: number;
|
|
180815
|
+
median: number | null;
|
|
180816
|
+
/** @enum {string} */
|
|
180817
|
+
source: "linea" | "account";
|
|
180818
|
+
} | null;
|
|
180819
|
+
/** @description people × the comparator’s booking rate. */
|
|
180820
|
+
expected_bookings: number | null;
|
|
180821
|
+
/** @description Zero bookings: how sure a pause is. */
|
|
180822
|
+
pause: {
|
|
180823
|
+
/**
|
|
180824
|
+
* @description `seguro` · `probable` · `falta_data` (with ≈ `people_needed` more people) — D64, never a fixed floor.
|
|
180825
|
+
* @enum {string}
|
|
180826
|
+
*/
|
|
180827
|
+
confidence: "seguro" | "probable" | "falta_data";
|
|
180828
|
+
people_needed: number | null;
|
|
180829
|
+
} | null;
|
|
180830
|
+
/** @description Bookings: how sure a scale is. */
|
|
180831
|
+
scale: {
|
|
180832
|
+
/**
|
|
180833
|
+
* @description `seguro` · `probable` · `falta_data` (with ≈ `people_needed` more people) — D64, never a fixed floor.
|
|
180834
|
+
* @enum {string}
|
|
180835
|
+
*/
|
|
180836
|
+
confidence: "seguro" | "probable" | "falta_data";
|
|
180837
|
+
people_needed: number | null;
|
|
180838
|
+
} | null;
|
|
180839
|
+
cost_per_booking: number | null;
|
|
180840
|
+
expected_value: number | null;
|
|
180841
|
+
/** @description The Línea’s cash per evaluated new patient used (CLP). */
|
|
180842
|
+
value_per_patient: number | null;
|
|
180843
|
+
/** @enum {string|null} */
|
|
180844
|
+
judged_on: "cash" | "expected" | null;
|
|
180845
|
+
} | null;
|
|
180846
|
+
/** @description D67: the creative’s own signals (the engine’s feature store) — context for the verdict, never part of it. */
|
|
180847
|
+
signals?: {
|
|
180848
|
+
frequency: number | null;
|
|
180849
|
+
days_active: number | null;
|
|
180850
|
+
/** @description % (null for an image ad). */
|
|
180851
|
+
hook_rate: number | null;
|
|
180852
|
+
/** @description % (null for an image ad). */
|
|
180853
|
+
thumb_stop_rate: number | null;
|
|
180854
|
+
/** @description Link CTR, %. */
|
|
180855
|
+
ctr: number | null;
|
|
180856
|
+
} | null;
|
|
180857
|
+
/** @description D67: where the ad loses people, read from its signals against the account’s median. */
|
|
180858
|
+
explanation?: {
|
|
180859
|
+
/** @enum {string|null} */
|
|
180860
|
+
story: "after_click" | "filters_well" | "creative_first" | "tired" | null;
|
|
180861
|
+
/** @description One Spanish sentence. */
|
|
180862
|
+
text: string | null;
|
|
180863
|
+
} | null;
|
|
179006
180864
|
/** @description The metric that RANKED the ad — the accepted-quote return, or (with `cash_evidence.used_for_ranking`) the better of it and the cash return. A surface naming the winner displays exactly this metric. */
|
|
179007
180865
|
lead: {
|
|
179008
180866
|
/** @enum {string} */
|
|
179009
|
-
metric: "accepted" | "cash";
|
|
180867
|
+
metric: "accepted" | "cash" | "expected";
|
|
179010
180868
|
value: number | null;
|
|
179011
180869
|
};
|
|
179012
180870
|
/** @description 1 = the best ad; null = not ranked (too little spend or people). */
|
|
@@ -179020,6 +180878,133 @@ interface components {
|
|
|
179020
180878
|
}[];
|
|
179021
180879
|
best_ad_external_id: string | null;
|
|
179022
180880
|
};
|
|
180881
|
+
AdsByLinea: {
|
|
180882
|
+
window: {
|
|
180883
|
+
from: string;
|
|
180884
|
+
to: string;
|
|
180885
|
+
days: number;
|
|
180886
|
+
};
|
|
180887
|
+
coverage: components["schemas"]["AdsCoverage"] & (Record<string, never> | null);
|
|
180888
|
+
/** @description Every live Línea (even with no ads), then «Sin línea» when it holds any. */
|
|
180889
|
+
lineas: {
|
|
180890
|
+
/**
|
|
180891
|
+
* Format: uuid
|
|
180892
|
+
* @description `null` = «Sin línea»: ads no rule places.
|
|
180893
|
+
*/
|
|
180894
|
+
linea_id: string | null;
|
|
180895
|
+
nombre: string | null;
|
|
180896
|
+
/** @description Ads of the window that belong here. */
|
|
180897
|
+
ads: number;
|
|
180898
|
+
/** @description Spend (CLP); null = unread. */
|
|
180899
|
+
spend: number | null;
|
|
180900
|
+
/** @description People whose first message came from these ads. */
|
|
180901
|
+
people: number | null;
|
|
180902
|
+
booked: number | null;
|
|
180903
|
+
attended: number | null;
|
|
180904
|
+
/** @description Accepted presupuestos / closed sales — pipeline, never cash. */
|
|
180905
|
+
accepted: {
|
|
180906
|
+
count: number;
|
|
180907
|
+
value: number;
|
|
180908
|
+
} | null;
|
|
180909
|
+
/** @description Attributed cash (CLP): first payment + later payments. */
|
|
180910
|
+
cash: {
|
|
180911
|
+
first: number;
|
|
180912
|
+
recurring: number;
|
|
180913
|
+
total: number;
|
|
180914
|
+
payments: number;
|
|
180915
|
+
} | null;
|
|
180916
|
+
ratios: {
|
|
180917
|
+
/** @description Accepted presupuestos / closed sales ÷ spend (×). */
|
|
180918
|
+
accepted_return: number | null;
|
|
180919
|
+
/** @description Cash (first + recurring payments) ÷ spend (×). */
|
|
180920
|
+
cash_return: number | null;
|
|
180921
|
+
/** @description First-payment cash ÷ spend (×). */
|
|
180922
|
+
first_payment_return: number | null;
|
|
180923
|
+
/** @description The spend of the people window ÷ `people` (CLP) — the same division as a campaign’s «por persona». */
|
|
180924
|
+
cost_per_person: number | null;
|
|
180925
|
+
/** @description The expected value of the ad’s bookings ÷ spend (×, D63): bookings × its Línea’s cash per evaluated new patient × the clinic’s show rate. */
|
|
180926
|
+
expected_return?: number | null;
|
|
180927
|
+
/** @description Spend ÷ bookings (CLP, «costo por cita agendada»). */
|
|
180928
|
+
cost_per_booking?: number | null;
|
|
180929
|
+
};
|
|
180930
|
+
}[];
|
|
180931
|
+
/** @description The scorecard’s own totals: the Líneas plus «Sin línea» add up to it. */
|
|
180932
|
+
totals: {
|
|
180933
|
+
/** @description Ads of the window that belong here. */
|
|
180934
|
+
ads: number;
|
|
180935
|
+
/** @description Spend (CLP); null = unread. */
|
|
180936
|
+
spend: number | null;
|
|
180937
|
+
/** @description People whose first message came from these ads. */
|
|
180938
|
+
people: number | null;
|
|
180939
|
+
booked: number | null;
|
|
180940
|
+
attended: number | null;
|
|
180941
|
+
/** @description Accepted presupuestos / closed sales — pipeline, never cash. */
|
|
180942
|
+
accepted: {
|
|
180943
|
+
count: number;
|
|
180944
|
+
value: number;
|
|
180945
|
+
} | null;
|
|
180946
|
+
/** @description Attributed cash (CLP): first payment + later payments. */
|
|
180947
|
+
cash: {
|
|
180948
|
+
first: number;
|
|
180949
|
+
recurring: number;
|
|
180950
|
+
total: number;
|
|
180951
|
+
payments: number;
|
|
180952
|
+
} | null;
|
|
180953
|
+
ratios: {
|
|
180954
|
+
/** @description Accepted presupuestos / closed sales ÷ spend (×). */
|
|
180955
|
+
accepted_return: number | null;
|
|
180956
|
+
/** @description Cash (first + recurring payments) ÷ spend (×). */
|
|
180957
|
+
cash_return: number | null;
|
|
180958
|
+
/** @description First-payment cash ÷ spend (×). */
|
|
180959
|
+
first_payment_return: number | null;
|
|
180960
|
+
/** @description The spend of the people window ÷ `people` (CLP) — the same division as a campaign’s «por persona». */
|
|
180961
|
+
cost_per_person: number | null;
|
|
180962
|
+
/** @description The expected value of the ad’s bookings ÷ spend (×, D63): bookings × its Línea’s cash per evaluated new patient × the clinic’s show rate. */
|
|
180963
|
+
expected_return?: number | null;
|
|
180964
|
+
/** @description Spend ÷ bookings (CLP, «costo por cita agendada»). */
|
|
180965
|
+
cost_per_booking?: number | null;
|
|
180966
|
+
};
|
|
180967
|
+
};
|
|
180968
|
+
/** @description D65 · the monthly and Monday split across Líneas against agenda capacity: best next peso first, each up to its current pace +20 % and never past what its free hours can take; a Línea with no hours gets $0. */
|
|
180969
|
+
plan?: {
|
|
180970
|
+
/** @description The account’s spend of the last 30 days (major units). */
|
|
180971
|
+
month_budget: number;
|
|
180972
|
+
week_budget: number;
|
|
180973
|
+
/** @description What no Línea can take this month (no hours, under 1×, capacity reached). */
|
|
180974
|
+
unallocated_month: number;
|
|
180975
|
+
lineas: {
|
|
180976
|
+
/** Format: uuid */
|
|
180977
|
+
linea_id: string;
|
|
180978
|
+
nombre: string;
|
|
180979
|
+
spend: number;
|
|
180980
|
+
/** @description That spend as a month. */
|
|
180981
|
+
pace_month: number;
|
|
180982
|
+
booked: number;
|
|
180983
|
+
cost_per_booking: number | null;
|
|
180984
|
+
/** @description Its ads’ cash (with 5 own payments) or expected value ÷ spend. */
|
|
180985
|
+
return: number | null;
|
|
180986
|
+
/** @description The return of its best ad with evidence — what the next peso earns; orders the split. */
|
|
180987
|
+
marginal_return: number | null;
|
|
180988
|
+
/** @description The agenda of the Línea’s professionals; `null` = unknown (never caps). */
|
|
180989
|
+
capacity: {
|
|
180990
|
+
free_minutes_14: number;
|
|
180991
|
+
visit_minutes: number;
|
|
180992
|
+
next_slot_day: string | null;
|
|
180993
|
+
slots_month: number;
|
|
180994
|
+
slots_week: number;
|
|
180995
|
+
bottleneck: boolean;
|
|
180996
|
+
} | null;
|
|
180997
|
+
/** @description Suggested budget for the month. */
|
|
180998
|
+
month: number;
|
|
180999
|
+
/** @description Suggested budget for this week (Monday). */
|
|
181000
|
+
week: number;
|
|
181001
|
+
/** @enum {string} */
|
|
181002
|
+
reason: "capacity" | "value" | "no_hours" | "low_return" | "no_data" | "no_ads";
|
|
181003
|
+
/** @description A usable hour within 7 days: the «reanudar» moment. */
|
|
181004
|
+
reopens_on: string | null;
|
|
181005
|
+
}[];
|
|
181006
|
+
} | null;
|
|
181007
|
+
};
|
|
179023
181008
|
AdsPeopleFunnel: {
|
|
179024
181009
|
window: {
|
|
179025
181010
|
from: string;
|
|
@@ -179541,7 +181526,7 @@ interface components {
|
|
|
179541
181526
|
/** @description `<kind>:<target external id>:<YYYY-MM-DD>` — a composite key, stable for a day. */
|
|
179542
181527
|
key: string;
|
|
179543
181528
|
/** @enum {string} */
|
|
179544
|
-
kind: "pause_ad" | "campaign_pause" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "url_tags_fix" | "send_setup" | "send_stage" | "send_dataset" | "send_stop" | "send_protected_move" | "nav";
|
|
181529
|
+
kind: "pause_ad" | "campaign_pause" | "adset_pause" | "ad_resume" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "url_tags_fix" | "send_setup" | "send_stage" | "send_dataset" | "send_stop" | "send_protected_move" | "nav";
|
|
179545
181530
|
screen: ("resumen" | "campanas" | "creativos" | "salud" | "envio")[];
|
|
179546
181531
|
/** @description The one card the rail leads with. */
|
|
179547
181532
|
primary: boolean;
|
|
@@ -179578,7 +181563,7 @@ interface components {
|
|
|
179578
181563
|
campaign_name: string | null;
|
|
179579
181564
|
}[];
|
|
179580
181565
|
};
|
|
179581
|
-
/** @description The engine’s own vocabulary, e.g. `{ budget_change_pct: 20 }`. `url_tags_fix`: `{ ads: [{ external_id, expected_url_tags, url_tags }] }` — each ad’s current parameters (null = none) and exactly what it gets. «Enviar a Meta»: `send_setup`/`send_dataset` `{ dataset_id }`, `send_stage` `{ stage, enabled, meta_event, active_ad_sets }`. `campaign_pause`: `{ period_spend, period_days, delivering_ads_count, avg_daily_spend_7d }` — the campaign’s spend in the listed period (the account currency’s major units), the period’s days and its delivering ads, what the card draws at rest (spend → 0, ~spend/days a day); `avg_daily_spend_7d` is the live 7-day daily mean the preview shows (`AdsMoney`: exact decimal + currency), `null` when the list could not know it (real mode reads it only at preview) — fall back to `period_spend / period_days`, labelled as the period. Agenda capacity (clinics): a `nav` card with `params.card = "capacity_bottleneck"` REPLACES an ad's «Pausar» (`variant: "pause"`) or a «Subir» (`variant: "budget"`) when the specialty the ad books has no usable hour for more than 7 days (or under 2 bookable hours in 14): `{ card, variant, especialidad, mapping_source: "map" | "booked" | "name", unmapped: false, next_slot_day, searched_through, free_minutes_14, booked_minutes_14, fill_14, visit_minutes, evaluation_price, price_above_median, people, booked, booking_rate, median_booking_rate, waitlist_30d }` — counts, minutes and dates, never a probability; `waitlist_30d` = people waiting now for that specialty (the clinic waitlist demand feed), `null` when the feed is absent or 0 — the card then carries no «N personas esperan hora con X hoy» sentence. A `pause_ad` whose ad books an unknown specialty carries `params.capacity = { unmapped: true }` (ask which specialty; `tenant.settings.ads.specialty_map`). */
|
|
181566
|
+
/** @description The engine’s own vocabulary, e.g. `{ budget_change_pct: 20 }`. `url_tags_fix`: `{ ads: [{ external_id, expected_url_tags, url_tags }] }` — each ad’s current parameters (null = none) and exactly what it gets. «Enviar a Meta»: `send_setup`/`send_dataset` `{ dataset_id }`, `send_stage` `{ stage, enabled, meta_event, active_ad_sets }`. `campaign_pause`: `{ period_spend, period_days, delivering_ads_count, avg_daily_spend_7d }` — the campaign’s spend in the listed period (the account currency’s major units), the period’s days and its delivering ads, what the card draws at rest (spend → 0, ~spend/days a day); `avg_daily_spend_7d` is the live 7-day daily mean the preview shows (`AdsMoney`: exact decimal + currency), `null` when the list could not know it (real mode reads it only at preview) — fall back to `period_spend / period_days`, labelled as the period. `adset_pause` (D62): `{ ad_ids, period_spend, share, booking_rate, sibling_ad_set, sibling_booking_rate, budget_level }` — the ad set’s delivering ads (bound into the approval: only those the preview read as showing), its share of the campaign’s spend and its booking rate vs its best sibling’s; with a campaign budget Meta moves the money to the sibling. A `nav` card with `params.card = "campaign_budget"` is a scale on a campaign that owns its budget: `{ campaign_external_id, daily_budget, new_daily_budget, step_pct }` — the change is made in Meta (`href`). `params.card = "funnel_leak"` (D66): the account books under 10 % of the people who write from ads — `{ people, booked, booking_rate, booking_interval, benchmark, by_ad }`. Agenda capacity (clinics): a `nav` card with `params.card = "capacity_bottleneck"` REPLACES an ad's «Pausar» (`variant: "pause"`) or a «Subir» (`variant: "budget"`) when the specialty the ad books has no usable hour for more than 7 days (or under 2 bookable hours in 14): `{ card, variant, especialidad, mapping_source: "map" | "booked" | "name", unmapped: false, next_slot_day, searched_through, free_minutes_14, booked_minutes_14, fill_14, visit_minutes, evaluation_price, price_above_median, people, booked, booking_rate, median_booking_rate, waitlist_30d }` — counts, minutes and dates, never a probability; `waitlist_30d` = people waiting now for that specialty (the clinic waitlist demand feed), `null` when the feed is absent or 0 — the card then carries no «N personas esperan hora con X hoy» sentence. A `pause_ad` whose ad books an unknown specialty carries `params.capacity = { unmapped: true }` (ask which specialty; `tenant.settings.ads.specialty_map`). */
|
|
179582
181567
|
params: {
|
|
179583
181568
|
[key: string]: unknown;
|
|
179584
181569
|
};
|
|
@@ -179588,7 +181573,7 @@ interface components {
|
|
|
179588
181573
|
/** @description Which operation executes it; `null` for `nav`. */
|
|
179589
181574
|
engine_ref: {
|
|
179590
181575
|
/** @enum {string} */
|
|
179591
|
-
op: "recommendations.apply" | "ads.pause" | "campaigns.pause" | "campaigns.resume" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | "quality.url_tags_apply" | "quality.url_tags_undo" | "send.setup" | "send.dataset" | "send.stage" | "send.stop" | "send.restore";
|
|
181576
|
+
op: "recommendations.apply" | "ads.pause" | "ads.pause_set" | "ads.resume" | "ads.resume_set" | "adsets.budget" | "campaigns.pause" | "campaigns.resume" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | "quality.url_tags_apply" | "quality.url_tags_undo" | "send.setup" | "send.dataset" | "send.stage" | "send.stop" | "send.restore";
|
|
179592
181577
|
recommendation_id?: string;
|
|
179593
181578
|
} | null;
|
|
179594
181579
|
/** @description `nav` only: a workspace-relative path (`/anuncios/atribuidos?c=…`, `/anuncios/activar?paso=tag`), or an absolute Meta Ads Manager URL built from Meta ids (`https://www.facebook.com/adsmanager/…`) — open it in a new tab; it changes nothing by itself. */
|
|
@@ -179596,6 +181581,12 @@ interface components {
|
|
|
179596
181581
|
cta?: string;
|
|
179597
181582
|
/** @description Fact keys the card is built from. */
|
|
179598
181583
|
facts: string[];
|
|
181584
|
+
/** @description How sure the per-ad verdict behind a pause / scale card is (D64): «seguro», «probable», or «falta data» with ≈ `people_needed` more people. Absent on cards that rest on no per-ad verdict. */
|
|
181585
|
+
confidence?: {
|
|
181586
|
+
/** @enum {string} */
|
|
181587
|
+
level: "seguro" | "probable" | "falta_data";
|
|
181588
|
+
people_needed: number | null;
|
|
181589
|
+
};
|
|
179599
181590
|
dismissed_until: string | null;
|
|
179600
181591
|
/**
|
|
179601
181592
|
* @description Set on a listed action that cannot run yet — show it disabled. `consent_pending`: its consent text is not published yet (`send_protected_move`, the move of the ad sets onto the protected dataset of a restricted clinic dataset).
|
|
@@ -179673,7 +181664,7 @@ interface components {
|
|
|
179673
181664
|
} | null;
|
|
179674
181665
|
reversible: boolean;
|
|
179675
181666
|
/** @enum {string|null} */
|
|
179676
|
-
engine_op: "recommendations.apply" | "ads.pause" | "campaigns.pause" | "campaigns.resume" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | "quality.url_tags_apply" | "quality.url_tags_undo" | "send.setup" | "send.dataset" | "send.stage" | "send.stop" | "send.restore" | null;
|
|
181667
|
+
engine_op: "recommendations.apply" | "ads.pause" | "ads.pause_set" | "ads.resume" | "ads.resume_set" | "adsets.budget" | "campaigns.pause" | "campaigns.resume" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback" | "quality.url_tags_apply" | "quality.url_tags_undo" | "send.setup" | "send.dataset" | "send.stage" | "send.stop" | "send.restore" | null;
|
|
179677
181668
|
/** @description `campaign_pause` only: the line the sheet leads with — «Pausar «{campaign}» · detiene {n} anuncios · ~$X al día» (the count and the daily figure are dropped when unknown). */
|
|
179678
181669
|
summary?: string;
|
|
179679
181670
|
campaign?: components["schemas"]["AdsCampaignPauseSnapshot"];
|
|
@@ -179683,7 +181674,7 @@ interface components {
|
|
|
179683
181674
|
id: string;
|
|
179684
181675
|
action_key: string;
|
|
179685
181676
|
/** @enum {string} */
|
|
179686
|
-
kind: "pause_ad" | "campaign_pause" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "url_tags_fix" | "send_setup" | "send_stage" | "send_dataset" | "send_stop";
|
|
181677
|
+
kind: "pause_ad" | "campaign_pause" | "adset_pause" | "ad_resume" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck" | "url_tags_fix" | "send_setup" | "send_stage" | "send_dataset" | "send_stop";
|
|
179687
181678
|
/** @enum {string} */
|
|
179688
181679
|
status: "queued" | "running" | "succeeded" | "failed" | "refused" | "rolled_back";
|
|
179689
181680
|
target: {
|
|
@@ -180025,7 +182016,7 @@ interface components {
|
|
|
180025
182016
|
* @description The outcome stage. `first_payment` = a clinic’s first payment of an accepted plan («Primer pago»), the Purchase Meta receives after the switch. `web_form` = a landing-page form a connected CRM reported («Formulario web»); `checkout_started` = the person opened a Vitrina payment link («Abrió el link de pago»); `deposit_paid` = a deposit (booking, evaluation or reservation) fully paid («Abono pagado»).
|
|
180026
182017
|
* @enum {string}
|
|
180027
182018
|
*/
|
|
180028
|
-
stage: "lead_created" | "web_form" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
182019
|
+
stage: "lead_created" | "web_form" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "returning_first_payment" | "payment_received";
|
|
180029
182020
|
/**
|
|
180030
182021
|
* @description Which system recorded the outcome: `vitrina` — Vitrina itself (a conversation, a booking, a payment it registered); `gohighlevel` / `mercadopago` — the provider the workspace connected reported it to the attribution engine (a Website ad’s form, booking or payment), and Vitrina lists it. Such a row may have no contact (`contact.id` `""`): a healthcare workspace’s provider events never carry the person.
|
|
180031
182022
|
* @enum {string}
|
|
@@ -180123,7 +182114,7 @@ interface components {
|
|
|
180123
182114
|
* @description The outcome stage of a recorded step (the vocabulary key); `null` on a touch. `first_payment` is a plan’s first payment (shown once, in place of that payment’s `payment_received`).
|
|
180124
182115
|
* @enum {string|null}
|
|
180125
182116
|
*/
|
|
180126
|
-
stage: "lead_created" | "web_form" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received" | "first_payment" | "returning_first_payment" | null;
|
|
182117
|
+
stage: "lead_created" | "web_form" | "lead_qualified" | "appointment_booked" | "checkout_started" | "deposit_paid" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received" | "first_payment" | "returning_first_payment" | null;
|
|
180127
182118
|
/** @description Ready to render, in the workspace’s own vocabulary. */
|
|
180128
182119
|
label: string;
|
|
180129
182120
|
detail: string | null;
|