@vitrina/api 17.41.0 → 17.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +412 -0
- package/dist/index.d.ts +412 -0
- package/package.json +1 -1
package/dist/index.d.cts
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: {
|
|
@@ -234286,6 +234288,416 @@ interface paths {
|
|
|
234286
234288
|
patch?: never;
|
|
234287
234289
|
trace?: never;
|
|
234288
234290
|
};
|
|
234291
|
+
"/clinic-form-source": {
|
|
234292
|
+
parameters: {
|
|
234293
|
+
query?: never;
|
|
234294
|
+
header?: never;
|
|
234295
|
+
path?: never;
|
|
234296
|
+
cookie?: never;
|
|
234297
|
+
};
|
|
234298
|
+
/**
|
|
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`.
|
|
234301
|
+
*/
|
|
234302
|
+
get: {
|
|
234303
|
+
parameters: {
|
|
234304
|
+
query?: never;
|
|
234305
|
+
header?: never;
|
|
234306
|
+
path?: never;
|
|
234307
|
+
cookie?: never;
|
|
234308
|
+
};
|
|
234309
|
+
requestBody?: never;
|
|
234310
|
+
responses: {
|
|
234311
|
+
/** @description The source */
|
|
234312
|
+
200: {
|
|
234313
|
+
headers: {
|
|
234314
|
+
[name: string]: unknown;
|
|
234315
|
+
};
|
|
234316
|
+
content: {
|
|
234317
|
+
/**
|
|
234318
|
+
* @example {
|
|
234319
|
+
* "data": {
|
|
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"
|
|
234333
|
+
* }
|
|
234334
|
+
* }
|
|
234335
|
+
*/
|
|
234336
|
+
"application/json": {
|
|
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
|
+
};
|
|
234350
|
+
};
|
|
234351
|
+
};
|
|
234352
|
+
};
|
|
234353
|
+
/** @description Validation error */
|
|
234354
|
+
400: {
|
|
234355
|
+
headers: {
|
|
234356
|
+
[name: string]: unknown;
|
|
234357
|
+
};
|
|
234358
|
+
content: {
|
|
234359
|
+
"application/json": components["schemas"]["Error"];
|
|
234360
|
+
};
|
|
234361
|
+
};
|
|
234362
|
+
/** @description Unauthorized */
|
|
234363
|
+
401: {
|
|
234364
|
+
headers: {
|
|
234365
|
+
[name: string]: unknown;
|
|
234366
|
+
};
|
|
234367
|
+
content: {
|
|
234368
|
+
"application/json": components["schemas"]["Error"];
|
|
234369
|
+
};
|
|
234370
|
+
};
|
|
234371
|
+
/** @description Forbidden */
|
|
234372
|
+
403: {
|
|
234373
|
+
headers: {
|
|
234374
|
+
[name: string]: unknown;
|
|
234375
|
+
};
|
|
234376
|
+
content: {
|
|
234377
|
+
"application/json": components["schemas"]["Error"];
|
|
234378
|
+
};
|
|
234379
|
+
};
|
|
234380
|
+
/** @description Not found */
|
|
234381
|
+
404: {
|
|
234382
|
+
headers: {
|
|
234383
|
+
[name: string]: unknown;
|
|
234384
|
+
};
|
|
234385
|
+
content: {
|
|
234386
|
+
"application/json": components["schemas"]["Error"];
|
|
234387
|
+
};
|
|
234388
|
+
};
|
|
234389
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
234390
|
+
409: {
|
|
234391
|
+
headers: {
|
|
234392
|
+
[name: string]: unknown;
|
|
234393
|
+
};
|
|
234394
|
+
content: {
|
|
234395
|
+
"application/json": components["schemas"]["Error"];
|
|
234396
|
+
};
|
|
234397
|
+
};
|
|
234398
|
+
/** @description Rate limited */
|
|
234399
|
+
429: {
|
|
234400
|
+
headers: {
|
|
234401
|
+
[name: string]: unknown;
|
|
234402
|
+
};
|
|
234403
|
+
content: {
|
|
234404
|
+
"application/json": components["schemas"]["Error"];
|
|
234405
|
+
};
|
|
234406
|
+
};
|
|
234407
|
+
};
|
|
234408
|
+
};
|
|
234409
|
+
/**
|
|
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`.
|
|
234412
|
+
*/
|
|
234413
|
+
put: {
|
|
234414
|
+
parameters: {
|
|
234415
|
+
query?: never;
|
|
234416
|
+
header?: never;
|
|
234417
|
+
path?: never;
|
|
234418
|
+
cookie?: never;
|
|
234419
|
+
};
|
|
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
|
+
};
|
|
234456
|
+
responses: {
|
|
234457
|
+
/** @description Updated */
|
|
234458
|
+
200: {
|
|
234459
|
+
headers: {
|
|
234460
|
+
[name: string]: unknown;
|
|
234461
|
+
};
|
|
234462
|
+
content: {
|
|
234463
|
+
/**
|
|
234464
|
+
* @example {
|
|
234465
|
+
* "data": {
|
|
234466
|
+
* "enabled": true,
|
|
234467
|
+
* "enabled_at": "2026-11-20T12:00:00.000Z",
|
|
234468
|
+
* "messaging_account_id": null,
|
|
234469
|
+
* "daily_cap": 200,
|
|
234470
|
+
* "forms": [
|
|
234471
|
+
* {
|
|
234472
|
+
* "form_id": "Hk3QpZ8",
|
|
234473
|
+
* "form_name": "Implantes landing",
|
|
234474
|
+
* "treatment_label": "implantes dentales"
|
|
234475
|
+
* }
|
|
234476
|
+
* ],
|
|
234477
|
+
* "token_hint": "a1b2",
|
|
234478
|
+
* "intake_path": "/api/v1/integrations/gohighlevel-forms"
|
|
234479
|
+
* }
|
|
234480
|
+
* }
|
|
234481
|
+
*/
|
|
234482
|
+
"application/json": {
|
|
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
|
+
};
|
|
234496
|
+
};
|
|
234497
|
+
};
|
|
234498
|
+
};
|
|
234499
|
+
/** @description Validation error */
|
|
234500
|
+
400: {
|
|
234501
|
+
headers: {
|
|
234502
|
+
[name: string]: unknown;
|
|
234503
|
+
};
|
|
234504
|
+
content: {
|
|
234505
|
+
"application/json": components["schemas"]["Error"];
|
|
234506
|
+
};
|
|
234507
|
+
};
|
|
234508
|
+
/** @description Unauthorized */
|
|
234509
|
+
401: {
|
|
234510
|
+
headers: {
|
|
234511
|
+
[name: string]: unknown;
|
|
234512
|
+
};
|
|
234513
|
+
content: {
|
|
234514
|
+
"application/json": components["schemas"]["Error"];
|
|
234515
|
+
};
|
|
234516
|
+
};
|
|
234517
|
+
/** @description Forbidden */
|
|
234518
|
+
403: {
|
|
234519
|
+
headers: {
|
|
234520
|
+
[name: string]: unknown;
|
|
234521
|
+
};
|
|
234522
|
+
content: {
|
|
234523
|
+
"application/json": components["schemas"]["Error"];
|
|
234524
|
+
};
|
|
234525
|
+
};
|
|
234526
|
+
/** @description Not found */
|
|
234527
|
+
404: {
|
|
234528
|
+
headers: {
|
|
234529
|
+
[name: string]: unknown;
|
|
234530
|
+
};
|
|
234531
|
+
content: {
|
|
234532
|
+
"application/json": components["schemas"]["Error"];
|
|
234533
|
+
};
|
|
234534
|
+
};
|
|
234535
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
234536
|
+
409: {
|
|
234537
|
+
headers: {
|
|
234538
|
+
[name: string]: unknown;
|
|
234539
|
+
};
|
|
234540
|
+
content: {
|
|
234541
|
+
"application/json": components["schemas"]["Error"];
|
|
234542
|
+
};
|
|
234543
|
+
};
|
|
234544
|
+
/** @description Rate limited */
|
|
234545
|
+
429: {
|
|
234546
|
+
headers: {
|
|
234547
|
+
[name: string]: unknown;
|
|
234548
|
+
};
|
|
234549
|
+
content: {
|
|
234550
|
+
"application/json": components["schemas"]["Error"];
|
|
234551
|
+
};
|
|
234552
|
+
};
|
|
234553
|
+
};
|
|
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;
|
|
234571
|
+
/**
|
|
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.
|
|
234576
|
+
*/
|
|
234577
|
+
post: {
|
|
234578
|
+
parameters: {
|
|
234579
|
+
query?: never;
|
|
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;
|
|
234583
|
+
};
|
|
234584
|
+
path?: never;
|
|
234585
|
+
cookie?: never;
|
|
234586
|
+
};
|
|
234587
|
+
requestBody?: never;
|
|
234588
|
+
responses: {
|
|
234589
|
+
/** @description Issued */
|
|
234590
|
+
201: {
|
|
234591
|
+
headers: {
|
|
234592
|
+
[name: string]: unknown;
|
|
234593
|
+
};
|
|
234594
|
+
content: {
|
|
234595
|
+
/**
|
|
234596
|
+
* @example {
|
|
234597
|
+
* "data": {
|
|
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"
|
|
234615
|
+
* }
|
|
234616
|
+
* }
|
|
234617
|
+
*/
|
|
234618
|
+
"application/json": {
|
|
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
|
+
};
|
|
234636
|
+
};
|
|
234637
|
+
};
|
|
234638
|
+
};
|
|
234639
|
+
/** @description Validation error */
|
|
234640
|
+
400: {
|
|
234641
|
+
headers: {
|
|
234642
|
+
[name: string]: unknown;
|
|
234643
|
+
};
|
|
234644
|
+
content: {
|
|
234645
|
+
"application/json": components["schemas"]["Error"];
|
|
234646
|
+
};
|
|
234647
|
+
};
|
|
234648
|
+
/** @description Unauthorized */
|
|
234649
|
+
401: {
|
|
234650
|
+
headers: {
|
|
234651
|
+
[name: string]: unknown;
|
|
234652
|
+
};
|
|
234653
|
+
content: {
|
|
234654
|
+
"application/json": components["schemas"]["Error"];
|
|
234655
|
+
};
|
|
234656
|
+
};
|
|
234657
|
+
/** @description Forbidden */
|
|
234658
|
+
403: {
|
|
234659
|
+
headers: {
|
|
234660
|
+
[name: string]: unknown;
|
|
234661
|
+
};
|
|
234662
|
+
content: {
|
|
234663
|
+
"application/json": components["schemas"]["Error"];
|
|
234664
|
+
};
|
|
234665
|
+
};
|
|
234666
|
+
/** @description Not found */
|
|
234667
|
+
404: {
|
|
234668
|
+
headers: {
|
|
234669
|
+
[name: string]: unknown;
|
|
234670
|
+
};
|
|
234671
|
+
content: {
|
|
234672
|
+
"application/json": components["schemas"]["Error"];
|
|
234673
|
+
};
|
|
234674
|
+
};
|
|
234675
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
234676
|
+
409: {
|
|
234677
|
+
headers: {
|
|
234678
|
+
[name: string]: unknown;
|
|
234679
|
+
};
|
|
234680
|
+
content: {
|
|
234681
|
+
"application/json": components["schemas"]["Error"];
|
|
234682
|
+
};
|
|
234683
|
+
};
|
|
234684
|
+
/** @description Rate limited */
|
|
234685
|
+
429: {
|
|
234686
|
+
headers: {
|
|
234687
|
+
[name: string]: unknown;
|
|
234688
|
+
};
|
|
234689
|
+
content: {
|
|
234690
|
+
"application/json": components["schemas"]["Error"];
|
|
234691
|
+
};
|
|
234692
|
+
};
|
|
234693
|
+
};
|
|
234694
|
+
};
|
|
234695
|
+
delete?: never;
|
|
234696
|
+
options?: never;
|
|
234697
|
+
head?: never;
|
|
234698
|
+
patch?: never;
|
|
234699
|
+
trace?: never;
|
|
234700
|
+
};
|
|
234289
234701
|
"/units": {
|
|
234290
234702
|
parameters: {
|
|
234291
234703
|
query?: never;
|
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: {
|
|
@@ -234286,6 +234288,416 @@ interface paths {
|
|
|
234286
234288
|
patch?: never;
|
|
234287
234289
|
trace?: never;
|
|
234288
234290
|
};
|
|
234291
|
+
"/clinic-form-source": {
|
|
234292
|
+
parameters: {
|
|
234293
|
+
query?: never;
|
|
234294
|
+
header?: never;
|
|
234295
|
+
path?: never;
|
|
234296
|
+
cookie?: never;
|
|
234297
|
+
};
|
|
234298
|
+
/**
|
|
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`.
|
|
234301
|
+
*/
|
|
234302
|
+
get: {
|
|
234303
|
+
parameters: {
|
|
234304
|
+
query?: never;
|
|
234305
|
+
header?: never;
|
|
234306
|
+
path?: never;
|
|
234307
|
+
cookie?: never;
|
|
234308
|
+
};
|
|
234309
|
+
requestBody?: never;
|
|
234310
|
+
responses: {
|
|
234311
|
+
/** @description The source */
|
|
234312
|
+
200: {
|
|
234313
|
+
headers: {
|
|
234314
|
+
[name: string]: unknown;
|
|
234315
|
+
};
|
|
234316
|
+
content: {
|
|
234317
|
+
/**
|
|
234318
|
+
* @example {
|
|
234319
|
+
* "data": {
|
|
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"
|
|
234333
|
+
* }
|
|
234334
|
+
* }
|
|
234335
|
+
*/
|
|
234336
|
+
"application/json": {
|
|
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
|
+
};
|
|
234350
|
+
};
|
|
234351
|
+
};
|
|
234352
|
+
};
|
|
234353
|
+
/** @description Validation error */
|
|
234354
|
+
400: {
|
|
234355
|
+
headers: {
|
|
234356
|
+
[name: string]: unknown;
|
|
234357
|
+
};
|
|
234358
|
+
content: {
|
|
234359
|
+
"application/json": components["schemas"]["Error"];
|
|
234360
|
+
};
|
|
234361
|
+
};
|
|
234362
|
+
/** @description Unauthorized */
|
|
234363
|
+
401: {
|
|
234364
|
+
headers: {
|
|
234365
|
+
[name: string]: unknown;
|
|
234366
|
+
};
|
|
234367
|
+
content: {
|
|
234368
|
+
"application/json": components["schemas"]["Error"];
|
|
234369
|
+
};
|
|
234370
|
+
};
|
|
234371
|
+
/** @description Forbidden */
|
|
234372
|
+
403: {
|
|
234373
|
+
headers: {
|
|
234374
|
+
[name: string]: unknown;
|
|
234375
|
+
};
|
|
234376
|
+
content: {
|
|
234377
|
+
"application/json": components["schemas"]["Error"];
|
|
234378
|
+
};
|
|
234379
|
+
};
|
|
234380
|
+
/** @description Not found */
|
|
234381
|
+
404: {
|
|
234382
|
+
headers: {
|
|
234383
|
+
[name: string]: unknown;
|
|
234384
|
+
};
|
|
234385
|
+
content: {
|
|
234386
|
+
"application/json": components["schemas"]["Error"];
|
|
234387
|
+
};
|
|
234388
|
+
};
|
|
234389
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
234390
|
+
409: {
|
|
234391
|
+
headers: {
|
|
234392
|
+
[name: string]: unknown;
|
|
234393
|
+
};
|
|
234394
|
+
content: {
|
|
234395
|
+
"application/json": components["schemas"]["Error"];
|
|
234396
|
+
};
|
|
234397
|
+
};
|
|
234398
|
+
/** @description Rate limited */
|
|
234399
|
+
429: {
|
|
234400
|
+
headers: {
|
|
234401
|
+
[name: string]: unknown;
|
|
234402
|
+
};
|
|
234403
|
+
content: {
|
|
234404
|
+
"application/json": components["schemas"]["Error"];
|
|
234405
|
+
};
|
|
234406
|
+
};
|
|
234407
|
+
};
|
|
234408
|
+
};
|
|
234409
|
+
/**
|
|
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`.
|
|
234412
|
+
*/
|
|
234413
|
+
put: {
|
|
234414
|
+
parameters: {
|
|
234415
|
+
query?: never;
|
|
234416
|
+
header?: never;
|
|
234417
|
+
path?: never;
|
|
234418
|
+
cookie?: never;
|
|
234419
|
+
};
|
|
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
|
+
};
|
|
234456
|
+
responses: {
|
|
234457
|
+
/** @description Updated */
|
|
234458
|
+
200: {
|
|
234459
|
+
headers: {
|
|
234460
|
+
[name: string]: unknown;
|
|
234461
|
+
};
|
|
234462
|
+
content: {
|
|
234463
|
+
/**
|
|
234464
|
+
* @example {
|
|
234465
|
+
* "data": {
|
|
234466
|
+
* "enabled": true,
|
|
234467
|
+
* "enabled_at": "2026-11-20T12:00:00.000Z",
|
|
234468
|
+
* "messaging_account_id": null,
|
|
234469
|
+
* "daily_cap": 200,
|
|
234470
|
+
* "forms": [
|
|
234471
|
+
* {
|
|
234472
|
+
* "form_id": "Hk3QpZ8",
|
|
234473
|
+
* "form_name": "Implantes landing",
|
|
234474
|
+
* "treatment_label": "implantes dentales"
|
|
234475
|
+
* }
|
|
234476
|
+
* ],
|
|
234477
|
+
* "token_hint": "a1b2",
|
|
234478
|
+
* "intake_path": "/api/v1/integrations/gohighlevel-forms"
|
|
234479
|
+
* }
|
|
234480
|
+
* }
|
|
234481
|
+
*/
|
|
234482
|
+
"application/json": {
|
|
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
|
+
};
|
|
234496
|
+
};
|
|
234497
|
+
};
|
|
234498
|
+
};
|
|
234499
|
+
/** @description Validation error */
|
|
234500
|
+
400: {
|
|
234501
|
+
headers: {
|
|
234502
|
+
[name: string]: unknown;
|
|
234503
|
+
};
|
|
234504
|
+
content: {
|
|
234505
|
+
"application/json": components["schemas"]["Error"];
|
|
234506
|
+
};
|
|
234507
|
+
};
|
|
234508
|
+
/** @description Unauthorized */
|
|
234509
|
+
401: {
|
|
234510
|
+
headers: {
|
|
234511
|
+
[name: string]: unknown;
|
|
234512
|
+
};
|
|
234513
|
+
content: {
|
|
234514
|
+
"application/json": components["schemas"]["Error"];
|
|
234515
|
+
};
|
|
234516
|
+
};
|
|
234517
|
+
/** @description Forbidden */
|
|
234518
|
+
403: {
|
|
234519
|
+
headers: {
|
|
234520
|
+
[name: string]: unknown;
|
|
234521
|
+
};
|
|
234522
|
+
content: {
|
|
234523
|
+
"application/json": components["schemas"]["Error"];
|
|
234524
|
+
};
|
|
234525
|
+
};
|
|
234526
|
+
/** @description Not found */
|
|
234527
|
+
404: {
|
|
234528
|
+
headers: {
|
|
234529
|
+
[name: string]: unknown;
|
|
234530
|
+
};
|
|
234531
|
+
content: {
|
|
234532
|
+
"application/json": components["schemas"]["Error"];
|
|
234533
|
+
};
|
|
234534
|
+
};
|
|
234535
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
234536
|
+
409: {
|
|
234537
|
+
headers: {
|
|
234538
|
+
[name: string]: unknown;
|
|
234539
|
+
};
|
|
234540
|
+
content: {
|
|
234541
|
+
"application/json": components["schemas"]["Error"];
|
|
234542
|
+
};
|
|
234543
|
+
};
|
|
234544
|
+
/** @description Rate limited */
|
|
234545
|
+
429: {
|
|
234546
|
+
headers: {
|
|
234547
|
+
[name: string]: unknown;
|
|
234548
|
+
};
|
|
234549
|
+
content: {
|
|
234550
|
+
"application/json": components["schemas"]["Error"];
|
|
234551
|
+
};
|
|
234552
|
+
};
|
|
234553
|
+
};
|
|
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;
|
|
234571
|
+
/**
|
|
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.
|
|
234576
|
+
*/
|
|
234577
|
+
post: {
|
|
234578
|
+
parameters: {
|
|
234579
|
+
query?: never;
|
|
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;
|
|
234583
|
+
};
|
|
234584
|
+
path?: never;
|
|
234585
|
+
cookie?: never;
|
|
234586
|
+
};
|
|
234587
|
+
requestBody?: never;
|
|
234588
|
+
responses: {
|
|
234589
|
+
/** @description Issued */
|
|
234590
|
+
201: {
|
|
234591
|
+
headers: {
|
|
234592
|
+
[name: string]: unknown;
|
|
234593
|
+
};
|
|
234594
|
+
content: {
|
|
234595
|
+
/**
|
|
234596
|
+
* @example {
|
|
234597
|
+
* "data": {
|
|
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"
|
|
234615
|
+
* }
|
|
234616
|
+
* }
|
|
234617
|
+
*/
|
|
234618
|
+
"application/json": {
|
|
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
|
+
};
|
|
234636
|
+
};
|
|
234637
|
+
};
|
|
234638
|
+
};
|
|
234639
|
+
/** @description Validation error */
|
|
234640
|
+
400: {
|
|
234641
|
+
headers: {
|
|
234642
|
+
[name: string]: unknown;
|
|
234643
|
+
};
|
|
234644
|
+
content: {
|
|
234645
|
+
"application/json": components["schemas"]["Error"];
|
|
234646
|
+
};
|
|
234647
|
+
};
|
|
234648
|
+
/** @description Unauthorized */
|
|
234649
|
+
401: {
|
|
234650
|
+
headers: {
|
|
234651
|
+
[name: string]: unknown;
|
|
234652
|
+
};
|
|
234653
|
+
content: {
|
|
234654
|
+
"application/json": components["schemas"]["Error"];
|
|
234655
|
+
};
|
|
234656
|
+
};
|
|
234657
|
+
/** @description Forbidden */
|
|
234658
|
+
403: {
|
|
234659
|
+
headers: {
|
|
234660
|
+
[name: string]: unknown;
|
|
234661
|
+
};
|
|
234662
|
+
content: {
|
|
234663
|
+
"application/json": components["schemas"]["Error"];
|
|
234664
|
+
};
|
|
234665
|
+
};
|
|
234666
|
+
/** @description Not found */
|
|
234667
|
+
404: {
|
|
234668
|
+
headers: {
|
|
234669
|
+
[name: string]: unknown;
|
|
234670
|
+
};
|
|
234671
|
+
content: {
|
|
234672
|
+
"application/json": components["schemas"]["Error"];
|
|
234673
|
+
};
|
|
234674
|
+
};
|
|
234675
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
234676
|
+
409: {
|
|
234677
|
+
headers: {
|
|
234678
|
+
[name: string]: unknown;
|
|
234679
|
+
};
|
|
234680
|
+
content: {
|
|
234681
|
+
"application/json": components["schemas"]["Error"];
|
|
234682
|
+
};
|
|
234683
|
+
};
|
|
234684
|
+
/** @description Rate limited */
|
|
234685
|
+
429: {
|
|
234686
|
+
headers: {
|
|
234687
|
+
[name: string]: unknown;
|
|
234688
|
+
};
|
|
234689
|
+
content: {
|
|
234690
|
+
"application/json": components["schemas"]["Error"];
|
|
234691
|
+
};
|
|
234692
|
+
};
|
|
234693
|
+
};
|
|
234694
|
+
};
|
|
234695
|
+
delete?: never;
|
|
234696
|
+
options?: never;
|
|
234697
|
+
head?: never;
|
|
234698
|
+
patch?: never;
|
|
234699
|
+
trace?: never;
|
|
234700
|
+
};
|
|
234289
234701
|
"/units": {
|
|
234290
234702
|
parameters: {
|
|
234291
234703
|
query?: never;
|
package/package.json
CHANGED