@vitrina/api 14.105.2 → 14.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +177 -6
- package/dist/index.d.ts +177 -6
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -15502,7 +15502,7 @@ interface paths {
|
|
|
15502
15502
|
};
|
|
15503
15503
|
/**
|
|
15504
15504
|
* Read the channel AI availability policy and current status
|
|
15505
|
-
* @description Returns the per-channel coverage clock and its current evaluation. Schedule availability does not override agent assignment, channel kill switches, or a human takeover. An account without a saved policy reports `configured: false` and preserves the legacy always-eligible schedule. `policy.timezone` and `status.effective_timezone` report the server-resolved clock inherited from General settings or selected business hours. `policy.human_silence_resume` and `policy.handoff_renotify` are always present in the response with defaults applied (resume: enabled, 30 minutes; re-notify: disabled, 30 minutes once enabled).
|
|
15505
|
+
* @description Returns the per-channel coverage clock and its current evaluation. Schedule availability does not override agent assignment, channel kill switches, or a human takeover. An account without a saved policy reports `configured: false` and preserves the legacy always-eligible schedule. `policy.timezone` and `status.effective_timezone` report the server-resolved clock inherited from General settings or selected business hours. `policy.human_silence_resume` and `policy.handoff_renotify` are always present in the response with defaults applied (resume: enabled, 30 minutes; re-notify: disabled, 30 minutes once enabled). `human_silence_resume` is RETIRED: since 2026-10-25 a conversation a person handles is silent until «Devolver a la IA», so the channel switch no longer makes the AI answer. Whether the AI answers a waiting customer is the workspace setting `after_handoff.ai_answers_waiting` (GET /followups/recontacto), for every tenant.
|
|
15506
15506
|
*/
|
|
15507
15507
|
get: {
|
|
15508
15508
|
parameters: {
|
|
@@ -15624,7 +15624,7 @@ interface paths {
|
|
|
15624
15624
|
head?: never;
|
|
15625
15625
|
/**
|
|
15626
15626
|
* Set the channel AI availability policy
|
|
15627
|
-
* @description Persists an always, outside-business-hours, or custom weekly schedule. Custom windows may cross midnight; overlapping windows are rejected. Custom schedules inherit General timezone, then workspace business-hours timezone, then America/Santiago. The optional legacy timezone field is accepted for compatibility and normalized by the server. Outside-business-hours mode requires configured workspace or tenant-owned team hours. The follow-through rules are optional: `human_silence_resume` (
|
|
15627
|
+
* @description Persists an always, outside-business-hours, or custom weekly schedule. Custom windows may cross midnight; overlapping windows are rejected. Custom schedules inherit General timezone, then workspace business-hours timezone, then America/Santiago. The optional legacy timezone field is accepted for compatibility and normalized by the server. Outside-business-hours mode requires configured workspace or tenant-owned team hours. The follow-through rules are optional: `human_silence_resume` (retired: accepted and stored for compatibility, it does nothing; use `after_handoff.ai_answers_waiting` on PUT /followups/recontacto) and `handoff_renotify` (after an AI handoff, re-notify the team every N minutes while the customer waits). Omitting either keeps the value already saved on the channel.
|
|
15628
15628
|
*/
|
|
15629
15629
|
patch: {
|
|
15630
15630
|
parameters: {
|
|
@@ -15671,7 +15671,7 @@ interface paths {
|
|
|
15671
15671
|
start: string;
|
|
15672
15672
|
end: string;
|
|
15673
15673
|
}[];
|
|
15674
|
-
/** @description
|
|
15674
|
+
/** @description RETIRED (2026-10-25): a conversation a person handles is silent until «Devolver a la IA», so this switch no longer makes the AI answer. It is accepted and stored for compatibility only. Whether the AI answers a waiting customer is `after_handoff.ai_answers_waiting` on `/followups/recontacto`. Absent = enabled, 30 minutes. */
|
|
15675
15675
|
human_silence_resume?: {
|
|
15676
15676
|
enabled: boolean;
|
|
15677
15677
|
minutes: number;
|
|
@@ -136646,7 +136646,7 @@ interface paths {
|
|
|
136646
136646
|
};
|
|
136647
136647
|
/**
|
|
136648
136648
|
* What a customer who stops answering receives (simulated)
|
|
136649
|
-
* @description The «Si no responde» ladder, computed by the engine itself: a synthetic lead is stepped along the sweeps’ clocks (hourly for the lead rails, every 15 minutes for the chat rows, only inside contact hours) through the real decision function and pacing holds, so every row’s `at` is when the engine would actually send it. `scenarios` holds `conversed` («Conversó y dejó de responder»: chat rows, then the WhatsApp/email/call rows, both counted from t0), `never_replied` («Nunca respondió nuestro primer mensaje»: t0 is our first message; the lost rail is never reached) and `lost` («Ya está perdido», counted from the loss); `?scenario=` returns just one. `start` is t0 (default now); `start_options` are the example clock’s picks. A moved row carries `deferred_code` (`outside_contact_hours`, `previous_late`, `unanswered_hold`, `min_gap`, `max_per_day`, `automated_gap`, `person_ceiling`, `daily_cap`) with its sentence, and `deferred_codes` lists every reason that moved it, and `hot_at` when R6 moves it for a hot lead; a drawn step the engine never sends has `sends: false` and `not_sent_reason`. Also: `header_sentence`, each scenario’s hero `sentence`, `pacing_summary` (the collapsed «Ritmo» line: the rules that are on) and `pacing` (every «Ritmo» rule R1–R13 with `on` and `value`), `limits_sentence` (every bound on what one person can receive, with the workspace values), row `warnings` for the editor (a first contact under 12 h, approval rows’ real send rate, Instagram past 24 h), `guards` from the registry (G21 `highlight` when a sweep hit its candidate ceiling in the last 24 h), `approval_fallback.available` (false for a clinic whose clinical response times are undeclared; `hours` is R11), `today` (sent, not sent, went to approval, awaiting approval, and the R8 counter `would_need_approval` of `due`, `failed` (follow-ups sent today that did not arrive) and `failed_actionable` (of those, the ones a person can retry or fix; never a number WhatsApp cannot deliver to), and `cap`: what the day used of the daily cap and the AI review budget, the spent one in `reached` with its `sentence` and `resumes_at`; while one is spent, rows at «now» that fall today move to tomorrow with `deferred_code: daily_cap`; and `backlog`, the whole queue’s drain: `queued`, `per_day`, `days` (first to last estimated release, inclusive), `last_release_on` and `sentence` «En cola: N, se reparte en ~D días (hasta el …)», null when nothing is queued) and `queue` (each queued backlog step’s estimated release day, 10 per tenant per day; `contact_id` or `lead_id` narrows it), and `after_handoff` («Después de pasarlo a una persona»: `followups`, `auto_send_after_hours`, `ai_answers_waiting_after_hours`, `reminder_minutes` and the block’s collapsed line `summary`, `controls` (which of `followups`, `auto_send_after_hours`, `ai_answers_waiting_after_hours` do anything here: the AI-answer control is false at a clinic, where D73 and the teammate-reply resume run instead), and `now`, the live state: `conversations` with the team after an AI handoff or a teammate takeover, `by_class` (`informational`, `operational`, `sensitive`, and `takeover` for chats a teammate took without a handoff), `drafts` (waiting in «Por aprobar
|
|
136649
|
+
* @description The «Si no responde» ladder, computed by the engine itself: a synthetic lead is stepped along the sweeps’ clocks (hourly for the lead rails, every 15 minutes for the chat rows, only inside contact hours) through the real decision function and pacing holds, so every row’s `at` is when the engine would actually send it. `scenarios` holds `conversed` («Conversó y dejó de responder»: chat rows, then the WhatsApp/email/call rows, both counted from t0), `never_replied` («Nunca respondió nuestro primer mensaje»: t0 is our first message; the lost rail is never reached) and `lost` («Ya está perdido», counted from the loss); `?scenario=` returns just one. `start` is t0 (default now); `start_options` are the example clock’s picks. A moved row carries `deferred_code` (`outside_contact_hours`, `previous_late`, `unanswered_hold`, `min_gap`, `max_per_day`, `automated_gap`, `person_ceiling`, `daily_cap`) with its sentence, and `deferred_codes` lists every reason that moved it, and `hot_at` when R6 moves it for a hot lead; a drawn step the engine never sends has `sends: false` and `not_sent_reason`. Also: `header_sentence`, each scenario’s hero `sentence`, `pacing_summary` (the collapsed «Ritmo» line: the rules that are on) and `pacing` (every «Ritmo» rule R1–R13 with `on` and `value`), `limits_sentence` (every bound on what one person can receive, with the workspace values), row `warnings` for the editor (a first contact under 12 h, approval rows’ real send rate, Instagram past 24 h), `guards` from the registry (G21 `highlight` when a sweep hit its candidate ceiling in the last 24 h), `approval_fallback.available` (false for a clinic whose clinical response times are undeclared; `hours` is R11), `today` (sent, not sent, went to approval, awaiting approval, and the R8 counter `would_need_approval` of `due`, `failed` (follow-ups sent today that did not arrive) and `failed_actionable` (of those, the ones a person can retry or fix; never a number WhatsApp cannot deliver to), and `cap`: what the day used of the daily cap and the AI review budget, the spent one in `reached` with its `sentence` and `resumes_at`; while one is spent, rows at «now» that fall today move to tomorrow with `deferred_code: daily_cap`; and `backlog`, the whole queue’s drain: `queued`, `per_day`, `days` (first to last estimated release, inclusive), `last_release_on` and `sentence` «En cola: N, se reparte en ~D días (hasta el …)», null when nothing is queued) and `queue` (each queued backlog step’s estimated release day, 10 per tenant per day; `contact_id` or `lead_id` narrows it), and `after_handoff` («Después de pasarlo a una persona»: `followups`, `auto_send_after_hours`, `ai_answers_waiting_after_hours`, `reminder_minutes` and the block’s collapsed line `summary`, `controls` (which of `followups`, `auto_send_after_hours`, `ai_answers_waiting_after_hours` do anything here: the AI-answer control is false at a clinic, where D73 and the teammate-reply resume run instead), and `now`, the live state: `conversations` with the team after an AI handoff or a teammate takeover, `by_class` (`informational`, `operational`, `sensitive`, and `takeover` for chats a teammate took without a handoff), `drafts` (waiting in «Por aprobar»: only drafts whose action is still awaiting approval; a rejected one leaves at once), `upcoming_drafts` («Próximos borradores»: people whose next step is a draft not written yet), `drafts_self_sending`, `customers_waiting`, the fact line `sentence` and `people` (one per conversation: `contact_id`, `contact_name`, `conversation_id`, `conversation_display_id`, `owner_user_id`, `owner_name`, `class`, `trigger` (`ai_handoff` | `teammate`), `has_draft`, `draft_auto_send_at`, `draft_auto_send_at_label`, `waiting_since`, `waited_hours`, `waited_label`, `promise_overdue`, `promise_label`, `next` (`kind` `draft` | `step` | `held` | `none`, `at_label`, `label`: the next step as one short fact, from the same facts as `sentence`), `sentence`; a broken promise sorts first), `truncated`; null when the read failed). `today.not_sent` counts people with a step that ended without a send today and no send at all today. All copy is in `lang` (default the workspace’s). `after_handoff_now=false` leaves `after_handoff.now` null (read it from `/followups/recontacto/plan/after-handoff`).
|
|
136650
136650
|
*/
|
|
136651
136651
|
get: {
|
|
136652
136652
|
parameters: {
|
|
@@ -136656,6 +136656,7 @@ interface paths {
|
|
|
136656
136656
|
lang?: "es" | "en";
|
|
136657
136657
|
contact_id?: string;
|
|
136658
136658
|
lead_id?: string;
|
|
136659
|
+
after_handoff_now?: "true" | "false";
|
|
136659
136660
|
};
|
|
136660
136661
|
header?: never;
|
|
136661
136662
|
path?: never;
|
|
@@ -136826,6 +136827,7 @@ interface paths {
|
|
|
136826
136827
|
* "takeover": 0
|
|
136827
136828
|
* },
|
|
136828
136829
|
* "drafts": 1,
|
|
136830
|
+
* "upcoming_drafts": 0,
|
|
136829
136831
|
* "drafts_self_sending": 1,
|
|
136830
136832
|
* "customers_waiting": 0,
|
|
136831
136833
|
* "sentence": "Ahora: 2 conversaciones con el equipo · 1 borrador por enviarse solo",
|
|
@@ -136994,6 +136996,175 @@ interface paths {
|
|
|
136994
136996
|
patch?: never;
|
|
136995
136997
|
trace?: never;
|
|
136996
136998
|
};
|
|
136999
|
+
"/followups/recontacto/plan/after-handoff": {
|
|
137000
|
+
parameters: {
|
|
137001
|
+
query?: never;
|
|
137002
|
+
header?: never;
|
|
137003
|
+
path?: never;
|
|
137004
|
+
cookie?: never;
|
|
137005
|
+
};
|
|
137006
|
+
/**
|
|
137007
|
+
* The «Ahora» block of the plan, on its own
|
|
137008
|
+
* @description Exactly the plan’s `after_handoff.now`: the open conversations with the team now (`conversations`, `drafts_self_sending`, `customers_waiting`, `by_class`, `sentence`, `people`, `truncated`), or null when the read failed. It costs one next-step read per handed-off person, so a screen asks `/followups/recontacto/plan?after_handoff_now=false` and reads this block separately. `lang` picks es or en (default the workspace’s).
|
|
137009
|
+
*/
|
|
137010
|
+
get: {
|
|
137011
|
+
parameters: {
|
|
137012
|
+
query?: {
|
|
137013
|
+
lang?: "es" | "en";
|
|
137014
|
+
};
|
|
137015
|
+
header?: never;
|
|
137016
|
+
path?: never;
|
|
137017
|
+
cookie?: never;
|
|
137018
|
+
};
|
|
137019
|
+
requestBody?: never;
|
|
137020
|
+
responses: {
|
|
137021
|
+
/** @description The «Ahora» block */
|
|
137022
|
+
200: {
|
|
137023
|
+
headers: {
|
|
137024
|
+
[name: string]: unknown;
|
|
137025
|
+
};
|
|
137026
|
+
content: {
|
|
137027
|
+
/**
|
|
137028
|
+
* @example {
|
|
137029
|
+
* "data": {
|
|
137030
|
+
* "conversations": 2,
|
|
137031
|
+
* "by_class": {
|
|
137032
|
+
* "informational": 1,
|
|
137033
|
+
* "operational": 1,
|
|
137034
|
+
* "sensitive": 0,
|
|
137035
|
+
* "takeover": 0
|
|
137036
|
+
* },
|
|
137037
|
+
* "drafts": 1,
|
|
137038
|
+
* "upcoming_drafts": 0,
|
|
137039
|
+
* "drafts_self_sending": 1,
|
|
137040
|
+
* "customers_waiting": 0,
|
|
137041
|
+
* "sentence": "Ahora: 2 conversaciones con el equipo · 1 borrador por enviarse solo",
|
|
137042
|
+
* "people": [
|
|
137043
|
+
* {
|
|
137044
|
+
* "contact_id": "3f1c2b4a-5d6e-4f70-8a91-b2c3d4e5f607",
|
|
137045
|
+
* "contact_name": "Nando",
|
|
137046
|
+
* "conversation_id": "01a1639b-75bf-79d7-8e5a-93c5000d6319",
|
|
137047
|
+
* "conversation_display_id": "C-363",
|
|
137048
|
+
* "owner_user_id": "829e61ea-2cb9-43dc-80fd-18baf78eaaed",
|
|
137049
|
+
* "owner_name": "Diego Navarrete",
|
|
137050
|
+
* "class": "informational",
|
|
137051
|
+
* "trigger": "ai_handoff",
|
|
137052
|
+
* "has_draft": true,
|
|
137053
|
+
* "draft_auto_send_at": "2026-10-25T16:30:00-03:00",
|
|
137054
|
+
* "draft_auto_send_at_label": "mañana 16:30",
|
|
137055
|
+
* "waiting_since": null,
|
|
137056
|
+
* "waited_hours": null,
|
|
137057
|
+
* "waited_label": null,
|
|
137058
|
+
* "promise_overdue": false,
|
|
137059
|
+
* "promise_label": null,
|
|
137060
|
+
* "next": {
|
|
137061
|
+
* "kind": "draft",
|
|
137062
|
+
* "at_label": "mañana 16:30",
|
|
137063
|
+
* "label": "borrador · mañana 16:30"
|
|
137064
|
+
* },
|
|
137065
|
+
* "sentence": "Lo atiende Diego Navarrete · borrador listo · se envía solo mañana 16:30 si nadie lo revisa"
|
|
137066
|
+
* },
|
|
137067
|
+
* {
|
|
137068
|
+
* "contact_id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
|
|
137069
|
+
* "contact_name": "Karen Olguin",
|
|
137070
|
+
* "conversation_id": "01a16d2e-9f3a-7b1c-8d2e-3f4a5b6c7d8e",
|
|
137071
|
+
* "conversation_display_id": "C-384",
|
|
137072
|
+
* "owner_user_id": "829e61ea-2cb9-43dc-80fd-18baf78eaaed",
|
|
137073
|
+
* "owner_name": "Diego Navarrete",
|
|
137074
|
+
* "class": "operational",
|
|
137075
|
+
* "trigger": "ai_handoff",
|
|
137076
|
+
* "has_draft": false,
|
|
137077
|
+
* "draft_auto_send_at": null,
|
|
137078
|
+
* "draft_auto_send_at_label": null,
|
|
137079
|
+
* "waiting_since": null,
|
|
137080
|
+
* "waited_hours": null,
|
|
137081
|
+
* "waited_label": null,
|
|
137082
|
+
* "promise_overdue": true,
|
|
137083
|
+
* "promise_label": "el vie 23 desde las 10:00 (no se cumplió)",
|
|
137084
|
+
* "next": {
|
|
137085
|
+
* "kind": "none",
|
|
137086
|
+
* "at_label": null,
|
|
137087
|
+
* "label": "le toca a Diego"
|
|
137088
|
+
* },
|
|
137089
|
+
* "sentence": "Lo atiende Diego · algo que solo puede hacer el equipo: la IA no escribe sola · La IA prometió que le escribirían el vie 23 desde las 10:00 (no se cumplió)"
|
|
137090
|
+
* }
|
|
137091
|
+
* ],
|
|
137092
|
+
* "truncated": false
|
|
137093
|
+
* }
|
|
137094
|
+
* }
|
|
137095
|
+
*/
|
|
137096
|
+
"application/json": {
|
|
137097
|
+
data?: unknown;
|
|
137098
|
+
meta?: {
|
|
137099
|
+
[key: string]: unknown;
|
|
137100
|
+
};
|
|
137101
|
+
};
|
|
137102
|
+
};
|
|
137103
|
+
};
|
|
137104
|
+
/** @description Validation error */
|
|
137105
|
+
400: {
|
|
137106
|
+
headers: {
|
|
137107
|
+
[name: string]: unknown;
|
|
137108
|
+
};
|
|
137109
|
+
content: {
|
|
137110
|
+
"application/json": components["schemas"]["Error"];
|
|
137111
|
+
};
|
|
137112
|
+
};
|
|
137113
|
+
/** @description Unauthorized */
|
|
137114
|
+
401: {
|
|
137115
|
+
headers: {
|
|
137116
|
+
[name: string]: unknown;
|
|
137117
|
+
};
|
|
137118
|
+
content: {
|
|
137119
|
+
"application/json": components["schemas"]["Error"];
|
|
137120
|
+
};
|
|
137121
|
+
};
|
|
137122
|
+
/** @description Forbidden */
|
|
137123
|
+
403: {
|
|
137124
|
+
headers: {
|
|
137125
|
+
[name: string]: unknown;
|
|
137126
|
+
};
|
|
137127
|
+
content: {
|
|
137128
|
+
"application/json": components["schemas"]["Error"];
|
|
137129
|
+
};
|
|
137130
|
+
};
|
|
137131
|
+
/** @description Not found */
|
|
137132
|
+
404: {
|
|
137133
|
+
headers: {
|
|
137134
|
+
[name: string]: unknown;
|
|
137135
|
+
};
|
|
137136
|
+
content: {
|
|
137137
|
+
"application/json": components["schemas"]["Error"];
|
|
137138
|
+
};
|
|
137139
|
+
};
|
|
137140
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
137141
|
+
409: {
|
|
137142
|
+
headers: {
|
|
137143
|
+
[name: string]: unknown;
|
|
137144
|
+
};
|
|
137145
|
+
content: {
|
|
137146
|
+
"application/json": components["schemas"]["Error"];
|
|
137147
|
+
};
|
|
137148
|
+
};
|
|
137149
|
+
/** @description Rate limited */
|
|
137150
|
+
429: {
|
|
137151
|
+
headers: {
|
|
137152
|
+
[name: string]: unknown;
|
|
137153
|
+
};
|
|
137154
|
+
content: {
|
|
137155
|
+
"application/json": components["schemas"]["Error"];
|
|
137156
|
+
};
|
|
137157
|
+
};
|
|
137158
|
+
};
|
|
137159
|
+
};
|
|
137160
|
+
put?: never;
|
|
137161
|
+
post?: never;
|
|
137162
|
+
delete?: never;
|
|
137163
|
+
options?: never;
|
|
137164
|
+
head?: never;
|
|
137165
|
+
patch?: never;
|
|
137166
|
+
trace?: never;
|
|
137167
|
+
};
|
|
136997
137168
|
"/followups/recontacto/next-steps": {
|
|
136998
137169
|
parameters: {
|
|
136999
137170
|
query?: never;
|
|
@@ -137064,11 +137235,11 @@ interface paths {
|
|
|
137064
137235
|
* "what": null,
|
|
137065
137236
|
* "autonomy": null,
|
|
137066
137237
|
* "autonomy_label": null,
|
|
137067
|
-
* "sentence": "En pausa: ya visitó
|
|
137238
|
+
* "sentence": "En pausa: visita agendada, ya visitó o venta en curso (se retoma el jue 5 nov)",
|
|
137068
137239
|
* "held": {
|
|
137069
137240
|
* "guard": "G52",
|
|
137070
137241
|
* "code": "bottom_funnel",
|
|
137071
|
-
* "label": "ya visitó
|
|
137242
|
+
* "label": "visita agendada, ya visitó o venta en curso",
|
|
137072
137243
|
* "since": "2026-10-23T15:10:00-03:00",
|
|
137073
137244
|
* "last_seen": "2026-10-23T15:10:00-03:00",
|
|
137074
137245
|
* "until": "2026-11-05T13:00:00-03:00",
|
package/dist/index.d.ts
CHANGED
|
@@ -15502,7 +15502,7 @@ interface paths {
|
|
|
15502
15502
|
};
|
|
15503
15503
|
/**
|
|
15504
15504
|
* Read the channel AI availability policy and current status
|
|
15505
|
-
* @description Returns the per-channel coverage clock and its current evaluation. Schedule availability does not override agent assignment, channel kill switches, or a human takeover. An account without a saved policy reports `configured: false` and preserves the legacy always-eligible schedule. `policy.timezone` and `status.effective_timezone` report the server-resolved clock inherited from General settings or selected business hours. `policy.human_silence_resume` and `policy.handoff_renotify` are always present in the response with defaults applied (resume: enabled, 30 minutes; re-notify: disabled, 30 minutes once enabled).
|
|
15505
|
+
* @description Returns the per-channel coverage clock and its current evaluation. Schedule availability does not override agent assignment, channel kill switches, or a human takeover. An account without a saved policy reports `configured: false` and preserves the legacy always-eligible schedule. `policy.timezone` and `status.effective_timezone` report the server-resolved clock inherited from General settings or selected business hours. `policy.human_silence_resume` and `policy.handoff_renotify` are always present in the response with defaults applied (resume: enabled, 30 minutes; re-notify: disabled, 30 minutes once enabled). `human_silence_resume` is RETIRED: since 2026-10-25 a conversation a person handles is silent until «Devolver a la IA», so the channel switch no longer makes the AI answer. Whether the AI answers a waiting customer is the workspace setting `after_handoff.ai_answers_waiting` (GET /followups/recontacto), for every tenant.
|
|
15506
15506
|
*/
|
|
15507
15507
|
get: {
|
|
15508
15508
|
parameters: {
|
|
@@ -15624,7 +15624,7 @@ interface paths {
|
|
|
15624
15624
|
head?: never;
|
|
15625
15625
|
/**
|
|
15626
15626
|
* Set the channel AI availability policy
|
|
15627
|
-
* @description Persists an always, outside-business-hours, or custom weekly schedule. Custom windows may cross midnight; overlapping windows are rejected. Custom schedules inherit General timezone, then workspace business-hours timezone, then America/Santiago. The optional legacy timezone field is accepted for compatibility and normalized by the server. Outside-business-hours mode requires configured workspace or tenant-owned team hours. The follow-through rules are optional: `human_silence_resume` (
|
|
15627
|
+
* @description Persists an always, outside-business-hours, or custom weekly schedule. Custom windows may cross midnight; overlapping windows are rejected. Custom schedules inherit General timezone, then workspace business-hours timezone, then America/Santiago. The optional legacy timezone field is accepted for compatibility and normalized by the server. Outside-business-hours mode requires configured workspace or tenant-owned team hours. The follow-through rules are optional: `human_silence_resume` (retired: accepted and stored for compatibility, it does nothing; use `after_handoff.ai_answers_waiting` on PUT /followups/recontacto) and `handoff_renotify` (after an AI handoff, re-notify the team every N minutes while the customer waits). Omitting either keeps the value already saved on the channel.
|
|
15628
15628
|
*/
|
|
15629
15629
|
patch: {
|
|
15630
15630
|
parameters: {
|
|
@@ -15671,7 +15671,7 @@ interface paths {
|
|
|
15671
15671
|
start: string;
|
|
15672
15672
|
end: string;
|
|
15673
15673
|
}[];
|
|
15674
|
-
/** @description
|
|
15674
|
+
/** @description RETIRED (2026-10-25): a conversation a person handles is silent until «Devolver a la IA», so this switch no longer makes the AI answer. It is accepted and stored for compatibility only. Whether the AI answers a waiting customer is `after_handoff.ai_answers_waiting` on `/followups/recontacto`. Absent = enabled, 30 minutes. */
|
|
15675
15675
|
human_silence_resume?: {
|
|
15676
15676
|
enabled: boolean;
|
|
15677
15677
|
minutes: number;
|
|
@@ -136646,7 +136646,7 @@ interface paths {
|
|
|
136646
136646
|
};
|
|
136647
136647
|
/**
|
|
136648
136648
|
* What a customer who stops answering receives (simulated)
|
|
136649
|
-
* @description The «Si no responde» ladder, computed by the engine itself: a synthetic lead is stepped along the sweeps’ clocks (hourly for the lead rails, every 15 minutes for the chat rows, only inside contact hours) through the real decision function and pacing holds, so every row’s `at` is when the engine would actually send it. `scenarios` holds `conversed` («Conversó y dejó de responder»: chat rows, then the WhatsApp/email/call rows, both counted from t0), `never_replied` («Nunca respondió nuestro primer mensaje»: t0 is our first message; the lost rail is never reached) and `lost` («Ya está perdido», counted from the loss); `?scenario=` returns just one. `start` is t0 (default now); `start_options` are the example clock’s picks. A moved row carries `deferred_code` (`outside_contact_hours`, `previous_late`, `unanswered_hold`, `min_gap`, `max_per_day`, `automated_gap`, `person_ceiling`, `daily_cap`) with its sentence, and `deferred_codes` lists every reason that moved it, and `hot_at` when R6 moves it for a hot lead; a drawn step the engine never sends has `sends: false` and `not_sent_reason`. Also: `header_sentence`, each scenario’s hero `sentence`, `pacing_summary` (the collapsed «Ritmo» line: the rules that are on) and `pacing` (every «Ritmo» rule R1–R13 with `on` and `value`), `limits_sentence` (every bound on what one person can receive, with the workspace values), row `warnings` for the editor (a first contact under 12 h, approval rows’ real send rate, Instagram past 24 h), `guards` from the registry (G21 `highlight` when a sweep hit its candidate ceiling in the last 24 h), `approval_fallback.available` (false for a clinic whose clinical response times are undeclared; `hours` is R11), `today` (sent, not sent, went to approval, awaiting approval, and the R8 counter `would_need_approval` of `due`, `failed` (follow-ups sent today that did not arrive) and `failed_actionable` (of those, the ones a person can retry or fix; never a number WhatsApp cannot deliver to), and `cap`: what the day used of the daily cap and the AI review budget, the spent one in `reached` with its `sentence` and `resumes_at`; while one is spent, rows at «now» that fall today move to tomorrow with `deferred_code: daily_cap`; and `backlog`, the whole queue’s drain: `queued`, `per_day`, `days` (first to last estimated release, inclusive), `last_release_on` and `sentence` «En cola: N, se reparte en ~D días (hasta el …)», null when nothing is queued) and `queue` (each queued backlog step’s estimated release day, 10 per tenant per day; `contact_id` or `lead_id` narrows it), and `after_handoff` («Después de pasarlo a una persona»: `followups`, `auto_send_after_hours`, `ai_answers_waiting_after_hours`, `reminder_minutes` and the block’s collapsed line `summary`, `controls` (which of `followups`, `auto_send_after_hours`, `ai_answers_waiting_after_hours` do anything here: the AI-answer control is false at a clinic, where D73 and the teammate-reply resume run instead), and `now`, the live state: `conversations` with the team after an AI handoff or a teammate takeover, `by_class` (`informational`, `operational`, `sensitive`, and `takeover` for chats a teammate took without a handoff), `drafts` (waiting in «Por aprobar
|
|
136649
|
+
* @description The «Si no responde» ladder, computed by the engine itself: a synthetic lead is stepped along the sweeps’ clocks (hourly for the lead rails, every 15 minutes for the chat rows, only inside contact hours) through the real decision function and pacing holds, so every row’s `at` is when the engine would actually send it. `scenarios` holds `conversed` («Conversó y dejó de responder»: chat rows, then the WhatsApp/email/call rows, both counted from t0), `never_replied` («Nunca respondió nuestro primer mensaje»: t0 is our first message; the lost rail is never reached) and `lost` («Ya está perdido», counted from the loss); `?scenario=` returns just one. `start` is t0 (default now); `start_options` are the example clock’s picks. A moved row carries `deferred_code` (`outside_contact_hours`, `previous_late`, `unanswered_hold`, `min_gap`, `max_per_day`, `automated_gap`, `person_ceiling`, `daily_cap`) with its sentence, and `deferred_codes` lists every reason that moved it, and `hot_at` when R6 moves it for a hot lead; a drawn step the engine never sends has `sends: false` and `not_sent_reason`. Also: `header_sentence`, each scenario’s hero `sentence`, `pacing_summary` (the collapsed «Ritmo» line: the rules that are on) and `pacing` (every «Ritmo» rule R1–R13 with `on` and `value`), `limits_sentence` (every bound on what one person can receive, with the workspace values), row `warnings` for the editor (a first contact under 12 h, approval rows’ real send rate, Instagram past 24 h), `guards` from the registry (G21 `highlight` when a sweep hit its candidate ceiling in the last 24 h), `approval_fallback.available` (false for a clinic whose clinical response times are undeclared; `hours` is R11), `today` (sent, not sent, went to approval, awaiting approval, and the R8 counter `would_need_approval` of `due`, `failed` (follow-ups sent today that did not arrive) and `failed_actionable` (of those, the ones a person can retry or fix; never a number WhatsApp cannot deliver to), and `cap`: what the day used of the daily cap and the AI review budget, the spent one in `reached` with its `sentence` and `resumes_at`; while one is spent, rows at «now» that fall today move to tomorrow with `deferred_code: daily_cap`; and `backlog`, the whole queue’s drain: `queued`, `per_day`, `days` (first to last estimated release, inclusive), `last_release_on` and `sentence` «En cola: N, se reparte en ~D días (hasta el …)», null when nothing is queued) and `queue` (each queued backlog step’s estimated release day, 10 per tenant per day; `contact_id` or `lead_id` narrows it), and `after_handoff` («Después de pasarlo a una persona»: `followups`, `auto_send_after_hours`, `ai_answers_waiting_after_hours`, `reminder_minutes` and the block’s collapsed line `summary`, `controls` (which of `followups`, `auto_send_after_hours`, `ai_answers_waiting_after_hours` do anything here: the AI-answer control is false at a clinic, where D73 and the teammate-reply resume run instead), and `now`, the live state: `conversations` with the team after an AI handoff or a teammate takeover, `by_class` (`informational`, `operational`, `sensitive`, and `takeover` for chats a teammate took without a handoff), `drafts` (waiting in «Por aprobar»: only drafts whose action is still awaiting approval; a rejected one leaves at once), `upcoming_drafts` («Próximos borradores»: people whose next step is a draft not written yet), `drafts_self_sending`, `customers_waiting`, the fact line `sentence` and `people` (one per conversation: `contact_id`, `contact_name`, `conversation_id`, `conversation_display_id`, `owner_user_id`, `owner_name`, `class`, `trigger` (`ai_handoff` | `teammate`), `has_draft`, `draft_auto_send_at`, `draft_auto_send_at_label`, `waiting_since`, `waited_hours`, `waited_label`, `promise_overdue`, `promise_label`, `next` (`kind` `draft` | `step` | `held` | `none`, `at_label`, `label`: the next step as one short fact, from the same facts as `sentence`), `sentence`; a broken promise sorts first), `truncated`; null when the read failed). `today.not_sent` counts people with a step that ended without a send today and no send at all today. All copy is in `lang` (default the workspace’s). `after_handoff_now=false` leaves `after_handoff.now` null (read it from `/followups/recontacto/plan/after-handoff`).
|
|
136650
136650
|
*/
|
|
136651
136651
|
get: {
|
|
136652
136652
|
parameters: {
|
|
@@ -136656,6 +136656,7 @@ interface paths {
|
|
|
136656
136656
|
lang?: "es" | "en";
|
|
136657
136657
|
contact_id?: string;
|
|
136658
136658
|
lead_id?: string;
|
|
136659
|
+
after_handoff_now?: "true" | "false";
|
|
136659
136660
|
};
|
|
136660
136661
|
header?: never;
|
|
136661
136662
|
path?: never;
|
|
@@ -136826,6 +136827,7 @@ interface paths {
|
|
|
136826
136827
|
* "takeover": 0
|
|
136827
136828
|
* },
|
|
136828
136829
|
* "drafts": 1,
|
|
136830
|
+
* "upcoming_drafts": 0,
|
|
136829
136831
|
* "drafts_self_sending": 1,
|
|
136830
136832
|
* "customers_waiting": 0,
|
|
136831
136833
|
* "sentence": "Ahora: 2 conversaciones con el equipo · 1 borrador por enviarse solo",
|
|
@@ -136994,6 +136996,175 @@ interface paths {
|
|
|
136994
136996
|
patch?: never;
|
|
136995
136997
|
trace?: never;
|
|
136996
136998
|
};
|
|
136999
|
+
"/followups/recontacto/plan/after-handoff": {
|
|
137000
|
+
parameters: {
|
|
137001
|
+
query?: never;
|
|
137002
|
+
header?: never;
|
|
137003
|
+
path?: never;
|
|
137004
|
+
cookie?: never;
|
|
137005
|
+
};
|
|
137006
|
+
/**
|
|
137007
|
+
* The «Ahora» block of the plan, on its own
|
|
137008
|
+
* @description Exactly the plan’s `after_handoff.now`: the open conversations with the team now (`conversations`, `drafts_self_sending`, `customers_waiting`, `by_class`, `sentence`, `people`, `truncated`), or null when the read failed. It costs one next-step read per handed-off person, so a screen asks `/followups/recontacto/plan?after_handoff_now=false` and reads this block separately. `lang` picks es or en (default the workspace’s).
|
|
137009
|
+
*/
|
|
137010
|
+
get: {
|
|
137011
|
+
parameters: {
|
|
137012
|
+
query?: {
|
|
137013
|
+
lang?: "es" | "en";
|
|
137014
|
+
};
|
|
137015
|
+
header?: never;
|
|
137016
|
+
path?: never;
|
|
137017
|
+
cookie?: never;
|
|
137018
|
+
};
|
|
137019
|
+
requestBody?: never;
|
|
137020
|
+
responses: {
|
|
137021
|
+
/** @description The «Ahora» block */
|
|
137022
|
+
200: {
|
|
137023
|
+
headers: {
|
|
137024
|
+
[name: string]: unknown;
|
|
137025
|
+
};
|
|
137026
|
+
content: {
|
|
137027
|
+
/**
|
|
137028
|
+
* @example {
|
|
137029
|
+
* "data": {
|
|
137030
|
+
* "conversations": 2,
|
|
137031
|
+
* "by_class": {
|
|
137032
|
+
* "informational": 1,
|
|
137033
|
+
* "operational": 1,
|
|
137034
|
+
* "sensitive": 0,
|
|
137035
|
+
* "takeover": 0
|
|
137036
|
+
* },
|
|
137037
|
+
* "drafts": 1,
|
|
137038
|
+
* "upcoming_drafts": 0,
|
|
137039
|
+
* "drafts_self_sending": 1,
|
|
137040
|
+
* "customers_waiting": 0,
|
|
137041
|
+
* "sentence": "Ahora: 2 conversaciones con el equipo · 1 borrador por enviarse solo",
|
|
137042
|
+
* "people": [
|
|
137043
|
+
* {
|
|
137044
|
+
* "contact_id": "3f1c2b4a-5d6e-4f70-8a91-b2c3d4e5f607",
|
|
137045
|
+
* "contact_name": "Nando",
|
|
137046
|
+
* "conversation_id": "01a1639b-75bf-79d7-8e5a-93c5000d6319",
|
|
137047
|
+
* "conversation_display_id": "C-363",
|
|
137048
|
+
* "owner_user_id": "829e61ea-2cb9-43dc-80fd-18baf78eaaed",
|
|
137049
|
+
* "owner_name": "Diego Navarrete",
|
|
137050
|
+
* "class": "informational",
|
|
137051
|
+
* "trigger": "ai_handoff",
|
|
137052
|
+
* "has_draft": true,
|
|
137053
|
+
* "draft_auto_send_at": "2026-10-25T16:30:00-03:00",
|
|
137054
|
+
* "draft_auto_send_at_label": "mañana 16:30",
|
|
137055
|
+
* "waiting_since": null,
|
|
137056
|
+
* "waited_hours": null,
|
|
137057
|
+
* "waited_label": null,
|
|
137058
|
+
* "promise_overdue": false,
|
|
137059
|
+
* "promise_label": null,
|
|
137060
|
+
* "next": {
|
|
137061
|
+
* "kind": "draft",
|
|
137062
|
+
* "at_label": "mañana 16:30",
|
|
137063
|
+
* "label": "borrador · mañana 16:30"
|
|
137064
|
+
* },
|
|
137065
|
+
* "sentence": "Lo atiende Diego Navarrete · borrador listo · se envía solo mañana 16:30 si nadie lo revisa"
|
|
137066
|
+
* },
|
|
137067
|
+
* {
|
|
137068
|
+
* "contact_id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
|
|
137069
|
+
* "contact_name": "Karen Olguin",
|
|
137070
|
+
* "conversation_id": "01a16d2e-9f3a-7b1c-8d2e-3f4a5b6c7d8e",
|
|
137071
|
+
* "conversation_display_id": "C-384",
|
|
137072
|
+
* "owner_user_id": "829e61ea-2cb9-43dc-80fd-18baf78eaaed",
|
|
137073
|
+
* "owner_name": "Diego Navarrete",
|
|
137074
|
+
* "class": "operational",
|
|
137075
|
+
* "trigger": "ai_handoff",
|
|
137076
|
+
* "has_draft": false,
|
|
137077
|
+
* "draft_auto_send_at": null,
|
|
137078
|
+
* "draft_auto_send_at_label": null,
|
|
137079
|
+
* "waiting_since": null,
|
|
137080
|
+
* "waited_hours": null,
|
|
137081
|
+
* "waited_label": null,
|
|
137082
|
+
* "promise_overdue": true,
|
|
137083
|
+
* "promise_label": "el vie 23 desde las 10:00 (no se cumplió)",
|
|
137084
|
+
* "next": {
|
|
137085
|
+
* "kind": "none",
|
|
137086
|
+
* "at_label": null,
|
|
137087
|
+
* "label": "le toca a Diego"
|
|
137088
|
+
* },
|
|
137089
|
+
* "sentence": "Lo atiende Diego · algo que solo puede hacer el equipo: la IA no escribe sola · La IA prometió que le escribirían el vie 23 desde las 10:00 (no se cumplió)"
|
|
137090
|
+
* }
|
|
137091
|
+
* ],
|
|
137092
|
+
* "truncated": false
|
|
137093
|
+
* }
|
|
137094
|
+
* }
|
|
137095
|
+
*/
|
|
137096
|
+
"application/json": {
|
|
137097
|
+
data?: unknown;
|
|
137098
|
+
meta?: {
|
|
137099
|
+
[key: string]: unknown;
|
|
137100
|
+
};
|
|
137101
|
+
};
|
|
137102
|
+
};
|
|
137103
|
+
};
|
|
137104
|
+
/** @description Validation error */
|
|
137105
|
+
400: {
|
|
137106
|
+
headers: {
|
|
137107
|
+
[name: string]: unknown;
|
|
137108
|
+
};
|
|
137109
|
+
content: {
|
|
137110
|
+
"application/json": components["schemas"]["Error"];
|
|
137111
|
+
};
|
|
137112
|
+
};
|
|
137113
|
+
/** @description Unauthorized */
|
|
137114
|
+
401: {
|
|
137115
|
+
headers: {
|
|
137116
|
+
[name: string]: unknown;
|
|
137117
|
+
};
|
|
137118
|
+
content: {
|
|
137119
|
+
"application/json": components["schemas"]["Error"];
|
|
137120
|
+
};
|
|
137121
|
+
};
|
|
137122
|
+
/** @description Forbidden */
|
|
137123
|
+
403: {
|
|
137124
|
+
headers: {
|
|
137125
|
+
[name: string]: unknown;
|
|
137126
|
+
};
|
|
137127
|
+
content: {
|
|
137128
|
+
"application/json": components["schemas"]["Error"];
|
|
137129
|
+
};
|
|
137130
|
+
};
|
|
137131
|
+
/** @description Not found */
|
|
137132
|
+
404: {
|
|
137133
|
+
headers: {
|
|
137134
|
+
[name: string]: unknown;
|
|
137135
|
+
};
|
|
137136
|
+
content: {
|
|
137137
|
+
"application/json": components["schemas"]["Error"];
|
|
137138
|
+
};
|
|
137139
|
+
};
|
|
137140
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
137141
|
+
409: {
|
|
137142
|
+
headers: {
|
|
137143
|
+
[name: string]: unknown;
|
|
137144
|
+
};
|
|
137145
|
+
content: {
|
|
137146
|
+
"application/json": components["schemas"]["Error"];
|
|
137147
|
+
};
|
|
137148
|
+
};
|
|
137149
|
+
/** @description Rate limited */
|
|
137150
|
+
429: {
|
|
137151
|
+
headers: {
|
|
137152
|
+
[name: string]: unknown;
|
|
137153
|
+
};
|
|
137154
|
+
content: {
|
|
137155
|
+
"application/json": components["schemas"]["Error"];
|
|
137156
|
+
};
|
|
137157
|
+
};
|
|
137158
|
+
};
|
|
137159
|
+
};
|
|
137160
|
+
put?: never;
|
|
137161
|
+
post?: never;
|
|
137162
|
+
delete?: never;
|
|
137163
|
+
options?: never;
|
|
137164
|
+
head?: never;
|
|
137165
|
+
patch?: never;
|
|
137166
|
+
trace?: never;
|
|
137167
|
+
};
|
|
136997
137168
|
"/followups/recontacto/next-steps": {
|
|
136998
137169
|
parameters: {
|
|
136999
137170
|
query?: never;
|
|
@@ -137064,11 +137235,11 @@ interface paths {
|
|
|
137064
137235
|
* "what": null,
|
|
137065
137236
|
* "autonomy": null,
|
|
137066
137237
|
* "autonomy_label": null,
|
|
137067
|
-
* "sentence": "En pausa: ya visitó
|
|
137238
|
+
* "sentence": "En pausa: visita agendada, ya visitó o venta en curso (se retoma el jue 5 nov)",
|
|
137068
137239
|
* "held": {
|
|
137069
137240
|
* "guard": "G52",
|
|
137070
137241
|
* "code": "bottom_funnel",
|
|
137071
|
-
* "label": "ya visitó
|
|
137242
|
+
* "label": "visita agendada, ya visitó o venta en curso",
|
|
137072
137243
|
* "since": "2026-10-23T15:10:00-03:00",
|
|
137073
137244
|
* "last_seen": "2026-10-23T15:10:00-03:00",
|
|
137074
137245
|
* "until": "2026-11-05T13:00:00-03:00",
|
package/package.json
CHANGED