@vitrina/api 14.44.1 → 14.46.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 +2305 -439
- package/dist/index.d.ts +2305 -439
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -22430,6 +22430,7 @@ interface paths {
|
|
|
22430
22430
|
status?: "open" | "won" | "lost" | "unqualified";
|
|
22431
22431
|
source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | "campaign";
|
|
22432
22432
|
intent?: "buy" | "sell" | "financing" | "trade_in";
|
|
22433
|
+
acquisition_type?: "compra" | "consignacion" | "unknown";
|
|
22433
22434
|
owner_user_id?: string;
|
|
22434
22435
|
team_id?: string;
|
|
22435
22436
|
contact_id?: string;
|
|
@@ -22778,6 +22779,11 @@ interface paths {
|
|
|
22778
22779
|
source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "campaign";
|
|
22779
22780
|
/** @enum {string} */
|
|
22780
22781
|
intent?: "buy" | "sell" | "financing" | "trade_in";
|
|
22782
|
+
/**
|
|
22783
|
+
* @description «Compra y consignación»: compra (direct purchase) | consignacion | unknown. Set on intake when known; reaching the «Comprado» / «Consignado» stage stamps it and overwrites an earlier value. Read back as null on a lead that was never on that board.
|
|
22784
|
+
* @enum {string|null}
|
|
22785
|
+
*/
|
|
22786
|
+
acquisition_type?: "compra" | "consignacion" | "unknown" | null;
|
|
22781
22787
|
source_ref?: string | null;
|
|
22782
22788
|
value_amount?: number | null;
|
|
22783
22789
|
value_currency?: string | null;
|
|
@@ -24389,6 +24395,11 @@ interface paths {
|
|
|
24389
24395
|
temperature_reason?: string | null;
|
|
24390
24396
|
/** @enum {string} */
|
|
24391
24397
|
lost_reason?: "bought_elsewhere" | "financing_rejected" | "unit_unavailable" | "price" | "not_ready" | "unresponsive" | "other";
|
|
24398
|
+
/**
|
|
24399
|
+
* @description «Compra y consignación»: compra (direct purchase) | consignacion | unknown. Set on intake when known; reaching the «Comprado» / «Consignado» stage stamps it and overwrites an earlier value. Read back as null on a lead that was never on that board.
|
|
24400
|
+
* @enum {string|null}
|
|
24401
|
+
*/
|
|
24402
|
+
acquisition_type?: "compra" | "consignacion" | "unknown" | null;
|
|
24392
24403
|
};
|
|
24393
24404
|
};
|
|
24394
24405
|
};
|
|
@@ -27016,7 +27027,7 @@ interface paths {
|
|
|
27016
27027
|
patch?: never;
|
|
27017
27028
|
trace?: never;
|
|
27018
27029
|
};
|
|
27019
|
-
"/leads/{id}/
|
|
27030
|
+
"/leads/{id}/first-touch": {
|
|
27020
27031
|
parameters: {
|
|
27021
27032
|
query?: never;
|
|
27022
27033
|
header?: never;
|
|
@@ -27024,8 +27035,8 @@ interface paths {
|
|
|
27024
27035
|
cookie?: never;
|
|
27025
27036
|
};
|
|
27026
27037
|
/**
|
|
27027
|
-
*
|
|
27028
|
-
* @description
|
|
27038
|
+
* One lead's first-touch outcome
|
|
27039
|
+
* @description Whether the proactive first message for this lead went out, and if not, why: `status` (`none` = never attempted, `pending`, `sent`, `skipped`, `error`), the `skip_reason` (`invalid_phone` carries the number the portal delivered in `skip_evidence.raw_phone`), the classified `error_class`/`error_code` of a failed send (`undeliverable` = WhatsApp could not reach the number), the conversation it opened, and the contact's current phone with `phone_dialable`. `retryable` says whether `POST /leads/{id}/first-touch/retry` would be accepted; `retry_blocked_reason` names why not (`already_sent`, `in_progress`, `do_not_contact`, `source_disabled`, `no_contact`).
|
|
27029
27040
|
*/
|
|
27030
27041
|
get: {
|
|
27031
27042
|
parameters: {
|
|
@@ -27038,7 +27049,7 @@ interface paths {
|
|
|
27038
27049
|
};
|
|
27039
27050
|
requestBody?: never;
|
|
27040
27051
|
responses: {
|
|
27041
|
-
/** @description
|
|
27052
|
+
/** @description Lead first-touch state */
|
|
27042
27053
|
200: {
|
|
27043
27054
|
headers: {
|
|
27044
27055
|
[name: string]: unknown;
|
|
@@ -27046,25 +27057,21 @@ interface paths {
|
|
|
27046
27057
|
content: {
|
|
27047
27058
|
/**
|
|
27048
27059
|
* @example {
|
|
27049
|
-
* "data":
|
|
27050
|
-
*
|
|
27051
|
-
*
|
|
27052
|
-
*
|
|
27053
|
-
* "
|
|
27054
|
-
*
|
|
27055
|
-
*
|
|
27056
|
-
*
|
|
27057
|
-
*
|
|
27058
|
-
*
|
|
27059
|
-
*
|
|
27060
|
-
*
|
|
27061
|
-
*
|
|
27062
|
-
*
|
|
27063
|
-
*
|
|
27064
|
-
* }
|
|
27065
|
-
* ],
|
|
27066
|
-
* "meta": {
|
|
27067
|
-
* "total": 1
|
|
27060
|
+
* "data": {
|
|
27061
|
+
* "status": "skipped",
|
|
27062
|
+
* "skip_reason": "invalid_phone",
|
|
27063
|
+
* "skip_evidence": {
|
|
27064
|
+
* "raw_phone": "+90773361"
|
|
27065
|
+
* },
|
|
27066
|
+
* "error_class": null,
|
|
27067
|
+
* "error_code": null,
|
|
27068
|
+
* "conversation_id": null,
|
|
27069
|
+
* "source": "chileautos",
|
|
27070
|
+
* "contact_id": "01a14658-50d7-764b-89dd-601c87c24fd7",
|
|
27071
|
+
* "phone": "+90773361",
|
|
27072
|
+
* "phone_dialable": false,
|
|
27073
|
+
* "retryable": true,
|
|
27074
|
+
* "retry_blocked_reason": null
|
|
27068
27075
|
* }
|
|
27069
27076
|
* }
|
|
27070
27077
|
*/
|
|
@@ -27133,9 +27140,25 @@ interface paths {
|
|
|
27133
27140
|
};
|
|
27134
27141
|
};
|
|
27135
27142
|
put?: never;
|
|
27143
|
+
post?: never;
|
|
27144
|
+
delete?: never;
|
|
27145
|
+
options?: never;
|
|
27146
|
+
head?: never;
|
|
27147
|
+
patch?: never;
|
|
27148
|
+
trace?: never;
|
|
27149
|
+
};
|
|
27150
|
+
"/leads/{id}/first-touch/retry": {
|
|
27151
|
+
parameters: {
|
|
27152
|
+
query?: never;
|
|
27153
|
+
header?: never;
|
|
27154
|
+
path?: never;
|
|
27155
|
+
cookie?: never;
|
|
27156
|
+
};
|
|
27157
|
+
get?: never;
|
|
27158
|
+
put?: never;
|
|
27136
27159
|
/**
|
|
27137
|
-
*
|
|
27138
|
-
* @description
|
|
27160
|
+
* Send the first message again, after fixing the buyer phone
|
|
27161
|
+
* @description Re-runs the proactive first touch for a lead whose first attempt was skipped or failed — typically because the portal delivered a phone WhatsApp cannot reach. Pass `phone` to correct the contact first (it must pass the dial gate: E.164 or a 9-digit Chilean number, else 400 `invalid_phone`). Uses the configured template and account of the lead's source, reopens the buyer's original inquiry as the context card, and answers with the rail's outcome: `sent` with the new `conversation_id`, or `sent: false` with the `reason` (`burst_skip`, `no_template`, `daily_cap`, …). 409 with the blocking reason when the first touch already went out, is in flight, the person asked not to be contacted, or the source is off.
|
|
27139
27162
|
*/
|
|
27140
27163
|
post: {
|
|
27141
27164
|
parameters: {
|
|
@@ -27153,32 +27176,18 @@ interface paths {
|
|
|
27153
27176
|
content: {
|
|
27154
27177
|
/**
|
|
27155
27178
|
* @example {
|
|
27156
|
-
* "
|
|
27157
|
-
* "resource_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
27158
|
-
* "quantity": 1,
|
|
27159
|
-
* "priority": "high",
|
|
27160
|
-
* "notes": "lo quiere gris, con mantenimiento al día"
|
|
27179
|
+
* "phone": "+56990773361"
|
|
27161
27180
|
* }
|
|
27162
27181
|
*/
|
|
27163
27182
|
"application/json": {
|
|
27164
|
-
/** @
|
|
27165
|
-
|
|
27166
|
-
/** Format: uuid */
|
|
27167
|
-
resource_id?: string | null;
|
|
27168
|
-
title?: string | null;
|
|
27169
|
-
quantity?: number | null;
|
|
27170
|
-
/** @enum {string|null} */
|
|
27171
|
-
priority?: "low" | "medium" | "high" | null;
|
|
27172
|
-
notes?: string | null;
|
|
27173
|
-
metadata?: {
|
|
27174
|
-
[key: string]: unknown;
|
|
27175
|
-
};
|
|
27183
|
+
/** @description Corrected buyer phone, applied to the contact before the retry. E.164 (`+56990773361`) or a 9-digit Chilean national number. */
|
|
27184
|
+
phone?: string;
|
|
27176
27185
|
};
|
|
27177
27186
|
};
|
|
27178
27187
|
};
|
|
27179
27188
|
responses: {
|
|
27180
|
-
/** @description
|
|
27181
|
-
|
|
27189
|
+
/** @description First-touch retry outcome */
|
|
27190
|
+
200: {
|
|
27182
27191
|
headers: {
|
|
27183
27192
|
[name: string]: unknown;
|
|
27184
27193
|
};
|
|
@@ -27186,24 +27195,18 @@ interface paths {
|
|
|
27186
27195
|
/**
|
|
27187
27196
|
* @example {
|
|
27188
27197
|
* "data": {
|
|
27189
|
-
* "
|
|
27190
|
-
* "
|
|
27191
|
-
* "
|
|
27192
|
-
* "
|
|
27193
|
-
* "resource_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
27194
|
-
* "title": "Toyota Corolla 2022",
|
|
27195
|
-
* "quantity": 1,
|
|
27196
|
-
* "priority": "high",
|
|
27197
|
-
* "notes": "lo quiere gris, con mantenimiento al día",
|
|
27198
|
-
* "metadata": {},
|
|
27199
|
-
* "created_at": "2026-09-22T08:39:26.884Z",
|
|
27200
|
-
* "updated_at": "2026-09-22T08:39:26.884Z",
|
|
27201
|
-
* "superseded_at": null
|
|
27198
|
+
* "sent": true,
|
|
27199
|
+
* "reason": null,
|
|
27200
|
+
* "conversation_id": "c0c0c0c0-0000-4000-8000-000000000459",
|
|
27201
|
+
* "phone": "+56990773361"
|
|
27202
27202
|
* }
|
|
27203
27203
|
* }
|
|
27204
27204
|
*/
|
|
27205
27205
|
"application/json": {
|
|
27206
27206
|
data?: unknown;
|
|
27207
|
+
meta?: {
|
|
27208
|
+
[key: string]: unknown;
|
|
27209
|
+
};
|
|
27207
27210
|
};
|
|
27208
27211
|
};
|
|
27209
27212
|
};
|
|
@@ -27269,27 +27272,23 @@ interface paths {
|
|
|
27269
27272
|
patch?: never;
|
|
27270
27273
|
trace?: never;
|
|
27271
27274
|
};
|
|
27272
|
-
"/leads/{id}/interests
|
|
27275
|
+
"/leads/{id}/interests": {
|
|
27273
27276
|
parameters: {
|
|
27274
27277
|
query?: never;
|
|
27275
27278
|
header?: never;
|
|
27276
27279
|
path?: never;
|
|
27277
27280
|
cookie?: never;
|
|
27278
27281
|
};
|
|
27279
|
-
get?: never;
|
|
27280
|
-
put?: never;
|
|
27281
|
-
post?: never;
|
|
27282
27282
|
/**
|
|
27283
|
-
*
|
|
27284
|
-
* @description
|
|
27283
|
+
* List what a lead concretely wants
|
|
27284
|
+
* @description A lead is the opportunity; an INTEREST is the thing being asked for, and there can be several. `resource_type` is `vehicle` · `property` · `product` · `service` · `repair_order` · `custom`, with `resource_id` pointing at the record when it exists in Vitrina and `title` carrying it in words when it does not ("un SUV gris, 2020 o más nuevo").
|
|
27285
27285
|
*/
|
|
27286
|
-
|
|
27286
|
+
get: {
|
|
27287
27287
|
parameters: {
|
|
27288
27288
|
query?: never;
|
|
27289
27289
|
header?: never;
|
|
27290
27290
|
path: {
|
|
27291
27291
|
id: string;
|
|
27292
|
-
interestId: string;
|
|
27293
27292
|
};
|
|
27294
27293
|
cookie?: never;
|
|
27295
27294
|
};
|
|
@@ -27303,9 +27302,25 @@ interface paths {
|
|
|
27303
27302
|
content: {
|
|
27304
27303
|
/**
|
|
27305
27304
|
* @example {
|
|
27306
|
-
* "data":
|
|
27307
|
-
*
|
|
27308
|
-
*
|
|
27305
|
+
* "data": [
|
|
27306
|
+
* {
|
|
27307
|
+
* "id": "aaaaaaaa-0000-4000-8000-000000000001",
|
|
27308
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
27309
|
+
* "lead_id": "99999999-0000-4000-8000-000000000001",
|
|
27310
|
+
* "resource_type": "vehicle",
|
|
27311
|
+
* "resource_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
27312
|
+
* "title": "Toyota Corolla 2022",
|
|
27313
|
+
* "quantity": 1,
|
|
27314
|
+
* "priority": "high",
|
|
27315
|
+
* "notes": "lo quiere gris, con mantenimiento al día",
|
|
27316
|
+
* "metadata": {},
|
|
27317
|
+
* "created_at": "2026-09-22T08:39:26.884Z",
|
|
27318
|
+
* "updated_at": "2026-09-22T08:39:26.884Z",
|
|
27319
|
+
* "superseded_at": null
|
|
27320
|
+
* }
|
|
27321
|
+
* ],
|
|
27322
|
+
* "meta": {
|
|
27323
|
+
* "total": 1
|
|
27309
27324
|
* }
|
|
27310
27325
|
* }
|
|
27311
27326
|
*/
|
|
@@ -27373,19 +27388,20 @@ interface paths {
|
|
|
27373
27388
|
};
|
|
27374
27389
|
};
|
|
27375
27390
|
};
|
|
27376
|
-
|
|
27377
|
-
head?: never;
|
|
27391
|
+
put?: never;
|
|
27378
27392
|
/**
|
|
27379
|
-
*
|
|
27380
|
-
* @description
|
|
27393
|
+
* Add an interest to a lead
|
|
27394
|
+
* @description Provide `resource_id`, `title`, or both — one of the two is required, because an interest that names neither a record nor a description says nothing. 400 otherwise.
|
|
27381
27395
|
*/
|
|
27382
|
-
|
|
27396
|
+
post: {
|
|
27383
27397
|
parameters: {
|
|
27384
27398
|
query?: never;
|
|
27385
|
-
header?:
|
|
27399
|
+
header?: {
|
|
27400
|
+
/** @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. */
|
|
27401
|
+
"Idempotency-Key"?: string;
|
|
27402
|
+
};
|
|
27386
27403
|
path: {
|
|
27387
27404
|
id: string;
|
|
27388
|
-
interestId: string;
|
|
27389
27405
|
};
|
|
27390
27406
|
cookie?: never;
|
|
27391
27407
|
};
|
|
@@ -27393,12 +27409,16 @@ interface paths {
|
|
|
27393
27409
|
content: {
|
|
27394
27410
|
/**
|
|
27395
27411
|
* @example {
|
|
27396
|
-
* "
|
|
27412
|
+
* "resource_type": "vehicle",
|
|
27413
|
+
* "resource_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
27414
|
+
* "quantity": 1,
|
|
27415
|
+
* "priority": "high",
|
|
27416
|
+
* "notes": "lo quiere gris, con mantenimiento al día"
|
|
27397
27417
|
* }
|
|
27398
27418
|
*/
|
|
27399
27419
|
"application/json": {
|
|
27400
27420
|
/** @enum {string} */
|
|
27401
|
-
resource_type
|
|
27421
|
+
resource_type: "vehicle" | "property" | "product" | "service" | "repair_order" | "custom";
|
|
27402
27422
|
/** Format: uuid */
|
|
27403
27423
|
resource_id?: string | null;
|
|
27404
27424
|
title?: string | null;
|
|
@@ -27414,7 +27434,7 @@ interface paths {
|
|
|
27414
27434
|
};
|
|
27415
27435
|
responses: {
|
|
27416
27436
|
/** @description LeadInterest */
|
|
27417
|
-
|
|
27437
|
+
201: {
|
|
27418
27438
|
headers: {
|
|
27419
27439
|
[name: string]: unknown;
|
|
27420
27440
|
};
|
|
@@ -27429,7 +27449,7 @@ interface paths {
|
|
|
27429
27449
|
* "resource_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
27430
27450
|
* "title": "Toyota Corolla 2022",
|
|
27431
27451
|
* "quantity": 1,
|
|
27432
|
-
* "priority": "
|
|
27452
|
+
* "priority": "high",
|
|
27433
27453
|
* "notes": "lo quiere gris, con mantenimiento al día",
|
|
27434
27454
|
* "metadata": {},
|
|
27435
27455
|
* "created_at": "2026-09-22T08:39:26.884Z",
|
|
@@ -27440,9 +27460,6 @@ interface paths {
|
|
|
27440
27460
|
*/
|
|
27441
27461
|
"application/json": {
|
|
27442
27462
|
data?: unknown;
|
|
27443
|
-
meta?: {
|
|
27444
|
-
[key: string]: unknown;
|
|
27445
|
-
};
|
|
27446
27463
|
};
|
|
27447
27464
|
};
|
|
27448
27465
|
};
|
|
@@ -27502,31 +27519,39 @@ interface paths {
|
|
|
27502
27519
|
};
|
|
27503
27520
|
};
|
|
27504
27521
|
};
|
|
27522
|
+
delete?: never;
|
|
27523
|
+
options?: never;
|
|
27524
|
+
head?: never;
|
|
27525
|
+
patch?: never;
|
|
27505
27526
|
trace?: never;
|
|
27506
27527
|
};
|
|
27507
|
-
"/leads/{id}/
|
|
27528
|
+
"/leads/{id}/interests/{interestId}": {
|
|
27508
27529
|
parameters: {
|
|
27509
27530
|
query?: never;
|
|
27510
27531
|
header?: never;
|
|
27511
27532
|
path?: never;
|
|
27512
27533
|
cookie?: never;
|
|
27513
27534
|
};
|
|
27535
|
+
get?: never;
|
|
27536
|
+
put?: never;
|
|
27537
|
+
post?: never;
|
|
27514
27538
|
/**
|
|
27515
|
-
*
|
|
27516
|
-
* @description
|
|
27539
|
+
* Remove a lead interest
|
|
27540
|
+
* @description Deletes the row and answers `{ id, deleted: true }` (200, not 204). Removes it from the record entirely — an interest the customer moved ON from is history worth keeping, so prefer adding the new one.
|
|
27517
27541
|
*/
|
|
27518
|
-
|
|
27542
|
+
delete: {
|
|
27519
27543
|
parameters: {
|
|
27520
27544
|
query?: never;
|
|
27521
27545
|
header?: never;
|
|
27522
27546
|
path: {
|
|
27523
27547
|
id: string;
|
|
27548
|
+
interestId: string;
|
|
27524
27549
|
};
|
|
27525
27550
|
cookie?: never;
|
|
27526
27551
|
};
|
|
27527
27552
|
requestBody?: never;
|
|
27528
27553
|
responses: {
|
|
27529
|
-
/** @description
|
|
27554
|
+
/** @description LeadInterest */
|
|
27530
27555
|
200: {
|
|
27531
27556
|
headers: {
|
|
27532
27557
|
[name: string]: unknown;
|
|
@@ -27534,21 +27559,9 @@ interface paths {
|
|
|
27534
27559
|
content: {
|
|
27535
27560
|
/**
|
|
27536
27561
|
* @example {
|
|
27537
|
-
* "data":
|
|
27538
|
-
*
|
|
27539
|
-
*
|
|
27540
|
-
* "display_id": "C-122",
|
|
27541
|
-
* "channel": "whatsapp",
|
|
27542
|
-
* "status": "open",
|
|
27543
|
-
* "is_primary": true,
|
|
27544
|
-
* "is_origin": true,
|
|
27545
|
-
* "linked_at": "2026-09-18T13:44:02.115Z",
|
|
27546
|
-
* "linked_by_type": "system",
|
|
27547
|
-
* "last_message_date": "2026-09-21T14:01:58.000Z"
|
|
27548
|
-
* }
|
|
27549
|
-
* ],
|
|
27550
|
-
* "meta": {
|
|
27551
|
-
* "total": 1
|
|
27562
|
+
* "data": {
|
|
27563
|
+
* "id": "aaaaaaaa-0000-4000-8000-000000000001",
|
|
27564
|
+
* "deleted": true
|
|
27552
27565
|
* }
|
|
27553
27566
|
* }
|
|
27554
27567
|
*/
|
|
@@ -27616,20 +27629,19 @@ interface paths {
|
|
|
27616
27629
|
};
|
|
27617
27630
|
};
|
|
27618
27631
|
};
|
|
27619
|
-
|
|
27632
|
+
options?: never;
|
|
27633
|
+
head?: never;
|
|
27620
27634
|
/**
|
|
27621
|
-
*
|
|
27622
|
-
* @description
|
|
27635
|
+
* Update a lead interest
|
|
27636
|
+
* @description Only the fields present in the body are written; at least one is required. Use this when the ask itself changed — a different unit, a different quantity, a different priority.
|
|
27623
27637
|
*/
|
|
27624
|
-
|
|
27638
|
+
patch: {
|
|
27625
27639
|
parameters: {
|
|
27626
27640
|
query?: never;
|
|
27627
|
-
header?:
|
|
27628
|
-
/** @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. */
|
|
27629
|
-
"Idempotency-Key"?: string;
|
|
27630
|
-
};
|
|
27641
|
+
header?: never;
|
|
27631
27642
|
path: {
|
|
27632
27643
|
id: string;
|
|
27644
|
+
interestId: string;
|
|
27633
27645
|
};
|
|
27634
27646
|
cookie?: never;
|
|
27635
27647
|
};
|
|
@@ -27637,19 +27649,27 @@ interface paths {
|
|
|
27637
27649
|
content: {
|
|
27638
27650
|
/**
|
|
27639
27651
|
* @example {
|
|
27640
|
-
* "
|
|
27641
|
-
* "make_primary": true
|
|
27652
|
+
* "priority": "medium"
|
|
27642
27653
|
* }
|
|
27643
27654
|
*/
|
|
27644
27655
|
"application/json": {
|
|
27656
|
+
/** @enum {string} */
|
|
27657
|
+
resource_type?: "vehicle" | "property" | "product" | "service" | "repair_order" | "custom";
|
|
27645
27658
|
/** Format: uuid */
|
|
27646
|
-
|
|
27647
|
-
|
|
27659
|
+
resource_id?: string | null;
|
|
27660
|
+
title?: string | null;
|
|
27661
|
+
quantity?: number | null;
|
|
27662
|
+
/** @enum {string|null} */
|
|
27663
|
+
priority?: "low" | "medium" | "high" | null;
|
|
27664
|
+
notes?: string | null;
|
|
27665
|
+
metadata?: {
|
|
27666
|
+
[key: string]: unknown;
|
|
27667
|
+
};
|
|
27648
27668
|
};
|
|
27649
27669
|
};
|
|
27650
27670
|
};
|
|
27651
27671
|
responses: {
|
|
27652
|
-
/** @description
|
|
27672
|
+
/** @description LeadInterest */
|
|
27653
27673
|
200: {
|
|
27654
27674
|
headers: {
|
|
27655
27675
|
[name: string]: unknown;
|
|
@@ -27658,8 +27678,19 @@ interface paths {
|
|
|
27658
27678
|
/**
|
|
27659
27679
|
* @example {
|
|
27660
27680
|
* "data": {
|
|
27661
|
-
* "
|
|
27662
|
-
* "
|
|
27681
|
+
* "id": "aaaaaaaa-0000-4000-8000-000000000001",
|
|
27682
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
27683
|
+
* "lead_id": "99999999-0000-4000-8000-000000000001",
|
|
27684
|
+
* "resource_type": "vehicle",
|
|
27685
|
+
* "resource_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
27686
|
+
* "title": "Toyota Corolla 2022",
|
|
27687
|
+
* "quantity": 1,
|
|
27688
|
+
* "priority": "medium",
|
|
27689
|
+
* "notes": "lo quiere gris, con mantenimiento al día",
|
|
27690
|
+
* "metadata": {},
|
|
27691
|
+
* "created_at": "2026-09-22T08:39:26.884Z",
|
|
27692
|
+
* "updated_at": "2026-09-22T08:39:26.884Z",
|
|
27693
|
+
* "superseded_at": null
|
|
27663
27694
|
* }
|
|
27664
27695
|
* }
|
|
27665
27696
|
*/
|
|
@@ -27727,39 +27758,31 @@ interface paths {
|
|
|
27727
27758
|
};
|
|
27728
27759
|
};
|
|
27729
27760
|
};
|
|
27730
|
-
delete?: never;
|
|
27731
|
-
options?: never;
|
|
27732
|
-
head?: never;
|
|
27733
|
-
patch?: never;
|
|
27734
27761
|
trace?: never;
|
|
27735
27762
|
};
|
|
27736
|
-
"/leads/{id}/conversations
|
|
27763
|
+
"/leads/{id}/conversations": {
|
|
27737
27764
|
parameters: {
|
|
27738
27765
|
query?: never;
|
|
27739
27766
|
header?: never;
|
|
27740
27767
|
path?: never;
|
|
27741
27768
|
cookie?: never;
|
|
27742
27769
|
};
|
|
27743
|
-
get?: never;
|
|
27744
|
-
put?: never;
|
|
27745
|
-
post?: never;
|
|
27746
27770
|
/**
|
|
27747
|
-
*
|
|
27748
|
-
* @description
|
|
27771
|
+
* List the conversations this opportunity spans
|
|
27772
|
+
* @description A lead is ONE closable opportunity; a conversation is a temporary session. The customer comes back next week on another channel and it is still the same opportunity, so this relation — not a single `conversation_id` — is the answer to "which conversations belong to this lead". `is_origin` marks where the opportunity STARTED (a historical fact) and `is_primary` the thread it is worked on now (editable).
|
|
27749
27773
|
*/
|
|
27750
|
-
|
|
27774
|
+
get: {
|
|
27751
27775
|
parameters: {
|
|
27752
27776
|
query?: never;
|
|
27753
27777
|
header?: never;
|
|
27754
27778
|
path: {
|
|
27755
27779
|
id: string;
|
|
27756
|
-
conversationId: string;
|
|
27757
27780
|
};
|
|
27758
27781
|
cookie?: never;
|
|
27759
27782
|
};
|
|
27760
27783
|
requestBody?: never;
|
|
27761
27784
|
responses: {
|
|
27762
|
-
/** @description
|
|
27785
|
+
/** @description Lead conversations */
|
|
27763
27786
|
200: {
|
|
27764
27787
|
headers: {
|
|
27765
27788
|
[name: string]: unknown;
|
|
@@ -27767,8 +27790,241 @@ interface paths {
|
|
|
27767
27790
|
content: {
|
|
27768
27791
|
/**
|
|
27769
27792
|
* @example {
|
|
27770
|
-
* "data":
|
|
27771
|
-
*
|
|
27793
|
+
* "data": [
|
|
27794
|
+
* {
|
|
27795
|
+
* "conversation_id": "bbbbbbbb-0000-4000-8000-000000000001",
|
|
27796
|
+
* "display_id": "C-122",
|
|
27797
|
+
* "channel": "whatsapp",
|
|
27798
|
+
* "status": "open",
|
|
27799
|
+
* "is_primary": true,
|
|
27800
|
+
* "is_origin": true,
|
|
27801
|
+
* "linked_at": "2026-09-18T13:44:02.115Z",
|
|
27802
|
+
* "linked_by_type": "system",
|
|
27803
|
+
* "last_message_date": "2026-09-21T14:01:58.000Z"
|
|
27804
|
+
* }
|
|
27805
|
+
* ],
|
|
27806
|
+
* "meta": {
|
|
27807
|
+
* "total": 1
|
|
27808
|
+
* }
|
|
27809
|
+
* }
|
|
27810
|
+
*/
|
|
27811
|
+
"application/json": {
|
|
27812
|
+
data?: unknown;
|
|
27813
|
+
meta?: {
|
|
27814
|
+
[key: string]: unknown;
|
|
27815
|
+
};
|
|
27816
|
+
};
|
|
27817
|
+
};
|
|
27818
|
+
};
|
|
27819
|
+
/** @description Validation error */
|
|
27820
|
+
400: {
|
|
27821
|
+
headers: {
|
|
27822
|
+
[name: string]: unknown;
|
|
27823
|
+
};
|
|
27824
|
+
content: {
|
|
27825
|
+
"application/json": components["schemas"]["Error"];
|
|
27826
|
+
};
|
|
27827
|
+
};
|
|
27828
|
+
/** @description Unauthorized */
|
|
27829
|
+
401: {
|
|
27830
|
+
headers: {
|
|
27831
|
+
[name: string]: unknown;
|
|
27832
|
+
};
|
|
27833
|
+
content: {
|
|
27834
|
+
"application/json": components["schemas"]["Error"];
|
|
27835
|
+
};
|
|
27836
|
+
};
|
|
27837
|
+
/** @description Forbidden */
|
|
27838
|
+
403: {
|
|
27839
|
+
headers: {
|
|
27840
|
+
[name: string]: unknown;
|
|
27841
|
+
};
|
|
27842
|
+
content: {
|
|
27843
|
+
"application/json": components["schemas"]["Error"];
|
|
27844
|
+
};
|
|
27845
|
+
};
|
|
27846
|
+
/** @description Not found */
|
|
27847
|
+
404: {
|
|
27848
|
+
headers: {
|
|
27849
|
+
[name: string]: unknown;
|
|
27850
|
+
};
|
|
27851
|
+
content: {
|
|
27852
|
+
"application/json": components["schemas"]["Error"];
|
|
27853
|
+
};
|
|
27854
|
+
};
|
|
27855
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
27856
|
+
409: {
|
|
27857
|
+
headers: {
|
|
27858
|
+
[name: string]: unknown;
|
|
27859
|
+
};
|
|
27860
|
+
content: {
|
|
27861
|
+
"application/json": components["schemas"]["Error"];
|
|
27862
|
+
};
|
|
27863
|
+
};
|
|
27864
|
+
/** @description Rate limited */
|
|
27865
|
+
429: {
|
|
27866
|
+
headers: {
|
|
27867
|
+
[name: string]: unknown;
|
|
27868
|
+
};
|
|
27869
|
+
content: {
|
|
27870
|
+
"application/json": components["schemas"]["Error"];
|
|
27871
|
+
};
|
|
27872
|
+
};
|
|
27873
|
+
};
|
|
27874
|
+
};
|
|
27875
|
+
put?: never;
|
|
27876
|
+
/**
|
|
27877
|
+
* Link a conversation to a lead
|
|
27878
|
+
* @description IDEMPOTENT: re-linking an existing pair answers `linked: false` and writes no second timeline entry. `make_primary` moves the primary flag onto this thread, demoting whichever held it. 404 for a lead or a conversation this credential cannot see — BOTH sides are checked, so a member restricted to their own records cannot attach a colleague's thread to a lead they own.
|
|
27879
|
+
*/
|
|
27880
|
+
post: {
|
|
27881
|
+
parameters: {
|
|
27882
|
+
query?: never;
|
|
27883
|
+
header?: {
|
|
27884
|
+
/** @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. */
|
|
27885
|
+
"Idempotency-Key"?: string;
|
|
27886
|
+
};
|
|
27887
|
+
path: {
|
|
27888
|
+
id: string;
|
|
27889
|
+
};
|
|
27890
|
+
cookie?: never;
|
|
27891
|
+
};
|
|
27892
|
+
requestBody?: {
|
|
27893
|
+
content: {
|
|
27894
|
+
/**
|
|
27895
|
+
* @example {
|
|
27896
|
+
* "conversation_id": "bbbbbbbb-0000-4000-8000-000000000001",
|
|
27897
|
+
* "make_primary": true
|
|
27898
|
+
* }
|
|
27899
|
+
*/
|
|
27900
|
+
"application/json": {
|
|
27901
|
+
/** Format: uuid */
|
|
27902
|
+
conversation_id: string;
|
|
27903
|
+
make_primary?: boolean;
|
|
27904
|
+
};
|
|
27905
|
+
};
|
|
27906
|
+
};
|
|
27907
|
+
responses: {
|
|
27908
|
+
/** @description Link result */
|
|
27909
|
+
200: {
|
|
27910
|
+
headers: {
|
|
27911
|
+
[name: string]: unknown;
|
|
27912
|
+
};
|
|
27913
|
+
content: {
|
|
27914
|
+
/**
|
|
27915
|
+
* @example {
|
|
27916
|
+
* "data": {
|
|
27917
|
+
* "linked": true,
|
|
27918
|
+
* "is_primary": true
|
|
27919
|
+
* }
|
|
27920
|
+
* }
|
|
27921
|
+
*/
|
|
27922
|
+
"application/json": {
|
|
27923
|
+
data?: unknown;
|
|
27924
|
+
meta?: {
|
|
27925
|
+
[key: string]: unknown;
|
|
27926
|
+
};
|
|
27927
|
+
};
|
|
27928
|
+
};
|
|
27929
|
+
};
|
|
27930
|
+
/** @description Validation error */
|
|
27931
|
+
400: {
|
|
27932
|
+
headers: {
|
|
27933
|
+
[name: string]: unknown;
|
|
27934
|
+
};
|
|
27935
|
+
content: {
|
|
27936
|
+
"application/json": components["schemas"]["Error"];
|
|
27937
|
+
};
|
|
27938
|
+
};
|
|
27939
|
+
/** @description Unauthorized */
|
|
27940
|
+
401: {
|
|
27941
|
+
headers: {
|
|
27942
|
+
[name: string]: unknown;
|
|
27943
|
+
};
|
|
27944
|
+
content: {
|
|
27945
|
+
"application/json": components["schemas"]["Error"];
|
|
27946
|
+
};
|
|
27947
|
+
};
|
|
27948
|
+
/** @description Forbidden */
|
|
27949
|
+
403: {
|
|
27950
|
+
headers: {
|
|
27951
|
+
[name: string]: unknown;
|
|
27952
|
+
};
|
|
27953
|
+
content: {
|
|
27954
|
+
"application/json": components["schemas"]["Error"];
|
|
27955
|
+
};
|
|
27956
|
+
};
|
|
27957
|
+
/** @description Not found */
|
|
27958
|
+
404: {
|
|
27959
|
+
headers: {
|
|
27960
|
+
[name: string]: unknown;
|
|
27961
|
+
};
|
|
27962
|
+
content: {
|
|
27963
|
+
"application/json": components["schemas"]["Error"];
|
|
27964
|
+
};
|
|
27965
|
+
};
|
|
27966
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
27967
|
+
409: {
|
|
27968
|
+
headers: {
|
|
27969
|
+
[name: string]: unknown;
|
|
27970
|
+
};
|
|
27971
|
+
content: {
|
|
27972
|
+
"application/json": components["schemas"]["Error"];
|
|
27973
|
+
};
|
|
27974
|
+
};
|
|
27975
|
+
/** @description Rate limited */
|
|
27976
|
+
429: {
|
|
27977
|
+
headers: {
|
|
27978
|
+
[name: string]: unknown;
|
|
27979
|
+
};
|
|
27980
|
+
content: {
|
|
27981
|
+
"application/json": components["schemas"]["Error"];
|
|
27982
|
+
};
|
|
27983
|
+
};
|
|
27984
|
+
};
|
|
27985
|
+
};
|
|
27986
|
+
delete?: never;
|
|
27987
|
+
options?: never;
|
|
27988
|
+
head?: never;
|
|
27989
|
+
patch?: never;
|
|
27990
|
+
trace?: never;
|
|
27991
|
+
};
|
|
27992
|
+
"/leads/{id}/conversations/{conversationId}": {
|
|
27993
|
+
parameters: {
|
|
27994
|
+
query?: never;
|
|
27995
|
+
header?: never;
|
|
27996
|
+
path?: never;
|
|
27997
|
+
cookie?: never;
|
|
27998
|
+
};
|
|
27999
|
+
get?: never;
|
|
28000
|
+
put?: never;
|
|
28001
|
+
post?: never;
|
|
28002
|
+
/**
|
|
28003
|
+
* Unlink a conversation from a lead
|
|
28004
|
+
* @description Detaching the ORIGIN conversation is allowed: the association is editable, but `origin_conversation_id` is a historical fact ("where this opportunity started") and stays put, because attribution keeps reading it. Answers `{ unlinked }` — `false` when there was no link to remove.
|
|
28005
|
+
*/
|
|
28006
|
+
delete: {
|
|
28007
|
+
parameters: {
|
|
28008
|
+
query?: never;
|
|
28009
|
+
header?: never;
|
|
28010
|
+
path: {
|
|
28011
|
+
id: string;
|
|
28012
|
+
conversationId: string;
|
|
28013
|
+
};
|
|
28014
|
+
cookie?: never;
|
|
28015
|
+
};
|
|
28016
|
+
requestBody?: never;
|
|
28017
|
+
responses: {
|
|
28018
|
+
/** @description Unlink result */
|
|
28019
|
+
200: {
|
|
28020
|
+
headers: {
|
|
28021
|
+
[name: string]: unknown;
|
|
28022
|
+
};
|
|
28023
|
+
content: {
|
|
28024
|
+
/**
|
|
28025
|
+
* @example {
|
|
28026
|
+
* "data": {
|
|
28027
|
+
* "unlinked": true
|
|
27772
28028
|
* }
|
|
27773
28029
|
* }
|
|
27774
28030
|
*/
|
|
@@ -64820,7 +65076,7 @@ interface paths {
|
|
|
64820
65076
|
patch?: never;
|
|
64821
65077
|
trace?: never;
|
|
64822
65078
|
};
|
|
64823
|
-
"/clinic/
|
|
65079
|
+
"/clinic/commissions/history": {
|
|
64824
65080
|
parameters: {
|
|
64825
65081
|
query?: never;
|
|
64826
65082
|
header?: never;
|
|
@@ -64828,17 +65084,15 @@ interface paths {
|
|
|
64828
65084
|
cookie?: never;
|
|
64829
65085
|
};
|
|
64830
65086
|
/**
|
|
64831
|
-
*
|
|
64832
|
-
* @description
|
|
65087
|
+
* A professional’s commission history, Vitrina and Dentalink
|
|
65088
|
+
* @description One professional’s months, newest first, so the whole history is in one place: for each month `settled_by` (`vitrina` from «primer mes que liquida Vitrina» on, `dentalink` before it), Vitrina’s own lines (`native`: counts and Σ, `read_only: false`), the liquidaciones Dentalink settled and the migration imported (`imported`, labelled «Importada de Dentalink», `read_only: true`, Dentalink’s own total) and the Dentalink exports the clinic uploaded for pages the reader could not reach (`exports`, `read_only: true`). Imported months are never recomputed, approved or exported and never count as months Vitrina computed. 404 unknown professional. Requires `clinic_money:read`.
|
|
65089
|
+
*
|
|
65090
|
+
* **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`.
|
|
64833
65091
|
*/
|
|
64834
65092
|
get: {
|
|
64835
65093
|
parameters: {
|
|
64836
|
-
query
|
|
64837
|
-
|
|
64838
|
-
status?: "pending" | "matched" | "closed" | "all";
|
|
64839
|
-
contact_id?: string;
|
|
64840
|
-
limit?: number;
|
|
64841
|
-
offset?: number | null;
|
|
65094
|
+
query: {
|
|
65095
|
+
professional_id: string;
|
|
64842
65096
|
};
|
|
64843
65097
|
header?: never;
|
|
64844
65098
|
path?: never;
|
|
@@ -64846,7 +65100,7 @@ interface paths {
|
|
|
64846
65100
|
};
|
|
64847
65101
|
requestBody?: never;
|
|
64848
65102
|
responses: {
|
|
64849
|
-
/** @description
|
|
65103
|
+
/** @description Commission history */
|
|
64850
65104
|
200: {
|
|
64851
65105
|
headers: {
|
|
64852
65106
|
[name: string]: unknown;
|
|
@@ -64854,63 +65108,606 @@ interface paths {
|
|
|
64854
65108
|
content: {
|
|
64855
65109
|
/**
|
|
64856
65110
|
* @example {
|
|
64857
|
-
* "data":
|
|
64858
|
-
*
|
|
64859
|
-
*
|
|
64860
|
-
*
|
|
64861
|
-
*
|
|
64862
|
-
*
|
|
64863
|
-
*
|
|
64864
|
-
*
|
|
64865
|
-
*
|
|
64866
|
-
*
|
|
64867
|
-
*
|
|
64868
|
-
*
|
|
64869
|
-
*
|
|
64870
|
-
*
|
|
64871
|
-
*
|
|
64872
|
-
*
|
|
64873
|
-
* "
|
|
64874
|
-
*
|
|
64875
|
-
* "concept": {
|
|
64876
|
-
* "kind": "appointment_deposit",
|
|
64877
|
-
* "label": "Abono cita",
|
|
64878
|
-
* "appointment_starts_at": "2026-10-09T13:00:00.000Z"
|
|
64879
|
-
* },
|
|
64880
|
-
* "medio": {
|
|
64881
|
-
* "code": "30",
|
|
64882
|
-
* "label": "Mercado Pago"
|
|
64883
|
-
* },
|
|
64884
|
-
* "matched": {
|
|
64885
|
-
* "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
|
|
64886
|
-
* "vendor_reference": "88123",
|
|
64887
|
-
* "received_on": "2026-10-05",
|
|
64888
|
-
* "amount_clp": 30000,
|
|
64889
|
-
* "medio": "Mercado Pago",
|
|
64890
|
-
* "voided": false,
|
|
64891
|
-
* "by": "auto_unique",
|
|
64892
|
-
* "at": "2026-10-05T18:20:00.000Z"
|
|
65111
|
+
* "data": {
|
|
65112
|
+
* "professional_id": "0192f0c4-0000-7000-8000-000000000001",
|
|
65113
|
+
* "first_native_money_month": "2026-11",
|
|
65114
|
+
* "months": [
|
|
65115
|
+
* {
|
|
65116
|
+
* "period": "2026-11",
|
|
65117
|
+
* "settled_by": "vitrina",
|
|
65118
|
+
* "native": {
|
|
65119
|
+
* "source": "vitrina",
|
|
65120
|
+
* "read_only": false,
|
|
65121
|
+
* "lines": 42,
|
|
65122
|
+
* "amount_clp": 1260000,
|
|
65123
|
+
* "computed": 0,
|
|
65124
|
+
* "approved": 42,
|
|
65125
|
+
* "exported": 0
|
|
65126
|
+
* },
|
|
65127
|
+
* "imported": [],
|
|
65128
|
+
* "exports": []
|
|
64893
65129
|
* },
|
|
64894
|
-
*
|
|
64895
|
-
*
|
|
64896
|
-
*
|
|
64897
|
-
*
|
|
64898
|
-
*
|
|
64899
|
-
*
|
|
64900
|
-
*
|
|
64901
|
-
*
|
|
64902
|
-
*
|
|
64903
|
-
*
|
|
64904
|
-
*
|
|
65130
|
+
* {
|
|
65131
|
+
* "period": "2026-10",
|
|
65132
|
+
* "settled_by": "dentalink",
|
|
65133
|
+
* "native": null,
|
|
65134
|
+
* "imported": [
|
|
65135
|
+
* {
|
|
65136
|
+
* "id": "0192f0c4-0000-7000-8000-000000000002",
|
|
65137
|
+
* "source": "dentalink_import",
|
|
65138
|
+
* "label": "Importada de Dentalink",
|
|
65139
|
+
* "read_only": true,
|
|
65140
|
+
* "external_id": "9001",
|
|
65141
|
+
* "location_id": null,
|
|
65142
|
+
* "location_name": "Central",
|
|
65143
|
+
* "period_from": "2026-10-01",
|
|
65144
|
+
* "period_to": "2026-10-31",
|
|
65145
|
+
* "total_clp": 1180000,
|
|
65146
|
+
* "lines_total_clp": 1180000,
|
|
65147
|
+
* "deductions_clp": -80000,
|
|
65148
|
+
* "line_count": 38,
|
|
65149
|
+
* "imported_at": "2026-11-05T14:00:00.000Z"
|
|
65150
|
+
* }
|
|
65151
|
+
* ],
|
|
65152
|
+
* "exports": []
|
|
65153
|
+
* }
|
|
65154
|
+
* ]
|
|
64905
65155
|
* }
|
|
64906
65156
|
* }
|
|
64907
65157
|
*/
|
|
64908
65158
|
"application/json": {
|
|
64909
|
-
data
|
|
64910
|
-
meta
|
|
64911
|
-
|
|
64912
|
-
|
|
64913
|
-
|
|
65159
|
+
data?: unknown;
|
|
65160
|
+
meta?: {
|
|
65161
|
+
[key: string]: unknown;
|
|
65162
|
+
};
|
|
65163
|
+
};
|
|
65164
|
+
};
|
|
65165
|
+
};
|
|
65166
|
+
/** @description Validation error */
|
|
65167
|
+
400: {
|
|
65168
|
+
headers: {
|
|
65169
|
+
[name: string]: unknown;
|
|
65170
|
+
};
|
|
65171
|
+
content: {
|
|
65172
|
+
"application/json": components["schemas"]["Error"];
|
|
65173
|
+
};
|
|
65174
|
+
};
|
|
65175
|
+
/** @description Unauthorized */
|
|
65176
|
+
401: {
|
|
65177
|
+
headers: {
|
|
65178
|
+
[name: string]: unknown;
|
|
65179
|
+
};
|
|
65180
|
+
content: {
|
|
65181
|
+
"application/json": components["schemas"]["Error"];
|
|
65182
|
+
};
|
|
65183
|
+
};
|
|
65184
|
+
/** @description Forbidden */
|
|
65185
|
+
403: {
|
|
65186
|
+
headers: {
|
|
65187
|
+
[name: string]: unknown;
|
|
65188
|
+
};
|
|
65189
|
+
content: {
|
|
65190
|
+
"application/json": components["schemas"]["Error"];
|
|
65191
|
+
};
|
|
65192
|
+
};
|
|
65193
|
+
/** @description Not found */
|
|
65194
|
+
404: {
|
|
65195
|
+
headers: {
|
|
65196
|
+
[name: string]: unknown;
|
|
65197
|
+
};
|
|
65198
|
+
content: {
|
|
65199
|
+
"application/json": components["schemas"]["Error"];
|
|
65200
|
+
};
|
|
65201
|
+
};
|
|
65202
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65203
|
+
409: {
|
|
65204
|
+
headers: {
|
|
65205
|
+
[name: string]: unknown;
|
|
65206
|
+
};
|
|
65207
|
+
content: {
|
|
65208
|
+
"application/json": components["schemas"]["Error"];
|
|
65209
|
+
};
|
|
65210
|
+
};
|
|
65211
|
+
/** @description Rate limited */
|
|
65212
|
+
429: {
|
|
65213
|
+
headers: {
|
|
65214
|
+
[name: string]: unknown;
|
|
65215
|
+
};
|
|
65216
|
+
content: {
|
|
65217
|
+
"application/json": components["schemas"]["Error"];
|
|
65218
|
+
};
|
|
65219
|
+
};
|
|
65220
|
+
};
|
|
65221
|
+
};
|
|
65222
|
+
put?: never;
|
|
65223
|
+
post?: never;
|
|
65224
|
+
delete?: never;
|
|
65225
|
+
options?: never;
|
|
65226
|
+
head?: never;
|
|
65227
|
+
patch?: never;
|
|
65228
|
+
trace?: never;
|
|
65229
|
+
};
|
|
65230
|
+
"/clinic/commissions/imported/{id}": {
|
|
65231
|
+
parameters: {
|
|
65232
|
+
query?: never;
|
|
65233
|
+
header?: never;
|
|
65234
|
+
path?: never;
|
|
65235
|
+
cookie?: never;
|
|
65236
|
+
};
|
|
65237
|
+
/**
|
|
65238
|
+
* One liquidación imported from Dentalink, with its lines
|
|
65239
|
+
* @description A liquidación as Dentalink settled it (read-only, «Importada de Dentalink»): dentist, sucursal, period, Dentalink’s total, the page’s own total and deductions, and its lines (day, prestación, base, rate in basis points, deductions, amount). The paciente is the migrated ficha’s id when resolvable and the INITIALS — never a name, like the native liquidación PDF. 404 unknown id. Requires `clinic_money:read`.
|
|
65240
|
+
*
|
|
65241
|
+
* **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`.
|
|
65242
|
+
*/
|
|
65243
|
+
get: {
|
|
65244
|
+
parameters: {
|
|
65245
|
+
query?: never;
|
|
65246
|
+
header?: never;
|
|
65247
|
+
path: {
|
|
65248
|
+
id: string;
|
|
65249
|
+
};
|
|
65250
|
+
cookie?: never;
|
|
65251
|
+
};
|
|
65252
|
+
requestBody?: never;
|
|
65253
|
+
responses: {
|
|
65254
|
+
/** @description Imported liquidación */
|
|
65255
|
+
200: {
|
|
65256
|
+
headers: {
|
|
65257
|
+
[name: string]: unknown;
|
|
65258
|
+
};
|
|
65259
|
+
content: {
|
|
65260
|
+
/**
|
|
65261
|
+
* @example {
|
|
65262
|
+
* "data": {
|
|
65263
|
+
* "id": "0192f0c4-0000-7000-8000-000000000002",
|
|
65264
|
+
* "source": "dentalink_import",
|
|
65265
|
+
* "label": "Importada de Dentalink",
|
|
65266
|
+
* "read_only": true,
|
|
65267
|
+
* "professional_id": "0192f0c4-0000-7000-8000-000000000001",
|
|
65268
|
+
* "external_id": "9001",
|
|
65269
|
+
* "location_id": "0192f0c4-0000-7000-8000-000000000003",
|
|
65270
|
+
* "location_name": "Central",
|
|
65271
|
+
* "period": "2026-10",
|
|
65272
|
+
* "period_from": "2026-10-01",
|
|
65273
|
+
* "period_to": "2026-10-31",
|
|
65274
|
+
* "total_clp": 152000,
|
|
65275
|
+
* "lines_total_clp": 152000,
|
|
65276
|
+
* "deductions_clp": -80000,
|
|
65277
|
+
* "line_count": 2,
|
|
65278
|
+
* "imported_at": "2026-11-05T14:00:00.000Z",
|
|
65279
|
+
* "lines": [
|
|
65280
|
+
* {
|
|
65281
|
+
* "position": 0,
|
|
65282
|
+
* "performed_on": "2026-10-02",
|
|
65283
|
+
* "treatment": "Obturación resina",
|
|
65284
|
+
* "patient": {
|
|
65285
|
+
* "id": "0192f0c4-0000-7000-8000-000000000004",
|
|
65286
|
+
* "initials": "APE"
|
|
65287
|
+
* },
|
|
65288
|
+
* "base_clp": 60000,
|
|
65289
|
+
* "rate_bps": 4000,
|
|
65290
|
+
* "deductions_clp": 0,
|
|
65291
|
+
* "amount_clp": 24000
|
|
65292
|
+
* },
|
|
65293
|
+
* {
|
|
65294
|
+
* "position": 1,
|
|
65295
|
+
* "performed_on": "2026-10-15",
|
|
65296
|
+
* "treatment": "Corona metal porcelana",
|
|
65297
|
+
* "patient": {
|
|
65298
|
+
* "id": null,
|
|
65299
|
+
* "initials": "BFD"
|
|
65300
|
+
* },
|
|
65301
|
+
* "base_clp": 400000,
|
|
65302
|
+
* "rate_bps": 4000,
|
|
65303
|
+
* "deductions_clp": -80000,
|
|
65304
|
+
* "amount_clp": 128000
|
|
65305
|
+
* }
|
|
65306
|
+
* ]
|
|
65307
|
+
* }
|
|
65308
|
+
* }
|
|
65309
|
+
*/
|
|
65310
|
+
"application/json": {
|
|
65311
|
+
data?: unknown;
|
|
65312
|
+
meta?: {
|
|
65313
|
+
[key: string]: unknown;
|
|
65314
|
+
};
|
|
65315
|
+
};
|
|
65316
|
+
};
|
|
65317
|
+
};
|
|
65318
|
+
/** @description Validation error */
|
|
65319
|
+
400: {
|
|
65320
|
+
headers: {
|
|
65321
|
+
[name: string]: unknown;
|
|
65322
|
+
};
|
|
65323
|
+
content: {
|
|
65324
|
+
"application/json": components["schemas"]["Error"];
|
|
65325
|
+
};
|
|
65326
|
+
};
|
|
65327
|
+
/** @description Unauthorized */
|
|
65328
|
+
401: {
|
|
65329
|
+
headers: {
|
|
65330
|
+
[name: string]: unknown;
|
|
65331
|
+
};
|
|
65332
|
+
content: {
|
|
65333
|
+
"application/json": components["schemas"]["Error"];
|
|
65334
|
+
};
|
|
65335
|
+
};
|
|
65336
|
+
/** @description Forbidden */
|
|
65337
|
+
403: {
|
|
65338
|
+
headers: {
|
|
65339
|
+
[name: string]: unknown;
|
|
65340
|
+
};
|
|
65341
|
+
content: {
|
|
65342
|
+
"application/json": components["schemas"]["Error"];
|
|
65343
|
+
};
|
|
65344
|
+
};
|
|
65345
|
+
/** @description Not found */
|
|
65346
|
+
404: {
|
|
65347
|
+
headers: {
|
|
65348
|
+
[name: string]: unknown;
|
|
65349
|
+
};
|
|
65350
|
+
content: {
|
|
65351
|
+
"application/json": components["schemas"]["Error"];
|
|
65352
|
+
};
|
|
65353
|
+
};
|
|
65354
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65355
|
+
409: {
|
|
65356
|
+
headers: {
|
|
65357
|
+
[name: string]: unknown;
|
|
65358
|
+
};
|
|
65359
|
+
content: {
|
|
65360
|
+
"application/json": components["schemas"]["Error"];
|
|
65361
|
+
};
|
|
65362
|
+
};
|
|
65363
|
+
/** @description Rate limited */
|
|
65364
|
+
429: {
|
|
65365
|
+
headers: {
|
|
65366
|
+
[name: string]: unknown;
|
|
65367
|
+
};
|
|
65368
|
+
content: {
|
|
65369
|
+
"application/json": components["schemas"]["Error"];
|
|
65370
|
+
};
|
|
65371
|
+
};
|
|
65372
|
+
};
|
|
65373
|
+
};
|
|
65374
|
+
put?: never;
|
|
65375
|
+
post?: never;
|
|
65376
|
+
delete?: never;
|
|
65377
|
+
options?: never;
|
|
65378
|
+
head?: never;
|
|
65379
|
+
patch?: never;
|
|
65380
|
+
trace?: never;
|
|
65381
|
+
};
|
|
65382
|
+
"/clinic/commissions/imported-exports": {
|
|
65383
|
+
parameters: {
|
|
65384
|
+
query?: never;
|
|
65385
|
+
header?: never;
|
|
65386
|
+
path?: never;
|
|
65387
|
+
cookie?: never;
|
|
65388
|
+
};
|
|
65389
|
+
get?: never;
|
|
65390
|
+
put?: never;
|
|
65391
|
+
/**
|
|
65392
|
+
* Upload Dentalink’s own export of a liquidación
|
|
65393
|
+
* @description The manual fallback for a liquidación the migration reader could not reach (gap `liquidacion_unreachable` / `liquidacion_unparseable`, whose detail names the professional, sucursal and month): Dentalink’s export (PDF, Excel, CSV or an image; `content` as base64 or a `data:` URL; at most 20 MB), stored against that professional, month and sucursal and shown in the professional’s history in place of the imported liquidación. A new upload for the same slot replaces the previous. Only a month Dentalink settled: 409 `month_owned_by_vitrina` otherwise. 400 `liquidacion_export_type` / `_encoding` / `_empty` / `_too_large`; 404 unknown professional. Requires `clinic_money:write`.
|
|
65394
|
+
*
|
|
65395
|
+
* **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`.
|
|
65396
|
+
*/
|
|
65397
|
+
post: {
|
|
65398
|
+
parameters: {
|
|
65399
|
+
query?: never;
|
|
65400
|
+
header?: {
|
|
65401
|
+
/** @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. */
|
|
65402
|
+
"Idempotency-Key"?: string;
|
|
65403
|
+
};
|
|
65404
|
+
path?: never;
|
|
65405
|
+
cookie?: never;
|
|
65406
|
+
};
|
|
65407
|
+
requestBody?: {
|
|
65408
|
+
content: {
|
|
65409
|
+
/**
|
|
65410
|
+
* @example {
|
|
65411
|
+
* "professional_id": "0192f0c4-0000-7000-8000-000000000001",
|
|
65412
|
+
* "period": "2026-09",
|
|
65413
|
+
* "location_id": "0192f0c4-0000-7000-8000-000000000003",
|
|
65414
|
+
* "external_id": "9000",
|
|
65415
|
+
* "file_name": "liquidacion-septiembre.pdf",
|
|
65416
|
+
* "content": "data:application/pdf;base64,JVBERi0xLjQK"
|
|
65417
|
+
* }
|
|
65418
|
+
*/
|
|
65419
|
+
"application/json": {
|
|
65420
|
+
/** Format: uuid */
|
|
65421
|
+
professional_id: string;
|
|
65422
|
+
period: string;
|
|
65423
|
+
/** Format: uuid */
|
|
65424
|
+
location_id?: string | null;
|
|
65425
|
+
external_id?: string | null;
|
|
65426
|
+
file_name: string;
|
|
65427
|
+
mime_type?: string;
|
|
65428
|
+
content: string;
|
|
65429
|
+
};
|
|
65430
|
+
};
|
|
65431
|
+
};
|
|
65432
|
+
responses: {
|
|
65433
|
+
/** @description Liquidación export */
|
|
65434
|
+
201: {
|
|
65435
|
+
headers: {
|
|
65436
|
+
[name: string]: unknown;
|
|
65437
|
+
};
|
|
65438
|
+
content: {
|
|
65439
|
+
/**
|
|
65440
|
+
* @example {
|
|
65441
|
+
* "data": {
|
|
65442
|
+
* "id": "0192f0c4-0000-7000-8000-000000000005",
|
|
65443
|
+
* "source": "dentalink_export",
|
|
65444
|
+
* "label": "Exportación de Dentalink",
|
|
65445
|
+
* "read_only": true,
|
|
65446
|
+
* "location_id": "0192f0c4-0000-7000-8000-000000000003",
|
|
65447
|
+
* "location_name": "Central",
|
|
65448
|
+
* "external_id": "9000",
|
|
65449
|
+
* "file_name": "liquidacion-septiembre.pdf",
|
|
65450
|
+
* "mime_type": "application/pdf",
|
|
65451
|
+
* "size_bytes": 48213,
|
|
65452
|
+
* "uploaded_at": "2026-11-06T13:10:00.000Z"
|
|
65453
|
+
* }
|
|
65454
|
+
* }
|
|
65455
|
+
*/
|
|
65456
|
+
"application/json": {
|
|
65457
|
+
data?: unknown;
|
|
65458
|
+
};
|
|
65459
|
+
};
|
|
65460
|
+
};
|
|
65461
|
+
/** @description Validation error */
|
|
65462
|
+
400: {
|
|
65463
|
+
headers: {
|
|
65464
|
+
[name: string]: unknown;
|
|
65465
|
+
};
|
|
65466
|
+
content: {
|
|
65467
|
+
"application/json": components["schemas"]["Error"];
|
|
65468
|
+
};
|
|
65469
|
+
};
|
|
65470
|
+
/** @description Unauthorized */
|
|
65471
|
+
401: {
|
|
65472
|
+
headers: {
|
|
65473
|
+
[name: string]: unknown;
|
|
65474
|
+
};
|
|
65475
|
+
content: {
|
|
65476
|
+
"application/json": components["schemas"]["Error"];
|
|
65477
|
+
};
|
|
65478
|
+
};
|
|
65479
|
+
/** @description Forbidden */
|
|
65480
|
+
403: {
|
|
65481
|
+
headers: {
|
|
65482
|
+
[name: string]: unknown;
|
|
65483
|
+
};
|
|
65484
|
+
content: {
|
|
65485
|
+
"application/json": components["schemas"]["Error"];
|
|
65486
|
+
};
|
|
65487
|
+
};
|
|
65488
|
+
/** @description Not found */
|
|
65489
|
+
404: {
|
|
65490
|
+
headers: {
|
|
65491
|
+
[name: string]: unknown;
|
|
65492
|
+
};
|
|
65493
|
+
content: {
|
|
65494
|
+
"application/json": components["schemas"]["Error"];
|
|
65495
|
+
};
|
|
65496
|
+
};
|
|
65497
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65498
|
+
409: {
|
|
65499
|
+
headers: {
|
|
65500
|
+
[name: string]: unknown;
|
|
65501
|
+
};
|
|
65502
|
+
content: {
|
|
65503
|
+
"application/json": components["schemas"]["Error"];
|
|
65504
|
+
};
|
|
65505
|
+
};
|
|
65506
|
+
/** @description Rate limited */
|
|
65507
|
+
429: {
|
|
65508
|
+
headers: {
|
|
65509
|
+
[name: string]: unknown;
|
|
65510
|
+
};
|
|
65511
|
+
content: {
|
|
65512
|
+
"application/json": components["schemas"]["Error"];
|
|
65513
|
+
};
|
|
65514
|
+
};
|
|
65515
|
+
};
|
|
65516
|
+
};
|
|
65517
|
+
delete?: never;
|
|
65518
|
+
options?: never;
|
|
65519
|
+
head?: never;
|
|
65520
|
+
patch?: never;
|
|
65521
|
+
trace?: never;
|
|
65522
|
+
};
|
|
65523
|
+
"/clinic/commissions/imported-exports/{id}/file": {
|
|
65524
|
+
parameters: {
|
|
65525
|
+
query?: never;
|
|
65526
|
+
header?: never;
|
|
65527
|
+
path?: never;
|
|
65528
|
+
cookie?: never;
|
|
65529
|
+
};
|
|
65530
|
+
/**
|
|
65531
|
+
* Download an uploaded Dentalink liquidación export
|
|
65532
|
+
* @description The file the clinic uploaded, as uploaded (its own content type). 404 unknown id. Requires `clinic_money:read`.
|
|
65533
|
+
*
|
|
65534
|
+
* **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`.
|
|
65535
|
+
*/
|
|
65536
|
+
get: {
|
|
65537
|
+
parameters: {
|
|
65538
|
+
query?: never;
|
|
65539
|
+
header?: never;
|
|
65540
|
+
path: {
|
|
65541
|
+
id: string;
|
|
65542
|
+
};
|
|
65543
|
+
cookie?: never;
|
|
65544
|
+
};
|
|
65545
|
+
requestBody?: never;
|
|
65546
|
+
responses: {
|
|
65547
|
+
/** @description The file */
|
|
65548
|
+
200: {
|
|
65549
|
+
headers: {
|
|
65550
|
+
[name: string]: unknown;
|
|
65551
|
+
};
|
|
65552
|
+
content: {
|
|
65553
|
+
"application/octet-stream": string;
|
|
65554
|
+
};
|
|
65555
|
+
};
|
|
65556
|
+
/** @description Validation error */
|
|
65557
|
+
400: {
|
|
65558
|
+
headers: {
|
|
65559
|
+
[name: string]: unknown;
|
|
65560
|
+
};
|
|
65561
|
+
content: {
|
|
65562
|
+
"application/json": components["schemas"]["Error"];
|
|
65563
|
+
};
|
|
65564
|
+
};
|
|
65565
|
+
/** @description Unauthorized */
|
|
65566
|
+
401: {
|
|
65567
|
+
headers: {
|
|
65568
|
+
[name: string]: unknown;
|
|
65569
|
+
};
|
|
65570
|
+
content: {
|
|
65571
|
+
"application/json": components["schemas"]["Error"];
|
|
65572
|
+
};
|
|
65573
|
+
};
|
|
65574
|
+
/** @description Forbidden */
|
|
65575
|
+
403: {
|
|
65576
|
+
headers: {
|
|
65577
|
+
[name: string]: unknown;
|
|
65578
|
+
};
|
|
65579
|
+
content: {
|
|
65580
|
+
"application/json": components["schemas"]["Error"];
|
|
65581
|
+
};
|
|
65582
|
+
};
|
|
65583
|
+
/** @description Not found */
|
|
65584
|
+
404: {
|
|
65585
|
+
headers: {
|
|
65586
|
+
[name: string]: unknown;
|
|
65587
|
+
};
|
|
65588
|
+
content: {
|
|
65589
|
+
"application/json": components["schemas"]["Error"];
|
|
65590
|
+
};
|
|
65591
|
+
};
|
|
65592
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65593
|
+
409: {
|
|
65594
|
+
headers: {
|
|
65595
|
+
[name: string]: unknown;
|
|
65596
|
+
};
|
|
65597
|
+
content: {
|
|
65598
|
+
"application/json": components["schemas"]["Error"];
|
|
65599
|
+
};
|
|
65600
|
+
};
|
|
65601
|
+
/** @description Rate limited */
|
|
65602
|
+
429: {
|
|
65603
|
+
headers: {
|
|
65604
|
+
[name: string]: unknown;
|
|
65605
|
+
};
|
|
65606
|
+
content: {
|
|
65607
|
+
"application/json": components["schemas"]["Error"];
|
|
65608
|
+
};
|
|
65609
|
+
};
|
|
65610
|
+
};
|
|
65611
|
+
};
|
|
65612
|
+
put?: never;
|
|
65613
|
+
post?: never;
|
|
65614
|
+
delete?: never;
|
|
65615
|
+
options?: never;
|
|
65616
|
+
head?: never;
|
|
65617
|
+
patch?: never;
|
|
65618
|
+
trace?: never;
|
|
65619
|
+
};
|
|
65620
|
+
"/clinic/payment-registrations": {
|
|
65621
|
+
parameters: {
|
|
65622
|
+
query?: never;
|
|
65623
|
+
header?: never;
|
|
65624
|
+
path?: never;
|
|
65625
|
+
cookie?: never;
|
|
65626
|
+
};
|
|
65627
|
+
/**
|
|
65628
|
+
* Mercado Pago payments to register in the practice system
|
|
65629
|
+
* @description The reception tasks: each Mercado Pago payment of a clinic whose Dentalink / Medilink / Reservo authors its money, pre-filled (patient and RUT, amount, medio, MP number, date, what it paid) and, once the mirror brings the pago in, its match. `status=pending` (default) = `open` + `ambiguous` (an ambiguous task lists its `candidates`). `payments:read`.
|
|
65630
|
+
*/
|
|
65631
|
+
get: {
|
|
65632
|
+
parameters: {
|
|
65633
|
+
query?: {
|
|
65634
|
+
/** @description `pending` = open + ambiguous (default); `closed` = matched, dismissed or cancelled. */
|
|
65635
|
+
status?: "pending" | "matched" | "closed" | "all";
|
|
65636
|
+
contact_id?: string;
|
|
65637
|
+
limit?: number;
|
|
65638
|
+
offset?: number | null;
|
|
65639
|
+
};
|
|
65640
|
+
header?: never;
|
|
65641
|
+
path?: never;
|
|
65642
|
+
cookie?: never;
|
|
65643
|
+
};
|
|
65644
|
+
requestBody?: never;
|
|
65645
|
+
responses: {
|
|
65646
|
+
/** @description The tasks, newest payment first */
|
|
65647
|
+
200: {
|
|
65648
|
+
headers: {
|
|
65649
|
+
[name: string]: unknown;
|
|
65650
|
+
};
|
|
65651
|
+
content: {
|
|
65652
|
+
/**
|
|
65653
|
+
* @example {
|
|
65654
|
+
* "data": [
|
|
65655
|
+
* {
|
|
65656
|
+
* "id": "0199c3a0-1111-7000-8000-000000000001",
|
|
65657
|
+
* "status": "matched",
|
|
65658
|
+
* "vendor": "dentalink",
|
|
65659
|
+
* "vendor_label": "Dentalink",
|
|
65660
|
+
* "provider": "mercadopago",
|
|
65661
|
+
* "provider_reference": "182050716739",
|
|
65662
|
+
* "provider_payment_url": "https://www.mercadopago.cl/activities?q=182050716739",
|
|
65663
|
+
* "customer_payment_id": "0199c3a0-2222-7000-8000-000000000002",
|
|
65664
|
+
* "contact_id": "0199c3a0-3333-7000-8000-000000000003",
|
|
65665
|
+
* "amount_clp": 30000,
|
|
65666
|
+
* "paid_on": "2026-10-05",
|
|
65667
|
+
* "patient": {
|
|
65668
|
+
* "id": "0199c3a0-4444-7000-8000-000000000004",
|
|
65669
|
+
* "name": "Ana Pérez",
|
|
65670
|
+
* "rut": "11.111.111-1"
|
|
65671
|
+
* },
|
|
65672
|
+
* "concept": {
|
|
65673
|
+
* "kind": "appointment_deposit",
|
|
65674
|
+
* "label": "Abono cita",
|
|
65675
|
+
* "appointment_starts_at": "2026-10-09T13:00:00.000Z"
|
|
65676
|
+
* },
|
|
65677
|
+
* "medio": {
|
|
65678
|
+
* "code": "30",
|
|
65679
|
+
* "label": "Mercado Pago"
|
|
65680
|
+
* },
|
|
65681
|
+
* "matched": {
|
|
65682
|
+
* "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
|
|
65683
|
+
* "vendor_reference": "88123",
|
|
65684
|
+
* "received_on": "2026-10-05",
|
|
65685
|
+
* "amount_clp": 30000,
|
|
65686
|
+
* "medio": "Mercado Pago",
|
|
65687
|
+
* "voided": false,
|
|
65688
|
+
* "by": "auto_unique",
|
|
65689
|
+
* "at": "2026-10-05T18:20:00.000Z"
|
|
65690
|
+
* },
|
|
65691
|
+
* "candidates": [],
|
|
65692
|
+
* "dismissed_reason": null,
|
|
65693
|
+
* "overdue": false,
|
|
65694
|
+
* "reminded_at": null,
|
|
65695
|
+
* "created_at": "2026-10-05T14:02:11.000Z"
|
|
65696
|
+
* }
|
|
65697
|
+
* ],
|
|
65698
|
+
* "meta": {
|
|
65699
|
+
* "total": 1,
|
|
65700
|
+
* "limit": 50,
|
|
65701
|
+
* "offset": 0
|
|
65702
|
+
* }
|
|
65703
|
+
* }
|
|
65704
|
+
*/
|
|
65705
|
+
"application/json": {
|
|
65706
|
+
data: components["schemas"]["PaymentRegistration"][];
|
|
65707
|
+
meta: {
|
|
65708
|
+
total: number;
|
|
65709
|
+
limit: number;
|
|
65710
|
+
offset: number;
|
|
64914
65711
|
};
|
|
64915
65712
|
};
|
|
64916
65713
|
};
|
|
@@ -155839,7 +156636,8 @@ interface paths {
|
|
|
155839
156636
|
* }
|
|
155840
156637
|
* ],
|
|
155841
156638
|
* "presets": [
|
|
155842
|
-
* "vitrina_automotora_v1"
|
|
156639
|
+
* "vitrina_automotora_v1",
|
|
156640
|
+
* "vitrina_clinica_v1"
|
|
155843
156641
|
* ]
|
|
155844
156642
|
* }
|
|
155845
156643
|
* }
|
|
@@ -156005,18 +156803,18 @@ interface paths {
|
|
|
156005
156803
|
*/
|
|
156006
156804
|
intake?: "inbox" | "demo";
|
|
156007
156805
|
/**
|
|
156008
|
-
* @description A built-in mapping
|
|
156806
|
+
* @description A built-in mapping: `vitrina_automotora_v1` (the Vitrina «Automotoras» form) or `vitrina_clinica_v1` (the «Clínicas» form: role, professionals to size, agenda system; vertical `clinica`). Replaces `mapping`.
|
|
156009
156807
|
* @enum {string}
|
|
156010
156808
|
*/
|
|
156011
|
-
preset?: "vitrina_automotora_v1";
|
|
156012
|
-
/** @description Per-question rules. A rule names the Meta question (`source`, compared lowercase / without accents / with `_` for spaces; `aliases` add more spellings), where its answer goes (`target`: contact.name, contact.first_name, contact.last_name, contact.phone, contact.email, contact.company, qualification.role, qualification.size, qualification.sellers, note), and optionally `values` (normalised answer → stored value). Every answer is kept in the lead note whatever its rule; a missing answer never blocks the lead. */
|
|
156809
|
+
preset?: "vitrina_automotora_v1" | "vitrina_clinica_v1";
|
|
156810
|
+
/** @description Per-question rules. A rule names the Meta question (`source`, compared lowercase / without accents / with `_` for spaces; `aliases` add more spellings), where its answer goes (`target`: contact.name, contact.first_name, contact.last_name, contact.phone, contact.email, contact.company, qualification.role, qualification.size, qualification.sellers, qualification.agenda_system, note), and optionally `values` (normalised answer → stored value). Every answer is kept in the lead note whatever its rule; a missing answer never blocks the lead. */
|
|
156013
156811
|
mapping?: {
|
|
156014
156812
|
/** @default [] */
|
|
156015
156813
|
rules?: {
|
|
156016
156814
|
source: string;
|
|
156017
156815
|
aliases?: string[];
|
|
156018
156816
|
/** @enum {string} */
|
|
156019
|
-
target: "contact.name" | "contact.first_name" | "contact.last_name" | "contact.phone" | "contact.email" | "contact.company" | "qualification.role" | "qualification.size" | "qualification.sellers" | "note";
|
|
156817
|
+
target: "contact.name" | "contact.first_name" | "contact.last_name" | "contact.phone" | "contact.email" | "contact.company" | "qualification.role" | "qualification.size" | "qualification.sellers" | "qualification.agenda_system" | "note";
|
|
156020
156818
|
label?: string;
|
|
156021
156819
|
values?: {
|
|
156022
156820
|
[key: string]: string;
|
|
@@ -161336,6 +162134,374 @@ interface paths {
|
|
|
161336
162134
|
patch?: never;
|
|
161337
162135
|
trace?: never;
|
|
161338
162136
|
};
|
|
162137
|
+
"/messaging-accounts/email/test": {
|
|
162138
|
+
parameters: {
|
|
162139
|
+
query?: never;
|
|
162140
|
+
header?: never;
|
|
162141
|
+
path?: never;
|
|
162142
|
+
cookie?: never;
|
|
162143
|
+
};
|
|
162144
|
+
get?: never;
|
|
162145
|
+
put?: never;
|
|
162146
|
+
/**
|
|
162147
|
+
* Test IMAP/SMTP credentials
|
|
162148
|
+
* @description Dials both legs with the supplied credentials and reports each independently — **nothing is persisted**, so this is the safe way to let someone iterate on a mailbox configuration.
|
|
162149
|
+
*
|
|
162150
|
+
* **Run `POST /messaging-accounts/email/discover` first** to get the `imap` / `smtp` host, port and TLS mode instead of guessing them. If discover returns `oauth` (Gmail / Microsoft 365), do NOT use this route: have the owner connect it with the OAuth sign-in (Conectar Gmail / Microsoft 365 in the app), which needs no password.
|
|
162151
|
+
*
|
|
162152
|
+
* The two legs fail independently: a mailbox can read (IMAP fine) and be unable to send (SMTP wrong), so read both results rather than treating the response as one boolean. `error_kind` says why a leg failed: `auth` = the server answered and refused the password, `unreachable` / `timeout` / `tls` = the server could not be reached with those settings. `imap.user` / `smtp.user` default to `email` when omitted, which is right for most providers.
|
|
162153
|
+
*
|
|
162154
|
+
* **The password is the mailbox owner’s real password.** Sending it through an AI chat puts it in that chat’s transcript — only do it when the owner asks you to. It is used for this one test, is never stored by this route, and is never returned or written to the audit log. Rate-limited per workspace (`429`).
|
|
162155
|
+
*/
|
|
162156
|
+
post: {
|
|
162157
|
+
parameters: {
|
|
162158
|
+
query?: never;
|
|
162159
|
+
header?: {
|
|
162160
|
+
/** @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. */
|
|
162161
|
+
"Idempotency-Key"?: string;
|
|
162162
|
+
};
|
|
162163
|
+
path?: never;
|
|
162164
|
+
cookie?: never;
|
|
162165
|
+
};
|
|
162166
|
+
requestBody?: {
|
|
162167
|
+
content: {
|
|
162168
|
+
/**
|
|
162169
|
+
* @example {
|
|
162170
|
+
* "email": "contacto@automotora-ejemplo.cl",
|
|
162171
|
+
* "imap": {
|
|
162172
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162173
|
+
* "port": 993,
|
|
162174
|
+
* "secure": true,
|
|
162175
|
+
* "password": "contraseña-del-buzón"
|
|
162176
|
+
* },
|
|
162177
|
+
* "smtp": {
|
|
162178
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162179
|
+
* "port": 465,
|
|
162180
|
+
* "secure": true,
|
|
162181
|
+
* "password": "contraseña-del-buzón"
|
|
162182
|
+
* }
|
|
162183
|
+
* }
|
|
162184
|
+
*/
|
|
162185
|
+
"application/json": {
|
|
162186
|
+
/** Format: email */
|
|
162187
|
+
email: string;
|
|
162188
|
+
imap: {
|
|
162189
|
+
host: string;
|
|
162190
|
+
port: number;
|
|
162191
|
+
/** @default true */
|
|
162192
|
+
secure?: boolean;
|
|
162193
|
+
user?: string;
|
|
162194
|
+
password: string;
|
|
162195
|
+
};
|
|
162196
|
+
smtp: {
|
|
162197
|
+
host: string;
|
|
162198
|
+
port: number;
|
|
162199
|
+
/** @default true */
|
|
162200
|
+
secure?: boolean;
|
|
162201
|
+
user?: string;
|
|
162202
|
+
password: string;
|
|
162203
|
+
};
|
|
162204
|
+
};
|
|
162205
|
+
};
|
|
162206
|
+
};
|
|
162207
|
+
responses: {
|
|
162208
|
+
/** @description Per-leg connection results */
|
|
162209
|
+
200: {
|
|
162210
|
+
headers: {
|
|
162211
|
+
[name: string]: unknown;
|
|
162212
|
+
};
|
|
162213
|
+
content: {
|
|
162214
|
+
/**
|
|
162215
|
+
* @example {
|
|
162216
|
+
* "data": {
|
|
162217
|
+
* "ok": false,
|
|
162218
|
+
* "imap": {
|
|
162219
|
+
* "ok": true,
|
|
162220
|
+
* "error": null,
|
|
162221
|
+
* "error_kind": null
|
|
162222
|
+
* },
|
|
162223
|
+
* "smtp": {
|
|
162224
|
+
* "ok": false,
|
|
162225
|
+
* "error": "Invalid login: 535 Incorrect authentication data",
|
|
162226
|
+
* "error_kind": "auth"
|
|
162227
|
+
* }
|
|
162228
|
+
* }
|
|
162229
|
+
* }
|
|
162230
|
+
*/
|
|
162231
|
+
"application/json": {
|
|
162232
|
+
data: {
|
|
162233
|
+
/** @description true only when BOTH legs passed */
|
|
162234
|
+
ok: boolean;
|
|
162235
|
+
imap: {
|
|
162236
|
+
ok: boolean;
|
|
162237
|
+
error: string | null;
|
|
162238
|
+
/** @enum {string|null} */
|
|
162239
|
+
error_kind: "auth" | "unreachable" | "tls" | "timeout" | "other" | null;
|
|
162240
|
+
};
|
|
162241
|
+
smtp: {
|
|
162242
|
+
ok: boolean;
|
|
162243
|
+
error: string | null;
|
|
162244
|
+
/** @enum {string|null} */
|
|
162245
|
+
error_kind: "auth" | "unreachable" | "tls" | "timeout" | "other" | null;
|
|
162246
|
+
};
|
|
162247
|
+
};
|
|
162248
|
+
};
|
|
162249
|
+
};
|
|
162250
|
+
};
|
|
162251
|
+
/** @description Validation error */
|
|
162252
|
+
400: {
|
|
162253
|
+
headers: {
|
|
162254
|
+
[name: string]: unknown;
|
|
162255
|
+
};
|
|
162256
|
+
content: {
|
|
162257
|
+
"application/json": components["schemas"]["Error"];
|
|
162258
|
+
};
|
|
162259
|
+
};
|
|
162260
|
+
/** @description Unauthorized */
|
|
162261
|
+
401: {
|
|
162262
|
+
headers: {
|
|
162263
|
+
[name: string]: unknown;
|
|
162264
|
+
};
|
|
162265
|
+
content: {
|
|
162266
|
+
"application/json": components["schemas"]["Error"];
|
|
162267
|
+
};
|
|
162268
|
+
};
|
|
162269
|
+
/** @description Forbidden */
|
|
162270
|
+
403: {
|
|
162271
|
+
headers: {
|
|
162272
|
+
[name: string]: unknown;
|
|
162273
|
+
};
|
|
162274
|
+
content: {
|
|
162275
|
+
"application/json": components["schemas"]["Error"];
|
|
162276
|
+
};
|
|
162277
|
+
};
|
|
162278
|
+
/** @description Not found */
|
|
162279
|
+
404: {
|
|
162280
|
+
headers: {
|
|
162281
|
+
[name: string]: unknown;
|
|
162282
|
+
};
|
|
162283
|
+
content: {
|
|
162284
|
+
"application/json": components["schemas"]["Error"];
|
|
162285
|
+
};
|
|
162286
|
+
};
|
|
162287
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
162288
|
+
409: {
|
|
162289
|
+
headers: {
|
|
162290
|
+
[name: string]: unknown;
|
|
162291
|
+
};
|
|
162292
|
+
content: {
|
|
162293
|
+
"application/json": components["schemas"]["Error"];
|
|
162294
|
+
};
|
|
162295
|
+
};
|
|
162296
|
+
/** @description Rate limited */
|
|
162297
|
+
429: {
|
|
162298
|
+
headers: {
|
|
162299
|
+
[name: string]: unknown;
|
|
162300
|
+
};
|
|
162301
|
+
content: {
|
|
162302
|
+
"application/json": components["schemas"]["Error"];
|
|
162303
|
+
};
|
|
162304
|
+
};
|
|
162305
|
+
};
|
|
162306
|
+
};
|
|
162307
|
+
delete?: never;
|
|
162308
|
+
options?: never;
|
|
162309
|
+
head?: never;
|
|
162310
|
+
patch?: never;
|
|
162311
|
+
trace?: never;
|
|
162312
|
+
};
|
|
162313
|
+
"/messaging-accounts/email": {
|
|
162314
|
+
parameters: {
|
|
162315
|
+
query?: never;
|
|
162316
|
+
header?: never;
|
|
162317
|
+
path?: never;
|
|
162318
|
+
cookie?: never;
|
|
162319
|
+
};
|
|
162320
|
+
get?: never;
|
|
162321
|
+
put?: never;
|
|
162322
|
+
/**
|
|
162323
|
+
* Connect a mailbox over IMAP/SMTP
|
|
162324
|
+
* @description Creates the `email_imap` account and stores the credentials encrypted. Same body as `/email/test` plus naming. The connection is re-tested server-side before anything is created, so **a failed connection answers 422 with the per-leg errors** (`imap` / `smtp`, each with `error_kind`) and creates nothing.
|
|
162325
|
+
*
|
|
162326
|
+
* Flow: `POST /messaging-accounts/email/discover` (finds the settings; with the password it also returns the `verified` candidate), optionally `POST /messaging-accounts/email/test`, then this route with the `verified` (or chosen) candidate’s `imap` / `smtp` and the password on both legs.
|
|
162327
|
+
*
|
|
162328
|
+
* This is the raw-credential path. **Prefer OAuth whenever discover returns `oauth`** (Gmail, Microsoft 365): connect those through the OAuth sign-in in the app (Conectar Gmail / Microsoft 365), which needs no password.
|
|
162329
|
+
*
|
|
162330
|
+
* **The password is the mailbox owner’s real password.** Sending it through an AI chat puts it in that chat’s transcript — only do it when the owner asks you to. It is stored encrypted, **never returned** (the account in the response carries no secrets, and later reads redact them) and never written to the audit log. Rate-limited per workspace (`429`).
|
|
162331
|
+
*/
|
|
162332
|
+
post: {
|
|
162333
|
+
parameters: {
|
|
162334
|
+
query?: never;
|
|
162335
|
+
header?: {
|
|
162336
|
+
/** @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. */
|
|
162337
|
+
"Idempotency-Key"?: string;
|
|
162338
|
+
};
|
|
162339
|
+
path?: never;
|
|
162340
|
+
cookie?: never;
|
|
162341
|
+
};
|
|
162342
|
+
requestBody?: {
|
|
162343
|
+
content: {
|
|
162344
|
+
/**
|
|
162345
|
+
* @example {
|
|
162346
|
+
* "email": "contacto@automotora-ejemplo.cl",
|
|
162347
|
+
* "name": "Correo de contacto",
|
|
162348
|
+
* "imap": {
|
|
162349
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162350
|
+
* "port": 993,
|
|
162351
|
+
* "secure": true,
|
|
162352
|
+
* "password": "contraseña-del-buzón"
|
|
162353
|
+
* },
|
|
162354
|
+
* "smtp": {
|
|
162355
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162356
|
+
* "port": 465,
|
|
162357
|
+
* "secure": true,
|
|
162358
|
+
* "password": "contraseña-del-buzón"
|
|
162359
|
+
* }
|
|
162360
|
+
* }
|
|
162361
|
+
*/
|
|
162362
|
+
"application/json": {
|
|
162363
|
+
/** Format: email */
|
|
162364
|
+
email: string;
|
|
162365
|
+
imap: {
|
|
162366
|
+
host: string;
|
|
162367
|
+
port: number;
|
|
162368
|
+
/** @default true */
|
|
162369
|
+
secure?: boolean;
|
|
162370
|
+
user?: string;
|
|
162371
|
+
password: string;
|
|
162372
|
+
};
|
|
162373
|
+
smtp: {
|
|
162374
|
+
host: string;
|
|
162375
|
+
port: number;
|
|
162376
|
+
/** @default true */
|
|
162377
|
+
secure?: boolean;
|
|
162378
|
+
user?: string;
|
|
162379
|
+
password: string;
|
|
162380
|
+
};
|
|
162381
|
+
name?: string;
|
|
162382
|
+
from_name?: string | null;
|
|
162383
|
+
/** Format: uuid */
|
|
162384
|
+
assignee_ai_agent_id?: string | null;
|
|
162385
|
+
/**
|
|
162386
|
+
* @description What the channel is for. `bank_reconciliation` («Solo conciliación bancaria», email mailboxes only): bank transfer notifications feed the bank-movement ledger; every other message is dropped (no conversation, no notification), the channel never has an AI agent and never sends. Default `conversations`.
|
|
162387
|
+
* @enum {string}
|
|
162388
|
+
*/
|
|
162389
|
+
purpose?: "conversations" | "bank_reconciliation";
|
|
162390
|
+
};
|
|
162391
|
+
};
|
|
162392
|
+
};
|
|
162393
|
+
responses: {
|
|
162394
|
+
/** @description The connected email account (no secrets) */
|
|
162395
|
+
201: {
|
|
162396
|
+
headers: {
|
|
162397
|
+
[name: string]: unknown;
|
|
162398
|
+
};
|
|
162399
|
+
content: {
|
|
162400
|
+
/**
|
|
162401
|
+
* @example {
|
|
162402
|
+
* "data": {
|
|
162403
|
+
* "id": "3f6d2c1e-8a4b-4d7e-9c10-5b2a7e9f0a11",
|
|
162404
|
+
* "name": "Correo de contacto",
|
|
162405
|
+
* "kind": "email_imap",
|
|
162406
|
+
* "channels": [
|
|
162407
|
+
* "email"
|
|
162408
|
+
* ],
|
|
162409
|
+
* "enabled": true,
|
|
162410
|
+
* "config": {
|
|
162411
|
+
* "connected_via": "imap_smtp",
|
|
162412
|
+
* "email": "contacto@automotora-ejemplo.cl",
|
|
162413
|
+
* "from_name": null,
|
|
162414
|
+
* "imap": {
|
|
162415
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162416
|
+
* "port": 993,
|
|
162417
|
+
* "secure": true,
|
|
162418
|
+
* "user": "contacto@automotora-ejemplo.cl"
|
|
162419
|
+
* },
|
|
162420
|
+
* "smtp": {
|
|
162421
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162422
|
+
* "port": 465,
|
|
162423
|
+
* "secure": true,
|
|
162424
|
+
* "user": "contacto@automotora-ejemplo.cl"
|
|
162425
|
+
* }
|
|
162426
|
+
* },
|
|
162427
|
+
* "created_at": "2026-10-16T14:00:00.000Z"
|
|
162428
|
+
* }
|
|
162429
|
+
* }
|
|
162430
|
+
*/
|
|
162431
|
+
"application/json": {
|
|
162432
|
+
data?: unknown;
|
|
162433
|
+
};
|
|
162434
|
+
};
|
|
162435
|
+
};
|
|
162436
|
+
/** @description Validation error */
|
|
162437
|
+
400: {
|
|
162438
|
+
headers: {
|
|
162439
|
+
[name: string]: unknown;
|
|
162440
|
+
};
|
|
162441
|
+
content: {
|
|
162442
|
+
"application/json": components["schemas"]["Error"];
|
|
162443
|
+
};
|
|
162444
|
+
};
|
|
162445
|
+
/** @description Unauthorized */
|
|
162446
|
+
401: {
|
|
162447
|
+
headers: {
|
|
162448
|
+
[name: string]: unknown;
|
|
162449
|
+
};
|
|
162450
|
+
content: {
|
|
162451
|
+
"application/json": components["schemas"]["Error"];
|
|
162452
|
+
};
|
|
162453
|
+
};
|
|
162454
|
+
/** @description Forbidden */
|
|
162455
|
+
403: {
|
|
162456
|
+
headers: {
|
|
162457
|
+
[name: string]: unknown;
|
|
162458
|
+
};
|
|
162459
|
+
content: {
|
|
162460
|
+
"application/json": components["schemas"]["Error"];
|
|
162461
|
+
};
|
|
162462
|
+
};
|
|
162463
|
+
/** @description Not found */
|
|
162464
|
+
404: {
|
|
162465
|
+
headers: {
|
|
162466
|
+
[name: string]: unknown;
|
|
162467
|
+
};
|
|
162468
|
+
content: {
|
|
162469
|
+
"application/json": components["schemas"]["Error"];
|
|
162470
|
+
};
|
|
162471
|
+
};
|
|
162472
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
162473
|
+
409: {
|
|
162474
|
+
headers: {
|
|
162475
|
+
[name: string]: unknown;
|
|
162476
|
+
};
|
|
162477
|
+
content: {
|
|
162478
|
+
"application/json": components["schemas"]["Error"];
|
|
162479
|
+
};
|
|
162480
|
+
};
|
|
162481
|
+
/** @description The IMAP and/or SMTP leg failed; nothing was created */
|
|
162482
|
+
422: {
|
|
162483
|
+
headers: {
|
|
162484
|
+
[name: string]: unknown;
|
|
162485
|
+
};
|
|
162486
|
+
content?: never;
|
|
162487
|
+
};
|
|
162488
|
+
/** @description Rate limited */
|
|
162489
|
+
429: {
|
|
162490
|
+
headers: {
|
|
162491
|
+
[name: string]: unknown;
|
|
162492
|
+
};
|
|
162493
|
+
content: {
|
|
162494
|
+
"application/json": components["schemas"]["Error"];
|
|
162495
|
+
};
|
|
162496
|
+
};
|
|
162497
|
+
};
|
|
162498
|
+
};
|
|
162499
|
+
delete?: never;
|
|
162500
|
+
options?: never;
|
|
162501
|
+
head?: never;
|
|
162502
|
+
patch?: never;
|
|
162503
|
+
trace?: never;
|
|
162504
|
+
};
|
|
161339
162505
|
"/products": {
|
|
161340
162506
|
parameters: {
|
|
161341
162507
|
query?: never;
|
|
@@ -166110,6 +167276,432 @@ interface paths {
|
|
|
166110
167276
|
patch?: never;
|
|
166111
167277
|
trace?: never;
|
|
166112
167278
|
};
|
|
167279
|
+
"/store-setup": {
|
|
167280
|
+
parameters: {
|
|
167281
|
+
query?: never;
|
|
167282
|
+
header?: never;
|
|
167283
|
+
path?: never;
|
|
167284
|
+
cookie?: never;
|
|
167285
|
+
};
|
|
167286
|
+
/**
|
|
167287
|
+
* Get the store setup steps
|
|
167288
|
+
* @description The steps a store still has before its agent sells end to end, each computed from real data on every read: `store` «Conecta tu tienda» (a Shopify or WooCommerce store connected, or `sells_without_store`; `attention` when the store asks to be reconnected), `catalog` «Revisa tu catálogo» (at least one active product and the owner marked it reviewed), `mercadopago` «Conecta Mercado Pago» (present when native orders can be paid by link, i.e. `order_payment.mode` is not `transfer_only`) and `bank_account` «Agrega tu cuenta para transferencias» (present for `transfer_first` / `transfer_only`). `order_payment` is how a native order is paid (the `final` charging mode; change it with `PUT /payment-settings/charging`). `applies` is true for an ecommerce workspace, the one whose Home shows the steps; `complete` when every listed step is `done`. Requires `tenant:read`.
|
|
167289
|
+
*/
|
|
167290
|
+
get: {
|
|
167291
|
+
parameters: {
|
|
167292
|
+
query?: never;
|
|
167293
|
+
header?: never;
|
|
167294
|
+
path?: never;
|
|
167295
|
+
cookie?: never;
|
|
167296
|
+
};
|
|
167297
|
+
requestBody?: never;
|
|
167298
|
+
responses: {
|
|
167299
|
+
/** @description The store setup */
|
|
167300
|
+
200: {
|
|
167301
|
+
headers: {
|
|
167302
|
+
[name: string]: unknown;
|
|
167303
|
+
};
|
|
167304
|
+
content: {
|
|
167305
|
+
/**
|
|
167306
|
+
* @example {
|
|
167307
|
+
* "data": {
|
|
167308
|
+
* "applies": true,
|
|
167309
|
+
* "complete": false,
|
|
167310
|
+
* "steps": [
|
|
167311
|
+
* {
|
|
167312
|
+
* "key": "store",
|
|
167313
|
+
* "status": "done"
|
|
167314
|
+
* },
|
|
167315
|
+
* {
|
|
167316
|
+
* "key": "catalog",
|
|
167317
|
+
* "status": "todo"
|
|
167318
|
+
* },
|
|
167319
|
+
* {
|
|
167320
|
+
* "key": "mercadopago",
|
|
167321
|
+
* "status": "todo"
|
|
167322
|
+
* }
|
|
167323
|
+
* ],
|
|
167324
|
+
* "order_payment": {
|
|
167325
|
+
* "mode": "mp_first",
|
|
167326
|
+
* "source": "tenant",
|
|
167327
|
+
* "default_mode": "mp_first"
|
|
167328
|
+
* },
|
|
167329
|
+
* "store": {
|
|
167330
|
+
* "connections": [
|
|
167331
|
+
* {
|
|
167332
|
+
* "provider": "shopify",
|
|
167333
|
+
* "status": "connected",
|
|
167334
|
+
* "account": "Tienda Ejemplo"
|
|
167335
|
+
* },
|
|
167336
|
+
* {
|
|
167337
|
+
* "provider": "woocommerce",
|
|
167338
|
+
* "status": "not_connected",
|
|
167339
|
+
* "account": null
|
|
167340
|
+
* }
|
|
167341
|
+
* ],
|
|
167342
|
+
* "sells_without_store": false
|
|
167343
|
+
* },
|
|
167344
|
+
* "catalog": {
|
|
167345
|
+
* "active": 42,
|
|
167346
|
+
* "native": 0,
|
|
167347
|
+
* "synced": 42,
|
|
167348
|
+
* "without_price": 1,
|
|
167349
|
+
* "without_photo": 3,
|
|
167350
|
+
* "reviewed_at": null
|
|
167351
|
+
* },
|
|
167352
|
+
* "mercadopago": {
|
|
167353
|
+
* "configured": true,
|
|
167354
|
+
* "connected": false,
|
|
167355
|
+
* "account": null
|
|
167356
|
+
* },
|
|
167357
|
+
* "bank_accounts": {
|
|
167358
|
+
* "active": 0
|
|
167359
|
+
* }
|
|
167360
|
+
* }
|
|
167361
|
+
* }
|
|
167362
|
+
*/
|
|
167363
|
+
"application/json": {
|
|
167364
|
+
data: {
|
|
167365
|
+
/** @description The workspace is an ecommerce one: Home shows the steps. */
|
|
167366
|
+
applies: boolean;
|
|
167367
|
+
/** @description Every step is `done`. */
|
|
167368
|
+
complete: boolean;
|
|
167369
|
+
steps: {
|
|
167370
|
+
/**
|
|
167371
|
+
* @description `store` «Conecta tu tienda» · `catalog` «Revisa tu catálogo» · `mercadopago` «Conecta Mercado Pago» (only when native orders can be paid by link) · `bank_account` «Agrega tu cuenta para transferencias» (only when they are paid by transfer first or only).
|
|
167372
|
+
* @enum {string}
|
|
167373
|
+
*/
|
|
167374
|
+
key: "store" | "catalog" | "mercadopago" | "bank_account";
|
|
167375
|
+
/**
|
|
167376
|
+
* @description `attention` = the step was done and broke (the store asks to be reconnected).
|
|
167377
|
+
* @enum {string}
|
|
167378
|
+
*/
|
|
167379
|
+
status: "todo" | "done" | "attention";
|
|
167380
|
+
}[];
|
|
167381
|
+
/** @description How a native order (built from the Vitrina catalog) is paid: the workspace’s `final` charging mode. Written with `PUT /payment-settings/charging` (`{ final }`). */
|
|
167382
|
+
order_payment: {
|
|
167383
|
+
/**
|
|
167384
|
+
* @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
|
|
167385
|
+
* @enum {string}
|
|
167386
|
+
*/
|
|
167387
|
+
mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
|
|
167388
|
+
/** @enum {string} */
|
|
167389
|
+
source: "tenant" | "default";
|
|
167390
|
+
/**
|
|
167391
|
+
* @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
|
|
167392
|
+
* @enum {string}
|
|
167393
|
+
*/
|
|
167394
|
+
default_mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
|
|
167395
|
+
};
|
|
167396
|
+
store: {
|
|
167397
|
+
connections: {
|
|
167398
|
+
/** @enum {string} */
|
|
167399
|
+
provider: "shopify" | "woocommerce";
|
|
167400
|
+
/** @enum {string} */
|
|
167401
|
+
status: "not_connected" | "pending" | "connected" | "needs_reconnect";
|
|
167402
|
+
/** @description The shop’s name (Shopify) or URL (WooCommerce). */
|
|
167403
|
+
account: string | null;
|
|
167404
|
+
}[];
|
|
167405
|
+
/** @description The owner said the business sells from the Vitrina catalog alone. */
|
|
167406
|
+
sells_without_store: boolean;
|
|
167407
|
+
};
|
|
167408
|
+
catalog: {
|
|
167409
|
+
active: number;
|
|
167410
|
+
native: number;
|
|
167411
|
+
synced: number;
|
|
167412
|
+
without_price: number;
|
|
167413
|
+
without_photo: number;
|
|
167414
|
+
reviewed_at: string | null;
|
|
167415
|
+
};
|
|
167416
|
+
mercadopago: {
|
|
167417
|
+
/** @description This deployment can connect Mercado Pago at all. */
|
|
167418
|
+
configured: boolean;
|
|
167419
|
+
connected: boolean;
|
|
167420
|
+
account: string | null;
|
|
167421
|
+
};
|
|
167422
|
+
bank_accounts: {
|
|
167423
|
+
active: number;
|
|
167424
|
+
};
|
|
167425
|
+
};
|
|
167426
|
+
};
|
|
167427
|
+
};
|
|
167428
|
+
};
|
|
167429
|
+
/** @description Validation error */
|
|
167430
|
+
400: {
|
|
167431
|
+
headers: {
|
|
167432
|
+
[name: string]: unknown;
|
|
167433
|
+
};
|
|
167434
|
+
content: {
|
|
167435
|
+
"application/json": components["schemas"]["Error"];
|
|
167436
|
+
};
|
|
167437
|
+
};
|
|
167438
|
+
/** @description Unauthorized */
|
|
167439
|
+
401: {
|
|
167440
|
+
headers: {
|
|
167441
|
+
[name: string]: unknown;
|
|
167442
|
+
};
|
|
167443
|
+
content: {
|
|
167444
|
+
"application/json": components["schemas"]["Error"];
|
|
167445
|
+
};
|
|
167446
|
+
};
|
|
167447
|
+
/** @description Forbidden */
|
|
167448
|
+
403: {
|
|
167449
|
+
headers: {
|
|
167450
|
+
[name: string]: unknown;
|
|
167451
|
+
};
|
|
167452
|
+
content: {
|
|
167453
|
+
"application/json": components["schemas"]["Error"];
|
|
167454
|
+
};
|
|
167455
|
+
};
|
|
167456
|
+
/** @description Not found */
|
|
167457
|
+
404: {
|
|
167458
|
+
headers: {
|
|
167459
|
+
[name: string]: unknown;
|
|
167460
|
+
};
|
|
167461
|
+
content: {
|
|
167462
|
+
"application/json": components["schemas"]["Error"];
|
|
167463
|
+
};
|
|
167464
|
+
};
|
|
167465
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
167466
|
+
409: {
|
|
167467
|
+
headers: {
|
|
167468
|
+
[name: string]: unknown;
|
|
167469
|
+
};
|
|
167470
|
+
content: {
|
|
167471
|
+
"application/json": components["schemas"]["Error"];
|
|
167472
|
+
};
|
|
167473
|
+
};
|
|
167474
|
+
/** @description Rate limited */
|
|
167475
|
+
429: {
|
|
167476
|
+
headers: {
|
|
167477
|
+
[name: string]: unknown;
|
|
167478
|
+
};
|
|
167479
|
+
content: {
|
|
167480
|
+
"application/json": components["schemas"]["Error"];
|
|
167481
|
+
};
|
|
167482
|
+
};
|
|
167483
|
+
};
|
|
167484
|
+
};
|
|
167485
|
+
put?: never;
|
|
167486
|
+
post?: never;
|
|
167487
|
+
delete?: never;
|
|
167488
|
+
options?: never;
|
|
167489
|
+
head?: never;
|
|
167490
|
+
/**
|
|
167491
|
+
* Mark the catalog reviewed, or that the store sells without one
|
|
167492
|
+
* @description The owner’s two marks no table can know: `catalog_reviewed` (`true` stamps the review, `false` clears it) and `sells_without_store` (no Shopify / WooCommerce to connect; the Vitrina catalog is the store). Answers with the recomputed setup. Requires `tenant:write`.
|
|
167493
|
+
*/
|
|
167494
|
+
patch: {
|
|
167495
|
+
parameters: {
|
|
167496
|
+
query?: never;
|
|
167497
|
+
header?: never;
|
|
167498
|
+
path?: never;
|
|
167499
|
+
cookie?: never;
|
|
167500
|
+
};
|
|
167501
|
+
requestBody?: {
|
|
167502
|
+
content: {
|
|
167503
|
+
/**
|
|
167504
|
+
* @example {
|
|
167505
|
+
* "catalog_reviewed": true
|
|
167506
|
+
* }
|
|
167507
|
+
*/
|
|
167508
|
+
"application/json": {
|
|
167509
|
+
/** @description `true` stamps the catalog as reviewed now (kept if already stamped); `false` clears it. */
|
|
167510
|
+
catalog_reviewed?: boolean;
|
|
167511
|
+
/** @description `true` = no Shopify / WooCommerce to connect: the business sells from the Vitrina catalog, and «Conecta tu tienda» is done. */
|
|
167512
|
+
sells_without_store?: boolean;
|
|
167513
|
+
};
|
|
167514
|
+
};
|
|
167515
|
+
};
|
|
167516
|
+
responses: {
|
|
167517
|
+
/** @description The store setup after the change */
|
|
167518
|
+
200: {
|
|
167519
|
+
headers: {
|
|
167520
|
+
[name: string]: unknown;
|
|
167521
|
+
};
|
|
167522
|
+
content: {
|
|
167523
|
+
/**
|
|
167524
|
+
* @example {
|
|
167525
|
+
* "data": {
|
|
167526
|
+
* "applies": true,
|
|
167527
|
+
* "complete": false,
|
|
167528
|
+
* "steps": [
|
|
167529
|
+
* {
|
|
167530
|
+
* "key": "store",
|
|
167531
|
+
* "status": "done"
|
|
167532
|
+
* },
|
|
167533
|
+
* {
|
|
167534
|
+
* "key": "catalog",
|
|
167535
|
+
* "status": "todo"
|
|
167536
|
+
* },
|
|
167537
|
+
* {
|
|
167538
|
+
* "key": "mercadopago",
|
|
167539
|
+
* "status": "todo"
|
|
167540
|
+
* }
|
|
167541
|
+
* ],
|
|
167542
|
+
* "order_payment": {
|
|
167543
|
+
* "mode": "mp_first",
|
|
167544
|
+
* "source": "tenant",
|
|
167545
|
+
* "default_mode": "mp_first"
|
|
167546
|
+
* },
|
|
167547
|
+
* "store": {
|
|
167548
|
+
* "connections": [
|
|
167549
|
+
* {
|
|
167550
|
+
* "provider": "shopify",
|
|
167551
|
+
* "status": "connected",
|
|
167552
|
+
* "account": "Tienda Ejemplo"
|
|
167553
|
+
* },
|
|
167554
|
+
* {
|
|
167555
|
+
* "provider": "woocommerce",
|
|
167556
|
+
* "status": "not_connected",
|
|
167557
|
+
* "account": null
|
|
167558
|
+
* }
|
|
167559
|
+
* ],
|
|
167560
|
+
* "sells_without_store": false
|
|
167561
|
+
* },
|
|
167562
|
+
* "catalog": {
|
|
167563
|
+
* "active": 42,
|
|
167564
|
+
* "native": 0,
|
|
167565
|
+
* "synced": 42,
|
|
167566
|
+
* "without_price": 1,
|
|
167567
|
+
* "without_photo": 3,
|
|
167568
|
+
* "reviewed_at": null
|
|
167569
|
+
* },
|
|
167570
|
+
* "mercadopago": {
|
|
167571
|
+
* "configured": true,
|
|
167572
|
+
* "connected": false,
|
|
167573
|
+
* "account": null
|
|
167574
|
+
* },
|
|
167575
|
+
* "bank_accounts": {
|
|
167576
|
+
* "active": 0
|
|
167577
|
+
* }
|
|
167578
|
+
* }
|
|
167579
|
+
* }
|
|
167580
|
+
*/
|
|
167581
|
+
"application/json": {
|
|
167582
|
+
data: {
|
|
167583
|
+
/** @description The workspace is an ecommerce one: Home shows the steps. */
|
|
167584
|
+
applies: boolean;
|
|
167585
|
+
/** @description Every step is `done`. */
|
|
167586
|
+
complete: boolean;
|
|
167587
|
+
steps: {
|
|
167588
|
+
/**
|
|
167589
|
+
* @description `store` «Conecta tu tienda» · `catalog` «Revisa tu catálogo» · `mercadopago` «Conecta Mercado Pago» (only when native orders can be paid by link) · `bank_account` «Agrega tu cuenta para transferencias» (only when they are paid by transfer first or only).
|
|
167590
|
+
* @enum {string}
|
|
167591
|
+
*/
|
|
167592
|
+
key: "store" | "catalog" | "mercadopago" | "bank_account";
|
|
167593
|
+
/**
|
|
167594
|
+
* @description `attention` = the step was done and broke (the store asks to be reconnected).
|
|
167595
|
+
* @enum {string}
|
|
167596
|
+
*/
|
|
167597
|
+
status: "todo" | "done" | "attention";
|
|
167598
|
+
}[];
|
|
167599
|
+
/** @description How a native order (built from the Vitrina catalog) is paid: the workspace’s `final` charging mode. Written with `PUT /payment-settings/charging` (`{ final }`). */
|
|
167600
|
+
order_payment: {
|
|
167601
|
+
/**
|
|
167602
|
+
* @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
|
|
167603
|
+
* @enum {string}
|
|
167604
|
+
*/
|
|
167605
|
+
mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
|
|
167606
|
+
/** @enum {string} */
|
|
167607
|
+
source: "tenant" | "default";
|
|
167608
|
+
/**
|
|
167609
|
+
* @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
|
|
167610
|
+
* @enum {string}
|
|
167611
|
+
*/
|
|
167612
|
+
default_mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
|
|
167613
|
+
};
|
|
167614
|
+
store: {
|
|
167615
|
+
connections: {
|
|
167616
|
+
/** @enum {string} */
|
|
167617
|
+
provider: "shopify" | "woocommerce";
|
|
167618
|
+
/** @enum {string} */
|
|
167619
|
+
status: "not_connected" | "pending" | "connected" | "needs_reconnect";
|
|
167620
|
+
/** @description The shop’s name (Shopify) or URL (WooCommerce). */
|
|
167621
|
+
account: string | null;
|
|
167622
|
+
}[];
|
|
167623
|
+
/** @description The owner said the business sells from the Vitrina catalog alone. */
|
|
167624
|
+
sells_without_store: boolean;
|
|
167625
|
+
};
|
|
167626
|
+
catalog: {
|
|
167627
|
+
active: number;
|
|
167628
|
+
native: number;
|
|
167629
|
+
synced: number;
|
|
167630
|
+
without_price: number;
|
|
167631
|
+
without_photo: number;
|
|
167632
|
+
reviewed_at: string | null;
|
|
167633
|
+
};
|
|
167634
|
+
mercadopago: {
|
|
167635
|
+
/** @description This deployment can connect Mercado Pago at all. */
|
|
167636
|
+
configured: boolean;
|
|
167637
|
+
connected: boolean;
|
|
167638
|
+
account: string | null;
|
|
167639
|
+
};
|
|
167640
|
+
bank_accounts: {
|
|
167641
|
+
active: number;
|
|
167642
|
+
};
|
|
167643
|
+
};
|
|
167644
|
+
};
|
|
167645
|
+
};
|
|
167646
|
+
};
|
|
167647
|
+
/** @description Validation error */
|
|
167648
|
+
400: {
|
|
167649
|
+
headers: {
|
|
167650
|
+
[name: string]: unknown;
|
|
167651
|
+
};
|
|
167652
|
+
content: {
|
|
167653
|
+
"application/json": components["schemas"]["Error"];
|
|
167654
|
+
};
|
|
167655
|
+
};
|
|
167656
|
+
/** @description Unauthorized */
|
|
167657
|
+
401: {
|
|
167658
|
+
headers: {
|
|
167659
|
+
[name: string]: unknown;
|
|
167660
|
+
};
|
|
167661
|
+
content: {
|
|
167662
|
+
"application/json": components["schemas"]["Error"];
|
|
167663
|
+
};
|
|
167664
|
+
};
|
|
167665
|
+
/** @description Forbidden */
|
|
167666
|
+
403: {
|
|
167667
|
+
headers: {
|
|
167668
|
+
[name: string]: unknown;
|
|
167669
|
+
};
|
|
167670
|
+
content: {
|
|
167671
|
+
"application/json": components["schemas"]["Error"];
|
|
167672
|
+
};
|
|
167673
|
+
};
|
|
167674
|
+
/** @description Not found */
|
|
167675
|
+
404: {
|
|
167676
|
+
headers: {
|
|
167677
|
+
[name: string]: unknown;
|
|
167678
|
+
};
|
|
167679
|
+
content: {
|
|
167680
|
+
"application/json": components["schemas"]["Error"];
|
|
167681
|
+
};
|
|
167682
|
+
};
|
|
167683
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
167684
|
+
409: {
|
|
167685
|
+
headers: {
|
|
167686
|
+
[name: string]: unknown;
|
|
167687
|
+
};
|
|
167688
|
+
content: {
|
|
167689
|
+
"application/json": components["schemas"]["Error"];
|
|
167690
|
+
};
|
|
167691
|
+
};
|
|
167692
|
+
/** @description Rate limited */
|
|
167693
|
+
429: {
|
|
167694
|
+
headers: {
|
|
167695
|
+
[name: string]: unknown;
|
|
167696
|
+
};
|
|
167697
|
+
content: {
|
|
167698
|
+
"application/json": components["schemas"]["Error"];
|
|
167699
|
+
};
|
|
167700
|
+
};
|
|
167701
|
+
};
|
|
167702
|
+
};
|
|
167703
|
+
trace?: never;
|
|
167704
|
+
};
|
|
166113
167705
|
"/sandbox/clinic": {
|
|
166114
167706
|
parameters: {
|
|
166115
167707
|
query?: never;
|
|
@@ -184092,7 +185684,444 @@ interface paths {
|
|
|
184092
185684
|
};
|
|
184093
185685
|
trace?: never;
|
|
184094
185686
|
};
|
|
184095
|
-
"/clinic/services": {
|
|
185687
|
+
"/clinic/services": {
|
|
185688
|
+
parameters: {
|
|
185689
|
+
query?: never;
|
|
185690
|
+
header?: never;
|
|
185691
|
+
path?: never;
|
|
185692
|
+
cookie?: never;
|
|
185693
|
+
};
|
|
185694
|
+
/**
|
|
185695
|
+
* List the clinic's services
|
|
185696
|
+
* @description The clinic's price list. `search` (min 2 chars) matches nombre, código or categoría accent-insensitively. `active` is OPTIONAL and omitting it returns every row. `precio` is the vendor LIST price before previsión/convenio — it is deliberately never shown to the AI agent. `is_entry` filters entry prestaciones, tri-state: `true` = entry (evaluación / diagnóstico), `false` = CONFIRMED treatment rows only, `unclassified` = nobody has said yet (`is_entry IS NULL`); omitted = every row. `arancel` (repeatable or comma-separated) keeps only rows priced in those vendor aranceles (`'0'` = «Arancel base»); each row carries `arancel_external_id` + `arancel_name`. `categoria` keeps one exact category. `agent_bookable` (`yes` | `no`) filters on the EFFECTIVE agent-bookable value: each row carries the explicit `agent_bookable` (null = undecided) and `agent_bookable_effective` (`agent_bookable ?? settings.clinic_attendance.agent_bookable_default`, unset default = true).
|
|
185697
|
+
*
|
|
185698
|
+
* **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`.
|
|
185699
|
+
*/
|
|
185700
|
+
get: {
|
|
185701
|
+
parameters: {
|
|
185702
|
+
query?: {
|
|
185703
|
+
search?: string;
|
|
185704
|
+
active?: "true" | "false";
|
|
185705
|
+
review_state?: "pending" | "stale" | "draft" | "reviewed";
|
|
185706
|
+
is_entry?: "true" | "false" | "unclassified";
|
|
185707
|
+
arancel?: string[] | null;
|
|
185708
|
+
categoria?: string;
|
|
185709
|
+
agent_bookable?: "yes" | "no";
|
|
185710
|
+
sort?: "nombre" | "codigo" | "categoria" | "tipo" | "precio" | "synced_at";
|
|
185711
|
+
dir?: "asc" | "desc";
|
|
185712
|
+
page?: number;
|
|
185713
|
+
limit?: number;
|
|
185714
|
+
};
|
|
185715
|
+
header?: never;
|
|
185716
|
+
path?: never;
|
|
185717
|
+
cookie?: never;
|
|
185718
|
+
};
|
|
185719
|
+
requestBody?: never;
|
|
185720
|
+
responses: {
|
|
185721
|
+
/** @description Clinic services */
|
|
185722
|
+
200: {
|
|
185723
|
+
headers: {
|
|
185724
|
+
[name: string]: unknown;
|
|
185725
|
+
};
|
|
185726
|
+
content: {
|
|
185727
|
+
/**
|
|
185728
|
+
* @example {
|
|
185729
|
+
* "data": {
|
|
185730
|
+
* "data": [
|
|
185731
|
+
* {
|
|
185732
|
+
* "id": "4cf5bc59-0000-4000-8000-000000000001",
|
|
185733
|
+
* "source": "native",
|
|
185734
|
+
* "external_id": null,
|
|
185735
|
+
* "nombre": "Control de ortodoncia",
|
|
185736
|
+
* "codigo": "ORT-CTRL",
|
|
185737
|
+
* "categoria": "Ortodoncia",
|
|
185738
|
+
* "tipo": null,
|
|
185739
|
+
* "precio": 25000,
|
|
185740
|
+
* "arancel": null,
|
|
185741
|
+
* "duration_minutes": 30,
|
|
185742
|
+
* "vendor_duration_minutes": null,
|
|
185743
|
+
* "review_state": "draft",
|
|
185744
|
+
* "reviewed_at": null,
|
|
185745
|
+
* "reviewed_by": null,
|
|
185746
|
+
* "is_telehealth": false,
|
|
185747
|
+
* "online_bookable": true,
|
|
185748
|
+
* "requires_consent_template_id": null,
|
|
185749
|
+
* "eligibility_min_age_years": null,
|
|
185750
|
+
* "eligibility_max_age_years": null,
|
|
185751
|
+
* "eligibility_sexo": null,
|
|
185752
|
+
* "eligibility_previsiones": null,
|
|
185753
|
+
* "active": true,
|
|
185754
|
+
* "synced_at": null
|
|
185755
|
+
* },
|
|
185756
|
+
* {
|
|
185757
|
+
* "id": "4cf5bc59-0000-4000-8000-000000000002",
|
|
185758
|
+
* "source": "native",
|
|
185759
|
+
* "external_id": null,
|
|
185760
|
+
* "nombre": "Limpieza dental",
|
|
185761
|
+
* "codigo": null,
|
|
185762
|
+
* "categoria": "Ortodoncia",
|
|
185763
|
+
* "tipo": null,
|
|
185764
|
+
* "precio": 35000,
|
|
185765
|
+
* "arancel": null,
|
|
185766
|
+
* "duration_minutes": 45,
|
|
185767
|
+
* "vendor_duration_minutes": null,
|
|
185768
|
+
* "review_state": "draft",
|
|
185769
|
+
* "reviewed_at": null,
|
|
185770
|
+
* "reviewed_by": null,
|
|
185771
|
+
* "is_telehealth": false,
|
|
185772
|
+
* "online_bookable": false,
|
|
185773
|
+
* "requires_consent_template_id": null,
|
|
185774
|
+
* "eligibility_min_age_years": null,
|
|
185775
|
+
* "eligibility_max_age_years": null,
|
|
185776
|
+
* "eligibility_sexo": null,
|
|
185777
|
+
* "eligibility_previsiones": null,
|
|
185778
|
+
* "active": true,
|
|
185779
|
+
* "synced_at": null
|
|
185780
|
+
* }
|
|
185781
|
+
* ],
|
|
185782
|
+
* "total": 2,
|
|
185783
|
+
* "page": 1,
|
|
185784
|
+
* "limit": 50
|
|
185785
|
+
* }
|
|
185786
|
+
* }
|
|
185787
|
+
*/
|
|
185788
|
+
"application/json": {
|
|
185789
|
+
data: {
|
|
185790
|
+
data: components["schemas"]["ClinicService"][];
|
|
185791
|
+
total: number;
|
|
185792
|
+
page: number;
|
|
185793
|
+
limit: number;
|
|
185794
|
+
};
|
|
185795
|
+
};
|
|
185796
|
+
};
|
|
185797
|
+
};
|
|
185798
|
+
/** @description Validation error */
|
|
185799
|
+
400: {
|
|
185800
|
+
headers: {
|
|
185801
|
+
[name: string]: unknown;
|
|
185802
|
+
};
|
|
185803
|
+
content: {
|
|
185804
|
+
"application/json": components["schemas"]["Error"];
|
|
185805
|
+
};
|
|
185806
|
+
};
|
|
185807
|
+
/** @description Unauthorized */
|
|
185808
|
+
401: {
|
|
185809
|
+
headers: {
|
|
185810
|
+
[name: string]: unknown;
|
|
185811
|
+
};
|
|
185812
|
+
content: {
|
|
185813
|
+
"application/json": components["schemas"]["Error"];
|
|
185814
|
+
};
|
|
185815
|
+
};
|
|
185816
|
+
/** @description Forbidden */
|
|
185817
|
+
403: {
|
|
185818
|
+
headers: {
|
|
185819
|
+
[name: string]: unknown;
|
|
185820
|
+
};
|
|
185821
|
+
content: {
|
|
185822
|
+
"application/json": components["schemas"]["Error"];
|
|
185823
|
+
};
|
|
185824
|
+
};
|
|
185825
|
+
/** @description Not found */
|
|
185826
|
+
404: {
|
|
185827
|
+
headers: {
|
|
185828
|
+
[name: string]: unknown;
|
|
185829
|
+
};
|
|
185830
|
+
content: {
|
|
185831
|
+
"application/json": components["schemas"]["Error"];
|
|
185832
|
+
};
|
|
185833
|
+
};
|
|
185834
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
185835
|
+
409: {
|
|
185836
|
+
headers: {
|
|
185837
|
+
[name: string]: unknown;
|
|
185838
|
+
};
|
|
185839
|
+
content: {
|
|
185840
|
+
"application/json": components["schemas"]["Error"];
|
|
185841
|
+
};
|
|
185842
|
+
};
|
|
185843
|
+
/** @description Rate limited */
|
|
185844
|
+
429: {
|
|
185845
|
+
headers: {
|
|
185846
|
+
[name: string]: unknown;
|
|
185847
|
+
};
|
|
185848
|
+
content: {
|
|
185849
|
+
"application/json": components["schemas"]["Error"];
|
|
185850
|
+
};
|
|
185851
|
+
};
|
|
185852
|
+
};
|
|
185853
|
+
};
|
|
185854
|
+
put?: never;
|
|
185855
|
+
/**
|
|
185856
|
+
* Create a native service
|
|
185857
|
+
* @description Create a native service
|
|
185858
|
+
*
|
|
185859
|
+
* **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`.
|
|
185860
|
+
*/
|
|
185861
|
+
post: {
|
|
185862
|
+
parameters: {
|
|
185863
|
+
query?: never;
|
|
185864
|
+
header?: {
|
|
185865
|
+
/** @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. */
|
|
185866
|
+
"Idempotency-Key"?: string;
|
|
185867
|
+
};
|
|
185868
|
+
path?: never;
|
|
185869
|
+
cookie?: never;
|
|
185870
|
+
};
|
|
185871
|
+
requestBody?: {
|
|
185872
|
+
content: {
|
|
185873
|
+
/**
|
|
185874
|
+
* @example {
|
|
185875
|
+
* "nombre": "Control de ortodoncia",
|
|
185876
|
+
* "codigo": "ORT-CTRL",
|
|
185877
|
+
* "categoria": "Ortodoncia",
|
|
185878
|
+
* "precio": 25000,
|
|
185879
|
+
* "duration_minutes": 30,
|
|
185880
|
+
* "online_bookable": true
|
|
185881
|
+
* }
|
|
185882
|
+
*/
|
|
185883
|
+
"application/json": {
|
|
185884
|
+
nombre: string;
|
|
185885
|
+
codigo?: string | null;
|
|
185886
|
+
categoria?: string | null;
|
|
185887
|
+
tipo?: string | null;
|
|
185888
|
+
precio?: number | null;
|
|
185889
|
+
duration_minutes?: number | null;
|
|
185890
|
+
active?: boolean;
|
|
185891
|
+
is_telehealth?: boolean;
|
|
185892
|
+
online_bookable?: boolean;
|
|
185893
|
+
is_entry?: boolean | null;
|
|
185894
|
+
agent_bookable?: boolean | null;
|
|
185895
|
+
lab_bearing?: boolean;
|
|
185896
|
+
/** Format: uuid */
|
|
185897
|
+
requires_consent_template_id?: string | null;
|
|
185898
|
+
eligibility_min_age_years?: number | null;
|
|
185899
|
+
eligibility_max_age_years?: number | null;
|
|
185900
|
+
/** @enum {string|null} */
|
|
185901
|
+
eligibility_sexo?: "F" | "M" | "otro" | null;
|
|
185902
|
+
eligibility_previsiones?: string[] | null;
|
|
185903
|
+
};
|
|
185904
|
+
};
|
|
185905
|
+
};
|
|
185906
|
+
responses: {
|
|
185907
|
+
/** @description ClinicService */
|
|
185908
|
+
201: {
|
|
185909
|
+
headers: {
|
|
185910
|
+
[name: string]: unknown;
|
|
185911
|
+
};
|
|
185912
|
+
content: {
|
|
185913
|
+
/**
|
|
185914
|
+
* @example {
|
|
185915
|
+
* "data": {
|
|
185916
|
+
* "id": "4cf5bc59-0000-4000-8000-000000000001",
|
|
185917
|
+
* "source": "native",
|
|
185918
|
+
* "external_id": null,
|
|
185919
|
+
* "nombre": "Control de ortodoncia",
|
|
185920
|
+
* "codigo": "ORT-CTRL",
|
|
185921
|
+
* "categoria": "Ortodoncia",
|
|
185922
|
+
* "tipo": null,
|
|
185923
|
+
* "precio": 25000,
|
|
185924
|
+
* "arancel": null,
|
|
185925
|
+
* "duration_minutes": 30,
|
|
185926
|
+
* "vendor_duration_minutes": null,
|
|
185927
|
+
* "review_state": "draft",
|
|
185928
|
+
* "reviewed_at": null,
|
|
185929
|
+
* "reviewed_by": null,
|
|
185930
|
+
* "is_telehealth": false,
|
|
185931
|
+
* "online_bookable": true,
|
|
185932
|
+
* "requires_consent_template_id": null,
|
|
185933
|
+
* "eligibility_min_age_years": null,
|
|
185934
|
+
* "eligibility_max_age_years": null,
|
|
185935
|
+
* "eligibility_sexo": null,
|
|
185936
|
+
* "eligibility_previsiones": null,
|
|
185937
|
+
* "active": true,
|
|
185938
|
+
* "synced_at": null
|
|
185939
|
+
* }
|
|
185940
|
+
* }
|
|
185941
|
+
*/
|
|
185942
|
+
"application/json": {
|
|
185943
|
+
data?: unknown;
|
|
185944
|
+
};
|
|
185945
|
+
};
|
|
185946
|
+
};
|
|
185947
|
+
/** @description Validation error */
|
|
185948
|
+
400: {
|
|
185949
|
+
headers: {
|
|
185950
|
+
[name: string]: unknown;
|
|
185951
|
+
};
|
|
185952
|
+
content: {
|
|
185953
|
+
"application/json": components["schemas"]["Error"];
|
|
185954
|
+
};
|
|
185955
|
+
};
|
|
185956
|
+
/** @description Unauthorized */
|
|
185957
|
+
401: {
|
|
185958
|
+
headers: {
|
|
185959
|
+
[name: string]: unknown;
|
|
185960
|
+
};
|
|
185961
|
+
content: {
|
|
185962
|
+
"application/json": components["schemas"]["Error"];
|
|
185963
|
+
};
|
|
185964
|
+
};
|
|
185965
|
+
/** @description Forbidden */
|
|
185966
|
+
403: {
|
|
185967
|
+
headers: {
|
|
185968
|
+
[name: string]: unknown;
|
|
185969
|
+
};
|
|
185970
|
+
content: {
|
|
185971
|
+
"application/json": components["schemas"]["Error"];
|
|
185972
|
+
};
|
|
185973
|
+
};
|
|
185974
|
+
/** @description Not found */
|
|
185975
|
+
404: {
|
|
185976
|
+
headers: {
|
|
185977
|
+
[name: string]: unknown;
|
|
185978
|
+
};
|
|
185979
|
+
content: {
|
|
185980
|
+
"application/json": components["schemas"]["Error"];
|
|
185981
|
+
};
|
|
185982
|
+
};
|
|
185983
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
185984
|
+
409: {
|
|
185985
|
+
headers: {
|
|
185986
|
+
[name: string]: unknown;
|
|
185987
|
+
};
|
|
185988
|
+
content: {
|
|
185989
|
+
"application/json": components["schemas"]["Error"];
|
|
185990
|
+
};
|
|
185991
|
+
};
|
|
185992
|
+
/** @description Rate limited */
|
|
185993
|
+
429: {
|
|
185994
|
+
headers: {
|
|
185995
|
+
[name: string]: unknown;
|
|
185996
|
+
};
|
|
185997
|
+
content: {
|
|
185998
|
+
"application/json": components["schemas"]["Error"];
|
|
185999
|
+
};
|
|
186000
|
+
};
|
|
186001
|
+
};
|
|
186002
|
+
};
|
|
186003
|
+
delete?: never;
|
|
186004
|
+
options?: never;
|
|
186005
|
+
head?: never;
|
|
186006
|
+
patch?: never;
|
|
186007
|
+
trace?: never;
|
|
186008
|
+
};
|
|
186009
|
+
"/clinic/services/aranceles": {
|
|
186010
|
+
parameters: {
|
|
186011
|
+
query?: never;
|
|
186012
|
+
header?: never;
|
|
186013
|
+
path?: never;
|
|
186014
|
+
cookie?: never;
|
|
186015
|
+
};
|
|
186016
|
+
/**
|
|
186017
|
+
* The clinic's vendor aranceles (price lists)
|
|
186018
|
+
* @description One entry per distinct `arancel_external_id` in the mirrored catálogo, with `total` rows and `active` rows, largest active list first. Dentalink/Medilink keep one copy of every prestación per arancel; this is what the screen filters on and what `tenant.settings.clinic_catalog_aranceles` (the aranceles the agent quotes) is chosen from. Empty for Reservo / native catálogos.
|
|
186019
|
+
*
|
|
186020
|
+
* **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`.
|
|
186021
|
+
*/
|
|
186022
|
+
get: {
|
|
186023
|
+
parameters: {
|
|
186024
|
+
query?: never;
|
|
186025
|
+
header?: never;
|
|
186026
|
+
path?: never;
|
|
186027
|
+
cookie?: never;
|
|
186028
|
+
};
|
|
186029
|
+
requestBody?: never;
|
|
186030
|
+
responses: {
|
|
186031
|
+
/** @description Aranceles with row counts */
|
|
186032
|
+
200: {
|
|
186033
|
+
headers: {
|
|
186034
|
+
[name: string]: unknown;
|
|
186035
|
+
};
|
|
186036
|
+
content: {
|
|
186037
|
+
/**
|
|
186038
|
+
* @example {
|
|
186039
|
+
* "data": [
|
|
186040
|
+
* {
|
|
186041
|
+
* "external_id": "0",
|
|
186042
|
+
* "name": "Arancel base",
|
|
186043
|
+
* "total": 412,
|
|
186044
|
+
* "active": 390
|
|
186045
|
+
* },
|
|
186046
|
+
* {
|
|
186047
|
+
* "external_id": "652",
|
|
186048
|
+
* "name": "Arancel convenio",
|
|
186049
|
+
* "total": 652,
|
|
186050
|
+
* "active": 640
|
|
186051
|
+
* }
|
|
186052
|
+
* ]
|
|
186053
|
+
* }
|
|
186054
|
+
*/
|
|
186055
|
+
"application/json": {
|
|
186056
|
+
data: components["schemas"]["ClinicServiceArancel"][];
|
|
186057
|
+
};
|
|
186058
|
+
};
|
|
186059
|
+
};
|
|
186060
|
+
/** @description Validation error */
|
|
186061
|
+
400: {
|
|
186062
|
+
headers: {
|
|
186063
|
+
[name: string]: unknown;
|
|
186064
|
+
};
|
|
186065
|
+
content: {
|
|
186066
|
+
"application/json": components["schemas"]["Error"];
|
|
186067
|
+
};
|
|
186068
|
+
};
|
|
186069
|
+
/** @description Unauthorized */
|
|
186070
|
+
401: {
|
|
186071
|
+
headers: {
|
|
186072
|
+
[name: string]: unknown;
|
|
186073
|
+
};
|
|
186074
|
+
content: {
|
|
186075
|
+
"application/json": components["schemas"]["Error"];
|
|
186076
|
+
};
|
|
186077
|
+
};
|
|
186078
|
+
/** @description Forbidden */
|
|
186079
|
+
403: {
|
|
186080
|
+
headers: {
|
|
186081
|
+
[name: string]: unknown;
|
|
186082
|
+
};
|
|
186083
|
+
content: {
|
|
186084
|
+
"application/json": components["schemas"]["Error"];
|
|
186085
|
+
};
|
|
186086
|
+
};
|
|
186087
|
+
/** @description Not found */
|
|
186088
|
+
404: {
|
|
186089
|
+
headers: {
|
|
186090
|
+
[name: string]: unknown;
|
|
186091
|
+
};
|
|
186092
|
+
content: {
|
|
186093
|
+
"application/json": components["schemas"]["Error"];
|
|
186094
|
+
};
|
|
186095
|
+
};
|
|
186096
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
186097
|
+
409: {
|
|
186098
|
+
headers: {
|
|
186099
|
+
[name: string]: unknown;
|
|
186100
|
+
};
|
|
186101
|
+
content: {
|
|
186102
|
+
"application/json": components["schemas"]["Error"];
|
|
186103
|
+
};
|
|
186104
|
+
};
|
|
186105
|
+
/** @description Rate limited */
|
|
186106
|
+
429: {
|
|
186107
|
+
headers: {
|
|
186108
|
+
[name: string]: unknown;
|
|
186109
|
+
};
|
|
186110
|
+
content: {
|
|
186111
|
+
"application/json": components["schemas"]["Error"];
|
|
186112
|
+
};
|
|
186113
|
+
};
|
|
186114
|
+
};
|
|
186115
|
+
};
|
|
186116
|
+
put?: never;
|
|
186117
|
+
post?: never;
|
|
186118
|
+
delete?: never;
|
|
186119
|
+
options?: never;
|
|
186120
|
+
head?: never;
|
|
186121
|
+
patch?: never;
|
|
186122
|
+
trace?: never;
|
|
186123
|
+
};
|
|
186124
|
+
"/clinic/services/agent-bookable-count": {
|
|
184096
186125
|
parameters: {
|
|
184097
186126
|
query?: never;
|
|
184098
186127
|
header?: never;
|
|
@@ -184100,23 +186129,15 @@ interface paths {
|
|
|
184100
186129
|
cookie?: never;
|
|
184101
186130
|
};
|
|
184102
186131
|
/**
|
|
184103
|
-
*
|
|
184104
|
-
* @description
|
|
186132
|
+
* How many active prestaciones the AI agent may book
|
|
186133
|
+
* @description `{ bookable, reception_only, total }` over ACTIVE services, by the EFFECTIVE agent-bookable value (`agent_bookable`, or the tenant default `settings.clinic_attendance.agent_bookable_default` when the row is undecided). `arancel` (repeatable or comma-separated) counts only rows priced in those vendor aranceles.
|
|
184105
186134
|
*
|
|
184106
186135
|
* **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`.
|
|
184107
186136
|
*/
|
|
184108
186137
|
get: {
|
|
184109
186138
|
parameters: {
|
|
184110
186139
|
query?: {
|
|
184111
|
-
search?: string;
|
|
184112
|
-
active?: "true" | "false";
|
|
184113
|
-
review_state?: "pending" | "stale" | "draft" | "reviewed";
|
|
184114
|
-
is_entry?: "true" | "false" | "unclassified";
|
|
184115
186140
|
arancel?: string[] | null;
|
|
184116
|
-
sort?: "nombre" | "codigo" | "categoria" | "tipo" | "precio" | "synced_at";
|
|
184117
|
-
dir?: "asc" | "desc";
|
|
184118
|
-
page?: number;
|
|
184119
|
-
limit?: number;
|
|
184120
186141
|
};
|
|
184121
186142
|
header?: never;
|
|
184122
186143
|
path?: never;
|
|
@@ -184124,7 +186145,7 @@ interface paths {
|
|
|
184124
186145
|
};
|
|
184125
186146
|
requestBody?: never;
|
|
184126
186147
|
responses: {
|
|
184127
|
-
/** @description
|
|
186148
|
+
/** @description Agent-bookable split */
|
|
184128
186149
|
200: {
|
|
184129
186150
|
headers: {
|
|
184130
186151
|
[name: string]: unknown;
|
|
@@ -184133,71 +186154,14 @@ interface paths {
|
|
|
184133
186154
|
/**
|
|
184134
186155
|
* @example {
|
|
184135
186156
|
* "data": {
|
|
184136
|
-
* "
|
|
184137
|
-
*
|
|
184138
|
-
*
|
|
184139
|
-
* "source": "native",
|
|
184140
|
-
* "external_id": null,
|
|
184141
|
-
* "nombre": "Control de ortodoncia",
|
|
184142
|
-
* "codigo": "ORT-CTRL",
|
|
184143
|
-
* "categoria": "Ortodoncia",
|
|
184144
|
-
* "tipo": null,
|
|
184145
|
-
* "precio": 25000,
|
|
184146
|
-
* "arancel": null,
|
|
184147
|
-
* "duration_minutes": 30,
|
|
184148
|
-
* "vendor_duration_minutes": null,
|
|
184149
|
-
* "review_state": "draft",
|
|
184150
|
-
* "reviewed_at": null,
|
|
184151
|
-
* "reviewed_by": null,
|
|
184152
|
-
* "is_telehealth": false,
|
|
184153
|
-
* "online_bookable": true,
|
|
184154
|
-
* "requires_consent_template_id": null,
|
|
184155
|
-
* "eligibility_min_age_years": null,
|
|
184156
|
-
* "eligibility_max_age_years": null,
|
|
184157
|
-
* "eligibility_sexo": null,
|
|
184158
|
-
* "eligibility_previsiones": null,
|
|
184159
|
-
* "active": true,
|
|
184160
|
-
* "synced_at": null
|
|
184161
|
-
* },
|
|
184162
|
-
* {
|
|
184163
|
-
* "id": "4cf5bc59-0000-4000-8000-000000000002",
|
|
184164
|
-
* "source": "native",
|
|
184165
|
-
* "external_id": null,
|
|
184166
|
-
* "nombre": "Limpieza dental",
|
|
184167
|
-
* "codigo": null,
|
|
184168
|
-
* "categoria": "Ortodoncia",
|
|
184169
|
-
* "tipo": null,
|
|
184170
|
-
* "precio": 35000,
|
|
184171
|
-
* "arancel": null,
|
|
184172
|
-
* "duration_minutes": 45,
|
|
184173
|
-
* "vendor_duration_minutes": null,
|
|
184174
|
-
* "review_state": "draft",
|
|
184175
|
-
* "reviewed_at": null,
|
|
184176
|
-
* "reviewed_by": null,
|
|
184177
|
-
* "is_telehealth": false,
|
|
184178
|
-
* "online_bookable": false,
|
|
184179
|
-
* "requires_consent_template_id": null,
|
|
184180
|
-
* "eligibility_min_age_years": null,
|
|
184181
|
-
* "eligibility_max_age_years": null,
|
|
184182
|
-
* "eligibility_sexo": null,
|
|
184183
|
-
* "eligibility_previsiones": null,
|
|
184184
|
-
* "active": true,
|
|
184185
|
-
* "synced_at": null
|
|
184186
|
-
* }
|
|
184187
|
-
* ],
|
|
184188
|
-
* "total": 2,
|
|
184189
|
-
* "page": 1,
|
|
184190
|
-
* "limit": 50
|
|
186157
|
+
* "bookable": 12,
|
|
186158
|
+
* "reception_only": 383,
|
|
186159
|
+
* "total": 395
|
|
184191
186160
|
* }
|
|
184192
186161
|
* }
|
|
184193
186162
|
*/
|
|
184194
186163
|
"application/json": {
|
|
184195
|
-
data:
|
|
184196
|
-
data: components["schemas"]["ClinicService"][];
|
|
184197
|
-
total: number;
|
|
184198
|
-
page: number;
|
|
184199
|
-
limit: number;
|
|
184200
|
-
};
|
|
186164
|
+
data: components["schemas"]["ClinicServiceAgentBookableCount"];
|
|
184201
186165
|
};
|
|
184202
186166
|
};
|
|
184203
186167
|
};
|
|
@@ -184258,9 +186222,25 @@ interface paths {
|
|
|
184258
186222
|
};
|
|
184259
186223
|
};
|
|
184260
186224
|
put?: never;
|
|
186225
|
+
post?: never;
|
|
186226
|
+
delete?: never;
|
|
186227
|
+
options?: never;
|
|
186228
|
+
head?: never;
|
|
186229
|
+
patch?: never;
|
|
186230
|
+
trace?: never;
|
|
186231
|
+
};
|
|
186232
|
+
"/clinic/services/agent-bookable": {
|
|
186233
|
+
parameters: {
|
|
186234
|
+
query?: never;
|
|
186235
|
+
header?: never;
|
|
186236
|
+
path?: never;
|
|
186237
|
+
cookie?: never;
|
|
186238
|
+
};
|
|
186239
|
+
get?: never;
|
|
186240
|
+
put?: never;
|
|
184261
186241
|
/**
|
|
184262
|
-
*
|
|
184263
|
-
* @description
|
|
186242
|
+
* Set which prestaciones the AI agent may book, in bulk
|
|
186243
|
+
* @description Sets `agent_bookable` to `value` — `true` (the agent may offer and book it), `false` (reception-only: the agent knows it exists, tells the patient reception schedules it and never books it) or `null` (back to the tenant default) — on up to 500 `ids`, OR on every row matching `all_matching` (the same filters, in the same string form, as the `GET /clinic/services` query). Exactly one of the two. Works on ANY source — the flag is Vitrina-owned and never reaches the vendor. `updated` is how many rows matched; ids of another tenant match nothing.
|
|
184264
186244
|
*
|
|
184265
186245
|
* **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`.
|
|
184266
186246
|
*/
|
|
@@ -184278,39 +186258,24 @@ interface paths {
|
|
|
184278
186258
|
content: {
|
|
184279
186259
|
/**
|
|
184280
186260
|
* @example {
|
|
184281
|
-
* "
|
|
184282
|
-
* "
|
|
184283
|
-
*
|
|
184284
|
-
*
|
|
184285
|
-
*
|
|
184286
|
-
*
|
|
186261
|
+
* "value": false,
|
|
186262
|
+
* "all_matching": {
|
|
186263
|
+
* "search": "control",
|
|
186264
|
+
* "active": "true",
|
|
186265
|
+
* "arancel": "0"
|
|
186266
|
+
* }
|
|
184287
186267
|
* }
|
|
184288
186268
|
*/
|
|
184289
186269
|
"application/json": {
|
|
184290
|
-
|
|
184291
|
-
|
|
184292
|
-
|
|
184293
|
-
tipo?: string | null;
|
|
184294
|
-
precio?: number | null;
|
|
184295
|
-
duration_minutes?: number | null;
|
|
184296
|
-
active?: boolean;
|
|
184297
|
-
is_telehealth?: boolean;
|
|
184298
|
-
online_bookable?: boolean;
|
|
184299
|
-
is_entry?: boolean | null;
|
|
184300
|
-
lab_bearing?: boolean;
|
|
184301
|
-
/** Format: uuid */
|
|
184302
|
-
requires_consent_template_id?: string | null;
|
|
184303
|
-
eligibility_min_age_years?: number | null;
|
|
184304
|
-
eligibility_max_age_years?: number | null;
|
|
184305
|
-
/** @enum {string|null} */
|
|
184306
|
-
eligibility_sexo?: "F" | "M" | "otro" | null;
|
|
184307
|
-
eligibility_previsiones?: string[] | null;
|
|
186270
|
+
value: boolean | null;
|
|
186271
|
+
ids?: string[];
|
|
186272
|
+
all_matching?: components["schemas"]["ClinicServiceMatchFilter"];
|
|
184308
186273
|
};
|
|
184309
186274
|
};
|
|
184310
186275
|
};
|
|
184311
186276
|
responses: {
|
|
184312
|
-
/** @description
|
|
184313
|
-
|
|
186277
|
+
/** @description Rows updated */
|
|
186278
|
+
200: {
|
|
184314
186279
|
headers: {
|
|
184315
186280
|
[name: string]: unknown;
|
|
184316
186281
|
};
|
|
@@ -184318,34 +186283,12 @@ interface paths {
|
|
|
184318
186283
|
/**
|
|
184319
186284
|
* @example {
|
|
184320
186285
|
* "data": {
|
|
184321
|
-
* "
|
|
184322
|
-
* "source": "native",
|
|
184323
|
-
* "external_id": null,
|
|
184324
|
-
* "nombre": "Control de ortodoncia",
|
|
184325
|
-
* "codigo": "ORT-CTRL",
|
|
184326
|
-
* "categoria": "Ortodoncia",
|
|
184327
|
-
* "tipo": null,
|
|
184328
|
-
* "precio": 25000,
|
|
184329
|
-
* "arancel": null,
|
|
184330
|
-
* "duration_minutes": 30,
|
|
184331
|
-
* "vendor_duration_minutes": null,
|
|
184332
|
-
* "review_state": "draft",
|
|
184333
|
-
* "reviewed_at": null,
|
|
184334
|
-
* "reviewed_by": null,
|
|
184335
|
-
* "is_telehealth": false,
|
|
184336
|
-
* "online_bookable": true,
|
|
184337
|
-
* "requires_consent_template_id": null,
|
|
184338
|
-
* "eligibility_min_age_years": null,
|
|
184339
|
-
* "eligibility_max_age_years": null,
|
|
184340
|
-
* "eligibility_sexo": null,
|
|
184341
|
-
* "eligibility_previsiones": null,
|
|
184342
|
-
* "active": true,
|
|
184343
|
-
* "synced_at": null
|
|
186286
|
+
* "updated": 37
|
|
184344
186287
|
* }
|
|
184345
186288
|
* }
|
|
184346
186289
|
*/
|
|
184347
186290
|
"application/json": {
|
|
184348
|
-
data
|
|
186291
|
+
data: components["schemas"]["ClinicServiceEntryFlagsResult"];
|
|
184349
186292
|
};
|
|
184350
186293
|
};
|
|
184351
186294
|
};
|
|
@@ -184411,121 +186354,6 @@ interface paths {
|
|
|
184411
186354
|
patch?: never;
|
|
184412
186355
|
trace?: never;
|
|
184413
186356
|
};
|
|
184414
|
-
"/clinic/services/aranceles": {
|
|
184415
|
-
parameters: {
|
|
184416
|
-
query?: never;
|
|
184417
|
-
header?: never;
|
|
184418
|
-
path?: never;
|
|
184419
|
-
cookie?: never;
|
|
184420
|
-
};
|
|
184421
|
-
/**
|
|
184422
|
-
* The clinic's vendor aranceles (price lists)
|
|
184423
|
-
* @description One entry per distinct `arancel_external_id` in the mirrored catálogo, with `total` rows and `active` rows, largest active list first. Dentalink/Medilink keep one copy of every prestación per arancel; this is what the screen filters on and what `tenant.settings.clinic_catalog_aranceles` (the aranceles the agent quotes) is chosen from. Empty for Reservo / native catálogos.
|
|
184424
|
-
*
|
|
184425
|
-
* **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`.
|
|
184426
|
-
*/
|
|
184427
|
-
get: {
|
|
184428
|
-
parameters: {
|
|
184429
|
-
query?: never;
|
|
184430
|
-
header?: never;
|
|
184431
|
-
path?: never;
|
|
184432
|
-
cookie?: never;
|
|
184433
|
-
};
|
|
184434
|
-
requestBody?: never;
|
|
184435
|
-
responses: {
|
|
184436
|
-
/** @description Aranceles with row counts */
|
|
184437
|
-
200: {
|
|
184438
|
-
headers: {
|
|
184439
|
-
[name: string]: unknown;
|
|
184440
|
-
};
|
|
184441
|
-
content: {
|
|
184442
|
-
/**
|
|
184443
|
-
* @example {
|
|
184444
|
-
* "data": [
|
|
184445
|
-
* {
|
|
184446
|
-
* "external_id": "0",
|
|
184447
|
-
* "name": "Arancel base",
|
|
184448
|
-
* "total": 412,
|
|
184449
|
-
* "active": 390
|
|
184450
|
-
* },
|
|
184451
|
-
* {
|
|
184452
|
-
* "external_id": "652",
|
|
184453
|
-
* "name": "Arancel convenio",
|
|
184454
|
-
* "total": 652,
|
|
184455
|
-
* "active": 640
|
|
184456
|
-
* }
|
|
184457
|
-
* ]
|
|
184458
|
-
* }
|
|
184459
|
-
*/
|
|
184460
|
-
"application/json": {
|
|
184461
|
-
data: components["schemas"]["ClinicServiceArancel"][];
|
|
184462
|
-
};
|
|
184463
|
-
};
|
|
184464
|
-
};
|
|
184465
|
-
/** @description Validation error */
|
|
184466
|
-
400: {
|
|
184467
|
-
headers: {
|
|
184468
|
-
[name: string]: unknown;
|
|
184469
|
-
};
|
|
184470
|
-
content: {
|
|
184471
|
-
"application/json": components["schemas"]["Error"];
|
|
184472
|
-
};
|
|
184473
|
-
};
|
|
184474
|
-
/** @description Unauthorized */
|
|
184475
|
-
401: {
|
|
184476
|
-
headers: {
|
|
184477
|
-
[name: string]: unknown;
|
|
184478
|
-
};
|
|
184479
|
-
content: {
|
|
184480
|
-
"application/json": components["schemas"]["Error"];
|
|
184481
|
-
};
|
|
184482
|
-
};
|
|
184483
|
-
/** @description Forbidden */
|
|
184484
|
-
403: {
|
|
184485
|
-
headers: {
|
|
184486
|
-
[name: string]: unknown;
|
|
184487
|
-
};
|
|
184488
|
-
content: {
|
|
184489
|
-
"application/json": components["schemas"]["Error"];
|
|
184490
|
-
};
|
|
184491
|
-
};
|
|
184492
|
-
/** @description Not found */
|
|
184493
|
-
404: {
|
|
184494
|
-
headers: {
|
|
184495
|
-
[name: string]: unknown;
|
|
184496
|
-
};
|
|
184497
|
-
content: {
|
|
184498
|
-
"application/json": components["schemas"]["Error"];
|
|
184499
|
-
};
|
|
184500
|
-
};
|
|
184501
|
-
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
184502
|
-
409: {
|
|
184503
|
-
headers: {
|
|
184504
|
-
[name: string]: unknown;
|
|
184505
|
-
};
|
|
184506
|
-
content: {
|
|
184507
|
-
"application/json": components["schemas"]["Error"];
|
|
184508
|
-
};
|
|
184509
|
-
};
|
|
184510
|
-
/** @description Rate limited */
|
|
184511
|
-
429: {
|
|
184512
|
-
headers: {
|
|
184513
|
-
[name: string]: unknown;
|
|
184514
|
-
};
|
|
184515
|
-
content: {
|
|
184516
|
-
"application/json": components["schemas"]["Error"];
|
|
184517
|
-
};
|
|
184518
|
-
};
|
|
184519
|
-
};
|
|
184520
|
-
};
|
|
184521
|
-
put?: never;
|
|
184522
|
-
post?: never;
|
|
184523
|
-
delete?: never;
|
|
184524
|
-
options?: never;
|
|
184525
|
-
head?: never;
|
|
184526
|
-
patch?: never;
|
|
184527
|
-
trace?: never;
|
|
184528
|
-
};
|
|
184529
186357
|
"/clinic/services/{id}": {
|
|
184530
186358
|
parameters: {
|
|
184531
186359
|
query?: never;
|
|
@@ -184651,6 +186479,7 @@ interface paths {
|
|
|
184651
186479
|
is_telehealth?: boolean;
|
|
184652
186480
|
online_bookable?: boolean;
|
|
184653
186481
|
is_entry?: boolean | null;
|
|
186482
|
+
agent_bookable?: boolean | null;
|
|
184654
186483
|
lab_bearing?: boolean;
|
|
184655
186484
|
/** Format: uuid */
|
|
184656
186485
|
requires_consent_template_id?: string | null;
|
|
@@ -186188,6 +188017,18 @@ interface components {
|
|
|
186188
188017
|
slack_webhook_url?: "••••";
|
|
186189
188018
|
/** @description Whether a Slack incoming webhook is configured for workspace alerts. */
|
|
186190
188019
|
slack_webhook_configured?: boolean;
|
|
188020
|
+
/** @description «Gestionar taller en Vitrina» (automotive). On: the workspace has the «Servicio de vehículos» workshop board next to Soporte. Never set → reads true exactly when that board already exists. Writing `true` creates the board (idempotent; refused with 400 outside the automotive vertical); `false` removes it only while no ticket was ever placed on it — a board in use is kept (see `workshop_board.in_use`). */
|
|
188021
|
+
manage_workshop?: boolean;
|
|
188022
|
+
/** @description Read-only: the workshop board `manage_workshop` governs. Ignored on write. */
|
|
188023
|
+
workshop_board?: {
|
|
188024
|
+
/**
|
|
188025
|
+
* Format: uuid
|
|
188026
|
+
* @description The «Servicio de vehículos» board; null when there is none.
|
|
188027
|
+
*/
|
|
188028
|
+
pipeline_id: string | null;
|
|
188029
|
+
/** @description A ticket was ever placed on the board; turning `manage_workshop` off keeps it. */
|
|
188030
|
+
in_use: boolean;
|
|
188031
|
+
};
|
|
186191
188032
|
};
|
|
186192
188033
|
TenantSettingsPublicWrite: {
|
|
186193
188034
|
/** @description Vitrina Ads workspace choices. `tag_choice`: how the «Instalar el tag» step was answered — `site` (the tag goes on the workspace's website, pasted or through Google Tag Manager) or `no_site` (no website; step skipped on purpose); `null` clears it. `goal`: the monthly goal the Ads hero measures pace against (`{kind, target, period:'month'}`; `null` clears it — `PUT /ads/goal` is the dedicated door). `dismissed_actions`: `{ [action id]: until ISO }` merged onto the stored map (`null` removes an id; expired entries are pruned). `specialty_map`: which specialty (and professionals, entry-visit length and price) each campaign / ad set / ad books — the agenda-capacity check behind «Pausar» / «Subir» reads it before the name match; replaces the stored list whole (`null` clears it). Merged into the stored `ads` object; the server stamps `tag_choice_at` / `goal_at` / `goal_by` on every write, and `GET /tenant/settings` returns them under `ads`. */
|
|
@@ -186258,6 +188099,8 @@ interface components {
|
|
|
186258
188099
|
change_template_name?: string;
|
|
186259
188100
|
};
|
|
186260
188101
|
};
|
|
188102
|
+
/** @description Turn the «Servicio de vehículos» workshop board on (creates it; automotive only) or off (removes it only while it never held a ticket). */
|
|
188103
|
+
manage_workshop?: boolean;
|
|
186261
188104
|
};
|
|
186262
188105
|
LiveUsage: {
|
|
186263
188106
|
as_of: string;
|
|
@@ -186873,6 +188716,8 @@ interface components {
|
|
|
186873
188716
|
is_telehealth: boolean;
|
|
186874
188717
|
online_bookable: boolean;
|
|
186875
188718
|
is_entry: boolean | null;
|
|
188719
|
+
agent_bookable: boolean | null;
|
|
188720
|
+
agent_bookable_effective: boolean;
|
|
186876
188721
|
lab_bearing: boolean;
|
|
186877
188722
|
requires_consent_template_id: string | null;
|
|
186878
188723
|
eligibility_min_age_years: number | null;
|
|
@@ -194266,6 +196111,27 @@ interface components {
|
|
|
194266
196111
|
/** @description The Flow JSON, as a string. */
|
|
194267
196112
|
flow_json: string;
|
|
194268
196113
|
};
|
|
196114
|
+
ClinicServiceEntryFlagsResult: {
|
|
196115
|
+
updated: number;
|
|
196116
|
+
};
|
|
196117
|
+
ClinicServiceAgentBookableCount: {
|
|
196118
|
+
bookable: number;
|
|
196119
|
+
reception_only: number;
|
|
196120
|
+
total: number;
|
|
196121
|
+
};
|
|
196122
|
+
ClinicServiceMatchFilter: {
|
|
196123
|
+
search?: string;
|
|
196124
|
+
/** @enum {string} */
|
|
196125
|
+
active?: "true" | "false";
|
|
196126
|
+
/** @enum {string} */
|
|
196127
|
+
review_state?: "pending" | "stale" | "draft" | "reviewed";
|
|
196128
|
+
/** @enum {string} */
|
|
196129
|
+
is_entry?: "true" | "false" | "unclassified";
|
|
196130
|
+
arancel?: string[] | null;
|
|
196131
|
+
categoria?: string;
|
|
196132
|
+
/** @enum {string} */
|
|
196133
|
+
agent_bookable?: "yes" | "no";
|
|
196134
|
+
};
|
|
194269
196135
|
};
|
|
194270
196136
|
responses: never;
|
|
194271
196137
|
parameters: never;
|