@vitrina/api 14.13.1 → 14.14.1

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 CHANGED
@@ -22097,7 +22097,7 @@ interface paths {
22097
22097
  pipeline_id?: string;
22098
22098
  stage_id?: string;
22099
22099
  status?: "open" | "won" | "lost" | "unqualified";
22100
- source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form";
22100
+ source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | "campaign";
22101
22101
  intent?: "buy" | "sell" | "financing" | "trade_in";
22102
22102
  owner_user_id?: string;
22103
22103
  team_id?: string;
@@ -22428,7 +22428,7 @@ interface paths {
22428
22428
  title: string;
22429
22429
  notes?: string | null;
22430
22430
  /** @enum {string} */
22431
- source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace";
22431
+ source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "campaign";
22432
22432
  /** @enum {string} */
22433
22433
  intent?: "buy" | "sell" | "financing" | "trade_in";
22434
22434
  source_ref?: string | null;
@@ -28130,7 +28130,7 @@ interface paths {
28130
28130
  [key: string]: string;
28131
28131
  } | null;
28132
28132
  /** @enum {string|null} */
28133
- origin_channel?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | null;
28133
+ origin_channel?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | "campaign" | null;
28134
28134
  tax_id?: string | null;
28135
28135
  /** @enum {string|null} */
28136
28136
  tax_id_kind?: "rut" | "passport" | "foreign_tax_id" | null;
@@ -28494,7 +28494,7 @@ interface paths {
28494
28494
  [key: string]: string;
28495
28495
  } | null;
28496
28496
  /** @enum {string|null} */
28497
- origin_channel?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | null;
28497
+ origin_channel?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | "campaign" | null;
28498
28498
  tax_id?: string | null;
28499
28499
  /** @enum {string|null} */
28500
28500
  tax_id_kind?: "rut" | "passport" | "foreign_tax_id" | null;
@@ -82917,7 +82917,7 @@ interface paths {
82917
82917
  * "updated_at": "2026-10-11T12:00:00.000Z",
82918
82918
  * "confirm_status_id": null,
82919
82919
  * "confirm_status": null,
82920
- * "create_contacts_from_patient_phone": false,
82920
+ * "create_contacts_from_patient_phone": true,
82921
82921
  * "messaging_account_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b20",
82922
82922
  * "accounts": [
82923
82923
  * {
@@ -83300,7 +83300,7 @@ interface paths {
83300
83300
  * "updated_at": "2026-10-11T12:00:00.000Z",
83301
83301
  * "confirm_status_id": null,
83302
83302
  * "confirm_status": null,
83303
- * "create_contacts_from_patient_phone": false,
83303
+ * "create_contacts_from_patient_phone": true,
83304
83304
  * "messaging_account_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b20",
83305
83305
  * "accounts": [
83306
83306
  * {
@@ -83762,7 +83762,7 @@ interface paths {
83762
83762
  * "updated_at": "2026-10-11T12:00:00.000Z",
83763
83763
  * "confirm_status_id": null,
83764
83764
  * "confirm_status": null,
83765
- * "create_contacts_from_patient_phone": false,
83765
+ * "create_contacts_from_patient_phone": true,
83766
83766
  * "messaging_account_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b20",
83767
83767
  * "accounts": [
83768
83768
  * {
@@ -84082,7 +84082,7 @@ interface paths {
84082
84082
  * "updated_at": "2026-10-11T12:00:00.000Z",
84083
84083
  * "confirm_status_id": null,
84084
84084
  * "confirm_status": null,
84085
- * "create_contacts_from_patient_phone": false,
84085
+ * "create_contacts_from_patient_phone": true,
84086
84086
  * "messaging_account_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b20",
84087
84087
  * "accounts": [
84088
84088
  * {
@@ -166770,6 +166770,329 @@ interface paths {
166770
166770
  patch?: never;
166771
166771
  trace?: never;
166772
166772
  };
166773
+ "/whatsapp-templates/{id}/analytics": {
166774
+ parameters: {
166775
+ query?: never;
166776
+ header?: never;
166777
+ path?: never;
166778
+ cookie?: never;
166779
+ };
166780
+ /**
166781
+ * A WhatsApp template’s analytics (Vitrina’s own data)
166782
+ * @description What happened to every send of this template in the range, from Vitrina’s own records — available on every number, including the WhatsApp Business app (coexistence) numbers Meta gives no template insights. `sent` = sends Meta accepted (every sender: campaigns, Seguimientos, Recontacto, first touch, clinic notices, the inbox, tests); `delivered` / `read` / `failed` from the delivery receipts; `replied` = the person wrote on the same number within 72 h and this was their latest template; `opted_out` = the number opted out within 72 h. Broken down by sender, by quick-reply button (a reply whose first line is a button label) and by Meta failure code with a plain-language reason, plus a per-day (or per-week) series by send time in the workspace time zone. Sends are kept 400 days; sender and reply tracking start 2026-10-14 (older sends were backfilled where derivable).
166783
+ */
166784
+ get: {
166785
+ parameters: {
166786
+ query?: {
166787
+ /** @description Range start: an ISO instant, or a calendar date (YYYY-MM-DD) in the workspace time zone. Default: 30 days before `to`. */
166788
+ from?: string;
166789
+ /** @description Range end: an ISO instant, or a calendar date (YYYY-MM-DD, inclusive — runs to the end of that day) in the workspace time zone. Default: now. At most 400 days after `from`. */
166790
+ to?: string;
166791
+ /** @description Bucket of the `daily` series. Default: day, or week for a range longer than 92 days. */
166792
+ group_by?: "day" | "week";
166793
+ };
166794
+ header?: never;
166795
+ path: {
166796
+ id: string;
166797
+ };
166798
+ cookie?: never;
166799
+ };
166800
+ requestBody?: never;
166801
+ responses: {
166802
+ /** @description The template’s analytics */
166803
+ 200: {
166804
+ headers: {
166805
+ [name: string]: unknown;
166806
+ };
166807
+ content: {
166808
+ /**
166809
+ * @example {
166810
+ * "data": {
166811
+ * "template": {
166812
+ * "id": "0199a3c2-7b10-7000-8000-0000000000a1",
166813
+ * "name": "invitacion_exclusiva_v2",
166814
+ * "language": "es",
166815
+ * "category": "MARKETING",
166816
+ * "status": "APPROVED",
166817
+ * "messaging_account_id": "0199a3c2-7b10-7000-8000-0000000000b1"
166818
+ * },
166819
+ * "range": {
166820
+ * "from": "2026-09-15T03:00:00.000Z",
166821
+ * "to": "2026-10-14T18:00:00.000Z",
166822
+ * "timezone": "America/Santiago",
166823
+ * "group_by": "day"
166824
+ * },
166825
+ * "totals": {
166826
+ * "sent": 120,
166827
+ * "delivered": 110,
166828
+ * "read": 84,
166829
+ * "failed": 6,
166830
+ * "replied": 31,
166831
+ * "opted_out": 2
166832
+ * },
166833
+ * "rates": {
166834
+ * "delivered": 0.9167,
166835
+ * "read": 0.7636,
166836
+ * "replied": 0.2583,
166837
+ * "failed": 0.05
166838
+ * },
166839
+ * "by_sender": [
166840
+ * {
166841
+ * "sender": "campaign",
166842
+ * "sent": 100,
166843
+ * "delivered": 92,
166844
+ * "read": 70,
166845
+ * "failed": 5,
166846
+ * "replied": 24
166847
+ * },
166848
+ * {
166849
+ * "sender": "manual",
166850
+ * "sent": 20,
166851
+ * "delivered": 18,
166852
+ * "read": 14,
166853
+ * "failed": 1,
166854
+ * "replied": 7
166855
+ * }
166856
+ * ],
166857
+ * "buttons": [
166858
+ * {
166859
+ * "text": "Quiero mi cupo",
166860
+ * "count": 18
166861
+ * },
166862
+ * {
166863
+ * "text": "No me interesa",
166864
+ * "count": 3
166865
+ * }
166866
+ * ],
166867
+ * "free_text": 10,
166868
+ * "failures": [
166869
+ * {
166870
+ * "code": "131026",
166871
+ * "title": "Message undeliverable",
166872
+ * "human_es": "El número no puede recibir mensajes de WhatsApp.",
166873
+ * "human_en": "The number cannot receive WhatsApp messages.",
166874
+ * "action": "remove_number",
166875
+ * "count": 6
166876
+ * }
166877
+ * ],
166878
+ * "daily": [
166879
+ * {
166880
+ * "date": "2026-10-13",
166881
+ * "sent": 80,
166882
+ * "delivered": 74,
166883
+ * "read": 60,
166884
+ * "failed": 4,
166885
+ * "replied": 22
166886
+ * },
166887
+ * {
166888
+ * "date": "2026-10-14",
166889
+ * "sent": 40,
166890
+ * "delivered": 36,
166891
+ * "read": 24,
166892
+ * "failed": 2,
166893
+ * "replied": 9
166894
+ * }
166895
+ * ]
166896
+ * }
166897
+ * }
166898
+ */
166899
+ "application/json": {
166900
+ data: components["schemas"]["WhatsappTemplateAnalytics"];
166901
+ meta?: {
166902
+ [key: string]: unknown;
166903
+ };
166904
+ };
166905
+ };
166906
+ };
166907
+ /** @description Validation error */
166908
+ 400: {
166909
+ headers: {
166910
+ [name: string]: unknown;
166911
+ };
166912
+ content: {
166913
+ "application/json": components["schemas"]["Error"];
166914
+ };
166915
+ };
166916
+ /** @description Unauthorized */
166917
+ 401: {
166918
+ headers: {
166919
+ [name: string]: unknown;
166920
+ };
166921
+ content: {
166922
+ "application/json": components["schemas"]["Error"];
166923
+ };
166924
+ };
166925
+ /** @description Forbidden */
166926
+ 403: {
166927
+ headers: {
166928
+ [name: string]: unknown;
166929
+ };
166930
+ content: {
166931
+ "application/json": components["schemas"]["Error"];
166932
+ };
166933
+ };
166934
+ /** @description Not found */
166935
+ 404: {
166936
+ headers: {
166937
+ [name: string]: unknown;
166938
+ };
166939
+ content: {
166940
+ "application/json": components["schemas"]["Error"];
166941
+ };
166942
+ };
166943
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
166944
+ 409: {
166945
+ headers: {
166946
+ [name: string]: unknown;
166947
+ };
166948
+ content: {
166949
+ "application/json": components["schemas"]["Error"];
166950
+ };
166951
+ };
166952
+ /** @description Rate limited */
166953
+ 429: {
166954
+ headers: {
166955
+ [name: string]: unknown;
166956
+ };
166957
+ content: {
166958
+ "application/json": components["schemas"]["Error"];
166959
+ };
166960
+ };
166961
+ };
166962
+ };
166963
+ put?: never;
166964
+ post?: never;
166965
+ delete?: never;
166966
+ options?: never;
166967
+ head?: never;
166968
+ patch?: never;
166969
+ trace?: never;
166970
+ };
166971
+ "/whatsapp-templates/analytics/summary": {
166972
+ parameters: {
166973
+ query?: never;
166974
+ header?: never;
166975
+ path?: never;
166976
+ cookie?: never;
166977
+ };
166978
+ /**
166979
+ * Sends, reads, replies and failures per WhatsApp template
166980
+ * @description The list-page numbers for every template of the workspace in one read: per template with at least one send in the range, the counts of `GET /whatsapp-templates/{id}/analytics`’s totals. Same sources and definitions.
166981
+ */
166982
+ get: {
166983
+ parameters: {
166984
+ query?: {
166985
+ /** @description Range start: an ISO instant, or a calendar date (YYYY-MM-DD) in the workspace time zone. Default: 30 days before `to`. */
166986
+ from?: string;
166987
+ /** @description Range end: an ISO instant, or a calendar date (YYYY-MM-DD, inclusive — runs to the end of that day) in the workspace time zone. Default: now. At most 400 days after `from`. */
166988
+ to?: string;
166989
+ };
166990
+ header?: never;
166991
+ path?: never;
166992
+ cookie?: never;
166993
+ };
166994
+ requestBody?: never;
166995
+ responses: {
166996
+ /** @description Per-template counts */
166997
+ 200: {
166998
+ headers: {
166999
+ [name: string]: unknown;
167000
+ };
167001
+ content: {
167002
+ /**
167003
+ * @example {
167004
+ * "data": {
167005
+ * "range": {
167006
+ * "from": "2026-09-15T03:00:00.000Z",
167007
+ * "to": "2026-10-14T18:00:00.000Z",
167008
+ * "timezone": "America/Santiago"
167009
+ * },
167010
+ * "templates": [
167011
+ * {
167012
+ * "template_id": "0199a3c2-7b10-7000-8000-0000000000a1",
167013
+ * "sent": 120,
167014
+ * "delivered": 110,
167015
+ * "read": 84,
167016
+ * "failed": 6,
167017
+ * "replied": 31,
167018
+ * "opted_out": 2
167019
+ * }
167020
+ * ]
167021
+ * }
167022
+ * }
167023
+ */
167024
+ "application/json": {
167025
+ data: components["schemas"]["WhatsappTemplateAnalyticsSummary"];
167026
+ meta?: {
167027
+ [key: string]: unknown;
167028
+ };
167029
+ };
167030
+ };
167031
+ };
167032
+ /** @description Validation error */
167033
+ 400: {
167034
+ headers: {
167035
+ [name: string]: unknown;
167036
+ };
167037
+ content: {
167038
+ "application/json": components["schemas"]["Error"];
167039
+ };
167040
+ };
167041
+ /** @description Unauthorized */
167042
+ 401: {
167043
+ headers: {
167044
+ [name: string]: unknown;
167045
+ };
167046
+ content: {
167047
+ "application/json": components["schemas"]["Error"];
167048
+ };
167049
+ };
167050
+ /** @description Forbidden */
167051
+ 403: {
167052
+ headers: {
167053
+ [name: string]: unknown;
167054
+ };
167055
+ content: {
167056
+ "application/json": components["schemas"]["Error"];
167057
+ };
167058
+ };
167059
+ /** @description Not found */
167060
+ 404: {
167061
+ headers: {
167062
+ [name: string]: unknown;
167063
+ };
167064
+ content: {
167065
+ "application/json": components["schemas"]["Error"];
167066
+ };
167067
+ };
167068
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
167069
+ 409: {
167070
+ headers: {
167071
+ [name: string]: unknown;
167072
+ };
167073
+ content: {
167074
+ "application/json": components["schemas"]["Error"];
167075
+ };
167076
+ };
167077
+ /** @description Rate limited */
167078
+ 429: {
167079
+ headers: {
167080
+ [name: string]: unknown;
167081
+ };
167082
+ content: {
167083
+ "application/json": components["schemas"]["Error"];
167084
+ };
167085
+ };
167086
+ };
167087
+ };
167088
+ put?: never;
167089
+ post?: never;
167090
+ delete?: never;
167091
+ options?: never;
167092
+ head?: never;
167093
+ patch?: never;
167094
+ trace?: never;
167095
+ };
166773
167096
  "/whatsapp-templates": {
166774
167097
  parameters: {
166775
167098
  query?: never;
@@ -185076,6 +185399,125 @@ interface components {
185076
185399
  text_hash: string;
185077
185400
  };
185078
185401
  };
185402
+ WhatsappTemplateAnalytics: {
185403
+ template: {
185404
+ /** Format: uuid */
185405
+ id: string;
185406
+ name: string;
185407
+ language: string;
185408
+ category: string;
185409
+ status: string;
185410
+ /** Format: uuid */
185411
+ messaging_account_id: string;
185412
+ };
185413
+ range: {
185414
+ /** @description ISO instant (inclusive). */
185415
+ from: string;
185416
+ /** @description ISO instant (exclusive). */
185417
+ to: string;
185418
+ /** @description The workspace time zone the days are cut in. */
185419
+ timezone: string;
185420
+ /** @enum {string} */
185421
+ group_by: "day" | "week";
185422
+ };
185423
+ totals: {
185424
+ /** @description Template sends Meta accepted. */
185425
+ sent: number;
185426
+ /** @description Of them, delivered (or read) per the delivery receipts. */
185427
+ delivered: number;
185428
+ read: number;
185429
+ /** @description Accepted, then reported failed by Meta (receipt). */
185430
+ failed: number;
185431
+ /** @description The person wrote on the same number within 72 h and this was their latest template (last touch). */
185432
+ replied: number;
185433
+ /** @description Sends after which the number opted out of WhatsApp within 72 h. */
185434
+ opted_out: number;
185435
+ };
185436
+ /** @description 0–1 fractions; null when the denominator is 0. */
185437
+ rates: {
185438
+ /** @description delivered / sent */
185439
+ delivered: number | null;
185440
+ /** @description read / delivered */
185441
+ read: number | null;
185442
+ /** @description replied / sent */
185443
+ replied: number | null;
185444
+ /** @description failed / sent */
185445
+ failed: number | null;
185446
+ };
185447
+ /** @description Who sent the template, most sends first. */
185448
+ by_sender: {
185449
+ /**
185450
+ * @description campaign, followup (Seguimientos), recontacto, first_touch, clinic (reminders and notices), manual (inbox / copilot / API), test (campaign test sends), other (staff notices, digests, sends before 2026-10-14 that could not be told apart).
185451
+ * @enum {string}
185452
+ */
185453
+ sender: "campaign" | "followup" | "recontacto" | "first_touch" | "clinic" | "manual" | "test" | "other";
185454
+ /** @description Template sends Meta accepted. */
185455
+ sent: number;
185456
+ /** @description Of them, delivered (or read) per the delivery receipts. */
185457
+ delivered: number;
185458
+ read: number;
185459
+ /** @description Accepted, then reported failed by Meta (receipt). */
185460
+ failed: number;
185461
+ /** @description The person wrote on the same number within 72 h and this was their latest template (last touch). */
185462
+ replied: number;
185463
+ }[];
185464
+ /** @description Replies whose first message was a tap on one of the template's quick-reply buttons (every button listed, zeros included). */
185465
+ buttons: {
185466
+ text: string;
185467
+ count: number;
185468
+ }[];
185469
+ /** @description Replies whose first message was not a button tap. */
185470
+ free_text: number;
185471
+ /** @description Failed sends by Meta error code, with a plain-language reason. */
185472
+ failures: {
185473
+ code: string;
185474
+ title: string;
185475
+ human_es: string;
185476
+ human_en: string;
185477
+ /** @enum {string} */
185478
+ action: "none" | "remove_number" | "retry_later" | "check_template";
185479
+ count: number;
185480
+ }[];
185481
+ /** @description Every day (or week) of the range by send time, zeros included. */
185482
+ daily: {
185483
+ /** @description Bucket start (YYYY-MM-DD, workspace time zone). */
185484
+ date: string;
185485
+ /** @description Template sends Meta accepted. */
185486
+ sent: number;
185487
+ /** @description Of them, delivered (or read) per the delivery receipts. */
185488
+ delivered: number;
185489
+ read: number;
185490
+ /** @description Accepted, then reported failed by Meta (receipt). */
185491
+ failed: number;
185492
+ /** @description The person wrote on the same number within 72 h and this was their latest template (last touch). */
185493
+ replied: number;
185494
+ }[];
185495
+ };
185496
+ WhatsappTemplateAnalyticsSummary: {
185497
+ range: {
185498
+ /** @description ISO instant (inclusive). */
185499
+ from: string;
185500
+ /** @description ISO instant (exclusive). */
185501
+ to: string;
185502
+ /** @description The workspace time zone the days are cut in. */
185503
+ timezone: string;
185504
+ };
185505
+ /** @description Templates with at least one send in the range, most sends first. A template absent here sent nothing. */
185506
+ templates: {
185507
+ /** Format: uuid */
185508
+ template_id: string;
185509
+ /** @description Template sends Meta accepted. */
185510
+ sent: number;
185511
+ /** @description Of them, delivered (or read) per the delivery receipts. */
185512
+ delivered: number;
185513
+ read: number;
185514
+ /** @description Accepted, then reported failed by Meta (receipt). */
185515
+ failed: number;
185516
+ /** @description The person wrote on the same number within 72 h and this was their latest template (last touch). */
185517
+ replied: number;
185518
+ opted_out: number;
185519
+ }[];
185520
+ };
185079
185521
  WhatsappFlowCondition: {
185080
185522
  field: string;
185081
185523
  /** @enum {string} */
package/dist/index.d.ts CHANGED
@@ -22097,7 +22097,7 @@ interface paths {
22097
22097
  pipeline_id?: string;
22098
22098
  stage_id?: string;
22099
22099
  status?: "open" | "won" | "lost" | "unqualified";
22100
- source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form";
22100
+ source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | "campaign";
22101
22101
  intent?: "buy" | "sell" | "financing" | "trade_in";
22102
22102
  owner_user_id?: string;
22103
22103
  team_id?: string;
@@ -22428,7 +22428,7 @@ interface paths {
22428
22428
  title: string;
22429
22429
  notes?: string | null;
22430
22430
  /** @enum {string} */
22431
- source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace";
22431
+ source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "campaign";
22432
22432
  /** @enum {string} */
22433
22433
  intent?: "buy" | "sell" | "financing" | "trade_in";
22434
22434
  source_ref?: string | null;
@@ -28130,7 +28130,7 @@ interface paths {
28130
28130
  [key: string]: string;
28131
28131
  } | null;
28132
28132
  /** @enum {string|null} */
28133
- origin_channel?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | null;
28133
+ origin_channel?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | "campaign" | null;
28134
28134
  tax_id?: string | null;
28135
28135
  /** @enum {string|null} */
28136
28136
  tax_id_kind?: "rut" | "passport" | "foreign_tax_id" | null;
@@ -28494,7 +28494,7 @@ interface paths {
28494
28494
  [key: string]: string;
28495
28495
  } | null;
28496
28496
  /** @enum {string|null} */
28497
- origin_channel?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | null;
28497
+ origin_channel?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | "campaign" | null;
28498
28498
  tax_id?: string | null;
28499
28499
  /** @enum {string|null} */
28500
28500
  tax_id_kind?: "rut" | "passport" | "foreign_tax_id" | null;
@@ -82917,7 +82917,7 @@ interface paths {
82917
82917
  * "updated_at": "2026-10-11T12:00:00.000Z",
82918
82918
  * "confirm_status_id": null,
82919
82919
  * "confirm_status": null,
82920
- * "create_contacts_from_patient_phone": false,
82920
+ * "create_contacts_from_patient_phone": true,
82921
82921
  * "messaging_account_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b20",
82922
82922
  * "accounts": [
82923
82923
  * {
@@ -83300,7 +83300,7 @@ interface paths {
83300
83300
  * "updated_at": "2026-10-11T12:00:00.000Z",
83301
83301
  * "confirm_status_id": null,
83302
83302
  * "confirm_status": null,
83303
- * "create_contacts_from_patient_phone": false,
83303
+ * "create_contacts_from_patient_phone": true,
83304
83304
  * "messaging_account_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b20",
83305
83305
  * "accounts": [
83306
83306
  * {
@@ -83762,7 +83762,7 @@ interface paths {
83762
83762
  * "updated_at": "2026-10-11T12:00:00.000Z",
83763
83763
  * "confirm_status_id": null,
83764
83764
  * "confirm_status": null,
83765
- * "create_contacts_from_patient_phone": false,
83765
+ * "create_contacts_from_patient_phone": true,
83766
83766
  * "messaging_account_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b20",
83767
83767
  * "accounts": [
83768
83768
  * {
@@ -84082,7 +84082,7 @@ interface paths {
84082
84082
  * "updated_at": "2026-10-11T12:00:00.000Z",
84083
84083
  * "confirm_status_id": null,
84084
84084
  * "confirm_status": null,
84085
- * "create_contacts_from_patient_phone": false,
84085
+ * "create_contacts_from_patient_phone": true,
84086
84086
  * "messaging_account_id": "0198f3c2-6d1e-7a52-9c5b-3f1d2e7a4b20",
84087
84087
  * "accounts": [
84088
84088
  * {
@@ -166770,6 +166770,329 @@ interface paths {
166770
166770
  patch?: never;
166771
166771
  trace?: never;
166772
166772
  };
166773
+ "/whatsapp-templates/{id}/analytics": {
166774
+ parameters: {
166775
+ query?: never;
166776
+ header?: never;
166777
+ path?: never;
166778
+ cookie?: never;
166779
+ };
166780
+ /**
166781
+ * A WhatsApp template’s analytics (Vitrina’s own data)
166782
+ * @description What happened to every send of this template in the range, from Vitrina’s own records — available on every number, including the WhatsApp Business app (coexistence) numbers Meta gives no template insights. `sent` = sends Meta accepted (every sender: campaigns, Seguimientos, Recontacto, first touch, clinic notices, the inbox, tests); `delivered` / `read` / `failed` from the delivery receipts; `replied` = the person wrote on the same number within 72 h and this was their latest template; `opted_out` = the number opted out within 72 h. Broken down by sender, by quick-reply button (a reply whose first line is a button label) and by Meta failure code with a plain-language reason, plus a per-day (or per-week) series by send time in the workspace time zone. Sends are kept 400 days; sender and reply tracking start 2026-10-14 (older sends were backfilled where derivable).
166783
+ */
166784
+ get: {
166785
+ parameters: {
166786
+ query?: {
166787
+ /** @description Range start: an ISO instant, or a calendar date (YYYY-MM-DD) in the workspace time zone. Default: 30 days before `to`. */
166788
+ from?: string;
166789
+ /** @description Range end: an ISO instant, or a calendar date (YYYY-MM-DD, inclusive — runs to the end of that day) in the workspace time zone. Default: now. At most 400 days after `from`. */
166790
+ to?: string;
166791
+ /** @description Bucket of the `daily` series. Default: day, or week for a range longer than 92 days. */
166792
+ group_by?: "day" | "week";
166793
+ };
166794
+ header?: never;
166795
+ path: {
166796
+ id: string;
166797
+ };
166798
+ cookie?: never;
166799
+ };
166800
+ requestBody?: never;
166801
+ responses: {
166802
+ /** @description The template’s analytics */
166803
+ 200: {
166804
+ headers: {
166805
+ [name: string]: unknown;
166806
+ };
166807
+ content: {
166808
+ /**
166809
+ * @example {
166810
+ * "data": {
166811
+ * "template": {
166812
+ * "id": "0199a3c2-7b10-7000-8000-0000000000a1",
166813
+ * "name": "invitacion_exclusiva_v2",
166814
+ * "language": "es",
166815
+ * "category": "MARKETING",
166816
+ * "status": "APPROVED",
166817
+ * "messaging_account_id": "0199a3c2-7b10-7000-8000-0000000000b1"
166818
+ * },
166819
+ * "range": {
166820
+ * "from": "2026-09-15T03:00:00.000Z",
166821
+ * "to": "2026-10-14T18:00:00.000Z",
166822
+ * "timezone": "America/Santiago",
166823
+ * "group_by": "day"
166824
+ * },
166825
+ * "totals": {
166826
+ * "sent": 120,
166827
+ * "delivered": 110,
166828
+ * "read": 84,
166829
+ * "failed": 6,
166830
+ * "replied": 31,
166831
+ * "opted_out": 2
166832
+ * },
166833
+ * "rates": {
166834
+ * "delivered": 0.9167,
166835
+ * "read": 0.7636,
166836
+ * "replied": 0.2583,
166837
+ * "failed": 0.05
166838
+ * },
166839
+ * "by_sender": [
166840
+ * {
166841
+ * "sender": "campaign",
166842
+ * "sent": 100,
166843
+ * "delivered": 92,
166844
+ * "read": 70,
166845
+ * "failed": 5,
166846
+ * "replied": 24
166847
+ * },
166848
+ * {
166849
+ * "sender": "manual",
166850
+ * "sent": 20,
166851
+ * "delivered": 18,
166852
+ * "read": 14,
166853
+ * "failed": 1,
166854
+ * "replied": 7
166855
+ * }
166856
+ * ],
166857
+ * "buttons": [
166858
+ * {
166859
+ * "text": "Quiero mi cupo",
166860
+ * "count": 18
166861
+ * },
166862
+ * {
166863
+ * "text": "No me interesa",
166864
+ * "count": 3
166865
+ * }
166866
+ * ],
166867
+ * "free_text": 10,
166868
+ * "failures": [
166869
+ * {
166870
+ * "code": "131026",
166871
+ * "title": "Message undeliverable",
166872
+ * "human_es": "El número no puede recibir mensajes de WhatsApp.",
166873
+ * "human_en": "The number cannot receive WhatsApp messages.",
166874
+ * "action": "remove_number",
166875
+ * "count": 6
166876
+ * }
166877
+ * ],
166878
+ * "daily": [
166879
+ * {
166880
+ * "date": "2026-10-13",
166881
+ * "sent": 80,
166882
+ * "delivered": 74,
166883
+ * "read": 60,
166884
+ * "failed": 4,
166885
+ * "replied": 22
166886
+ * },
166887
+ * {
166888
+ * "date": "2026-10-14",
166889
+ * "sent": 40,
166890
+ * "delivered": 36,
166891
+ * "read": 24,
166892
+ * "failed": 2,
166893
+ * "replied": 9
166894
+ * }
166895
+ * ]
166896
+ * }
166897
+ * }
166898
+ */
166899
+ "application/json": {
166900
+ data: components["schemas"]["WhatsappTemplateAnalytics"];
166901
+ meta?: {
166902
+ [key: string]: unknown;
166903
+ };
166904
+ };
166905
+ };
166906
+ };
166907
+ /** @description Validation error */
166908
+ 400: {
166909
+ headers: {
166910
+ [name: string]: unknown;
166911
+ };
166912
+ content: {
166913
+ "application/json": components["schemas"]["Error"];
166914
+ };
166915
+ };
166916
+ /** @description Unauthorized */
166917
+ 401: {
166918
+ headers: {
166919
+ [name: string]: unknown;
166920
+ };
166921
+ content: {
166922
+ "application/json": components["schemas"]["Error"];
166923
+ };
166924
+ };
166925
+ /** @description Forbidden */
166926
+ 403: {
166927
+ headers: {
166928
+ [name: string]: unknown;
166929
+ };
166930
+ content: {
166931
+ "application/json": components["schemas"]["Error"];
166932
+ };
166933
+ };
166934
+ /** @description Not found */
166935
+ 404: {
166936
+ headers: {
166937
+ [name: string]: unknown;
166938
+ };
166939
+ content: {
166940
+ "application/json": components["schemas"]["Error"];
166941
+ };
166942
+ };
166943
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
166944
+ 409: {
166945
+ headers: {
166946
+ [name: string]: unknown;
166947
+ };
166948
+ content: {
166949
+ "application/json": components["schemas"]["Error"];
166950
+ };
166951
+ };
166952
+ /** @description Rate limited */
166953
+ 429: {
166954
+ headers: {
166955
+ [name: string]: unknown;
166956
+ };
166957
+ content: {
166958
+ "application/json": components["schemas"]["Error"];
166959
+ };
166960
+ };
166961
+ };
166962
+ };
166963
+ put?: never;
166964
+ post?: never;
166965
+ delete?: never;
166966
+ options?: never;
166967
+ head?: never;
166968
+ patch?: never;
166969
+ trace?: never;
166970
+ };
166971
+ "/whatsapp-templates/analytics/summary": {
166972
+ parameters: {
166973
+ query?: never;
166974
+ header?: never;
166975
+ path?: never;
166976
+ cookie?: never;
166977
+ };
166978
+ /**
166979
+ * Sends, reads, replies and failures per WhatsApp template
166980
+ * @description The list-page numbers for every template of the workspace in one read: per template with at least one send in the range, the counts of `GET /whatsapp-templates/{id}/analytics`’s totals. Same sources and definitions.
166981
+ */
166982
+ get: {
166983
+ parameters: {
166984
+ query?: {
166985
+ /** @description Range start: an ISO instant, or a calendar date (YYYY-MM-DD) in the workspace time zone. Default: 30 days before `to`. */
166986
+ from?: string;
166987
+ /** @description Range end: an ISO instant, or a calendar date (YYYY-MM-DD, inclusive — runs to the end of that day) in the workspace time zone. Default: now. At most 400 days after `from`. */
166988
+ to?: string;
166989
+ };
166990
+ header?: never;
166991
+ path?: never;
166992
+ cookie?: never;
166993
+ };
166994
+ requestBody?: never;
166995
+ responses: {
166996
+ /** @description Per-template counts */
166997
+ 200: {
166998
+ headers: {
166999
+ [name: string]: unknown;
167000
+ };
167001
+ content: {
167002
+ /**
167003
+ * @example {
167004
+ * "data": {
167005
+ * "range": {
167006
+ * "from": "2026-09-15T03:00:00.000Z",
167007
+ * "to": "2026-10-14T18:00:00.000Z",
167008
+ * "timezone": "America/Santiago"
167009
+ * },
167010
+ * "templates": [
167011
+ * {
167012
+ * "template_id": "0199a3c2-7b10-7000-8000-0000000000a1",
167013
+ * "sent": 120,
167014
+ * "delivered": 110,
167015
+ * "read": 84,
167016
+ * "failed": 6,
167017
+ * "replied": 31,
167018
+ * "opted_out": 2
167019
+ * }
167020
+ * ]
167021
+ * }
167022
+ * }
167023
+ */
167024
+ "application/json": {
167025
+ data: components["schemas"]["WhatsappTemplateAnalyticsSummary"];
167026
+ meta?: {
167027
+ [key: string]: unknown;
167028
+ };
167029
+ };
167030
+ };
167031
+ };
167032
+ /** @description Validation error */
167033
+ 400: {
167034
+ headers: {
167035
+ [name: string]: unknown;
167036
+ };
167037
+ content: {
167038
+ "application/json": components["schemas"]["Error"];
167039
+ };
167040
+ };
167041
+ /** @description Unauthorized */
167042
+ 401: {
167043
+ headers: {
167044
+ [name: string]: unknown;
167045
+ };
167046
+ content: {
167047
+ "application/json": components["schemas"]["Error"];
167048
+ };
167049
+ };
167050
+ /** @description Forbidden */
167051
+ 403: {
167052
+ headers: {
167053
+ [name: string]: unknown;
167054
+ };
167055
+ content: {
167056
+ "application/json": components["schemas"]["Error"];
167057
+ };
167058
+ };
167059
+ /** @description Not found */
167060
+ 404: {
167061
+ headers: {
167062
+ [name: string]: unknown;
167063
+ };
167064
+ content: {
167065
+ "application/json": components["schemas"]["Error"];
167066
+ };
167067
+ };
167068
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
167069
+ 409: {
167070
+ headers: {
167071
+ [name: string]: unknown;
167072
+ };
167073
+ content: {
167074
+ "application/json": components["schemas"]["Error"];
167075
+ };
167076
+ };
167077
+ /** @description Rate limited */
167078
+ 429: {
167079
+ headers: {
167080
+ [name: string]: unknown;
167081
+ };
167082
+ content: {
167083
+ "application/json": components["schemas"]["Error"];
167084
+ };
167085
+ };
167086
+ };
167087
+ };
167088
+ put?: never;
167089
+ post?: never;
167090
+ delete?: never;
167091
+ options?: never;
167092
+ head?: never;
167093
+ patch?: never;
167094
+ trace?: never;
167095
+ };
166773
167096
  "/whatsapp-templates": {
166774
167097
  parameters: {
166775
167098
  query?: never;
@@ -185076,6 +185399,125 @@ interface components {
185076
185399
  text_hash: string;
185077
185400
  };
185078
185401
  };
185402
+ WhatsappTemplateAnalytics: {
185403
+ template: {
185404
+ /** Format: uuid */
185405
+ id: string;
185406
+ name: string;
185407
+ language: string;
185408
+ category: string;
185409
+ status: string;
185410
+ /** Format: uuid */
185411
+ messaging_account_id: string;
185412
+ };
185413
+ range: {
185414
+ /** @description ISO instant (inclusive). */
185415
+ from: string;
185416
+ /** @description ISO instant (exclusive). */
185417
+ to: string;
185418
+ /** @description The workspace time zone the days are cut in. */
185419
+ timezone: string;
185420
+ /** @enum {string} */
185421
+ group_by: "day" | "week";
185422
+ };
185423
+ totals: {
185424
+ /** @description Template sends Meta accepted. */
185425
+ sent: number;
185426
+ /** @description Of them, delivered (or read) per the delivery receipts. */
185427
+ delivered: number;
185428
+ read: number;
185429
+ /** @description Accepted, then reported failed by Meta (receipt). */
185430
+ failed: number;
185431
+ /** @description The person wrote on the same number within 72 h and this was their latest template (last touch). */
185432
+ replied: number;
185433
+ /** @description Sends after which the number opted out of WhatsApp within 72 h. */
185434
+ opted_out: number;
185435
+ };
185436
+ /** @description 0–1 fractions; null when the denominator is 0. */
185437
+ rates: {
185438
+ /** @description delivered / sent */
185439
+ delivered: number | null;
185440
+ /** @description read / delivered */
185441
+ read: number | null;
185442
+ /** @description replied / sent */
185443
+ replied: number | null;
185444
+ /** @description failed / sent */
185445
+ failed: number | null;
185446
+ };
185447
+ /** @description Who sent the template, most sends first. */
185448
+ by_sender: {
185449
+ /**
185450
+ * @description campaign, followup (Seguimientos), recontacto, first_touch, clinic (reminders and notices), manual (inbox / copilot / API), test (campaign test sends), other (staff notices, digests, sends before 2026-10-14 that could not be told apart).
185451
+ * @enum {string}
185452
+ */
185453
+ sender: "campaign" | "followup" | "recontacto" | "first_touch" | "clinic" | "manual" | "test" | "other";
185454
+ /** @description Template sends Meta accepted. */
185455
+ sent: number;
185456
+ /** @description Of them, delivered (or read) per the delivery receipts. */
185457
+ delivered: number;
185458
+ read: number;
185459
+ /** @description Accepted, then reported failed by Meta (receipt). */
185460
+ failed: number;
185461
+ /** @description The person wrote on the same number within 72 h and this was their latest template (last touch). */
185462
+ replied: number;
185463
+ }[];
185464
+ /** @description Replies whose first message was a tap on one of the template's quick-reply buttons (every button listed, zeros included). */
185465
+ buttons: {
185466
+ text: string;
185467
+ count: number;
185468
+ }[];
185469
+ /** @description Replies whose first message was not a button tap. */
185470
+ free_text: number;
185471
+ /** @description Failed sends by Meta error code, with a plain-language reason. */
185472
+ failures: {
185473
+ code: string;
185474
+ title: string;
185475
+ human_es: string;
185476
+ human_en: string;
185477
+ /** @enum {string} */
185478
+ action: "none" | "remove_number" | "retry_later" | "check_template";
185479
+ count: number;
185480
+ }[];
185481
+ /** @description Every day (or week) of the range by send time, zeros included. */
185482
+ daily: {
185483
+ /** @description Bucket start (YYYY-MM-DD, workspace time zone). */
185484
+ date: string;
185485
+ /** @description Template sends Meta accepted. */
185486
+ sent: number;
185487
+ /** @description Of them, delivered (or read) per the delivery receipts. */
185488
+ delivered: number;
185489
+ read: number;
185490
+ /** @description Accepted, then reported failed by Meta (receipt). */
185491
+ failed: number;
185492
+ /** @description The person wrote on the same number within 72 h and this was their latest template (last touch). */
185493
+ replied: number;
185494
+ }[];
185495
+ };
185496
+ WhatsappTemplateAnalyticsSummary: {
185497
+ range: {
185498
+ /** @description ISO instant (inclusive). */
185499
+ from: string;
185500
+ /** @description ISO instant (exclusive). */
185501
+ to: string;
185502
+ /** @description The workspace time zone the days are cut in. */
185503
+ timezone: string;
185504
+ };
185505
+ /** @description Templates with at least one send in the range, most sends first. A template absent here sent nothing. */
185506
+ templates: {
185507
+ /** Format: uuid */
185508
+ template_id: string;
185509
+ /** @description Template sends Meta accepted. */
185510
+ sent: number;
185511
+ /** @description Of them, delivered (or read) per the delivery receipts. */
185512
+ delivered: number;
185513
+ read: number;
185514
+ /** @description Accepted, then reported failed by Meta (receipt). */
185515
+ failed: number;
185516
+ /** @description The person wrote on the same number within 72 h and this was their latest template (last touch). */
185517
+ replied: number;
185518
+ opted_out: number;
185519
+ }[];
185520
+ };
185079
185521
  WhatsappFlowCondition: {
185080
185522
  field: string;
185081
185523
  /** @enum {string} */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "14.13.1",
3
+ "version": "14.14.1",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",