@vitrina/api 17.40.1 → 17.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.cts +938 -245
  2. package/dist/index.d.ts +938 -245
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -29410,6 +29410,8 @@ interface paths {
29410
29410
  * @description Health and recent outcomes of the proactive first message for one lead source (`chileautos`, `yapo`, `mercadolibre`, `website`, …): which rail it uses, whether its account is usable, sends today, and the latest outcomes with the reason a lead was skipped.
29411
29411
  *
29412
29412
  * `website` is ON by default for every workspace, and a portal (`chileautos`, `mercadolibre`, `yapo`) is ON by default once the workspace has an enabled marketplace account for it. With no block of its own such a source borrows the account and template chain of the first enabled source (`config_origin: inherited`, named in `inherited_from`), or uses the partner WhatsApp account and Vitrina's own templates — for a portal, the workspace's own first-contact templates first, then Vitrina's fallback ones (`platform_default`). An explicit block, `enabled: false` included, always wins. `templates` lists the WhatsApp ladder in send order with each template's state on that account: only `APPROVED` templates are ever sent; a `PENDING` or `REJECTED` one is shown so it is not silently skipped, and `status: null` means it is not on that account. When no template can be sent the first message goes by email, from the workspace mailbox. Each `recent` row carries its lead’s `contact_id` (one row per person on screen) and, on an `error` row, the classified `error_code` (`undeliverable` is Meta 131026; `provider_frequency_capped` and `recipient_experiment` are Meta holding marketing back), never the provider’s message.
29413
+ *
29414
+ * `clinic_form` (the clinic form first contact, configured at `/clinic-form-source`) is OFF until the workspace turns it on; its `templates` are the first message’s ladder, and the answer adds `clinic_form`: whether the intake URL exists, `enabled_at`, the number of mapped forms, the second message’s ladder (`follow_up_templates`, each with its state on the number) and the newest submissions with what the intake decided for each.
29413
29415
  */
29414
29416
  get: {
29415
29417
  parameters: {
@@ -73748,6 +73750,11 @@ interface paths {
73748
73750
  * "price_clp_per_bank_month": 15000,
73749
73751
  * "widget_public_key": "pk_test_ejemplo"
73750
73752
  * },
73753
+ * "bank_aggregator": {
73754
+ * "provider": "fintoc",
73755
+ * "configured": true,
73756
+ * "banks": []
73757
+ * },
73751
73758
  * "stale_after_hours": 48,
73752
73759
  * "manual_sync_min_interval_minutes": 60
73753
73760
  * }
@@ -74070,28 +74077,44 @@ interface paths {
74070
74077
  patch?: never;
74071
74078
  trace?: never;
74072
74079
  };
74073
- "/finanzas/connections/sync": {
74080
+ "/finanzas/connections/emisso/link-session": {
74074
74081
  parameters: {
74075
74082
  query?: never;
74076
74083
  header?: never;
74077
74084
  path?: never;
74078
74085
  cookie?: never;
74079
74086
  };
74087
+ get?: never;
74088
+ put?: never;
74080
74089
  /**
74081
- * Freshness of the bank movements
74082
- * @description When each bank link was last pulled, and whether a pull is queued. A read: it queues nothing. Poll it after `POST /finanzas/connections/sync` until `queued` is false, then reload. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
74090
+ * Start a bank link (Emisso page)
74091
+ * @description For a workspace whose `bank_aggregator.provider` is `emisso` (see `GET /finanzas/connections`). Returns a one-use page on `connect.emisso.ai` where the account holder enters the credentials of the chosen bank; they never reach Vitrina. Show the page with its full domain and say why it is asked. When the holder is done, call `POST /finanzas/connections/emisso/claim`. With `connection_id` the page renews the credential of that existing bank connection. Reads no bank. Requires the `bank_feed_fintoc` add-on (`402 ENTITLEMENT_NOT_ACTIVE` otherwise); `503 BANK_FEED_NOT_CONFIGURED` when this deployment has no Emisso key. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
74092
+ *
74093
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
74083
74094
  */
74084
- get: {
74095
+ post: {
74085
74096
  parameters: {
74086
74097
  query?: never;
74087
- header?: never;
74098
+ header?: {
74099
+ /** @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. */
74100
+ "Idempotency-Key"?: string;
74101
+ };
74088
74102
  path?: never;
74089
74103
  cookie?: never;
74090
74104
  };
74091
- requestBody?: never;
74105
+ requestBody?: {
74106
+ content: {
74107
+ /**
74108
+ * @example {
74109
+ * "bank": "bch_empresas"
74110
+ * }
74111
+ */
74112
+ "application/json": components["schemas"]["FinanzasEmissoLinkSessionBody"];
74113
+ };
74114
+ };
74092
74115
  responses: {
74093
- /** @description The freshness */
74094
- 200: {
74116
+ /** @description The bank-link page */
74117
+ 201: {
74095
74118
  headers: {
74096
74119
  [name: string]: unknown;
74097
74120
  };
@@ -74099,27 +74122,14 @@ interface paths {
74099
74122
  /**
74100
74123
  * @example {
74101
74124
  * "data": {
74102
- * "last_sync_at": "2026-10-30T08:00:00.000Z",
74103
- * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74104
- * "queued": true,
74105
- * "enqueued": 0,
74106
- * "links": [
74107
- * {
74108
- * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
74109
- * "institution_name": "Banco de Chile",
74110
- * "last_sync_at": "2026-10-30T08:00:00.000Z",
74111
- * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74112
- * "queued": true,
74113
- * "next_refresh_at": "2026-10-30T09:15:00.000Z",
74114
- * "skipped": null
74115
- * }
74116
- * ],
74117
- * "min_interval_minutes": 15
74125
+ * "url": "https://connect.emisso.ai/c/connect_cs_ejemplo",
74126
+ * "expires_at": "2026-11-15T15:43:57.205Z",
74127
+ * "bank": "bch_empresas"
74118
74128
  * }
74119
74129
  * }
74120
74130
  */
74121
74131
  "application/json": {
74122
- data: components["schemas"]["FinanzasBankPull"];
74132
+ data: components["schemas"]["FinanzasEmissoLinkSession"];
74123
74133
  };
74124
74134
  };
74125
74135
  };
@@ -74179,10 +74189,26 @@ interface paths {
74179
74189
  };
74180
74190
  };
74181
74191
  };
74192
+ delete?: never;
74193
+ options?: never;
74194
+ head?: never;
74195
+ patch?: never;
74196
+ trace?: never;
74197
+ };
74198
+ "/finanzas/connections/emisso/claim": {
74199
+ parameters: {
74200
+ query?: never;
74201
+ header?: never;
74202
+ path?: never;
74203
+ cookie?: never;
74204
+ };
74205
+ get?: never;
74182
74206
  put?: never;
74183
74207
  /**
74184
- * Sync every bank link
74185
- * @description Sync on entry to Finanzas and «Sincronizar ahora» for every bank link. Idempotent, never throttled: each active link not pulled nor requested in the last `min_interval_minutes` (15) gets one pull, the others answer with their last pull (`enqueued` counts the pulls this call queued). A `login_required` or disconnected link is skipped and reported in `links[].skipped`. Movements land within a minute or two; poll `GET /finanzas/connections/sync` until `queued` is false. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
74208
+ * Add the banks connected on the Emisso page
74209
+ * @description Call it after the holder finishes the page from `…/emisso/link-session` (poll every few seconds while that page is open). Every bank connected for this workspace that Vitrina does not hold yet becomes a bank connection and its first read is queued; a renewed credential reactivates its connection. Idempotent: an empty `connections` means nothing new was ready. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
74210
+ *
74211
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
74186
74212
  */
74187
74213
  post: {
74188
74214
  parameters: {
@@ -74196,7 +74222,7 @@ interface paths {
74196
74222
  };
74197
74223
  requestBody?: never;
74198
74224
  responses: {
74199
- /** @description The freshness after the request */
74225
+ /** @description What was added */
74200
74226
  200: {
74201
74227
  headers: {
74202
74228
  [name: string]: unknown;
@@ -74205,27 +74231,40 @@ interface paths {
74205
74231
  /**
74206
74232
  * @example {
74207
74233
  * "data": {
74208
- * "last_sync_at": "2026-10-30T08:00:00.000Z",
74209
- * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74210
- * "queued": true,
74211
- * "enqueued": 1,
74212
- * "links": [
74234
+ * "connections": [
74213
74235
  * {
74214
74236
  * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
74237
+ * "kind": "bank",
74238
+ * "provider": "fintoc",
74215
74239
  * "institution_name": "Banco de Chile",
74240
+ * "holder_name": "Clínica Ejemplo SpA",
74241
+ * "accounts": [
74242
+ * {
74243
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a6c",
74244
+ * "number_masked": "****4821",
74245
+ * "type": "cuenta_corriente",
74246
+ * "currency": "CLP"
74247
+ * }
74248
+ * ],
74249
+ * "movement_count": 1284,
74250
+ * "connected_at": "2026-10-01T14:03:00.000Z",
74216
74251
  * "last_sync_at": "2026-10-30T08:00:00.000Z",
74217
74252
  * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74218
- * "queued": true,
74219
- * "next_refresh_at": "2026-10-30T09:15:00.000Z",
74220
- * "skipped": null
74253
+ * "last_sync_error": null,
74254
+ * "status": "ok",
74255
+ * "next_refresh_at": "2026-10-30T09:00:00.000Z",
74256
+ * "actions": {
74257
+ * "sync_now": true,
74258
+ * "reconnect": false,
74259
+ * "disconnect": true
74260
+ * }
74221
74261
  * }
74222
- * ],
74223
- * "min_interval_minutes": 15
74262
+ * ]
74224
74263
  * }
74225
74264
  * }
74226
74265
  */
74227
74266
  "application/json": {
74228
- data: components["schemas"]["FinanzasBankPull"];
74267
+ data: components["schemas"]["FinanzasEmissoClaim"];
74229
74268
  };
74230
74269
  };
74231
74270
  };
@@ -74291,18 +74330,119 @@ interface paths {
74291
74330
  patch?: never;
74292
74331
  trace?: never;
74293
74332
  };
74294
- "/finanzas/connections/{id}/sync": {
74333
+ "/finanzas/connections/sync": {
74295
74334
  parameters: {
74296
74335
  query?: never;
74297
74336
  header?: never;
74298
74337
  path?: never;
74299
74338
  cookie?: never;
74300
74339
  };
74301
- get?: never;
74340
+ /**
74341
+ * Freshness of the bank movements
74342
+ * @description When each bank link was last pulled, and whether a pull is queued. A read: it queues nothing. Poll it after `POST /finanzas/connections/sync` until `queued` is false, then reload. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
74343
+ */
74344
+ get: {
74345
+ parameters: {
74346
+ query?: never;
74347
+ header?: never;
74348
+ path?: never;
74349
+ cookie?: never;
74350
+ };
74351
+ requestBody?: never;
74352
+ responses: {
74353
+ /** @description The freshness */
74354
+ 200: {
74355
+ headers: {
74356
+ [name: string]: unknown;
74357
+ };
74358
+ content: {
74359
+ /**
74360
+ * @example {
74361
+ * "data": {
74362
+ * "last_sync_at": "2026-10-30T08:00:00.000Z",
74363
+ * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74364
+ * "queued": true,
74365
+ * "enqueued": 0,
74366
+ * "links": [
74367
+ * {
74368
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
74369
+ * "institution_name": "Banco de Chile",
74370
+ * "last_sync_at": "2026-10-30T08:00:00.000Z",
74371
+ * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74372
+ * "queued": true,
74373
+ * "next_refresh_at": "2026-10-30T09:15:00.000Z",
74374
+ * "skipped": null
74375
+ * }
74376
+ * ],
74377
+ * "min_interval_minutes": 15
74378
+ * }
74379
+ * }
74380
+ */
74381
+ "application/json": {
74382
+ data: components["schemas"]["FinanzasBankPull"];
74383
+ };
74384
+ };
74385
+ };
74386
+ /** @description Validation error */
74387
+ 400: {
74388
+ headers: {
74389
+ [name: string]: unknown;
74390
+ };
74391
+ content: {
74392
+ "application/json": components["schemas"]["Error"];
74393
+ };
74394
+ };
74395
+ /** @description Unauthorized */
74396
+ 401: {
74397
+ headers: {
74398
+ [name: string]: unknown;
74399
+ };
74400
+ content: {
74401
+ "application/json": components["schemas"]["Error"];
74402
+ };
74403
+ };
74404
+ /** @description Forbidden */
74405
+ 403: {
74406
+ headers: {
74407
+ [name: string]: unknown;
74408
+ };
74409
+ content: {
74410
+ "application/json": components["schemas"]["Error"];
74411
+ };
74412
+ };
74413
+ /** @description Not found */
74414
+ 404: {
74415
+ headers: {
74416
+ [name: string]: unknown;
74417
+ };
74418
+ content: {
74419
+ "application/json": components["schemas"]["Error"];
74420
+ };
74421
+ };
74422
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
74423
+ 409: {
74424
+ headers: {
74425
+ [name: string]: unknown;
74426
+ };
74427
+ content: {
74428
+ "application/json": components["schemas"]["Error"];
74429
+ };
74430
+ };
74431
+ /** @description Rate limited */
74432
+ 429: {
74433
+ headers: {
74434
+ [name: string]: unknown;
74435
+ };
74436
+ content: {
74437
+ "application/json": components["schemas"]["Error"];
74438
+ };
74439
+ };
74440
+ };
74441
+ };
74302
74442
  put?: never;
74303
74443
  /**
74304
- * Sync a connection now
74305
- * @description «Sincronizar ahora». Queues a pull of a bank link or the Mercado Pago account. A bank link can be synced on demand at most once per `manual_sync_min_interval_minutes`; sooner answers `429 FINANZAS_SYNC_THROTTLED` with `details.next_refresh_at`. A `login_required` link, a disconnected one or an SII connection answers 409. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
74444
+ * Sync every bank link
74445
+ * @description Sync on entry to Finanzas and «Sincronizar ahora» for every bank link. Idempotent, never throttled: each active link not pulled nor requested in the last `min_interval_minutes` (15) gets one pull, the others answer with their last pull (`enqueued` counts the pulls this call queued). A `login_required` or disconnected link is skipped and reported in `links[].skipped`. Movements land within a minute or two; poll `GET /finanzas/connections/sync` until `queued` is false. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
74306
74446
  */
74307
74447
  post: {
74308
74448
  parameters: {
@@ -74311,15 +74451,13 @@ interface paths {
74311
74451
  /** @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. */
74312
74452
  "Idempotency-Key"?: string;
74313
74453
  };
74314
- path: {
74315
- id: string;
74316
- };
74454
+ path?: never;
74317
74455
  cookie?: never;
74318
74456
  };
74319
74457
  requestBody?: never;
74320
74458
  responses: {
74321
- /** @description Queued */
74322
- 202: {
74459
+ /** @description The freshness after the request */
74460
+ 200: {
74323
74461
  headers: {
74324
74462
  [name: string]: unknown;
74325
74463
  };
@@ -74327,13 +74465,27 @@ interface paths {
74327
74465
  /**
74328
74466
  * @example {
74329
74467
  * "data": {
74330
- * "enqueued": true,
74331
- * "next_refresh_at": "2026-10-30T09:00:00.000Z"
74468
+ * "last_sync_at": "2026-10-30T08:00:00.000Z",
74469
+ * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74470
+ * "queued": true,
74471
+ * "enqueued": 1,
74472
+ * "links": [
74473
+ * {
74474
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
74475
+ * "institution_name": "Banco de Chile",
74476
+ * "last_sync_at": "2026-10-30T08:00:00.000Z",
74477
+ * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74478
+ * "queued": true,
74479
+ * "next_refresh_at": "2026-10-30T09:15:00.000Z",
74480
+ * "skipped": null
74481
+ * }
74482
+ * ],
74483
+ * "min_interval_minutes": 15
74332
74484
  * }
74333
74485
  * }
74334
74486
  */
74335
74487
  "application/json": {
74336
- data: components["schemas"]["FinanzasSyncResult"];
74488
+ data: components["schemas"]["FinanzasBankPull"];
74337
74489
  };
74338
74490
  };
74339
74491
  };
@@ -74399,7 +74551,7 @@ interface paths {
74399
74551
  patch?: never;
74400
74552
  trace?: never;
74401
74553
  };
74402
- "/finanzas/connections/{id}/reconnect": {
74554
+ "/finanzas/connections/{id}/sync": {
74403
74555
  parameters: {
74404
74556
  query?: never;
74405
74557
  header?: never;
@@ -74409,10 +74561,8 @@ interface paths {
74409
74561
  get?: never;
74410
74562
  put?: never;
74411
74563
  /**
74412
- * Reconnect a bank account
74413
- * @description For a bank link whose login must be redone (`login_required`). Send the `exchange_token` from Fintoc's widget opened again for that bank. The link returns to `active`; if Fintoc answers with a different link, it replaces this one, which is disconnected. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
74414
- *
74415
- * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
74564
+ * Sync a connection now
74565
+ * @description «Sincronizar ahora». Queues a pull of a bank link or the Mercado Pago account. A bank link can be synced on demand at most once per `manual_sync_min_interval_minutes`; sooner answers `429 FINANZAS_SYNC_THROTTLED` with `details.next_refresh_at`. A `login_required` link, a disconnected one or an SII connection answers 409. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
74416
74566
  */
74417
74567
  post: {
74418
74568
  parameters: {
@@ -74426,19 +74576,10 @@ interface paths {
74426
74576
  };
74427
74577
  cookie?: never;
74428
74578
  };
74429
- requestBody?: {
74430
- content: {
74431
- /**
74432
- * @example {
74433
- * "exchange_token": "exchange_token_ejemplo_123"
74434
- * }
74435
- */
74436
- "application/json": components["schemas"]["FinanzasFintocConnectBody"];
74437
- };
74438
- };
74579
+ requestBody?: never;
74439
74580
  responses: {
74440
- /** @description The connection */
74441
- 200: {
74581
+ /** @description Queued */
74582
+ 202: {
74442
74583
  headers: {
74443
74584
  [name: string]: unknown;
74444
74585
  };
@@ -74446,36 +74587,155 @@ interface paths {
74446
74587
  /**
74447
74588
  * @example {
74448
74589
  * "data": {
74449
- * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
74450
- * "kind": "bank",
74451
- * "provider": "fintoc",
74452
- * "institution_name": "Banco de Chile",
74453
- * "holder_name": "Clínica Ejemplo SpA",
74454
- * "accounts": [
74455
- * {
74456
- * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a6c",
74457
- * "number_masked": "****4821",
74458
- * "type": "cuenta_corriente",
74459
- * "currency": "CLP"
74460
- * }
74461
- * ],
74462
- * "movement_count": 1284,
74463
- * "connected_at": "2026-10-01T14:03:00.000Z",
74464
- * "last_sync_at": "2026-10-30T08:00:00.000Z",
74465
- * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74466
- * "last_sync_error": null,
74467
- * "status": "ok",
74468
- * "next_refresh_at": "2026-10-30T09:00:00.000Z",
74469
- * "actions": {
74470
- * "sync_now": true,
74471
- * "reconnect": false,
74472
- * "disconnect": true
74473
- * }
74590
+ * "enqueued": true,
74591
+ * "next_refresh_at": "2026-10-30T09:00:00.000Z"
74474
74592
  * }
74475
74593
  * }
74476
74594
  */
74477
74595
  "application/json": {
74478
- data: components["schemas"]["FinanzasConnection"];
74596
+ data: components["schemas"]["FinanzasSyncResult"];
74597
+ };
74598
+ };
74599
+ };
74600
+ /** @description Validation error */
74601
+ 400: {
74602
+ headers: {
74603
+ [name: string]: unknown;
74604
+ };
74605
+ content: {
74606
+ "application/json": components["schemas"]["Error"];
74607
+ };
74608
+ };
74609
+ /** @description Unauthorized */
74610
+ 401: {
74611
+ headers: {
74612
+ [name: string]: unknown;
74613
+ };
74614
+ content: {
74615
+ "application/json": components["schemas"]["Error"];
74616
+ };
74617
+ };
74618
+ /** @description Forbidden */
74619
+ 403: {
74620
+ headers: {
74621
+ [name: string]: unknown;
74622
+ };
74623
+ content: {
74624
+ "application/json": components["schemas"]["Error"];
74625
+ };
74626
+ };
74627
+ /** @description Not found */
74628
+ 404: {
74629
+ headers: {
74630
+ [name: string]: unknown;
74631
+ };
74632
+ content: {
74633
+ "application/json": components["schemas"]["Error"];
74634
+ };
74635
+ };
74636
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
74637
+ 409: {
74638
+ headers: {
74639
+ [name: string]: unknown;
74640
+ };
74641
+ content: {
74642
+ "application/json": components["schemas"]["Error"];
74643
+ };
74644
+ };
74645
+ /** @description Rate limited */
74646
+ 429: {
74647
+ headers: {
74648
+ [name: string]: unknown;
74649
+ };
74650
+ content: {
74651
+ "application/json": components["schemas"]["Error"];
74652
+ };
74653
+ };
74654
+ };
74655
+ };
74656
+ delete?: never;
74657
+ options?: never;
74658
+ head?: never;
74659
+ patch?: never;
74660
+ trace?: never;
74661
+ };
74662
+ "/finanzas/connections/{id}/reconnect": {
74663
+ parameters: {
74664
+ query?: never;
74665
+ header?: never;
74666
+ path?: never;
74667
+ cookie?: never;
74668
+ };
74669
+ get?: never;
74670
+ put?: never;
74671
+ /**
74672
+ * Reconnect a bank account
74673
+ * @description For a bank link whose login must be redone (`login_required`). Send the `exchange_token` from Fintoc's widget opened again for that bank. The link returns to `active`; if Fintoc answers with a different link, it replaces this one, which is disconnected. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
74674
+ *
74675
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
74676
+ */
74677
+ post: {
74678
+ parameters: {
74679
+ query?: never;
74680
+ header?: {
74681
+ /** @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. */
74682
+ "Idempotency-Key"?: string;
74683
+ };
74684
+ path: {
74685
+ id: string;
74686
+ };
74687
+ cookie?: never;
74688
+ };
74689
+ requestBody?: {
74690
+ content: {
74691
+ /**
74692
+ * @example {
74693
+ * "exchange_token": "exchange_token_ejemplo_123"
74694
+ * }
74695
+ */
74696
+ "application/json": components["schemas"]["FinanzasFintocConnectBody"];
74697
+ };
74698
+ };
74699
+ responses: {
74700
+ /** @description The connection */
74701
+ 200: {
74702
+ headers: {
74703
+ [name: string]: unknown;
74704
+ };
74705
+ content: {
74706
+ /**
74707
+ * @example {
74708
+ * "data": {
74709
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
74710
+ * "kind": "bank",
74711
+ * "provider": "fintoc",
74712
+ * "institution_name": "Banco de Chile",
74713
+ * "holder_name": "Clínica Ejemplo SpA",
74714
+ * "accounts": [
74715
+ * {
74716
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a6c",
74717
+ * "number_masked": "****4821",
74718
+ * "type": "cuenta_corriente",
74719
+ * "currency": "CLP"
74720
+ * }
74721
+ * ],
74722
+ * "movement_count": 1284,
74723
+ * "connected_at": "2026-10-01T14:03:00.000Z",
74724
+ * "last_sync_at": "2026-10-30T08:00:00.000Z",
74725
+ * "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
74726
+ * "last_sync_error": null,
74727
+ * "status": "ok",
74728
+ * "next_refresh_at": "2026-10-30T09:00:00.000Z",
74729
+ * "actions": {
74730
+ * "sync_now": true,
74731
+ * "reconnect": false,
74732
+ * "disconnect": true
74733
+ * }
74734
+ * }
74735
+ * }
74736
+ */
74737
+ "application/json": {
74738
+ data: components["schemas"]["FinanzasConnection"];
74479
74739
  };
74480
74740
  };
74481
74741
  };
@@ -233630,45 +233890,425 @@ interface paths {
233630
233890
  patch?: never;
233631
233891
  trace?: never;
233632
233892
  };
233633
- "/toctoc-listings/{id}": {
233893
+ "/toctoc-listings/{id}": {
233894
+ parameters: {
233895
+ query?: never;
233896
+ header?: never;
233897
+ path?: never;
233898
+ cookie?: never;
233899
+ };
233900
+ get?: never;
233901
+ put?: never;
233902
+ post?: never;
233903
+ delete?: never;
233904
+ options?: never;
233905
+ head?: never;
233906
+ /**
233907
+ * Map or unmap a TocToc publication
233908
+ * @description Sets the proyecto of a publication (`project_id`), or clears it with `null`. Mapping stamps the proyecto on the leads waiting on the publication and routes the unowned ones to its ejecutivos; unmapping only affects leads that arrive afterwards. Requires `marketplace:write`. Only on a workspace that runs the Proyectos module (real-estate vertical, inmobiliaria); any other answers 403 `MODULE_NOT_ENABLED`. Refused (403) to a caller whose role narrows proyectos.
233909
+ */
233910
+ patch: {
233911
+ parameters: {
233912
+ query?: never;
233913
+ header?: never;
233914
+ path: {
233915
+ /** @description The TocToc listing id. */
233916
+ id: string;
233917
+ };
233918
+ cookie?: never;
233919
+ };
233920
+ requestBody?: {
233921
+ content: {
233922
+ /**
233923
+ * @example {
233924
+ * "project_id": "0199e3a0-0000-7000-8000-000000000101"
233925
+ * }
233926
+ */
233927
+ "application/json": components["schemas"]["UpdateToctocListingBody"];
233928
+ };
233929
+ };
233930
+ responses: {
233931
+ /** @description Updated */
233932
+ 200: {
233933
+ headers: {
233934
+ [name: string]: unknown;
233935
+ };
233936
+ content: {
233937
+ /**
233938
+ * @example {
233939
+ * "data": {
233940
+ * "id": "0199e3a0-0000-7000-8000-000000000801",
233941
+ * "tenant_id": "0199e3a0-0000-7000-8000-0000000000aa",
233942
+ * "external_id": "TT-48213",
233943
+ * "project_id": "0199e3a0-0000-7000-8000-000000000101",
233944
+ * "title": "Parque Los Aromos",
233945
+ * "created_at": "2026-10-20T12:00:00.000Z",
233946
+ * "updated_at": "2026-10-20T12:00:00.000Z",
233947
+ * "leads_mapped": 3
233948
+ * }
233949
+ * }
233950
+ */
233951
+ "application/json": {
233952
+ data: components["schemas"]["MappedToctocListing"];
233953
+ };
233954
+ };
233955
+ };
233956
+ /** @description Validation error */
233957
+ 400: {
233958
+ headers: {
233959
+ [name: string]: unknown;
233960
+ };
233961
+ content: {
233962
+ "application/json": components["schemas"]["Error"];
233963
+ };
233964
+ };
233965
+ /** @description Unauthorized */
233966
+ 401: {
233967
+ headers: {
233968
+ [name: string]: unknown;
233969
+ };
233970
+ content: {
233971
+ "application/json": components["schemas"]["Error"];
233972
+ };
233973
+ };
233974
+ /** @description Forbidden */
233975
+ 403: {
233976
+ headers: {
233977
+ [name: string]: unknown;
233978
+ };
233979
+ content: {
233980
+ "application/json": components["schemas"]["Error"];
233981
+ };
233982
+ };
233983
+ /** @description Not found */
233984
+ 404: {
233985
+ headers: {
233986
+ [name: string]: unknown;
233987
+ };
233988
+ content: {
233989
+ "application/json": components["schemas"]["Error"];
233990
+ };
233991
+ };
233992
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
233993
+ 409: {
233994
+ headers: {
233995
+ [name: string]: unknown;
233996
+ };
233997
+ content: {
233998
+ "application/json": components["schemas"]["Error"];
233999
+ };
234000
+ };
234001
+ /** @description Rate limited */
234002
+ 429: {
234003
+ headers: {
234004
+ [name: string]: unknown;
234005
+ };
234006
+ content: {
234007
+ "application/json": components["schemas"]["Error"];
234008
+ };
234009
+ };
234010
+ };
234011
+ };
234012
+ trace?: never;
234013
+ };
234014
+ "/projects/{id}/toctoc": {
234015
+ parameters: {
234016
+ query?: never;
234017
+ header?: never;
234018
+ path?: never;
234019
+ cookie?: never;
234020
+ };
234021
+ /**
234022
+ * A proyecto’s TocToc publishing payload and state
234023
+ * @description The payload a hand-over of the proyecto to TocToc carries (the proyecto, its tipologías and the live stock behind each, versioned by `schema`), what the listing still lacks (`issues`, empty = ready), and where the proyecto stands on TocToc (`publication`, null = a draft). Requires `marketplace:read`. TocToc offers no API or webhook (spike #4427): its lead notifications arrive by the forwarded email at the workspace’s lead door, and publishing is assisted (export the payload, record the code TocToc returns). Only on a workspace that runs the Proyectos module (real-estate vertical, inmobiliaria); any other answers 403 `MODULE_NOT_ENABLED`. Refused (403) to a caller whose role narrows proyectos.
234024
+ */
234025
+ get: {
234026
+ parameters: {
234027
+ query?: never;
234028
+ header?: never;
234029
+ path: {
234030
+ /** @description The proyecto id. */
234031
+ id: string;
234032
+ };
234033
+ cookie?: never;
234034
+ };
234035
+ requestBody?: never;
234036
+ responses: {
234037
+ /** @description Payload and state */
234038
+ 200: {
234039
+ headers: {
234040
+ [name: string]: unknown;
234041
+ };
234042
+ content: {
234043
+ /**
234044
+ * @example {
234045
+ * "data": {
234046
+ * "publication": {
234047
+ * "id": "0199e3a0-0000-7000-8000-000000000803",
234048
+ * "tenant_id": "0199e3a0-0000-7000-8000-0000000000aa",
234049
+ * "project_id": "0199e3a0-0000-7000-8000-000000000101",
234050
+ * "status": "live",
234051
+ * "external_ref": "TT-48213",
234052
+ * "notes": null,
234053
+ * "submitted_at": "2026-10-20T12:00:00.000Z",
234054
+ * "live_at": "2026-10-20T12:00:00.000Z",
234055
+ * "created_at": "2026-10-20T12:00:00.000Z",
234056
+ * "updated_at": "2026-10-20T12:00:00.000Z"
234057
+ * },
234058
+ * "payload": {
234059
+ * "schema": "vitrina.toctoc.project.v1",
234060
+ * "project": {
234061
+ * "reference": "0199e3a0-0000-7000-8000-000000000101",
234062
+ * "name": "Parque Los Aromos",
234063
+ * "description": "Condominio de departamentos a pasos del metro.",
234064
+ * "stage": "en_verde",
234065
+ * "stage_label": "En verde",
234066
+ * "delivery_date": "2027-12-01",
234067
+ * "region": "Metropolitana",
234068
+ * "comuna": "La Florida",
234069
+ * "address": "Av. Vicuña Mackenna 0000",
234070
+ * "subsidies": [
234071
+ * "DS19"
234072
+ * ],
234073
+ * "photos": [
234074
+ * "https://media.example.com/t/other/aromos-1.jpg"
234075
+ * ],
234076
+ * "brochure_url": null
234077
+ * },
234078
+ * "unit_models": [
234079
+ * {
234080
+ * "reference": "0199e3a0-0000-7000-8000-000000000201",
234081
+ * "name": "3D2B 78 m²",
234082
+ * "description": null,
234083
+ * "bedrooms": 3,
234084
+ * "bathrooms": 2,
234085
+ * "usable_area_m2": 72.5,
234086
+ * "terrace_area_m2": 6,
234087
+ * "total_area_m2": 78.5,
234088
+ * "floor_plans": [],
234089
+ * "renders": [],
234090
+ * "tour_360_url": null,
234091
+ * "total_units": 24,
234092
+ * "available_units": 11,
234093
+ * "price": {
234094
+ * "currency": "UF",
234095
+ * "from": 3450,
234096
+ * "to": 3780
234097
+ * }
234098
+ * }
234099
+ * ],
234100
+ * "extras": {
234101
+ * "parking_available": 8,
234102
+ * "storage_available": 5
234103
+ * }
234104
+ * },
234105
+ * "issues": [
234106
+ * {
234107
+ * "field": "project.brochure_url",
234108
+ * "message": "Agrega el brochure del proyecto."
234109
+ * }
234110
+ * ]
234111
+ * }
234112
+ * }
234113
+ */
234114
+ "application/json": {
234115
+ data: components["schemas"]["ToctocProjectPublication"];
234116
+ };
234117
+ };
234118
+ };
234119
+ /** @description Validation error */
234120
+ 400: {
234121
+ headers: {
234122
+ [name: string]: unknown;
234123
+ };
234124
+ content: {
234125
+ "application/json": components["schemas"]["Error"];
234126
+ };
234127
+ };
234128
+ /** @description Unauthorized */
234129
+ 401: {
234130
+ headers: {
234131
+ [name: string]: unknown;
234132
+ };
234133
+ content: {
234134
+ "application/json": components["schemas"]["Error"];
234135
+ };
234136
+ };
234137
+ /** @description Forbidden */
234138
+ 403: {
234139
+ headers: {
234140
+ [name: string]: unknown;
234141
+ };
234142
+ content: {
234143
+ "application/json": components["schemas"]["Error"];
234144
+ };
234145
+ };
234146
+ /** @description Not found */
234147
+ 404: {
234148
+ headers: {
234149
+ [name: string]: unknown;
234150
+ };
234151
+ content: {
234152
+ "application/json": components["schemas"]["Error"];
234153
+ };
234154
+ };
234155
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
234156
+ 409: {
234157
+ headers: {
234158
+ [name: string]: unknown;
234159
+ };
234160
+ content: {
234161
+ "application/json": components["schemas"]["Error"];
234162
+ };
234163
+ };
234164
+ /** @description Rate limited */
234165
+ 429: {
234166
+ headers: {
234167
+ [name: string]: unknown;
234168
+ };
234169
+ content: {
234170
+ "application/json": components["schemas"]["Error"];
234171
+ };
234172
+ };
234173
+ };
234174
+ };
234175
+ /**
234176
+ * Record where a proyecto stands on TocToc
234177
+ * @description Records `draft`, `submitted` (handed to TocToc), `live` or `paused`, and the code TocToc gave the proyecto. `live` needs the code (400 otherwise). Recording a code maps it to the proyecto, so the leads that carry it land on it and those already waiting on it are moved; a code that belongs to another proyecto is refused (400). Requires `marketplace:write`. Only on a workspace that runs the Proyectos module (real-estate vertical, inmobiliaria); any other answers 403 `MODULE_NOT_ENABLED`. Refused (403) to a caller whose role narrows proyectos.
234178
+ */
234179
+ put: {
234180
+ parameters: {
234181
+ query?: never;
234182
+ header?: never;
234183
+ path: {
234184
+ /** @description The proyecto id. */
234185
+ id: string;
234186
+ };
234187
+ cookie?: never;
234188
+ };
234189
+ requestBody?: {
234190
+ content: {
234191
+ /**
234192
+ * @example {
234193
+ * "status": "live",
234194
+ * "external_ref": "TT-48213"
234195
+ * }
234196
+ */
234197
+ "application/json": components["schemas"]["UpdateToctocPublicationBody"];
234198
+ };
234199
+ };
234200
+ responses: {
234201
+ /** @description Recorded */
234202
+ 200: {
234203
+ headers: {
234204
+ [name: string]: unknown;
234205
+ };
234206
+ content: {
234207
+ /**
234208
+ * @example {
234209
+ * "data": {
234210
+ * "id": "0199e3a0-0000-7000-8000-000000000803",
234211
+ * "tenant_id": "0199e3a0-0000-7000-8000-0000000000aa",
234212
+ * "project_id": "0199e3a0-0000-7000-8000-000000000101",
234213
+ * "status": "live",
234214
+ * "external_ref": "TT-48213",
234215
+ * "notes": null,
234216
+ * "submitted_at": "2026-10-20T12:00:00.000Z",
234217
+ * "live_at": "2026-10-20T12:00:00.000Z",
234218
+ * "created_at": "2026-10-20T12:00:00.000Z",
234219
+ * "updated_at": "2026-10-20T12:00:00.000Z"
234220
+ * }
234221
+ * }
234222
+ */
234223
+ "application/json": {
234224
+ data: components["schemas"]["ToctocPublication"] & Record<string, never>;
234225
+ };
234226
+ };
234227
+ };
234228
+ /** @description Validation error */
234229
+ 400: {
234230
+ headers: {
234231
+ [name: string]: unknown;
234232
+ };
234233
+ content: {
234234
+ "application/json": components["schemas"]["Error"];
234235
+ };
234236
+ };
234237
+ /** @description Unauthorized */
234238
+ 401: {
234239
+ headers: {
234240
+ [name: string]: unknown;
234241
+ };
234242
+ content: {
234243
+ "application/json": components["schemas"]["Error"];
234244
+ };
234245
+ };
234246
+ /** @description Forbidden */
234247
+ 403: {
234248
+ headers: {
234249
+ [name: string]: unknown;
234250
+ };
234251
+ content: {
234252
+ "application/json": components["schemas"]["Error"];
234253
+ };
234254
+ };
234255
+ /** @description Not found */
234256
+ 404: {
234257
+ headers: {
234258
+ [name: string]: unknown;
234259
+ };
234260
+ content: {
234261
+ "application/json": components["schemas"]["Error"];
234262
+ };
234263
+ };
234264
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
234265
+ 409: {
234266
+ headers: {
234267
+ [name: string]: unknown;
234268
+ };
234269
+ content: {
234270
+ "application/json": components["schemas"]["Error"];
234271
+ };
234272
+ };
234273
+ /** @description Rate limited */
234274
+ 429: {
234275
+ headers: {
234276
+ [name: string]: unknown;
234277
+ };
234278
+ content: {
234279
+ "application/json": components["schemas"]["Error"];
234280
+ };
234281
+ };
234282
+ };
234283
+ };
234284
+ post?: never;
234285
+ delete?: never;
234286
+ options?: never;
234287
+ head?: never;
234288
+ patch?: never;
234289
+ trace?: never;
234290
+ };
234291
+ "/clinic-form-source": {
233634
234292
  parameters: {
233635
234293
  query?: never;
233636
234294
  header?: never;
233637
234295
  path?: never;
233638
234296
  cookie?: never;
233639
234297
  };
233640
- get?: never;
233641
- put?: never;
233642
- post?: never;
233643
- delete?: never;
233644
- options?: never;
233645
- head?: never;
233646
234298
  /**
233647
- * Map or unmap a TocToc publication
233648
- * @description Sets the proyecto of a publication (`project_id`), or clears it with `null`. Mapping stamps the proyecto on the leads waiting on the publication and routes the unowned ones to its ejecutivos; unmapping only affects leads that arrive afterwards. Requires `marketplace:write`. Only on a workspace that runs the Proyectos module (real-estate vertical, inmobiliaria); any other answers 403 `MODULE_NOT_ENABLED`. Refused (403) to a caller whose role narrows proyectos.
234299
+ * The clinic form first contact of the workspace
234300
+ * @description Whether it is on, the sending number, the form → treatment map and whether an intake URL exists (`token_hint`). Requires `leads:read`. Healthcare workspaces only (any other answers 403 `VERTICAL_NOT_ENABLED`). Creating or rotating the intake URL is withheld from connected apps. A GoHighLevel workflow («form submitted», any form) posts its standard Webhook body to the intake URL; Vitrina answers the patient at once, at any hour, with two approved WhatsApp templates 30 s apart; outside the workspace’s opening hours (`business_hours`, none = always open) the second message is the out-of-hours copy, unless a live AI agent answers the number. A form the map does not know gets the generic second message. A person who got a first contact in the last 24 h, or has an open conversation, gets a private note instead of a new message. Status: `GET /lead-outreach/status?source=clinic_form`.
233649
234301
  */
233650
- patch: {
234302
+ get: {
233651
234303
  parameters: {
233652
234304
  query?: never;
233653
234305
  header?: never;
233654
- path: {
233655
- /** @description The TocToc listing id. */
233656
- id: string;
233657
- };
234306
+ path?: never;
233658
234307
  cookie?: never;
233659
234308
  };
233660
- requestBody?: {
233661
- content: {
233662
- /**
233663
- * @example {
233664
- * "project_id": "0199e3a0-0000-7000-8000-000000000101"
233665
- * }
233666
- */
233667
- "application/json": components["schemas"]["UpdateToctocListingBody"];
233668
- };
233669
- };
234309
+ requestBody?: never;
233670
234310
  responses: {
233671
- /** @description Updated */
234311
+ /** @description The source */
233672
234312
  200: {
233673
234313
  headers: {
233674
234314
  [name: string]: unknown;
@@ -233677,19 +234317,36 @@ interface paths {
233677
234317
  /**
233678
234318
  * @example {
233679
234319
  * "data": {
233680
- * "id": "0199e3a0-0000-7000-8000-000000000801",
233681
- * "tenant_id": "0199e3a0-0000-7000-8000-0000000000aa",
233682
- * "external_id": "TT-48213",
233683
- * "project_id": "0199e3a0-0000-7000-8000-000000000101",
233684
- * "title": "Parque Los Aromos",
233685
- * "created_at": "2026-10-20T12:00:00.000Z",
233686
- * "updated_at": "2026-10-20T12:00:00.000Z",
233687
- * "leads_mapped": 3
234320
+ * "enabled": true,
234321
+ * "enabled_at": "2026-11-20T12:00:00.000Z",
234322
+ * "messaging_account_id": null,
234323
+ * "daily_cap": 200,
234324
+ * "forms": [
234325
+ * {
234326
+ * "form_id": "Hk3QpZ8",
234327
+ * "form_name": "Implantes landing",
234328
+ * "treatment_label": "implantes dentales"
234329
+ * }
234330
+ * ],
234331
+ * "token_hint": "a1b2",
234332
+ * "intake_path": "/api/v1/integrations/gohighlevel-forms"
233688
234333
  * }
233689
234334
  * }
233690
234335
  */
233691
234336
  "application/json": {
233692
- data: components["schemas"]["MappedToctocListing"];
234337
+ data: {
234338
+ enabled: boolean;
234339
+ enabled_at: string | null;
234340
+ messaging_account_id: string | null;
234341
+ daily_cap: number;
234342
+ forms: {
234343
+ form_id: string;
234344
+ form_name: string | null;
234345
+ treatment_label: string;
234346
+ }[];
234347
+ token_hint: string | null;
234348
+ intake_path: string;
234349
+ };
233693
234350
  };
233694
234351
  };
233695
234352
  };
@@ -233749,32 +234406,55 @@ interface paths {
233749
234406
  };
233750
234407
  };
233751
234408
  };
233752
- trace?: never;
233753
- };
233754
- "/projects/{id}/toctoc": {
233755
- parameters: {
233756
- query?: never;
233757
- header?: never;
233758
- path?: never;
233759
- cookie?: never;
233760
- };
233761
234409
  /**
233762
- * A proyecto’s TocToc publishing payload and state
233763
- * @description The payload a hand-over of the proyecto to TocToc carries (the proyecto, its tipologías and the live stock behind each, versioned by `schema`), what the listing still lacks (`issues`, empty = ready), and where the proyecto stands on TocToc (`publication`, null = a draft). Requires `marketplace:read`. TocToc offers no API or webhook (spike #4427): its lead notifications arrive by the forwarded email at the workspace’s lead door, and publishing is assisted (export the payload, record the code TocToc returns). Only on a workspace that runs the Proyectos module (real-estate vertical, inmobiliaria); any other answers 403 `MODULE_NOT_ENABLED`. Refused (403) to a caller whose role narrows proyectos.
234410
+ * Turn the clinic form first contact on or off, or edit its form map
234411
+ * @description Every field is optional. `forms` replaces the whole map (a repeated `form_id` is refused). Turning it on needs a healthcare workspace and an issued intake URL; it still sends nothing until the templates of the `clinic_form` pack are approved on the number. Requires `tenant:write`. Healthcare workspaces only (any other answers 403 `VERTICAL_NOT_ENABLED`). Creating or rotating the intake URL is withheld from connected apps. A GoHighLevel workflow («form submitted», any form) posts its standard Webhook body to the intake URL; Vitrina answers the patient at once, at any hour, with two approved WhatsApp templates 30 s apart; outside the workspace’s opening hours (`business_hours`, none = always open) the second message is the out-of-hours copy, unless a live AI agent answers the number. A form the map does not know gets the generic second message. A person who got a first contact in the last 24 h, or has an open conversation, gets a private note instead of a new message. Status: `GET /lead-outreach/status?source=clinic_form`.
233764
234412
  */
233765
- get: {
234413
+ put: {
233766
234414
  parameters: {
233767
234415
  query?: never;
233768
234416
  header?: never;
233769
- path: {
233770
- /** @description The proyecto id. */
233771
- id: string;
233772
- };
234417
+ path?: never;
233773
234418
  cookie?: never;
233774
234419
  };
233775
- requestBody?: never;
234420
+ requestBody?: {
234421
+ content: {
234422
+ /**
234423
+ * @example {
234424
+ * "enabled": true,
234425
+ * "forms": [
234426
+ * {
234427
+ * "form_id": "Hk3QpZ8",
234428
+ * "form_name": "Implantes landing",
234429
+ * "treatment_label": "implantes dentales"
234430
+ * }
234431
+ * ]
234432
+ * }
234433
+ */
234434
+ "application/json": {
234435
+ /** @description Turn the first contact on or off. Nothing is ever sent while it is off. Turning it on needs a healthcare workspace and an issued intake URL. */
234436
+ enabled?: boolean;
234437
+ /**
234438
+ * Format: uuid
234439
+ * @description The WhatsApp number to send from. Null = the workspace's partner WhatsApp number.
234440
+ */
234441
+ messaging_account_id?: string | null;
234442
+ /** @description First contacts this source may schedule per workspace day (default 200). Forms past it are recorded, not answered. */
234443
+ daily_cap?: number;
234444
+ /** @description The whole form → treatment map (replaces the stored one). */
234445
+ forms?: {
234446
+ /** @description The GoHighLevel form id the webhook body names. */
234447
+ form_id: string;
234448
+ /** @description The form’s name, for people. */
234449
+ form_name?: string | null;
234450
+ /** @description What the patient reads in the second message: «…en nuestro formulario de <treatment_label>». Control characters and repeated spaces are removed and it is cut at 60 characters. */
234451
+ treatment_label: string;
234452
+ }[];
234453
+ };
234454
+ };
234455
+ };
233776
234456
  responses: {
233777
- /** @description Payload and state */
234457
+ /** @description Updated */
233778
234458
  200: {
233779
234459
  headers: {
233780
234460
  [name: string]: unknown;
@@ -233783,76 +234463,36 @@ interface paths {
233783
234463
  /**
233784
234464
  * @example {
233785
234465
  * "data": {
233786
- * "publication": {
233787
- * "id": "0199e3a0-0000-7000-8000-000000000803",
233788
- * "tenant_id": "0199e3a0-0000-7000-8000-0000000000aa",
233789
- * "project_id": "0199e3a0-0000-7000-8000-000000000101",
233790
- * "status": "live",
233791
- * "external_ref": "TT-48213",
233792
- * "notes": null,
233793
- * "submitted_at": "2026-10-20T12:00:00.000Z",
233794
- * "live_at": "2026-10-20T12:00:00.000Z",
233795
- * "created_at": "2026-10-20T12:00:00.000Z",
233796
- * "updated_at": "2026-10-20T12:00:00.000Z"
233797
- * },
233798
- * "payload": {
233799
- * "schema": "vitrina.toctoc.project.v1",
233800
- * "project": {
233801
- * "reference": "0199e3a0-0000-7000-8000-000000000101",
233802
- * "name": "Parque Los Aromos",
233803
- * "description": "Condominio de departamentos a pasos del metro.",
233804
- * "stage": "en_verde",
233805
- * "stage_label": "En verde",
233806
- * "delivery_date": "2027-12-01",
233807
- * "region": "Metropolitana",
233808
- * "comuna": "La Florida",
233809
- * "address": "Av. Vicuña Mackenna 0000",
233810
- * "subsidies": [
233811
- * "DS19"
233812
- * ],
233813
- * "photos": [
233814
- * "https://media.example.com/t/other/aromos-1.jpg"
233815
- * ],
233816
- * "brochure_url": null
233817
- * },
233818
- * "unit_models": [
233819
- * {
233820
- * "reference": "0199e3a0-0000-7000-8000-000000000201",
233821
- * "name": "3D2B 78 m²",
233822
- * "description": null,
233823
- * "bedrooms": 3,
233824
- * "bathrooms": 2,
233825
- * "usable_area_m2": 72.5,
233826
- * "terrace_area_m2": 6,
233827
- * "total_area_m2": 78.5,
233828
- * "floor_plans": [],
233829
- * "renders": [],
233830
- * "tour_360_url": null,
233831
- * "total_units": 24,
233832
- * "available_units": 11,
233833
- * "price": {
233834
- * "currency": "UF",
233835
- * "from": 3450,
233836
- * "to": 3780
233837
- * }
233838
- * }
233839
- * ],
233840
- * "extras": {
233841
- * "parking_available": 8,
233842
- * "storage_available": 5
233843
- * }
233844
- * },
233845
- * "issues": [
234466
+ * "enabled": true,
234467
+ * "enabled_at": "2026-11-20T12:00:00.000Z",
234468
+ * "messaging_account_id": null,
234469
+ * "daily_cap": 200,
234470
+ * "forms": [
233846
234471
  * {
233847
- * "field": "project.brochure_url",
233848
- * "message": "Agrega el brochure del proyecto."
234472
+ * "form_id": "Hk3QpZ8",
234473
+ * "form_name": "Implantes landing",
234474
+ * "treatment_label": "implantes dentales"
233849
234475
  * }
233850
- * ]
234476
+ * ],
234477
+ * "token_hint": "a1b2",
234478
+ * "intake_path": "/api/v1/integrations/gohighlevel-forms"
233851
234479
  * }
233852
234480
  * }
233853
234481
  */
233854
234482
  "application/json": {
233855
- data: components["schemas"]["ToctocProjectPublication"];
234483
+ data: {
234484
+ enabled: boolean;
234485
+ enabled_at: string | null;
234486
+ messaging_account_id: string | null;
234487
+ daily_cap: number;
234488
+ forms: {
234489
+ form_id: string;
234490
+ form_name: string | null;
234491
+ treatment_label: string;
234492
+ }[];
234493
+ token_hint: string | null;
234494
+ intake_path: string;
234495
+ };
233856
234496
  };
233857
234497
  };
233858
234498
  };
@@ -233912,34 +234552,42 @@ interface paths {
233912
234552
  };
233913
234553
  };
233914
234554
  };
234555
+ post?: never;
234556
+ delete?: never;
234557
+ options?: never;
234558
+ head?: never;
234559
+ patch?: never;
234560
+ trace?: never;
234561
+ };
234562
+ "/clinic-form-source/token": {
234563
+ parameters: {
234564
+ query?: never;
234565
+ header?: never;
234566
+ path?: never;
234567
+ cookie?: never;
234568
+ };
234569
+ get?: never;
234570
+ put?: never;
233915
234571
  /**
233916
- * Record where a proyecto stands on TocToc
233917
- * @description Records `draft`, `submitted` (handed to TocToc), `live` or `paused`, and the code TocToc gave the proyecto. `live` needs the code (400 otherwise). Recording a code maps it to the proyecto, so the leads that carry it land on it and those already waiting on it are moved; a code that belongs to another proyecto is refused (400). Requires `marketplace:write`. Only on a workspace that runs the Proyectos module (real-estate vertical, inmobiliaria); any other answers 403 `MODULE_NOT_ENABLED`. Refused (403) to a caller whose role narrows proyectos.
234572
+ * Create or rotate the clinic form intake URL
234573
+ * @description Creates the intake URL, or rotates its token (the previous URL stops working at once). The token is returned ONCE: only its hash is kept. Paste `path` (with the API host) as the URL of the GoHighLevel workflow's Webhook action; no headers or custom body are needed. Requires `tenant:write`. Healthcare workspaces only (any other answers 403 `VERTICAL_NOT_ENABLED`). Creating or rotating the intake URL is withheld from connected apps. A GoHighLevel workflow («form submitted», any form) posts its standard Webhook body to the intake URL; Vitrina answers the patient at once, at any hour, with two approved WhatsApp templates 30 s apart; outside the workspace’s opening hours (`business_hours`, none = always open) the second message is the out-of-hours copy, unless a live AI agent answers the number. A form the map does not know gets the generic second message. A person who got a first contact in the last 24 h, or has an open conversation, gets a private note instead of a new message. Status: `GET /lead-outreach/status?source=clinic_form`.
234574
+ *
234575
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
233918
234576
  */
233919
- put: {
234577
+ post: {
233920
234578
  parameters: {
233921
234579
  query?: never;
233922
- header?: never;
233923
- path: {
233924
- /** @description The proyecto id. */
233925
- id: string;
234580
+ header?: {
234581
+ /** @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. */
234582
+ "Idempotency-Key"?: string;
233926
234583
  };
234584
+ path?: never;
233927
234585
  cookie?: never;
233928
234586
  };
233929
- requestBody?: {
233930
- content: {
233931
- /**
233932
- * @example {
233933
- * "status": "live",
233934
- * "external_ref": "TT-48213"
233935
- * }
233936
- */
233937
- "application/json": components["schemas"]["UpdateToctocPublicationBody"];
233938
- };
233939
- };
234587
+ requestBody?: never;
233940
234588
  responses: {
233941
- /** @description Recorded */
233942
- 200: {
234589
+ /** @description Issued */
234590
+ 201: {
233943
234591
  headers: {
233944
234592
  [name: string]: unknown;
233945
234593
  };
@@ -233947,21 +234595,44 @@ interface paths {
233947
234595
  /**
233948
234596
  * @example {
233949
234597
  * "data": {
233950
- * "id": "0199e3a0-0000-7000-8000-000000000803",
233951
- * "tenant_id": "0199e3a0-0000-7000-8000-0000000000aa",
233952
- * "project_id": "0199e3a0-0000-7000-8000-000000000101",
233953
- * "status": "live",
233954
- * "external_ref": "TT-48213",
233955
- * "notes": null,
233956
- * "submitted_at": "2026-10-20T12:00:00.000Z",
233957
- * "live_at": "2026-10-20T12:00:00.000Z",
233958
- * "created_at": "2026-10-20T12:00:00.000Z",
233959
- * "updated_at": "2026-10-20T12:00:00.000Z"
234598
+ * "source": {
234599
+ * "enabled": true,
234600
+ * "enabled_at": "2026-11-20T12:00:00.000Z",
234601
+ * "messaging_account_id": null,
234602
+ * "daily_cap": 200,
234603
+ * "forms": [
234604
+ * {
234605
+ * "form_id": "Hk3QpZ8",
234606
+ * "form_name": "Implantes landing",
234607
+ * "treatment_label": "implantes dentales"
234608
+ * }
234609
+ * ],
234610
+ * "token_hint": "a1b2",
234611
+ * "intake_path": "/api/v1/integrations/gohighlevel-forms"
234612
+ * },
234613
+ * "token": "ghf_0f3c…a1b2",
234614
+ * "path": "/api/v1/integrations/gohighlevel-forms/ghf_0f3c…a1b2"
233960
234615
  * }
233961
234616
  * }
233962
234617
  */
233963
234618
  "application/json": {
233964
- data: components["schemas"]["ToctocPublication"] & Record<string, never>;
234619
+ data: {
234620
+ source: {
234621
+ enabled: boolean;
234622
+ enabled_at: string | null;
234623
+ messaging_account_id: string | null;
234624
+ daily_cap: number;
234625
+ forms: {
234626
+ form_id: string;
234627
+ form_name: string | null;
234628
+ treatment_label: string;
234629
+ }[];
234630
+ token_hint: string | null;
234631
+ intake_path: string;
234632
+ };
234633
+ token: string;
234634
+ path: string;
234635
+ };
233965
234636
  };
233966
234637
  };
233967
234638
  };
@@ -234021,7 +234692,6 @@ interface paths {
234021
234692
  };
234022
234693
  };
234023
234694
  };
234024
- post?: never;
234025
234695
  delete?: never;
234026
234696
  options?: never;
234027
234697
  head?: never;
@@ -283288,7 +283958,7 @@ interface components {
283288
283958
  BankFeedConnection: {
283289
283959
  id: string;
283290
283960
  /** @enum {string} */
283291
- provider: "fintoc" | "bci_api_market";
283961
+ provider: "fintoc" | "emisso" | "bci_api_market";
283292
283962
  institution_name: string | null;
283293
283963
  holder_name: string | null;
283294
283964
  accounts: {
@@ -283438,7 +284108,7 @@ interface components {
283438
284108
  /** @enum {string} */
283439
284109
  kind: "bank" | "mercado_pago" | "sii";
283440
284110
  /** @enum {string} */
283441
- provider: "fintoc" | "bci_api_market" | "mercadopago" | "sii";
284111
+ provider: "fintoc" | "emisso" | "bci_api_market" | "mercadopago" | "sii";
283442
284112
  institution_name: string | null;
283443
284113
  holder_name: string | null;
283444
284114
  accounts: {
@@ -283495,6 +284165,16 @@ interface components {
283495
284165
  price_clp_per_bank_month: number | null;
283496
284166
  widget_public_key: string | null;
283497
284167
  };
284168
+ /** @description Which provider a NEW direct bank link goes through. `fintoc`: open its widget (`…/fintoc/link-intent`). `emisso`: let the user pick one of `banks`, then open the page from `…/emisso/link-session`. */
284169
+ bank_aggregator: {
284170
+ /** @enum {string} */
284171
+ provider: "fintoc" | "emisso";
284172
+ configured: boolean;
284173
+ banks: {
284174
+ code: string;
284175
+ name: string;
284176
+ }[];
284177
+ };
283498
284178
  stale_after_hours: number;
283499
284179
  manual_sync_min_interval_minutes: number;
283500
284180
  };
@@ -283506,6 +284186,19 @@ interface components {
283506
284186
  exchange_token?: string;
283507
284187
  link_token?: string;
283508
284188
  };
284189
+ FinanzasEmissoLinkSession: {
284190
+ url: string;
284191
+ expires_at: string;
284192
+ bank: string;
284193
+ };
284194
+ FinanzasEmissoLinkSessionBody: {
284195
+ bank?: string;
284196
+ /** Format: uuid */
284197
+ connection_id?: string;
284198
+ };
284199
+ FinanzasEmissoClaim: {
284200
+ connections: components["schemas"]["FinanzasConnection"][];
284201
+ };
283509
284202
  FinanzasBankPullLink: {
283510
284203
  /** Format: uuid */
283511
284204
  id: string;
@@ -284163,7 +284856,7 @@ interface components {
284163
284856
  /** @enum {string} */
284164
284857
  currency: "CLP" | "USD";
284165
284858
  /** @enum {string} */
284166
- source: "fintoc" | "mercado_pago" | "manual";
284859
+ source: "fintoc" | "emisso" | "mercado_pago" | "manual";
284167
284860
  has_feed: boolean;
284168
284861
  balance_clp: number | null;
284169
284862
  balance_original: {