@vitrina/api 15.34.1 → 15.35.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 +3764 -358
  2. package/dist/index.d.ts +3764 -358
  3. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -90422,6 +90422,16 @@ interface paths {
90422
90422
  };
90423
90423
  requestBody?: {
90424
90424
  content: {
90425
+ /**
90426
+ * @example {
90427
+ * "signer": {
90428
+ * "name": "María Pérez Soto",
90429
+ * "rut": "12.345.678-5",
90430
+ * "email": "maria@empresa.cl"
90431
+ * },
90432
+ * "send_email": true
90433
+ * }
90434
+ */
90425
90435
  "application/json": {
90426
90436
  /** @description Who signs. Name and RUT default to the razón social's representante legal; the email is required (here or on file). */
90427
90437
  signer?: {
@@ -160128,7 +160138,7 @@ interface paths {
160128
160138
  patch?: never;
160129
160139
  trace?: never;
160130
160140
  };
160131
- "/followups/recontacto/readiness": {
160141
+ "/followups/attention": {
160132
160142
  parameters: {
160133
160143
  query?: never;
160134
160144
  header?: never;
@@ -160136,19 +160146,21 @@ interface paths {
160136
160146
  cookie?: never;
160137
160147
  };
160138
160148
  /**
160139
- * Can Recontacto actually send?
160140
- * @description WhatsApp connection, how many APPROVED templates Vitrina can fill, and the 30-day counts of sends stuck for want of a template versus sends the model deliberately abstained from. `auto_template` describes the template Vitrina drafted and submitted on the tenant’s behalf (`pending` → in Meta review, `approved`, `gave_up` → three rejections, a human must author one) and how many rungs are parked waiting on it.
160149
+ * What needs my attention in «Escribir primero»
160150
+ * @description One read for the «Escribir primero» attention strip. `pending.count` is the single «esperan tu OK» number: proactive messages waiting for approval, merged across every rail that queues one (`by_source` splits it by rail). It is computed with the same predicate as `GET /outbound/approvals`, so it always equals that list’s `total`. `ai_review_limit` is today’s AI reviews (`used` of `total`) and `resumes_at` (ISO) once it is spent, else null. `channel_problems` lists disconnected channels that stop sends with the Avisos waiting on each. `items` are other things needing a person (templates). `quiet` holds the calm numbers: `sent_today`, `in_queue` (count and when the next one may go) and `not_sent` (count plus `reasons`). Every entry that leads somewhere carries `action_target`, a typed destination (`record` | `list` | `page`) the UI routes. Copy for `reasons` is in `lang` (default the workspace’s).
160141
160151
  */
160142
160152
  get: {
160143
160153
  parameters: {
160144
- query?: never;
160154
+ query?: {
160155
+ lang?: "es" | "en";
160156
+ };
160145
160157
  header?: never;
160146
160158
  path?: never;
160147
160159
  cookie?: never;
160148
160160
  };
160149
160161
  requestBody?: never;
160150
160162
  responses: {
160151
- /** @description Readiness */
160163
+ /** @description The attention summary */
160152
160164
  200: {
160153
160165
  headers: {
160154
160166
  [name: string]: unknown;
@@ -160157,24 +160169,67 @@ interface paths {
160157
160169
  /**
160158
160170
  * @example {
160159
160171
  * "data": {
160160
- * "whatsapp_connected": true,
160161
- * "usable_templates": 2,
160162
- * "template_names": [
160163
- * "reactivar_cotizacion",
160164
- * "seguimiento_visita"
160172
+ * "pending": {
160173
+ * "count": 5,
160174
+ * "by_source": [
160175
+ * {
160176
+ * "source": "recontacto",
160177
+ * "count": 4
160178
+ * },
160179
+ * {
160180
+ * "source": "service_lifecycle",
160181
+ * "count": 1
160182
+ * }
160183
+ * ],
160184
+ * "action_target": {
160185
+ * "kind": "list",
160186
+ * "screen": "conversations",
160187
+ * "filter": {
160188
+ * "view": "inbox-approvals"
160189
+ * }
160190
+ * }
160191
+ * },
160192
+ * "ai_review_limit": {
160193
+ * "used": 200,
160194
+ * "total": 200,
160195
+ * "resumes_at": "2026-11-03T09:00:00-03:00"
160196
+ * },
160197
+ * "channel_problems": [
160198
+ * {
160199
+ * "kind": "email_not_connected",
160200
+ * "channel": "email",
160201
+ * "count": 3,
160202
+ * "action_target": {
160203
+ * "kind": "page",
160204
+ * "page": "settings.channels"
160205
+ * }
160206
+ * }
160165
160207
  * ],
160166
- * "wrong_category_templates": 0,
160167
- * "skips_missing_template_30d": 0,
160168
- * "abstentions_30d": 4,
160169
- * "auto_template": {
160170
- * "status": "pending",
160171
- * "template_id": "7a7a7a7a-0000-4000-8000-0000000000c0",
160172
- * "template_name": "reactivar_conversacion",
160173
- * "language": "es",
160174
- * "submitted_at": "2026-10-09T12:00:00.000Z",
160175
- * "rejection_reason": null,
160176
- * "rejected_count": 0,
160177
- * "waiting_attempts": 2
160208
+ * "items": [
160209
+ * {
160210
+ * "kind": "waiting_template",
160211
+ * "count": 2,
160212
+ * "action_target": {
160213
+ * "kind": "page",
160214
+ * "page": "settings.templates"
160215
+ * }
160216
+ * }
160217
+ * ],
160218
+ * "quiet": {
160219
+ * "sent_today": 12,
160220
+ * "in_queue": {
160221
+ * "count": 7,
160222
+ * "until": "2026-11-03T09:00:00-03:00"
160223
+ * },
160224
+ * "not_sent": {
160225
+ * "count": 9,
160226
+ * "reasons": [
160227
+ * {
160228
+ * "reason": "Habló con un compañero hace poco",
160229
+ * "count": 9
160230
+ * }
160231
+ * ]
160232
+ * }
160178
160233
  * }
160179
160234
  * }
160180
160235
  * }
@@ -160251,137 +160306,7 @@ interface paths {
160251
160306
  patch?: never;
160252
160307
  trace?: never;
160253
160308
  };
160254
- "/followups/recontacto/run": {
160255
- parameters: {
160256
- query?: never;
160257
- header?: never;
160258
- path?: never;
160259
- cookie?: never;
160260
- };
160261
- get?: never;
160262
- put?: never;
160263
- /**
160264
- * Run the Recontacto sweep now
160265
- * @description Forces both sweeps regardless of schedule, enablement or quiet hours. Only a caller who also holds `campaigns:write` triggers the auto-send legs; everyone else gets a review-queue-only sweep. `waiting_template` counts rungs parked on a template Vitrina just asked Meta for — neither sent nor skipped, and no budget spent.
160266
- */
160267
- post: {
160268
- parameters: {
160269
- query?: never;
160270
- header?: {
160271
- /** @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. */
160272
- "Idempotency-Key"?: string;
160273
- };
160274
- path?: never;
160275
- cookie?: never;
160276
- };
160277
- requestBody?: never;
160278
- responses: {
160279
- /** @description Sweep result */
160280
- 200: {
160281
- headers: {
160282
- [name: string]: unknown;
160283
- };
160284
- content: {
160285
- /**
160286
- * @example {
160287
- * "data": {
160288
- * "evaluated": 12,
160289
- * "truncated": false,
160290
- * "attempted": 5,
160291
- * "sent": 0,
160292
- * "queued": 5,
160293
- * "skipped": 7,
160294
- * "lost": 0,
160295
- * "capped": 0,
160296
- * "waiting_template": 0,
160297
- * "answer_debt": 0,
160298
- * "contact_deduped": 0,
160299
- * "unreachable": 0,
160300
- * "transient": 0,
160301
- * "expired": 0,
160302
- * "halted": false,
160303
- * "unanswered_message": {
160304
- * "evaluated": 0,
160305
- * "sent": 0,
160306
- * "queued": 0,
160307
- * "skipped": 0,
160308
- * "transient": 0,
160309
- * "halted": false
160310
- * }
160311
- * }
160312
- * }
160313
- */
160314
- "application/json": {
160315
- data?: unknown;
160316
- meta?: {
160317
- [key: string]: unknown;
160318
- };
160319
- };
160320
- };
160321
- };
160322
- /** @description Validation error */
160323
- 400: {
160324
- headers: {
160325
- [name: string]: unknown;
160326
- };
160327
- content: {
160328
- "application/json": components["schemas"]["Error"];
160329
- };
160330
- };
160331
- /** @description Unauthorized */
160332
- 401: {
160333
- headers: {
160334
- [name: string]: unknown;
160335
- };
160336
- content: {
160337
- "application/json": components["schemas"]["Error"];
160338
- };
160339
- };
160340
- /** @description Forbidden */
160341
- 403: {
160342
- headers: {
160343
- [name: string]: unknown;
160344
- };
160345
- content: {
160346
- "application/json": components["schemas"]["Error"];
160347
- };
160348
- };
160349
- /** @description Not found */
160350
- 404: {
160351
- headers: {
160352
- [name: string]: unknown;
160353
- };
160354
- content: {
160355
- "application/json": components["schemas"]["Error"];
160356
- };
160357
- };
160358
- /** @description Conflict (incl. Idempotency-Key reuse with different body) */
160359
- 409: {
160360
- headers: {
160361
- [name: string]: unknown;
160362
- };
160363
- content: {
160364
- "application/json": components["schemas"]["Error"];
160365
- };
160366
- };
160367
- /** @description Rate limited */
160368
- 429: {
160369
- headers: {
160370
- [name: string]: unknown;
160371
- };
160372
- content: {
160373
- "application/json": components["schemas"]["Error"];
160374
- };
160375
- };
160376
- };
160377
- };
160378
- delete?: never;
160379
- options?: never;
160380
- head?: never;
160381
- patch?: never;
160382
- trace?: never;
160383
- };
160384
- "/followups/recontacto/attempts": {
160309
+ "/followups/recontacto/readiness": {
160385
160310
  parameters: {
160386
160311
  query?: never;
160387
160312
  header?: never;
@@ -160389,30 +160314,19 @@ interface paths {
160389
160314
  cookie?: never;
160390
160315
  };
160391
160316
  /**
160392
- * List Recontacto attempts (ledger and review queue)
160393
- * @description One row per cadence rung (with `no_send_code`, the «no enviados» drill, each row also carries `step_label`, the step as the hero names it). `exhausted` means the rung spent its evaluation budget without ever reaching the customer — never read it as "we chased them". `waiting_template` means it is parked on a WhatsApp template in Meta review: no budget spent, the ladder did not move, and the template hooks own the row. `queued` is an overdue step held by the backlog rule (G24): it waits for its release slot (at most 10 per workspace per day), is never composed and never counts as a try until released; `release_estimate_at` says when it is expected to go out. A `failed` row carries `failure`: `reason`, the owner’s sentence in `lang`, and `next` (`retry`, `wait_for_reply` when WhatsApp cannot deliver to the person and we wait until they write, `retry_on` when Meta holds marketing back from the number for an experiment (130472) and we try again by ourselves on `retry_on`, `fix_template`, or `none`; `retry_on` is null otherwise). `statuses` filters several statuses at once; `limit` and `cursor` page the history (`meta.pagination.nextCursor`), and `meta.pagination.total` counts every row the filter matches.
160317
+ * Can Recontacto actually send?
160318
+ * @description WhatsApp connection, how many APPROVED templates Vitrina can fill, and the 30-day counts of sends stuck for want of a template versus sends the model deliberately abstained from. `auto_template` describes the template Vitrina drafted and submitted on the tenant’s behalf (`pending` → in Meta review, `approved`, `gave_up` → three rejections, a human must author one) and how many rungs are parked waiting on it.
160394
160319
  */
160395
160320
  get: {
160396
160321
  parameters: {
160397
- query?: {
160398
- status?: "proposed" | "dismissed" | "sent" | "failed" | "skipped" | "exhausted" | "waiting_template" | "queued";
160399
- situation?: "never_replied" | "stalled" | "lost" | "unanswered_message";
160400
- contact_id?: string;
160401
- lead_id?: string;
160402
- no_send_code?: string;
160403
- not_sent_since?: string;
160404
- statuses?: string;
160405
- limit?: number;
160406
- cursor?: string;
160407
- lang?: "es" | "en";
160408
- };
160322
+ query?: never;
160409
160323
  header?: never;
160410
160324
  path?: never;
160411
160325
  cookie?: never;
160412
160326
  };
160413
160327
  requestBody?: never;
160414
160328
  responses: {
160415
- /** @description Recontacto attempts */
160329
+ /** @description Readiness */
160416
160330
  200: {
160417
160331
  headers: {
160418
160332
  [name: string]: unknown;
@@ -160420,52 +160334,25 @@ interface paths {
160420
160334
  content: {
160421
160335
  /**
160422
160336
  * @example {
160423
- * "data": [
160424
- * {
160425
- * "id": "7a7a7a7a-0000-4000-8000-0000000000a0",
160426
- * "tenant_id": "7a7a7a7a-0000-4000-8000-000000000001",
160427
- * "contact_id": "7a7a7a7a-0000-4000-8000-000000000030",
160428
- * "lead_id": "7a7a7a7a-0000-4000-8000-000000000050",
160429
- * "conversation_id": null,
160430
- * "assignee_user_id": "7a7a7a7a-0000-4000-8000-000000000060",
160431
- * "situation": "stalled",
160432
- * "step": 1,
160433
- * "channel": "whatsapp",
160434
- * "status": "proposed",
160435
- * "reason": "Pidió cotización hace 6 días y no respondió; el auto que le interesaba sigue disponible.",
160436
- * "draft_message": "Hola María, ¿pudiste revisar la cotización? El auto sigue disponible y puedo agendarte una visita.",
160437
- * "email_subject": null,
160438
- * "template_id": null,
160439
- * "template_params": null,
160440
- * "outbound_action_id": "7a7a7a7a-0000-4000-8000-0000000000b0",
160441
- * "read_message_id": null,
160442
- * "score_at_attempt": 72,
160443
- * "contact_attempts": 0,
160444
- * "evaluation_attempts": 1,
160445
- * "last_evaluated_at": "2026-10-10T13:00:00.000Z",
160446
- * "no_send_code": null,
160447
- * "no_send_reason": null,
160448
- * "error": null,
160449
- * "sent_at": null,
160450
- * "dismissed_at": null,
160451
- * "outcome": null,
160452
- * "outcome_at": null,
160453
- * "outcome_value_amount": null,
160454
- * "created_at": "2026-10-10T13:00:00.000Z",
160455
- * "lead_title": "Mazda CX-5 2021",
160456
- * "contact_name": "María González",
160457
- * "contact_phone": "+56 9 1234 5678",
160458
- * "contact_email": "maria.gonzalez@example.cl",
160459
- * "lead_conversation_id": "7a7a7a7a-0000-4000-8000-000000000040",
160460
- * "template_name": null,
160461
- * "last_inbound_at": "2026-10-04T16:20:00.000Z"
160462
- * }
160463
- * ],
160464
- * "meta": {
160465
- * "pagination": {
160466
- * "total": 1,
160467
- * "nextCursor": null,
160468
- * "limit": 200
160337
+ * "data": {
160338
+ * "whatsapp_connected": true,
160339
+ * "usable_templates": 2,
160340
+ * "template_names": [
160341
+ * "reactivar_cotizacion",
160342
+ * "seguimiento_visita"
160343
+ * ],
160344
+ * "wrong_category_templates": 0,
160345
+ * "skips_missing_template_30d": 0,
160346
+ * "abstentions_30d": 4,
160347
+ * "auto_template": {
160348
+ * "status": "pending",
160349
+ * "template_id": "7a7a7a7a-0000-4000-8000-0000000000c0",
160350
+ * "template_name": "reactivar_conversacion",
160351
+ * "language": "es",
160352
+ * "submitted_at": "2026-10-09T12:00:00.000Z",
160353
+ * "rejection_reason": null,
160354
+ * "rejected_count": 0,
160355
+ * "waiting_attempts": 2
160469
160356
  * }
160470
160357
  * }
160471
160358
  * }
@@ -160542,29 +160429,32 @@ interface paths {
160542
160429
  patch?: never;
160543
160430
  trace?: never;
160544
160431
  };
160545
- "/followups/recontacto/stats": {
160432
+ "/followups/recontacto/run": {
160546
160433
  parameters: {
160547
160434
  query?: never;
160548
160435
  header?: never;
160549
160436
  path?: never;
160550
160437
  cookie?: never;
160551
160438
  };
160439
+ get?: never;
160440
+ put?: never;
160552
160441
  /**
160553
- * Recontacto results by situation, rung and channel
160554
- * @description One row per (situation, rung, channel) over the last `since_days` (default 30, max 365), counting only rungs that were actually sent: `sent`, `answered` (live: sends the customer has written after, by now), `replied` (the judged outcome: any inbound after the send, including reactivated and won), `won` and `recovered_value`, the value of leads closed won after the nudge. Outcomes are judged a week after the send, so the latest rungs read as unreplied. Requires `followups:read`.
160442
+ * Run the Recontacto sweep now
160443
+ * @description Forces both sweeps regardless of schedule, enablement or quiet hours. Only a caller who also holds `campaigns:write` triggers the auto-send legs; everyone else gets a review-queue-only sweep. `waiting_template` counts rungs parked on a template Vitrina just asked Meta for — neither sent nor skipped, and no budget spent.
160555
160444
  */
160556
- get: {
160445
+ post: {
160557
160446
  parameters: {
160558
- query?: {
160559
- since_days?: number;
160447
+ query?: never;
160448
+ header?: {
160449
+ /** @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. */
160450
+ "Idempotency-Key"?: string;
160560
160451
  };
160561
- header?: never;
160562
160452
  path?: never;
160563
160453
  cookie?: never;
160564
160454
  };
160565
160455
  requestBody?: never;
160566
160456
  responses: {
160567
- /** @description Recontacto stats */
160457
+ /** @description Sweep result */
160568
160458
  200: {
160569
160459
  headers: {
160570
160460
  [name: string]: unknown;
@@ -160572,17 +160462,305 @@ interface paths {
160572
160462
  content: {
160573
160463
  /**
160574
160464
  * @example {
160575
- * "data": [
160576
- * {
160577
- * "situation": "stalled",
160578
- * "step": 1,
160579
- * "channel": "whatsapp",
160580
- * "sent": 18,
160581
- * "replied": 6,
160582
- * "won": 1,
160583
- * "recovered_value": 17500000
160465
+ * "data": {
160466
+ * "evaluated": 12,
160467
+ * "truncated": false,
160468
+ * "attempted": 5,
160469
+ * "sent": 0,
160470
+ * "queued": 5,
160471
+ * "skipped": 7,
160472
+ * "lost": 0,
160473
+ * "capped": 0,
160474
+ * "waiting_template": 0,
160475
+ * "answer_debt": 0,
160476
+ * "contact_deduped": 0,
160477
+ * "unreachable": 0,
160478
+ * "transient": 0,
160479
+ * "expired": 0,
160480
+ * "halted": false,
160481
+ * "unanswered_message": {
160482
+ * "evaluated": 0,
160483
+ * "sent": 0,
160484
+ * "queued": 0,
160485
+ * "skipped": 0,
160486
+ * "transient": 0,
160487
+ * "halted": false
160584
160488
  * }
160585
- * ]
160489
+ * }
160490
+ * }
160491
+ */
160492
+ "application/json": {
160493
+ data?: unknown;
160494
+ meta?: {
160495
+ [key: string]: unknown;
160496
+ };
160497
+ };
160498
+ };
160499
+ };
160500
+ /** @description Validation error */
160501
+ 400: {
160502
+ headers: {
160503
+ [name: string]: unknown;
160504
+ };
160505
+ content: {
160506
+ "application/json": components["schemas"]["Error"];
160507
+ };
160508
+ };
160509
+ /** @description Unauthorized */
160510
+ 401: {
160511
+ headers: {
160512
+ [name: string]: unknown;
160513
+ };
160514
+ content: {
160515
+ "application/json": components["schemas"]["Error"];
160516
+ };
160517
+ };
160518
+ /** @description Forbidden */
160519
+ 403: {
160520
+ headers: {
160521
+ [name: string]: unknown;
160522
+ };
160523
+ content: {
160524
+ "application/json": components["schemas"]["Error"];
160525
+ };
160526
+ };
160527
+ /** @description Not found */
160528
+ 404: {
160529
+ headers: {
160530
+ [name: string]: unknown;
160531
+ };
160532
+ content: {
160533
+ "application/json": components["schemas"]["Error"];
160534
+ };
160535
+ };
160536
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
160537
+ 409: {
160538
+ headers: {
160539
+ [name: string]: unknown;
160540
+ };
160541
+ content: {
160542
+ "application/json": components["schemas"]["Error"];
160543
+ };
160544
+ };
160545
+ /** @description Rate limited */
160546
+ 429: {
160547
+ headers: {
160548
+ [name: string]: unknown;
160549
+ };
160550
+ content: {
160551
+ "application/json": components["schemas"]["Error"];
160552
+ };
160553
+ };
160554
+ };
160555
+ };
160556
+ delete?: never;
160557
+ options?: never;
160558
+ head?: never;
160559
+ patch?: never;
160560
+ trace?: never;
160561
+ };
160562
+ "/followups/recontacto/attempts": {
160563
+ parameters: {
160564
+ query?: never;
160565
+ header?: never;
160566
+ path?: never;
160567
+ cookie?: never;
160568
+ };
160569
+ /**
160570
+ * List Recontacto attempts (ledger and review queue)
160571
+ * @description One row per cadence rung (with `no_send_code`, the «no enviados» drill, each row also carries `step_label`, the step as the hero names it). `exhausted` means the rung spent its evaluation budget without ever reaching the customer — never read it as "we chased them". `waiting_template` means it is parked on a WhatsApp template in Meta review: no budget spent, the ladder did not move, and the template hooks own the row. `queued` is an overdue step held by the backlog rule (G24): it waits for its release slot (at most 10 per workspace per day), is never composed and never counts as a try until released; `release_estimate_at` says when it is expected to go out. A `failed` row carries `failure`: `reason`, the owner’s sentence in `lang`, and `next` (`retry`, `wait_for_reply` when WhatsApp cannot deliver to the person and we wait until they write, `retry_on` when Meta holds marketing back from the number for an experiment (130472) and we try again by ourselves on `retry_on`, `fix_template`, or `none`; `retry_on` is null otherwise). `statuses` filters several statuses at once; `limit` and `cursor` page the history (`meta.pagination.nextCursor`), and `meta.pagination.total` counts every row the filter matches.
160572
+ */
160573
+ get: {
160574
+ parameters: {
160575
+ query?: {
160576
+ status?: "proposed" | "dismissed" | "sent" | "failed" | "skipped" | "exhausted" | "waiting_template" | "queued";
160577
+ situation?: "never_replied" | "stalled" | "lost" | "unanswered_message";
160578
+ contact_id?: string;
160579
+ lead_id?: string;
160580
+ no_send_code?: string;
160581
+ not_sent_since?: string;
160582
+ statuses?: string;
160583
+ limit?: number;
160584
+ cursor?: string;
160585
+ lang?: "es" | "en";
160586
+ };
160587
+ header?: never;
160588
+ path?: never;
160589
+ cookie?: never;
160590
+ };
160591
+ requestBody?: never;
160592
+ responses: {
160593
+ /** @description Recontacto attempts */
160594
+ 200: {
160595
+ headers: {
160596
+ [name: string]: unknown;
160597
+ };
160598
+ content: {
160599
+ /**
160600
+ * @example {
160601
+ * "data": [
160602
+ * {
160603
+ * "id": "7a7a7a7a-0000-4000-8000-0000000000a0",
160604
+ * "tenant_id": "7a7a7a7a-0000-4000-8000-000000000001",
160605
+ * "contact_id": "7a7a7a7a-0000-4000-8000-000000000030",
160606
+ * "lead_id": "7a7a7a7a-0000-4000-8000-000000000050",
160607
+ * "conversation_id": null,
160608
+ * "assignee_user_id": "7a7a7a7a-0000-4000-8000-000000000060",
160609
+ * "situation": "stalled",
160610
+ * "step": 1,
160611
+ * "channel": "whatsapp",
160612
+ * "status": "proposed",
160613
+ * "reason": "Pidió cotización hace 6 días y no respondió; el auto que le interesaba sigue disponible.",
160614
+ * "draft_message": "Hola María, ¿pudiste revisar la cotización? El auto sigue disponible y puedo agendarte una visita.",
160615
+ * "email_subject": null,
160616
+ * "template_id": null,
160617
+ * "template_params": null,
160618
+ * "outbound_action_id": "7a7a7a7a-0000-4000-8000-0000000000b0",
160619
+ * "read_message_id": null,
160620
+ * "score_at_attempt": 72,
160621
+ * "contact_attempts": 0,
160622
+ * "evaluation_attempts": 1,
160623
+ * "last_evaluated_at": "2026-10-10T13:00:00.000Z",
160624
+ * "no_send_code": null,
160625
+ * "no_send_reason": null,
160626
+ * "error": null,
160627
+ * "sent_at": null,
160628
+ * "dismissed_at": null,
160629
+ * "outcome": null,
160630
+ * "outcome_at": null,
160631
+ * "outcome_value_amount": null,
160632
+ * "created_at": "2026-10-10T13:00:00.000Z",
160633
+ * "lead_title": "Mazda CX-5 2021",
160634
+ * "contact_name": "María González",
160635
+ * "contact_phone": "+56 9 1234 5678",
160636
+ * "contact_email": "maria.gonzalez@example.cl",
160637
+ * "lead_conversation_id": "7a7a7a7a-0000-4000-8000-000000000040",
160638
+ * "template_name": null,
160639
+ * "last_inbound_at": "2026-10-04T16:20:00.000Z"
160640
+ * }
160641
+ * ],
160642
+ * "meta": {
160643
+ * "pagination": {
160644
+ * "total": 1,
160645
+ * "nextCursor": null,
160646
+ * "limit": 200
160647
+ * }
160648
+ * }
160649
+ * }
160650
+ */
160651
+ "application/json": {
160652
+ data?: unknown;
160653
+ meta?: {
160654
+ [key: string]: unknown;
160655
+ };
160656
+ };
160657
+ };
160658
+ };
160659
+ /** @description Validation error */
160660
+ 400: {
160661
+ headers: {
160662
+ [name: string]: unknown;
160663
+ };
160664
+ content: {
160665
+ "application/json": components["schemas"]["Error"];
160666
+ };
160667
+ };
160668
+ /** @description Unauthorized */
160669
+ 401: {
160670
+ headers: {
160671
+ [name: string]: unknown;
160672
+ };
160673
+ content: {
160674
+ "application/json": components["schemas"]["Error"];
160675
+ };
160676
+ };
160677
+ /** @description Forbidden */
160678
+ 403: {
160679
+ headers: {
160680
+ [name: string]: unknown;
160681
+ };
160682
+ content: {
160683
+ "application/json": components["schemas"]["Error"];
160684
+ };
160685
+ };
160686
+ /** @description Not found */
160687
+ 404: {
160688
+ headers: {
160689
+ [name: string]: unknown;
160690
+ };
160691
+ content: {
160692
+ "application/json": components["schemas"]["Error"];
160693
+ };
160694
+ };
160695
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
160696
+ 409: {
160697
+ headers: {
160698
+ [name: string]: unknown;
160699
+ };
160700
+ content: {
160701
+ "application/json": components["schemas"]["Error"];
160702
+ };
160703
+ };
160704
+ /** @description Rate limited */
160705
+ 429: {
160706
+ headers: {
160707
+ [name: string]: unknown;
160708
+ };
160709
+ content: {
160710
+ "application/json": components["schemas"]["Error"];
160711
+ };
160712
+ };
160713
+ };
160714
+ };
160715
+ put?: never;
160716
+ post?: never;
160717
+ delete?: never;
160718
+ options?: never;
160719
+ head?: never;
160720
+ patch?: never;
160721
+ trace?: never;
160722
+ };
160723
+ "/followups/recontacto/stats": {
160724
+ parameters: {
160725
+ query?: never;
160726
+ header?: never;
160727
+ path?: never;
160728
+ cookie?: never;
160729
+ };
160730
+ /**
160731
+ * Recontacto results by situation, rung and channel
160732
+ * @description One row per (situation, rung, channel) over the last `since_days` (default 30, max 365), counting only rungs that were actually sent: `sent`, `answered` (live: sends the customer has written after, by now), `replied` (the judged outcome: any inbound after the send, including reactivated and won), `won` and `recovered_value`, the value of leads closed won after the nudge. Outcomes are judged a week after the send, so the latest rungs read as unreplied. Requires `followups:read`.
160733
+ */
160734
+ get: {
160735
+ parameters: {
160736
+ query?: {
160737
+ since_days?: number;
160738
+ };
160739
+ header?: never;
160740
+ path?: never;
160741
+ cookie?: never;
160742
+ };
160743
+ requestBody?: never;
160744
+ responses: {
160745
+ /** @description Recontacto stats */
160746
+ 200: {
160747
+ headers: {
160748
+ [name: string]: unknown;
160749
+ };
160750
+ content: {
160751
+ /**
160752
+ * @example {
160753
+ * "data": [
160754
+ * {
160755
+ * "situation": "stalled",
160756
+ * "step": 1,
160757
+ * "channel": "whatsapp",
160758
+ * "sent": 18,
160759
+ * "replied": 6,
160760
+ * "won": 1,
160761
+ * "recovered_value": 17500000
160762
+ * }
160763
+ * ]
160586
160764
  * }
160587
160765
  */
160588
160766
  "application/json": {
@@ -163363,6 +163541,2329 @@ interface paths {
163363
163541
  patch?: never;
163364
163542
  trace?: never;
163365
163543
  };
163544
+ "/sequences": {
163545
+ parameters: {
163546
+ query?: never;
163547
+ header?: never;
163548
+ path?: never;
163549
+ cookie?: never;
163550
+ };
163551
+ /**
163552
+ * List the workspace’s sequences
163553
+ * @description Every sequence of the workspace, lowest `priority` first (an agreed reminder wins over the others), each with its whole graph and the numbers of the last 30 days. Each sequence carries `situations` (its lanes: «Conversó y dejó de responder», «Nunca respondió», «Ya está perdido» for `builtin:si-no-responde`; one per lead source for `builtin:al-llegar`; one per recipe for `builtin:avisos`), `steps` (channel, the configured `wait`, the drawn `wait_after_previous` and `at_hours`, `mode` as configured and `mode_effective`, the config block it comes from in `config_ref`, and `stats`: `waiting_now`, `sent_30d`, `reply_rate_30d`, `daily_14d`), `connections` between step keys and the `entry` / `exit` / `end:<situation>` nodes (`reply_exit` is «si responde»), `window_markers` (where WhatsApp’s 24 h window closes; from there only approved templates) and `ends` (mark lost, finish, or continue in another sequence). Order, gaps and markers of «Si no responde» come from the same simulation `GET /followups/recontacto/plan` renders.
163554
+ *
163555
+ * A workspace with nothing configured still lists the three built-ins, `status: paused`. `lang` picks the labels; omitted = the workspace’s language. Requires `followups:read`.
163556
+ */
163557
+ get: {
163558
+ parameters: {
163559
+ query?: {
163560
+ lang?: "es" | "en";
163561
+ };
163562
+ header?: never;
163563
+ path?: never;
163564
+ cookie?: never;
163565
+ };
163566
+ requestBody?: never;
163567
+ responses: {
163568
+ /** @description The sequences */
163569
+ 200: {
163570
+ headers: {
163571
+ [name: string]: unknown;
163572
+ };
163573
+ content: {
163574
+ /**
163575
+ * @example {
163576
+ * "data": [
163577
+ * {
163578
+ * "id": "42bcd0a4-e0bd-5418-8a00-71495a4d3e46",
163579
+ * "key": "builtin:avisos",
163580
+ * "kind": "builtin",
163581
+ * "name": "Avisos",
163582
+ * "description": "Lo que el cliente pidió que le recordáramos.",
163583
+ * "status": "active",
163584
+ * "entry": {
163585
+ * "type": "event",
163586
+ * "event": "customer_asked_reminder",
163587
+ * "filters": [
163588
+ * {
163589
+ * "field": "trigger",
163590
+ * "op": "in",
163591
+ * "values": [
163592
+ * "after_delay"
163593
+ * ]
163594
+ * }
163595
+ * ]
163596
+ * },
163597
+ * "goal": {
163598
+ * "type": "promise_kept",
163599
+ * "label": "Cumplir lo que le prometimos"
163600
+ * },
163601
+ * "agent_id": null,
163602
+ * "priority": 1,
163603
+ * "situations": [
163604
+ * {
163605
+ * "key": "33333333-3333-4333-8333-333333333333",
163606
+ * "name": "Recordatorio acordado",
163607
+ * "enabled": true,
163608
+ * "first_step": "followup-33333333-3333-4333-8333-333333333333",
163609
+ * "waiting_now": 10,
163610
+ * "notes": []
163611
+ * }
163612
+ * ],
163613
+ * "steps": [
163614
+ * {
163615
+ * "id": "15c4a32c-b151-589d-ad47-25181454816b",
163616
+ * "key": "followup-33333333-3333-4333-8333-333333333333",
163617
+ * "situation": "33333333-3333-4333-8333-333333333333",
163618
+ * "kind": "message",
163619
+ * "position": 1,
163620
+ * "channel": "same_chat",
163621
+ * "fallback_channel": null,
163622
+ * "wait": {
163623
+ * "type": "agreed_time"
163624
+ * },
163625
+ * "wait_after_previous": null,
163626
+ * "at_hours": null,
163627
+ * "mode": "auto",
163628
+ * "mode_effective": "auto",
163629
+ * "sends": true,
163630
+ * "not_sent_reason": null,
163631
+ * "needs_template": false,
163632
+ * "content": {
163633
+ * "type": "promise",
163634
+ * "followup_id": "33333333-3333-4333-8333-333333333333",
163635
+ * "trigger_key": "after_delay"
163636
+ * },
163637
+ * "config_ref": {
163638
+ * "type": "followup",
163639
+ * "followup_id": "33333333-3333-4333-8333-333333333333",
163640
+ * "trigger_key": "after_delay"
163641
+ * },
163642
+ * "warnings": [],
163643
+ * "stats": {
163644
+ * "waiting_now": 10,
163645
+ * "sent_30d": 14,
163646
+ * "reply_rate_30d": 0.429,
163647
+ * "daily_14d": [
163648
+ * 0,
163649
+ * 1,
163650
+ * 1,
163651
+ * 0,
163652
+ * 2,
163653
+ * 1,
163654
+ * 0,
163655
+ * 1,
163656
+ * 1,
163657
+ * 2,
163658
+ * 1,
163659
+ * 0,
163660
+ * 1,
163661
+ * 3
163662
+ * ]
163663
+ * }
163664
+ * }
163665
+ * ],
163666
+ * "connections": [
163667
+ * {
163668
+ * "from": "entry",
163669
+ * "to": "followup-33333333-3333-4333-8333-333333333333",
163670
+ * "kind": "next",
163671
+ * "situation": "33333333-3333-4333-8333-333333333333"
163672
+ * },
163673
+ * {
163674
+ * "from": "followup-33333333-3333-4333-8333-333333333333",
163675
+ * "to": "exit",
163676
+ * "kind": "reply_exit",
163677
+ * "situation": "33333333-3333-4333-8333-333333333333"
163678
+ * },
163679
+ * {
163680
+ * "from": "followup-33333333-3333-4333-8333-333333333333",
163681
+ * "to": "end:33333333-3333-4333-8333-333333333333",
163682
+ * "kind": "end",
163683
+ * "situation": "33333333-3333-4333-8333-333333333333"
163684
+ * }
163685
+ * ],
163686
+ * "window_markers": [],
163687
+ * "ends": [
163688
+ * {
163689
+ * "key": "end:33333333-3333-4333-8333-333333333333",
163690
+ * "situation": "33333333-3333-4333-8333-333333333333",
163691
+ * "type": "finish",
163692
+ * "after": null,
163693
+ * "at_hours": null,
163694
+ * "label": "Avisado",
163695
+ * "detail": null,
163696
+ * "continues_in": null
163697
+ * }
163698
+ * ],
163699
+ * "stats": {
163700
+ * "waiting_now": 10,
163701
+ * "sent_30d": 14,
163702
+ * "reply_rate_30d": 0.429,
163703
+ * "daily_14d": [
163704
+ * 0,
163705
+ * 1,
163706
+ * 1,
163707
+ * 0,
163708
+ * 2,
163709
+ * 1,
163710
+ * 0,
163711
+ * 1,
163712
+ * 1,
163713
+ * 2,
163714
+ * 1,
163715
+ * 0,
163716
+ * 1,
163717
+ * 3
163718
+ * ]
163719
+ * }
163720
+ * },
163721
+ * {
163722
+ * "id": "01f68f1c-696b-5fc5-8191-d26ac3a3a8ee",
163723
+ * "key": "builtin:al-llegar",
163724
+ * "kind": "builtin",
163725
+ * "name": "Al llegar",
163726
+ * "description": "Un lead que no abrió el chat recibe el primer mensaje.",
163727
+ * "status": "active",
163728
+ * "entry": {
163729
+ * "type": "event",
163730
+ * "event": "lead_arrived",
163731
+ * "filters": [
163732
+ * {
163733
+ * "field": "source",
163734
+ * "op": "in",
163735
+ * "values": [
163736
+ * "website"
163737
+ * ]
163738
+ * }
163739
+ * ]
163740
+ * },
163741
+ * "goal": {
163742
+ * "type": "reply",
163743
+ * "label": "Que el cliente responda"
163744
+ * },
163745
+ * "agent_id": null,
163746
+ * "priority": 2,
163747
+ * "situations": [
163748
+ * {
163749
+ * "key": "website",
163750
+ * "name": "Lead del sitio web",
163751
+ * "enabled": true,
163752
+ * "first_step": "first_touch-website",
163753
+ * "waiting_now": null,
163754
+ * "notes": []
163755
+ * }
163756
+ * ],
163757
+ * "steps": [
163758
+ * {
163759
+ * "id": "168d38eb-62b8-5ecc-b0cb-663736f9be97",
163760
+ * "key": "first_touch-website",
163761
+ * "situation": "website",
163762
+ * "kind": "message",
163763
+ * "position": 1,
163764
+ * "channel": "whatsapp",
163765
+ * "fallback_channel": null,
163766
+ * "wait": {
163767
+ * "type": "duration",
163768
+ * "value": 5,
163769
+ * "unit": "minutes",
163770
+ * "from": "start",
163771
+ * "from_step": null,
163772
+ * "hours": 0.08333333333333333
163773
+ * },
163774
+ * "wait_after_previous": {
163775
+ * "value": 5,
163776
+ * "unit": "minutes"
163777
+ * },
163778
+ * "at_hours": 0.08333333333333333,
163779
+ * "mode": "auto",
163780
+ * "mode_effective": "auto",
163781
+ * "sends": true,
163782
+ * "not_sent_reason": null,
163783
+ * "needs_template": true,
163784
+ * "content": {
163785
+ * "type": "template_ladder",
163786
+ * "templates": [
163787
+ * {
163788
+ * "name": "cotizacion_web",
163789
+ * "language": "es"
163790
+ * }
163791
+ * ]
163792
+ * },
163793
+ * "config_ref": {
163794
+ * "type": "first_touch",
163795
+ * "source": "website",
163796
+ * "config_origin": "configured"
163797
+ * },
163798
+ * "warnings": [],
163799
+ * "stats": {
163800
+ * "waiting_now": null,
163801
+ * "sent_30d": 322,
163802
+ * "reply_rate_30d": 0.304,
163803
+ * "daily_14d": [
163804
+ * 10,
163805
+ * 12,
163806
+ * 11,
163807
+ * 13,
163808
+ * 12,
163809
+ * 11,
163810
+ * 12,
163811
+ * 13,
163812
+ * 10,
163813
+ * 11,
163814
+ * 12,
163815
+ * 13,
163816
+ * 11,
163817
+ * 12
163818
+ * ]
163819
+ * }
163820
+ * }
163821
+ * ],
163822
+ * "connections": [
163823
+ * {
163824
+ * "from": "entry",
163825
+ * "to": "first_touch-website",
163826
+ * "kind": "next",
163827
+ * "situation": "website"
163828
+ * },
163829
+ * {
163830
+ * "from": "first_touch-website",
163831
+ * "to": "exit",
163832
+ * "kind": "reply_exit",
163833
+ * "situation": "website"
163834
+ * },
163835
+ * {
163836
+ * "from": "first_touch-website",
163837
+ * "to": "end:website",
163838
+ * "kind": "end",
163839
+ * "situation": "website"
163840
+ * }
163841
+ * ],
163842
+ * "window_markers": [],
163843
+ * "ends": [
163844
+ * {
163845
+ * "key": "end:website",
163846
+ * "situation": "website",
163847
+ * "type": "continue",
163848
+ * "after": null,
163849
+ * "at_hours": null,
163850
+ * "label": "Si no responde, sigue en «Nunca respondió»",
163851
+ * "detail": null,
163852
+ * "continues_in": {
163853
+ * "sequence_key": "builtin:si-no-responde",
163854
+ * "situation": "never_replied"
163855
+ * }
163856
+ * }
163857
+ * ],
163858
+ * "stats": {
163859
+ * "waiting_now": null,
163860
+ * "sent_30d": 322,
163861
+ * "reply_rate_30d": 0.304,
163862
+ * "daily_14d": [
163863
+ * 10,
163864
+ * 12,
163865
+ * 11,
163866
+ * 13,
163867
+ * 12,
163868
+ * 11,
163869
+ * 12,
163870
+ * 13,
163871
+ * 10,
163872
+ * 11,
163873
+ * 12,
163874
+ * 13,
163875
+ * 11,
163876
+ * 12
163877
+ * ]
163878
+ * }
163879
+ * },
163880
+ * {
163881
+ * "id": "dd63825c-cb16-553d-90cc-6cb4fa694ce8",
163882
+ * "key": "builtin:si-no-responde",
163883
+ * "kind": "builtin",
163884
+ * "name": "Si no responde",
163885
+ * "description": "Le escribimos a quien dejó de responder, nunca respondió o ya está perdido.",
163886
+ * "status": "active",
163887
+ * "entry": {
163888
+ * "type": "event",
163889
+ * "event": "customer_went_quiet",
163890
+ * "filters": [
163891
+ * {
163892
+ * "field": "situation",
163893
+ * "op": "in",
163894
+ * "values": [
163895
+ * "conversed",
163896
+ * "never_replied",
163897
+ * "lost"
163898
+ * ]
163899
+ * }
163900
+ * ]
163901
+ * },
163902
+ * "goal": {
163903
+ * "type": "reply",
163904
+ * "label": "Que el cliente vuelva a responder"
163905
+ * },
163906
+ * "agent_id": null,
163907
+ * "priority": 3,
163908
+ * "situations": [
163909
+ * {
163910
+ * "key": "conversed",
163911
+ * "name": "Conversó y dejó de responder",
163912
+ * "enabled": true,
163913
+ * "first_step": "unanswered_message-1",
163914
+ * "waiting_now": 45,
163915
+ * "notes": []
163916
+ * },
163917
+ * {
163918
+ * "key": "never_replied",
163919
+ * "name": "Nunca respondió",
163920
+ * "enabled": true,
163921
+ * "first_step": "never_replied-1",
163922
+ * "waiting_now": 1,
163923
+ * "notes": []
163924
+ * },
163925
+ * {
163926
+ * "key": "lost",
163927
+ * "name": "Ya está perdido",
163928
+ * "enabled": true,
163929
+ * "first_step": "lost-1",
163930
+ * "waiting_now": 9,
163931
+ * "notes": [
163932
+ * "A quien compró en otro lado o dijo que no quiere, no le escribimos."
163933
+ * ]
163934
+ * }
163935
+ * ],
163936
+ * "steps": [
163937
+ * {
163938
+ * "id": "8a385269-303e-5d82-8ce3-d2c82d1c2af7",
163939
+ * "key": "unanswered_message-1",
163940
+ * "situation": "conversed",
163941
+ * "kind": "message",
163942
+ * "position": 1,
163943
+ * "channel": "same_chat",
163944
+ * "fallback_channel": null,
163945
+ * "wait": {
163946
+ * "type": "duration",
163947
+ * "value": 4,
163948
+ * "unit": "hours",
163949
+ * "from": "start",
163950
+ * "from_step": null,
163951
+ * "hours": 4
163952
+ * },
163953
+ * "wait_after_previous": {
163954
+ * "value": 4,
163955
+ * "unit": "hours"
163956
+ * },
163957
+ * "at_hours": 4,
163958
+ * "mode": "auto",
163959
+ * "mode_effective": "auto",
163960
+ * "sends": true,
163961
+ * "not_sent_reason": null,
163962
+ * "needs_template": false,
163963
+ * "content": {
163964
+ * "type": "ai_message",
163965
+ * "template_after_window": true
163966
+ * },
163967
+ * "config_ref": {
163968
+ * "type": "recontacto",
163969
+ * "rail": "unanswered_message",
163970
+ * "step": 1,
163971
+ * "after_hours": 4,
163972
+ * "unit": null,
163973
+ * "autonomy": "auto",
163974
+ * "channel": null,
163975
+ * "min_score": null
163976
+ * },
163977
+ * "warnings": [],
163978
+ * "stats": {
163979
+ * "waiting_now": 18,
163980
+ * "sent_30d": 212,
163981
+ * "reply_rate_30d": 0.231,
163982
+ * "daily_14d": [
163983
+ * 6,
163984
+ * 8,
163985
+ * 7,
163986
+ * 9,
163987
+ * 8,
163988
+ * 7,
163989
+ * 8,
163990
+ * 9,
163991
+ * 6,
163992
+ * 7,
163993
+ * 8,
163994
+ * 9,
163995
+ * 7,
163996
+ * 8
163997
+ * ]
163998
+ * }
163999
+ * },
164000
+ * {
164001
+ * "id": "4a6f17b4-0255-5c56-bdc5-93d14b544d5d",
164002
+ * "key": "unanswered_message-2",
164003
+ * "situation": "conversed",
164004
+ * "kind": "message",
164005
+ * "position": 2,
164006
+ * "channel": "same_chat",
164007
+ * "fallback_channel": null,
164008
+ * "wait": {
164009
+ * "type": "duration",
164010
+ * "value": 30,
164011
+ * "unit": "hours",
164012
+ * "from": "previous_step",
164013
+ * "from_step": "unanswered_message-1",
164014
+ * "hours": 30
164015
+ * },
164016
+ * "wait_after_previous": {
164017
+ * "value": 30,
164018
+ * "unit": "hours"
164019
+ * },
164020
+ * "at_hours": 34,
164021
+ * "mode": "auto",
164022
+ * "mode_effective": "auto",
164023
+ * "sends": true,
164024
+ * "not_sent_reason": null,
164025
+ * "needs_template": true,
164026
+ * "content": {
164027
+ * "type": "ai_message",
164028
+ * "template_after_window": true
164029
+ * },
164030
+ * "config_ref": {
164031
+ * "type": "recontacto",
164032
+ * "rail": "unanswered_message",
164033
+ * "step": 2,
164034
+ * "after_hours": 30,
164035
+ * "unit": null,
164036
+ * "autonomy": "auto",
164037
+ * "channel": null,
164038
+ * "min_score": null
164039
+ * },
164040
+ * "warnings": [
164041
+ * "Instagram no permite escribir pasadas 24 h: este mensaje no saldrá a quien no tenga teléfono."
164042
+ * ],
164043
+ * "stats": {
164044
+ * "waiting_now": 11,
164045
+ * "sent_30d": 164,
164046
+ * "reply_rate_30d": 0.14,
164047
+ * "daily_14d": [
164048
+ * 5,
164049
+ * 6,
164050
+ * 5,
164051
+ * 6,
164052
+ * 5,
164053
+ * 6,
164054
+ * 5,
164055
+ * 6,
164056
+ * 5,
164057
+ * 6,
164058
+ * 5,
164059
+ * 6,
164060
+ * 5,
164061
+ * 6
164062
+ * ]
164063
+ * }
164064
+ * },
164065
+ * {
164066
+ * "id": "7876340a-bc26-5e3c-8ef7-778cd18f1eda",
164067
+ * "key": "stalled-1",
164068
+ * "situation": "conversed",
164069
+ * "kind": "message",
164070
+ * "position": 3,
164071
+ * "channel": "whatsapp",
164072
+ * "fallback_channel": null,
164073
+ * "wait": {
164074
+ * "type": "duration",
164075
+ * "value": 2,
164076
+ * "unit": "days",
164077
+ * "from": "start",
164078
+ * "from_step": null,
164079
+ * "hours": 48
164080
+ * },
164081
+ * "wait_after_previous": {
164082
+ * "value": 14,
164083
+ * "unit": "hours"
164084
+ * },
164085
+ * "at_hours": 48,
164086
+ * "mode": "auto",
164087
+ * "mode_effective": "auto",
164088
+ * "sends": true,
164089
+ * "not_sent_reason": null,
164090
+ * "needs_template": true,
164091
+ * "content": {
164092
+ * "type": "ai_message",
164093
+ * "template_after_window": true
164094
+ * },
164095
+ * "config_ref": {
164096
+ * "type": "recontacto",
164097
+ * "rail": "stalled",
164098
+ * "step": 1,
164099
+ * "after_hours": 48,
164100
+ * "unit": "d",
164101
+ * "autonomy": "auto",
164102
+ * "channel": "whatsapp",
164103
+ * "min_score": null
164104
+ * },
164105
+ * "warnings": [],
164106
+ * "stats": {
164107
+ * "waiting_now": 9,
164108
+ * "sent_30d": 120,
164109
+ * "reply_rate_30d": 0.092,
164110
+ * "daily_14d": [
164111
+ * 4,
164112
+ * 4,
164113
+ * 4,
164114
+ * 4,
164115
+ * 4,
164116
+ * 4,
164117
+ * 4,
164118
+ * 4,
164119
+ * 4,
164120
+ * 4,
164121
+ * 4,
164122
+ * 4,
164123
+ * 4,
164124
+ * 4
164125
+ * ]
164126
+ * }
164127
+ * },
164128
+ * {
164129
+ * "id": "3f04a26b-1479-5a3b-9f58-95c52e16c0a5",
164130
+ * "key": "stalled-2",
164131
+ * "situation": "conversed",
164132
+ * "kind": "message",
164133
+ * "position": 4,
164134
+ * "channel": "whatsapp",
164135
+ * "fallback_channel": null,
164136
+ * "wait": {
164137
+ * "type": "duration",
164138
+ * "value": 3,
164139
+ * "unit": "days",
164140
+ * "from": "previous_step",
164141
+ * "from_step": "stalled-1",
164142
+ * "hours": 72
164143
+ * },
164144
+ * "wait_after_previous": {
164145
+ * "value": 3,
164146
+ * "unit": "days"
164147
+ * },
164148
+ * "at_hours": 120,
164149
+ * "mode": "auto",
164150
+ * "mode_effective": "auto",
164151
+ * "sends": true,
164152
+ * "not_sent_reason": null,
164153
+ * "needs_template": true,
164154
+ * "content": {
164155
+ * "type": "ai_message",
164156
+ * "template_after_window": true
164157
+ * },
164158
+ * "config_ref": {
164159
+ * "type": "recontacto",
164160
+ * "rail": "stalled",
164161
+ * "step": 2,
164162
+ * "after_hours": 72,
164163
+ * "unit": "d",
164164
+ * "autonomy": "auto",
164165
+ * "channel": "whatsapp",
164166
+ * "min_score": null
164167
+ * },
164168
+ * "warnings": [],
164169
+ * "stats": {
164170
+ * "waiting_now": 7,
164171
+ * "sent_30d": 46,
164172
+ * "reply_rate_30d": 0.065,
164173
+ * "daily_14d": [
164174
+ * 1,
164175
+ * 2,
164176
+ * 1,
164177
+ * 2,
164178
+ * 1,
164179
+ * 2,
164180
+ * 1,
164181
+ * 2,
164182
+ * 1,
164183
+ * 2,
164184
+ * 1,
164185
+ * 2,
164186
+ * 1,
164187
+ * 2
164188
+ * ]
164189
+ * }
164190
+ * },
164191
+ * {
164192
+ * "id": "ec87b5be-92d7-51a5-9936-c5131838d9ab",
164193
+ * "key": "never_replied-1",
164194
+ * "situation": "never_replied",
164195
+ * "kind": "message",
164196
+ * "position": 1,
164197
+ * "channel": "whatsapp",
164198
+ * "fallback_channel": null,
164199
+ * "wait": {
164200
+ * "type": "duration",
164201
+ * "value": 3,
164202
+ * "unit": "hours",
164203
+ * "from": "start",
164204
+ * "from_step": null,
164205
+ * "hours": 3
164206
+ * },
164207
+ * "wait_after_previous": {
164208
+ * "value": 3,
164209
+ * "unit": "hours"
164210
+ * },
164211
+ * "at_hours": 3,
164212
+ * "mode": "auto",
164213
+ * "mode_effective": "auto",
164214
+ * "sends": true,
164215
+ * "not_sent_reason": null,
164216
+ * "needs_template": true,
164217
+ * "content": {
164218
+ * "type": "ai_message",
164219
+ * "template_after_window": true
164220
+ * },
164221
+ * "config_ref": {
164222
+ * "type": "recontacto",
164223
+ * "rail": "never_replied",
164224
+ * "step": 1,
164225
+ * "after_hours": 3,
164226
+ * "unit": "h",
164227
+ * "autonomy": "auto",
164228
+ * "channel": "whatsapp",
164229
+ * "min_score": null
164230
+ * },
164231
+ * "warnings": [
164232
+ * "Muy pronto: un seguimiento a menos de 12 horas de nuestro primer mensaje casi nunca tiene respuesta."
164233
+ * ],
164234
+ * "stats": {
164235
+ * "waiting_now": 1,
164236
+ * "sent_30d": 92,
164237
+ * "reply_rate_30d": 0.076,
164238
+ * "daily_14d": [
164239
+ * 3,
164240
+ * 3,
164241
+ * 3,
164242
+ * 3,
164243
+ * 3,
164244
+ * 3,
164245
+ * 3,
164246
+ * 3,
164247
+ * 3,
164248
+ * 3,
164249
+ * 3,
164250
+ * 3,
164251
+ * 3,
164252
+ * 3
164253
+ * ]
164254
+ * }
164255
+ * },
164256
+ * {
164257
+ * "id": "9211cfce-9740-5f79-b76c-962cb908f160",
164258
+ * "key": "never_replied-2",
164259
+ * "situation": "never_replied",
164260
+ * "kind": "message",
164261
+ * "position": 2,
164262
+ * "channel": "whatsapp",
164263
+ * "fallback_channel": null,
164264
+ * "wait": {
164265
+ * "type": "duration",
164266
+ * "value": 5,
164267
+ * "unit": "hours",
164268
+ * "from": "previous_step",
164269
+ * "from_step": "never_replied-1",
164270
+ * "hours": 5
164271
+ * },
164272
+ * "wait_after_previous": {
164273
+ * "value": 5,
164274
+ * "unit": "hours"
164275
+ * },
164276
+ * "at_hours": 8,
164277
+ * "mode": "auto",
164278
+ * "mode_effective": "auto",
164279
+ * "sends": true,
164280
+ * "not_sent_reason": null,
164281
+ * "needs_template": true,
164282
+ * "content": {
164283
+ * "type": "ai_message",
164284
+ * "template_after_window": true
164285
+ * },
164286
+ * "config_ref": {
164287
+ * "type": "recontacto",
164288
+ * "rail": "never_replied",
164289
+ * "step": 2,
164290
+ * "after_hours": 5,
164291
+ * "unit": "h",
164292
+ * "autonomy": "auto",
164293
+ * "channel": "whatsapp",
164294
+ * "min_score": null
164295
+ * },
164296
+ * "warnings": [],
164297
+ * "stats": {
164298
+ * "waiting_now": 0,
164299
+ * "sent_30d": 0,
164300
+ * "reply_rate_30d": null,
164301
+ * "daily_14d": [
164302
+ * 0,
164303
+ * 0,
164304
+ * 0,
164305
+ * 0,
164306
+ * 0,
164307
+ * 0,
164308
+ * 0,
164309
+ * 0,
164310
+ * 0,
164311
+ * 0,
164312
+ * 0,
164313
+ * 0,
164314
+ * 0,
164315
+ * 0
164316
+ * ]
164317
+ * }
164318
+ * },
164319
+ * {
164320
+ * "id": "2e4ea654-9d30-50e7-b586-6aae005a35f3",
164321
+ * "key": "never_replied-3",
164322
+ * "situation": "never_replied",
164323
+ * "kind": "message",
164324
+ * "position": 3,
164325
+ * "channel": "whatsapp",
164326
+ * "fallback_channel": null,
164327
+ * "wait": {
164328
+ * "type": "duration",
164329
+ * "value": 40,
164330
+ * "unit": "hours",
164331
+ * "from": "previous_step",
164332
+ * "from_step": "never_replied-2",
164333
+ * "hours": 40
164334
+ * },
164335
+ * "wait_after_previous": {
164336
+ * "value": 40,
164337
+ * "unit": "hours"
164338
+ * },
164339
+ * "at_hours": 48,
164340
+ * "mode": "auto",
164341
+ * "mode_effective": "auto",
164342
+ * "sends": true,
164343
+ * "not_sent_reason": null,
164344
+ * "needs_template": true,
164345
+ * "content": {
164346
+ * "type": "ai_message",
164347
+ * "template_after_window": true
164348
+ * },
164349
+ * "config_ref": {
164350
+ * "type": "recontacto",
164351
+ * "rail": "never_replied",
164352
+ * "step": 3,
164353
+ * "after_hours": 40,
164354
+ * "unit": "d",
164355
+ * "autonomy": "auto",
164356
+ * "channel": "whatsapp",
164357
+ * "min_score": null
164358
+ * },
164359
+ * "warnings": [],
164360
+ * "stats": {
164361
+ * "waiting_now": 0,
164362
+ * "sent_30d": 0,
164363
+ * "reply_rate_30d": null,
164364
+ * "daily_14d": [
164365
+ * 0,
164366
+ * 0,
164367
+ * 0,
164368
+ * 0,
164369
+ * 0,
164370
+ * 0,
164371
+ * 0,
164372
+ * 0,
164373
+ * 0,
164374
+ * 0,
164375
+ * 0,
164376
+ * 0,
164377
+ * 0,
164378
+ * 0
164379
+ * ]
164380
+ * }
164381
+ * },
164382
+ * {
164383
+ * "id": "5a157200-6687-519a-b3a1-7c7da36b88d8",
164384
+ * "key": "never_replied-4",
164385
+ * "situation": "never_replied",
164386
+ * "kind": "message",
164387
+ * "position": 4,
164388
+ * "channel": "whatsapp",
164389
+ * "fallback_channel": null,
164390
+ * "wait": {
164391
+ * "type": "duration",
164392
+ * "value": 3,
164393
+ * "unit": "days",
164394
+ * "from": "previous_step",
164395
+ * "from_step": "never_replied-3",
164396
+ * "hours": 72
164397
+ * },
164398
+ * "wait_after_previous": {
164399
+ * "value": 3,
164400
+ * "unit": "days"
164401
+ * },
164402
+ * "at_hours": 120,
164403
+ * "mode": "auto",
164404
+ * "mode_effective": "auto",
164405
+ * "sends": true,
164406
+ * "not_sent_reason": null,
164407
+ * "needs_template": true,
164408
+ * "content": {
164409
+ * "type": "ai_message",
164410
+ * "template_after_window": true
164411
+ * },
164412
+ * "config_ref": {
164413
+ * "type": "recontacto",
164414
+ * "rail": "never_replied",
164415
+ * "step": 4,
164416
+ * "after_hours": 72,
164417
+ * "unit": "d",
164418
+ * "autonomy": "auto",
164419
+ * "channel": "whatsapp",
164420
+ * "min_score": null
164421
+ * },
164422
+ * "warnings": [],
164423
+ * "stats": {
164424
+ * "waiting_now": 0,
164425
+ * "sent_30d": 0,
164426
+ * "reply_rate_30d": null,
164427
+ * "daily_14d": [
164428
+ * 0,
164429
+ * 0,
164430
+ * 0,
164431
+ * 0,
164432
+ * 0,
164433
+ * 0,
164434
+ * 0,
164435
+ * 0,
164436
+ * 0,
164437
+ * 0,
164438
+ * 0,
164439
+ * 0,
164440
+ * 0,
164441
+ * 0
164442
+ * ]
164443
+ * }
164444
+ * },
164445
+ * {
164446
+ * "id": "09d4bf1d-8cbb-553c-8b68-ff0373a4cb37",
164447
+ * "key": "lost-1",
164448
+ * "situation": "lost",
164449
+ * "kind": "message",
164450
+ * "position": 1,
164451
+ * "channel": "whatsapp",
164452
+ * "fallback_channel": null,
164453
+ * "wait": {
164454
+ * "type": "duration",
164455
+ * "value": 30,
164456
+ * "unit": "days",
164457
+ * "from": "start",
164458
+ * "from_step": null,
164459
+ * "hours": 720
164460
+ * },
164461
+ * "wait_after_previous": {
164462
+ * "value": 30,
164463
+ * "unit": "days"
164464
+ * },
164465
+ * "at_hours": 720,
164466
+ * "mode": "approval",
164467
+ * "mode_effective": "approval",
164468
+ * "sends": true,
164469
+ * "not_sent_reason": null,
164470
+ * "needs_template": true,
164471
+ * "content": {
164472
+ * "type": "ai_message",
164473
+ * "template_after_window": true
164474
+ * },
164475
+ * "config_ref": {
164476
+ * "type": "recontacto",
164477
+ * "rail": "lost",
164478
+ * "step": 1,
164479
+ * "after_hours": 720,
164480
+ * "unit": "d",
164481
+ * "autonomy": "approval",
164482
+ * "channel": "whatsapp",
164483
+ * "min_score": null
164484
+ * },
164485
+ * "warnings": [],
164486
+ * "stats": {
164487
+ * "waiting_now": 9,
164488
+ * "sent_30d": 27,
164489
+ * "reply_rate_30d": 0.185,
164490
+ * "daily_14d": [
164491
+ * 1,
164492
+ * 1,
164493
+ * 1,
164494
+ * 1,
164495
+ * 1,
164496
+ * 1,
164497
+ * 1,
164498
+ * 1,
164499
+ * 1,
164500
+ * 1,
164501
+ * 1,
164502
+ * 1,
164503
+ * 1,
164504
+ * 1
164505
+ * ]
164506
+ * }
164507
+ * }
164508
+ * ],
164509
+ * "connections": [
164510
+ * {
164511
+ * "from": "entry",
164512
+ * "to": "unanswered_message-1",
164513
+ * "kind": "next",
164514
+ * "situation": "conversed"
164515
+ * },
164516
+ * {
164517
+ * "from": "unanswered_message-1",
164518
+ * "to": "exit",
164519
+ * "kind": "reply_exit",
164520
+ * "situation": "conversed"
164521
+ * },
164522
+ * {
164523
+ * "from": "unanswered_message-1",
164524
+ * "to": "unanswered_message-2",
164525
+ * "kind": "next",
164526
+ * "situation": "conversed"
164527
+ * },
164528
+ * {
164529
+ * "from": "unanswered_message-2",
164530
+ * "to": "exit",
164531
+ * "kind": "reply_exit",
164532
+ * "situation": "conversed"
164533
+ * },
164534
+ * {
164535
+ * "from": "unanswered_message-2",
164536
+ * "to": "stalled-1",
164537
+ * "kind": "next",
164538
+ * "situation": "conversed"
164539
+ * },
164540
+ * {
164541
+ * "from": "stalled-1",
164542
+ * "to": "exit",
164543
+ * "kind": "reply_exit",
164544
+ * "situation": "conversed"
164545
+ * },
164546
+ * {
164547
+ * "from": "stalled-1",
164548
+ * "to": "stalled-2",
164549
+ * "kind": "next",
164550
+ * "situation": "conversed"
164551
+ * },
164552
+ * {
164553
+ * "from": "stalled-2",
164554
+ * "to": "exit",
164555
+ * "kind": "reply_exit",
164556
+ * "situation": "conversed"
164557
+ * },
164558
+ * {
164559
+ * "from": "stalled-2",
164560
+ * "to": "end:conversed",
164561
+ * "kind": "end",
164562
+ * "situation": "conversed"
164563
+ * },
164564
+ * {
164565
+ * "from": "entry",
164566
+ * "to": "never_replied-1",
164567
+ * "kind": "next",
164568
+ * "situation": "never_replied"
164569
+ * },
164570
+ * {
164571
+ * "from": "never_replied-1",
164572
+ * "to": "exit",
164573
+ * "kind": "reply_exit",
164574
+ * "situation": "never_replied"
164575
+ * },
164576
+ * {
164577
+ * "from": "never_replied-1",
164578
+ * "to": "never_replied-2",
164579
+ * "kind": "next",
164580
+ * "situation": "never_replied"
164581
+ * },
164582
+ * {
164583
+ * "from": "never_replied-2",
164584
+ * "to": "exit",
164585
+ * "kind": "reply_exit",
164586
+ * "situation": "never_replied"
164587
+ * },
164588
+ * {
164589
+ * "from": "never_replied-2",
164590
+ * "to": "never_replied-3",
164591
+ * "kind": "next",
164592
+ * "situation": "never_replied"
164593
+ * },
164594
+ * {
164595
+ * "from": "never_replied-3",
164596
+ * "to": "exit",
164597
+ * "kind": "reply_exit",
164598
+ * "situation": "never_replied"
164599
+ * },
164600
+ * {
164601
+ * "from": "never_replied-3",
164602
+ * "to": "never_replied-4",
164603
+ * "kind": "next",
164604
+ * "situation": "never_replied"
164605
+ * },
164606
+ * {
164607
+ * "from": "never_replied-4",
164608
+ * "to": "exit",
164609
+ * "kind": "reply_exit",
164610
+ * "situation": "never_replied"
164611
+ * },
164612
+ * {
164613
+ * "from": "never_replied-4",
164614
+ * "to": "end:never_replied",
164615
+ * "kind": "end",
164616
+ * "situation": "never_replied"
164617
+ * },
164618
+ * {
164619
+ * "from": "entry",
164620
+ * "to": "lost-1",
164621
+ * "kind": "next",
164622
+ * "situation": "lost"
164623
+ * },
164624
+ * {
164625
+ * "from": "lost-1",
164626
+ * "to": "exit",
164627
+ * "kind": "reply_exit",
164628
+ * "situation": "lost"
164629
+ * },
164630
+ * {
164631
+ * "from": "lost-1",
164632
+ * "to": "end:lost",
164633
+ * "kind": "end",
164634
+ * "situation": "lost"
164635
+ * }
164636
+ * ],
164637
+ * "window_markers": [
164638
+ * {
164639
+ * "situation": "conversed",
164640
+ * "after_step": "unanswered_message-1",
164641
+ * "label": "se cierra la ventana de WhatsApp (se cuenta desde el último mensaje del cliente): desde aquí, solo plantillas aprobadas"
164642
+ * }
164643
+ * ],
164644
+ * "ends": [
164645
+ * {
164646
+ * "key": "end:conversed",
164647
+ * "situation": "conversed",
164648
+ * "type": "mark_lost",
164649
+ * "after": {
164650
+ * "value": 7,
164651
+ * "unit": "days"
164652
+ * },
164653
+ * "at_hours": 288,
164654
+ * "label": "Lo marcamos perdido",
164655
+ * "detail": "Si sigue sin responder 7 días después del último mensaje.",
164656
+ * "continues_in": {
164657
+ * "sequence_key": "builtin:si-no-responde",
164658
+ * "situation": "lost"
164659
+ * }
164660
+ * },
164661
+ * {
164662
+ * "key": "end:never_replied",
164663
+ * "situation": "never_replied",
164664
+ * "type": "mark_lost",
164665
+ * "after": {
164666
+ * "value": 7,
164667
+ * "unit": "days"
164668
+ * },
164669
+ * "at_hours": 288,
164670
+ * "label": "Lo marcamos perdido",
164671
+ * "detail": "Si sigue sin responder 7 días después del último mensaje.",
164672
+ * "continues_in": {
164673
+ * "sequence_key": "builtin:si-no-responde",
164674
+ * "situation": "lost"
164675
+ * }
164676
+ * },
164677
+ * {
164678
+ * "key": "end:lost",
164679
+ * "situation": "lost",
164680
+ * "type": "finish",
164681
+ * "after": null,
164682
+ * "at_hours": null,
164683
+ * "label": "Fin de este camino.",
164684
+ * "detail": "Si vuelve a escribir y después se queda en silencio, empieza otro.",
164685
+ * "continues_in": null
164686
+ * }
164687
+ * ],
164688
+ * "stats": {
164689
+ * "waiting_now": 55,
164690
+ * "sent_30d": 661,
164691
+ * "reply_rate_30d": 0.148,
164692
+ * "daily_14d": [
164693
+ * 20,
164694
+ * 24,
164695
+ * 21,
164696
+ * 25,
164697
+ * 22,
164698
+ * 23,
164699
+ * 22,
164700
+ * 25,
164701
+ * 20,
164702
+ * 23,
164703
+ * 22,
164704
+ * 25,
164705
+ * 21,
164706
+ * 24
164707
+ * ]
164708
+ * }
164709
+ * }
164710
+ * ]
164711
+ * }
164712
+ */
164713
+ "application/json": {
164714
+ data: components["schemas"]["Sequence"][];
164715
+ };
164716
+ };
164717
+ };
164718
+ /** @description Validation error */
164719
+ 400: {
164720
+ headers: {
164721
+ [name: string]: unknown;
164722
+ };
164723
+ content: {
164724
+ "application/json": components["schemas"]["Error"];
164725
+ };
164726
+ };
164727
+ /** @description Unauthorized */
164728
+ 401: {
164729
+ headers: {
164730
+ [name: string]: unknown;
164731
+ };
164732
+ content: {
164733
+ "application/json": components["schemas"]["Error"];
164734
+ };
164735
+ };
164736
+ /** @description Forbidden */
164737
+ 403: {
164738
+ headers: {
164739
+ [name: string]: unknown;
164740
+ };
164741
+ content: {
164742
+ "application/json": components["schemas"]["Error"];
164743
+ };
164744
+ };
164745
+ /** @description Not found */
164746
+ 404: {
164747
+ headers: {
164748
+ [name: string]: unknown;
164749
+ };
164750
+ content: {
164751
+ "application/json": components["schemas"]["Error"];
164752
+ };
164753
+ };
164754
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
164755
+ 409: {
164756
+ headers: {
164757
+ [name: string]: unknown;
164758
+ };
164759
+ content: {
164760
+ "application/json": components["schemas"]["Error"];
164761
+ };
164762
+ };
164763
+ /** @description Rate limited */
164764
+ 429: {
164765
+ headers: {
164766
+ [name: string]: unknown;
164767
+ };
164768
+ content: {
164769
+ "application/json": components["schemas"]["Error"];
164770
+ };
164771
+ };
164772
+ };
164773
+ };
164774
+ put?: never;
164775
+ post?: never;
164776
+ delete?: never;
164777
+ options?: never;
164778
+ head?: never;
164779
+ patch?: never;
164780
+ trace?: never;
164781
+ };
164782
+ "/sequences/{id}": {
164783
+ parameters: {
164784
+ query?: never;
164785
+ header?: never;
164786
+ path?: never;
164787
+ cookie?: never;
164788
+ };
164789
+ /**
164790
+ * Read one sequence
164791
+ * @description One sequence by its uuid or by its key (`builtin:al-llegar`, `builtin:si-no-responde`, `builtin:avisos`). Each sequence carries `situations` (its lanes: «Conversó y dejó de responder», «Nunca respondió», «Ya está perdido» for `builtin:si-no-responde`; one per lead source for `builtin:al-llegar`; one per recipe for `builtin:avisos`), `steps` (channel, the configured `wait`, the drawn `wait_after_previous` and `at_hours`, `mode` as configured and `mode_effective`, the config block it comes from in `config_ref`, and `stats`: `waiting_now`, `sent_30d`, `reply_rate_30d`, `daily_14d`), `connections` between step keys and the `entry` / `exit` / `end:<situation>` nodes (`reply_exit` is «si responde»), `window_markers` (where WhatsApp’s 24 h window closes; from there only approved templates) and `ends` (mark lost, finish, or continue in another sequence). Order, gaps and markers of «Si no responde» come from the same simulation `GET /followups/recontacto/plan` renders.
164792
+ *
164793
+ * A built-in’s uuid is stable for the workspace. 404 for any other id. Requires `followups:read`.
164794
+ */
164795
+ get: {
164796
+ parameters: {
164797
+ query?: {
164798
+ lang?: "es" | "en";
164799
+ };
164800
+ header?: never;
164801
+ path: {
164802
+ id: string;
164803
+ };
164804
+ cookie?: never;
164805
+ };
164806
+ requestBody?: never;
164807
+ responses: {
164808
+ /** @description The sequence */
164809
+ 200: {
164810
+ headers: {
164811
+ [name: string]: unknown;
164812
+ };
164813
+ content: {
164814
+ /**
164815
+ * @example {
164816
+ * "data": {
164817
+ * "id": "dd63825c-cb16-553d-90cc-6cb4fa694ce8",
164818
+ * "key": "builtin:si-no-responde",
164819
+ * "kind": "builtin",
164820
+ * "name": "Si no responde",
164821
+ * "description": "Le escribimos a quien dejó de responder, nunca respondió o ya está perdido.",
164822
+ * "status": "active",
164823
+ * "entry": {
164824
+ * "type": "event",
164825
+ * "event": "customer_went_quiet",
164826
+ * "filters": [
164827
+ * {
164828
+ * "field": "situation",
164829
+ * "op": "in",
164830
+ * "values": [
164831
+ * "conversed",
164832
+ * "never_replied",
164833
+ * "lost"
164834
+ * ]
164835
+ * }
164836
+ * ]
164837
+ * },
164838
+ * "goal": {
164839
+ * "type": "reply",
164840
+ * "label": "Que el cliente vuelva a responder"
164841
+ * },
164842
+ * "agent_id": null,
164843
+ * "priority": 3,
164844
+ * "situations": [
164845
+ * {
164846
+ * "key": "conversed",
164847
+ * "name": "Conversó y dejó de responder",
164848
+ * "enabled": true,
164849
+ * "first_step": "unanswered_message-1",
164850
+ * "waiting_now": 45,
164851
+ * "notes": []
164852
+ * },
164853
+ * {
164854
+ * "key": "never_replied",
164855
+ * "name": "Nunca respondió",
164856
+ * "enabled": true,
164857
+ * "first_step": "never_replied-1",
164858
+ * "waiting_now": 1,
164859
+ * "notes": []
164860
+ * },
164861
+ * {
164862
+ * "key": "lost",
164863
+ * "name": "Ya está perdido",
164864
+ * "enabled": true,
164865
+ * "first_step": "lost-1",
164866
+ * "waiting_now": 9,
164867
+ * "notes": [
164868
+ * "A quien compró en otro lado o dijo que no quiere, no le escribimos."
164869
+ * ]
164870
+ * }
164871
+ * ],
164872
+ * "steps": [
164873
+ * {
164874
+ * "id": "8a385269-303e-5d82-8ce3-d2c82d1c2af7",
164875
+ * "key": "unanswered_message-1",
164876
+ * "situation": "conversed",
164877
+ * "kind": "message",
164878
+ * "position": 1,
164879
+ * "channel": "same_chat",
164880
+ * "fallback_channel": null,
164881
+ * "wait": {
164882
+ * "type": "duration",
164883
+ * "value": 4,
164884
+ * "unit": "hours",
164885
+ * "from": "start",
164886
+ * "from_step": null,
164887
+ * "hours": 4
164888
+ * },
164889
+ * "wait_after_previous": {
164890
+ * "value": 4,
164891
+ * "unit": "hours"
164892
+ * },
164893
+ * "at_hours": 4,
164894
+ * "mode": "auto",
164895
+ * "mode_effective": "auto",
164896
+ * "sends": true,
164897
+ * "not_sent_reason": null,
164898
+ * "needs_template": false,
164899
+ * "content": {
164900
+ * "type": "ai_message",
164901
+ * "template_after_window": true
164902
+ * },
164903
+ * "config_ref": {
164904
+ * "type": "recontacto",
164905
+ * "rail": "unanswered_message",
164906
+ * "step": 1,
164907
+ * "after_hours": 4,
164908
+ * "unit": null,
164909
+ * "autonomy": "auto",
164910
+ * "channel": null,
164911
+ * "min_score": null
164912
+ * },
164913
+ * "warnings": [],
164914
+ * "stats": {
164915
+ * "waiting_now": 18,
164916
+ * "sent_30d": 212,
164917
+ * "reply_rate_30d": 0.231,
164918
+ * "daily_14d": [
164919
+ * 6,
164920
+ * 8,
164921
+ * 7,
164922
+ * 9,
164923
+ * 8,
164924
+ * 7,
164925
+ * 8,
164926
+ * 9,
164927
+ * 6,
164928
+ * 7,
164929
+ * 8,
164930
+ * 9,
164931
+ * 7,
164932
+ * 8
164933
+ * ]
164934
+ * }
164935
+ * },
164936
+ * {
164937
+ * "id": "4a6f17b4-0255-5c56-bdc5-93d14b544d5d",
164938
+ * "key": "unanswered_message-2",
164939
+ * "situation": "conversed",
164940
+ * "kind": "message",
164941
+ * "position": 2,
164942
+ * "channel": "same_chat",
164943
+ * "fallback_channel": null,
164944
+ * "wait": {
164945
+ * "type": "duration",
164946
+ * "value": 30,
164947
+ * "unit": "hours",
164948
+ * "from": "previous_step",
164949
+ * "from_step": "unanswered_message-1",
164950
+ * "hours": 30
164951
+ * },
164952
+ * "wait_after_previous": {
164953
+ * "value": 30,
164954
+ * "unit": "hours"
164955
+ * },
164956
+ * "at_hours": 34,
164957
+ * "mode": "auto",
164958
+ * "mode_effective": "auto",
164959
+ * "sends": true,
164960
+ * "not_sent_reason": null,
164961
+ * "needs_template": true,
164962
+ * "content": {
164963
+ * "type": "ai_message",
164964
+ * "template_after_window": true
164965
+ * },
164966
+ * "config_ref": {
164967
+ * "type": "recontacto",
164968
+ * "rail": "unanswered_message",
164969
+ * "step": 2,
164970
+ * "after_hours": 30,
164971
+ * "unit": null,
164972
+ * "autonomy": "auto",
164973
+ * "channel": null,
164974
+ * "min_score": null
164975
+ * },
164976
+ * "warnings": [
164977
+ * "Instagram no permite escribir pasadas 24 h: este mensaje no saldrá a quien no tenga teléfono."
164978
+ * ],
164979
+ * "stats": {
164980
+ * "waiting_now": 11,
164981
+ * "sent_30d": 164,
164982
+ * "reply_rate_30d": 0.14,
164983
+ * "daily_14d": [
164984
+ * 5,
164985
+ * 6,
164986
+ * 5,
164987
+ * 6,
164988
+ * 5,
164989
+ * 6,
164990
+ * 5,
164991
+ * 6,
164992
+ * 5,
164993
+ * 6,
164994
+ * 5,
164995
+ * 6,
164996
+ * 5,
164997
+ * 6
164998
+ * ]
164999
+ * }
165000
+ * },
165001
+ * {
165002
+ * "id": "7876340a-bc26-5e3c-8ef7-778cd18f1eda",
165003
+ * "key": "stalled-1",
165004
+ * "situation": "conversed",
165005
+ * "kind": "message",
165006
+ * "position": 3,
165007
+ * "channel": "whatsapp",
165008
+ * "fallback_channel": null,
165009
+ * "wait": {
165010
+ * "type": "duration",
165011
+ * "value": 2,
165012
+ * "unit": "days",
165013
+ * "from": "start",
165014
+ * "from_step": null,
165015
+ * "hours": 48
165016
+ * },
165017
+ * "wait_after_previous": {
165018
+ * "value": 14,
165019
+ * "unit": "hours"
165020
+ * },
165021
+ * "at_hours": 48,
165022
+ * "mode": "auto",
165023
+ * "mode_effective": "auto",
165024
+ * "sends": true,
165025
+ * "not_sent_reason": null,
165026
+ * "needs_template": true,
165027
+ * "content": {
165028
+ * "type": "ai_message",
165029
+ * "template_after_window": true
165030
+ * },
165031
+ * "config_ref": {
165032
+ * "type": "recontacto",
165033
+ * "rail": "stalled",
165034
+ * "step": 1,
165035
+ * "after_hours": 48,
165036
+ * "unit": "d",
165037
+ * "autonomy": "auto",
165038
+ * "channel": "whatsapp",
165039
+ * "min_score": null
165040
+ * },
165041
+ * "warnings": [],
165042
+ * "stats": {
165043
+ * "waiting_now": 9,
165044
+ * "sent_30d": 120,
165045
+ * "reply_rate_30d": 0.092,
165046
+ * "daily_14d": [
165047
+ * 4,
165048
+ * 4,
165049
+ * 4,
165050
+ * 4,
165051
+ * 4,
165052
+ * 4,
165053
+ * 4,
165054
+ * 4,
165055
+ * 4,
165056
+ * 4,
165057
+ * 4,
165058
+ * 4,
165059
+ * 4,
165060
+ * 4
165061
+ * ]
165062
+ * }
165063
+ * },
165064
+ * {
165065
+ * "id": "3f04a26b-1479-5a3b-9f58-95c52e16c0a5",
165066
+ * "key": "stalled-2",
165067
+ * "situation": "conversed",
165068
+ * "kind": "message",
165069
+ * "position": 4,
165070
+ * "channel": "whatsapp",
165071
+ * "fallback_channel": null,
165072
+ * "wait": {
165073
+ * "type": "duration",
165074
+ * "value": 3,
165075
+ * "unit": "days",
165076
+ * "from": "previous_step",
165077
+ * "from_step": "stalled-1",
165078
+ * "hours": 72
165079
+ * },
165080
+ * "wait_after_previous": {
165081
+ * "value": 3,
165082
+ * "unit": "days"
165083
+ * },
165084
+ * "at_hours": 120,
165085
+ * "mode": "auto",
165086
+ * "mode_effective": "auto",
165087
+ * "sends": true,
165088
+ * "not_sent_reason": null,
165089
+ * "needs_template": true,
165090
+ * "content": {
165091
+ * "type": "ai_message",
165092
+ * "template_after_window": true
165093
+ * },
165094
+ * "config_ref": {
165095
+ * "type": "recontacto",
165096
+ * "rail": "stalled",
165097
+ * "step": 2,
165098
+ * "after_hours": 72,
165099
+ * "unit": "d",
165100
+ * "autonomy": "auto",
165101
+ * "channel": "whatsapp",
165102
+ * "min_score": null
165103
+ * },
165104
+ * "warnings": [],
165105
+ * "stats": {
165106
+ * "waiting_now": 7,
165107
+ * "sent_30d": 46,
165108
+ * "reply_rate_30d": 0.065,
165109
+ * "daily_14d": [
165110
+ * 1,
165111
+ * 2,
165112
+ * 1,
165113
+ * 2,
165114
+ * 1,
165115
+ * 2,
165116
+ * 1,
165117
+ * 2,
165118
+ * 1,
165119
+ * 2,
165120
+ * 1,
165121
+ * 2,
165122
+ * 1,
165123
+ * 2
165124
+ * ]
165125
+ * }
165126
+ * },
165127
+ * {
165128
+ * "id": "ec87b5be-92d7-51a5-9936-c5131838d9ab",
165129
+ * "key": "never_replied-1",
165130
+ * "situation": "never_replied",
165131
+ * "kind": "message",
165132
+ * "position": 1,
165133
+ * "channel": "whatsapp",
165134
+ * "fallback_channel": null,
165135
+ * "wait": {
165136
+ * "type": "duration",
165137
+ * "value": 3,
165138
+ * "unit": "hours",
165139
+ * "from": "start",
165140
+ * "from_step": null,
165141
+ * "hours": 3
165142
+ * },
165143
+ * "wait_after_previous": {
165144
+ * "value": 3,
165145
+ * "unit": "hours"
165146
+ * },
165147
+ * "at_hours": 3,
165148
+ * "mode": "auto",
165149
+ * "mode_effective": "auto",
165150
+ * "sends": true,
165151
+ * "not_sent_reason": null,
165152
+ * "needs_template": true,
165153
+ * "content": {
165154
+ * "type": "ai_message",
165155
+ * "template_after_window": true
165156
+ * },
165157
+ * "config_ref": {
165158
+ * "type": "recontacto",
165159
+ * "rail": "never_replied",
165160
+ * "step": 1,
165161
+ * "after_hours": 3,
165162
+ * "unit": "h",
165163
+ * "autonomy": "auto",
165164
+ * "channel": "whatsapp",
165165
+ * "min_score": null
165166
+ * },
165167
+ * "warnings": [
165168
+ * "Muy pronto: un seguimiento a menos de 12 horas de nuestro primer mensaje casi nunca tiene respuesta."
165169
+ * ],
165170
+ * "stats": {
165171
+ * "waiting_now": 1,
165172
+ * "sent_30d": 92,
165173
+ * "reply_rate_30d": 0.076,
165174
+ * "daily_14d": [
165175
+ * 3,
165176
+ * 3,
165177
+ * 3,
165178
+ * 3,
165179
+ * 3,
165180
+ * 3,
165181
+ * 3,
165182
+ * 3,
165183
+ * 3,
165184
+ * 3,
165185
+ * 3,
165186
+ * 3,
165187
+ * 3,
165188
+ * 3
165189
+ * ]
165190
+ * }
165191
+ * },
165192
+ * {
165193
+ * "id": "9211cfce-9740-5f79-b76c-962cb908f160",
165194
+ * "key": "never_replied-2",
165195
+ * "situation": "never_replied",
165196
+ * "kind": "message",
165197
+ * "position": 2,
165198
+ * "channel": "whatsapp",
165199
+ * "fallback_channel": null,
165200
+ * "wait": {
165201
+ * "type": "duration",
165202
+ * "value": 5,
165203
+ * "unit": "hours",
165204
+ * "from": "previous_step",
165205
+ * "from_step": "never_replied-1",
165206
+ * "hours": 5
165207
+ * },
165208
+ * "wait_after_previous": {
165209
+ * "value": 5,
165210
+ * "unit": "hours"
165211
+ * },
165212
+ * "at_hours": 8,
165213
+ * "mode": "auto",
165214
+ * "mode_effective": "auto",
165215
+ * "sends": true,
165216
+ * "not_sent_reason": null,
165217
+ * "needs_template": true,
165218
+ * "content": {
165219
+ * "type": "ai_message",
165220
+ * "template_after_window": true
165221
+ * },
165222
+ * "config_ref": {
165223
+ * "type": "recontacto",
165224
+ * "rail": "never_replied",
165225
+ * "step": 2,
165226
+ * "after_hours": 5,
165227
+ * "unit": "h",
165228
+ * "autonomy": "auto",
165229
+ * "channel": "whatsapp",
165230
+ * "min_score": null
165231
+ * },
165232
+ * "warnings": [],
165233
+ * "stats": {
165234
+ * "waiting_now": 0,
165235
+ * "sent_30d": 0,
165236
+ * "reply_rate_30d": null,
165237
+ * "daily_14d": [
165238
+ * 0,
165239
+ * 0,
165240
+ * 0,
165241
+ * 0,
165242
+ * 0,
165243
+ * 0,
165244
+ * 0,
165245
+ * 0,
165246
+ * 0,
165247
+ * 0,
165248
+ * 0,
165249
+ * 0,
165250
+ * 0,
165251
+ * 0
165252
+ * ]
165253
+ * }
165254
+ * },
165255
+ * {
165256
+ * "id": "2e4ea654-9d30-50e7-b586-6aae005a35f3",
165257
+ * "key": "never_replied-3",
165258
+ * "situation": "never_replied",
165259
+ * "kind": "message",
165260
+ * "position": 3,
165261
+ * "channel": "whatsapp",
165262
+ * "fallback_channel": null,
165263
+ * "wait": {
165264
+ * "type": "duration",
165265
+ * "value": 40,
165266
+ * "unit": "hours",
165267
+ * "from": "previous_step",
165268
+ * "from_step": "never_replied-2",
165269
+ * "hours": 40
165270
+ * },
165271
+ * "wait_after_previous": {
165272
+ * "value": 40,
165273
+ * "unit": "hours"
165274
+ * },
165275
+ * "at_hours": 48,
165276
+ * "mode": "auto",
165277
+ * "mode_effective": "auto",
165278
+ * "sends": true,
165279
+ * "not_sent_reason": null,
165280
+ * "needs_template": true,
165281
+ * "content": {
165282
+ * "type": "ai_message",
165283
+ * "template_after_window": true
165284
+ * },
165285
+ * "config_ref": {
165286
+ * "type": "recontacto",
165287
+ * "rail": "never_replied",
165288
+ * "step": 3,
165289
+ * "after_hours": 40,
165290
+ * "unit": "d",
165291
+ * "autonomy": "auto",
165292
+ * "channel": "whatsapp",
165293
+ * "min_score": null
165294
+ * },
165295
+ * "warnings": [],
165296
+ * "stats": {
165297
+ * "waiting_now": 0,
165298
+ * "sent_30d": 0,
165299
+ * "reply_rate_30d": null,
165300
+ * "daily_14d": [
165301
+ * 0,
165302
+ * 0,
165303
+ * 0,
165304
+ * 0,
165305
+ * 0,
165306
+ * 0,
165307
+ * 0,
165308
+ * 0,
165309
+ * 0,
165310
+ * 0,
165311
+ * 0,
165312
+ * 0,
165313
+ * 0,
165314
+ * 0
165315
+ * ]
165316
+ * }
165317
+ * },
165318
+ * {
165319
+ * "id": "5a157200-6687-519a-b3a1-7c7da36b88d8",
165320
+ * "key": "never_replied-4",
165321
+ * "situation": "never_replied",
165322
+ * "kind": "message",
165323
+ * "position": 4,
165324
+ * "channel": "whatsapp",
165325
+ * "fallback_channel": null,
165326
+ * "wait": {
165327
+ * "type": "duration",
165328
+ * "value": 3,
165329
+ * "unit": "days",
165330
+ * "from": "previous_step",
165331
+ * "from_step": "never_replied-3",
165332
+ * "hours": 72
165333
+ * },
165334
+ * "wait_after_previous": {
165335
+ * "value": 3,
165336
+ * "unit": "days"
165337
+ * },
165338
+ * "at_hours": 120,
165339
+ * "mode": "auto",
165340
+ * "mode_effective": "auto",
165341
+ * "sends": true,
165342
+ * "not_sent_reason": null,
165343
+ * "needs_template": true,
165344
+ * "content": {
165345
+ * "type": "ai_message",
165346
+ * "template_after_window": true
165347
+ * },
165348
+ * "config_ref": {
165349
+ * "type": "recontacto",
165350
+ * "rail": "never_replied",
165351
+ * "step": 4,
165352
+ * "after_hours": 72,
165353
+ * "unit": "d",
165354
+ * "autonomy": "auto",
165355
+ * "channel": "whatsapp",
165356
+ * "min_score": null
165357
+ * },
165358
+ * "warnings": [],
165359
+ * "stats": {
165360
+ * "waiting_now": 0,
165361
+ * "sent_30d": 0,
165362
+ * "reply_rate_30d": null,
165363
+ * "daily_14d": [
165364
+ * 0,
165365
+ * 0,
165366
+ * 0,
165367
+ * 0,
165368
+ * 0,
165369
+ * 0,
165370
+ * 0,
165371
+ * 0,
165372
+ * 0,
165373
+ * 0,
165374
+ * 0,
165375
+ * 0,
165376
+ * 0,
165377
+ * 0
165378
+ * ]
165379
+ * }
165380
+ * },
165381
+ * {
165382
+ * "id": "09d4bf1d-8cbb-553c-8b68-ff0373a4cb37",
165383
+ * "key": "lost-1",
165384
+ * "situation": "lost",
165385
+ * "kind": "message",
165386
+ * "position": 1,
165387
+ * "channel": "whatsapp",
165388
+ * "fallback_channel": null,
165389
+ * "wait": {
165390
+ * "type": "duration",
165391
+ * "value": 30,
165392
+ * "unit": "days",
165393
+ * "from": "start",
165394
+ * "from_step": null,
165395
+ * "hours": 720
165396
+ * },
165397
+ * "wait_after_previous": {
165398
+ * "value": 30,
165399
+ * "unit": "days"
165400
+ * },
165401
+ * "at_hours": 720,
165402
+ * "mode": "approval",
165403
+ * "mode_effective": "approval",
165404
+ * "sends": true,
165405
+ * "not_sent_reason": null,
165406
+ * "needs_template": true,
165407
+ * "content": {
165408
+ * "type": "ai_message",
165409
+ * "template_after_window": true
165410
+ * },
165411
+ * "config_ref": {
165412
+ * "type": "recontacto",
165413
+ * "rail": "lost",
165414
+ * "step": 1,
165415
+ * "after_hours": 720,
165416
+ * "unit": "d",
165417
+ * "autonomy": "approval",
165418
+ * "channel": "whatsapp",
165419
+ * "min_score": null
165420
+ * },
165421
+ * "warnings": [],
165422
+ * "stats": {
165423
+ * "waiting_now": 9,
165424
+ * "sent_30d": 27,
165425
+ * "reply_rate_30d": 0.185,
165426
+ * "daily_14d": [
165427
+ * 1,
165428
+ * 1,
165429
+ * 1,
165430
+ * 1,
165431
+ * 1,
165432
+ * 1,
165433
+ * 1,
165434
+ * 1,
165435
+ * 1,
165436
+ * 1,
165437
+ * 1,
165438
+ * 1,
165439
+ * 1,
165440
+ * 1
165441
+ * ]
165442
+ * }
165443
+ * }
165444
+ * ],
165445
+ * "connections": [
165446
+ * {
165447
+ * "from": "entry",
165448
+ * "to": "unanswered_message-1",
165449
+ * "kind": "next",
165450
+ * "situation": "conversed"
165451
+ * },
165452
+ * {
165453
+ * "from": "unanswered_message-1",
165454
+ * "to": "exit",
165455
+ * "kind": "reply_exit",
165456
+ * "situation": "conversed"
165457
+ * },
165458
+ * {
165459
+ * "from": "unanswered_message-1",
165460
+ * "to": "unanswered_message-2",
165461
+ * "kind": "next",
165462
+ * "situation": "conversed"
165463
+ * },
165464
+ * {
165465
+ * "from": "unanswered_message-2",
165466
+ * "to": "exit",
165467
+ * "kind": "reply_exit",
165468
+ * "situation": "conversed"
165469
+ * },
165470
+ * {
165471
+ * "from": "unanswered_message-2",
165472
+ * "to": "stalled-1",
165473
+ * "kind": "next",
165474
+ * "situation": "conversed"
165475
+ * },
165476
+ * {
165477
+ * "from": "stalled-1",
165478
+ * "to": "exit",
165479
+ * "kind": "reply_exit",
165480
+ * "situation": "conversed"
165481
+ * },
165482
+ * {
165483
+ * "from": "stalled-1",
165484
+ * "to": "stalled-2",
165485
+ * "kind": "next",
165486
+ * "situation": "conversed"
165487
+ * },
165488
+ * {
165489
+ * "from": "stalled-2",
165490
+ * "to": "exit",
165491
+ * "kind": "reply_exit",
165492
+ * "situation": "conversed"
165493
+ * },
165494
+ * {
165495
+ * "from": "stalled-2",
165496
+ * "to": "end:conversed",
165497
+ * "kind": "end",
165498
+ * "situation": "conversed"
165499
+ * },
165500
+ * {
165501
+ * "from": "entry",
165502
+ * "to": "never_replied-1",
165503
+ * "kind": "next",
165504
+ * "situation": "never_replied"
165505
+ * },
165506
+ * {
165507
+ * "from": "never_replied-1",
165508
+ * "to": "exit",
165509
+ * "kind": "reply_exit",
165510
+ * "situation": "never_replied"
165511
+ * },
165512
+ * {
165513
+ * "from": "never_replied-1",
165514
+ * "to": "never_replied-2",
165515
+ * "kind": "next",
165516
+ * "situation": "never_replied"
165517
+ * },
165518
+ * {
165519
+ * "from": "never_replied-2",
165520
+ * "to": "exit",
165521
+ * "kind": "reply_exit",
165522
+ * "situation": "never_replied"
165523
+ * },
165524
+ * {
165525
+ * "from": "never_replied-2",
165526
+ * "to": "never_replied-3",
165527
+ * "kind": "next",
165528
+ * "situation": "never_replied"
165529
+ * },
165530
+ * {
165531
+ * "from": "never_replied-3",
165532
+ * "to": "exit",
165533
+ * "kind": "reply_exit",
165534
+ * "situation": "never_replied"
165535
+ * },
165536
+ * {
165537
+ * "from": "never_replied-3",
165538
+ * "to": "never_replied-4",
165539
+ * "kind": "next",
165540
+ * "situation": "never_replied"
165541
+ * },
165542
+ * {
165543
+ * "from": "never_replied-4",
165544
+ * "to": "exit",
165545
+ * "kind": "reply_exit",
165546
+ * "situation": "never_replied"
165547
+ * },
165548
+ * {
165549
+ * "from": "never_replied-4",
165550
+ * "to": "end:never_replied",
165551
+ * "kind": "end",
165552
+ * "situation": "never_replied"
165553
+ * },
165554
+ * {
165555
+ * "from": "entry",
165556
+ * "to": "lost-1",
165557
+ * "kind": "next",
165558
+ * "situation": "lost"
165559
+ * },
165560
+ * {
165561
+ * "from": "lost-1",
165562
+ * "to": "exit",
165563
+ * "kind": "reply_exit",
165564
+ * "situation": "lost"
165565
+ * },
165566
+ * {
165567
+ * "from": "lost-1",
165568
+ * "to": "end:lost",
165569
+ * "kind": "end",
165570
+ * "situation": "lost"
165571
+ * }
165572
+ * ],
165573
+ * "window_markers": [
165574
+ * {
165575
+ * "situation": "conversed",
165576
+ * "after_step": "unanswered_message-1",
165577
+ * "label": "se cierra la ventana de WhatsApp (se cuenta desde el último mensaje del cliente): desde aquí, solo plantillas aprobadas"
165578
+ * }
165579
+ * ],
165580
+ * "ends": [
165581
+ * {
165582
+ * "key": "end:conversed",
165583
+ * "situation": "conversed",
165584
+ * "type": "mark_lost",
165585
+ * "after": {
165586
+ * "value": 7,
165587
+ * "unit": "days"
165588
+ * },
165589
+ * "at_hours": 288,
165590
+ * "label": "Lo marcamos perdido",
165591
+ * "detail": "Si sigue sin responder 7 días después del último mensaje.",
165592
+ * "continues_in": {
165593
+ * "sequence_key": "builtin:si-no-responde",
165594
+ * "situation": "lost"
165595
+ * }
165596
+ * },
165597
+ * {
165598
+ * "key": "end:never_replied",
165599
+ * "situation": "never_replied",
165600
+ * "type": "mark_lost",
165601
+ * "after": {
165602
+ * "value": 7,
165603
+ * "unit": "days"
165604
+ * },
165605
+ * "at_hours": 288,
165606
+ * "label": "Lo marcamos perdido",
165607
+ * "detail": "Si sigue sin responder 7 días después del último mensaje.",
165608
+ * "continues_in": {
165609
+ * "sequence_key": "builtin:si-no-responde",
165610
+ * "situation": "lost"
165611
+ * }
165612
+ * },
165613
+ * {
165614
+ * "key": "end:lost",
165615
+ * "situation": "lost",
165616
+ * "type": "finish",
165617
+ * "after": null,
165618
+ * "at_hours": null,
165619
+ * "label": "Fin de este camino.",
165620
+ * "detail": "Si vuelve a escribir y después se queda en silencio, empieza otro.",
165621
+ * "continues_in": null
165622
+ * }
165623
+ * ],
165624
+ * "stats": {
165625
+ * "waiting_now": 55,
165626
+ * "sent_30d": 661,
165627
+ * "reply_rate_30d": 0.148,
165628
+ * "daily_14d": [
165629
+ * 20,
165630
+ * 24,
165631
+ * 21,
165632
+ * 25,
165633
+ * 22,
165634
+ * 23,
165635
+ * 22,
165636
+ * 25,
165637
+ * 20,
165638
+ * 23,
165639
+ * 22,
165640
+ * 25,
165641
+ * 21,
165642
+ * 24
165643
+ * ]
165644
+ * }
165645
+ * }
165646
+ * }
165647
+ */
165648
+ "application/json": {
165649
+ data: components["schemas"]["Sequence"];
165650
+ };
165651
+ };
165652
+ };
165653
+ /** @description Validation error */
165654
+ 400: {
165655
+ headers: {
165656
+ [name: string]: unknown;
165657
+ };
165658
+ content: {
165659
+ "application/json": components["schemas"]["Error"];
165660
+ };
165661
+ };
165662
+ /** @description Unauthorized */
165663
+ 401: {
165664
+ headers: {
165665
+ [name: string]: unknown;
165666
+ };
165667
+ content: {
165668
+ "application/json": components["schemas"]["Error"];
165669
+ };
165670
+ };
165671
+ /** @description Forbidden */
165672
+ 403: {
165673
+ headers: {
165674
+ [name: string]: unknown;
165675
+ };
165676
+ content: {
165677
+ "application/json": components["schemas"]["Error"];
165678
+ };
165679
+ };
165680
+ /** @description Not found */
165681
+ 404: {
165682
+ headers: {
165683
+ [name: string]: unknown;
165684
+ };
165685
+ content: {
165686
+ "application/json": components["schemas"]["Error"];
165687
+ };
165688
+ };
165689
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
165690
+ 409: {
165691
+ headers: {
165692
+ [name: string]: unknown;
165693
+ };
165694
+ content: {
165695
+ "application/json": components["schemas"]["Error"];
165696
+ };
165697
+ };
165698
+ /** @description Rate limited */
165699
+ 429: {
165700
+ headers: {
165701
+ [name: string]: unknown;
165702
+ };
165703
+ content: {
165704
+ "application/json": components["schemas"]["Error"];
165705
+ };
165706
+ };
165707
+ };
165708
+ };
165709
+ put?: never;
165710
+ post?: never;
165711
+ delete?: never;
165712
+ options?: never;
165713
+ head?: never;
165714
+ patch?: never;
165715
+ trace?: never;
165716
+ };
165717
+ "/sequences/{id}/simulate": {
165718
+ parameters: {
165719
+ query?: never;
165720
+ header?: never;
165721
+ path?: never;
165722
+ cookie?: never;
165723
+ };
165724
+ get?: never;
165725
+ put?: never;
165726
+ /**
165727
+ * Simulate what one customer will receive
165728
+ * @description Walks «Si no responde» for ONE person: a real `contact_id` or a test `persona` (`has_whatsapp`, `opted_out`), from the moment our last message went out (`last_message_at`), with what the customer does (`behavior`: `never_replies`, `replies_after_step`; `pays` and `promises_date` are collections behaviors and are no-ops for sequences without payment steps). Returns the `timeline` (each step with the moment the ladder draws it, `planned_at`, and the moment the engine really sends it after contact hours and pacing, `shifted_at`, with `shift_reason`, a `preview` when a stored draft or approved template exists, and a `status`) and the real `end` reason: replied, end_of_sequence, marked_lost, no_fitting_approved_message, no_channel_left, message_limit_reached or opted_out. It is the same simulation `GET /followups/recontacto/plan` renders, so it follows the engine’s rules (contact hours from 9:00, the 24 h WhatsApp window, per-person limits, opt-out). Deterministic: no model call, nothing is sent or stored. `version` is `published` (default); drafts and version ids are resolved by the drafts feature (app#6448). Only `builtin:si-no-responde` is simulable today. Requires `followups:read`.
165729
+ */
165730
+ post: {
165731
+ parameters: {
165732
+ query?: never;
165733
+ header?: {
165734
+ /** @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. */
165735
+ "Idempotency-Key"?: string;
165736
+ };
165737
+ path: {
165738
+ id: string;
165739
+ };
165740
+ cookie?: never;
165741
+ };
165742
+ requestBody?: {
165743
+ content: {
165744
+ /**
165745
+ * @example {
165746
+ * "persona": {
165747
+ * "name": "Cliente de prueba",
165748
+ * "has_whatsapp": true,
165749
+ * "opted_out": false
165750
+ * },
165751
+ * "last_message_at": "2026-10-21T19:00:00Z",
165752
+ * "situation": "never_replied",
165753
+ * "behavior": {
165754
+ * "kind": "replies_after_step",
165755
+ * "step": 2
165756
+ * }
165757
+ * }
165758
+ */
165759
+ "application/json": components["schemas"]["SequenceSimulateRequest"];
165760
+ };
165761
+ };
165762
+ responses: {
165763
+ /** @description The timeline and how it ends */
165764
+ 200: {
165765
+ headers: {
165766
+ [name: string]: unknown;
165767
+ };
165768
+ content: {
165769
+ /**
165770
+ * @example {
165771
+ * "data": {
165772
+ * "timeline": [
165773
+ * {
165774
+ * "step_id": "c2f1a7b4-6d0e-5b8a-9a77-0b9f5d3e1c10",
165775
+ * "step_key": "never_replied-1",
165776
+ * "channel": "whatsapp",
165777
+ * "planned_at": "2026-10-21T22:00:00.000Z",
165778
+ * "shifted_at": "2026-10-21T22:00:00.000Z",
165779
+ * "status": "sends"
165780
+ * },
165781
+ * {
165782
+ * "step_id": "3a9d6e52-1f48-5c3b-8e0d-7a4c2b6f9d21",
165783
+ * "step_key": "never_replied-2",
165784
+ * "channel": "whatsapp",
165785
+ * "planned_at": "2026-10-22T03:00:00.000Z",
165786
+ * "shifted_at": "2026-10-22T12:00:00.000Z",
165787
+ * "shift_reason": "outside_contact_hours",
165788
+ * "status": "sends"
165789
+ * }
165790
+ * ],
165791
+ * "end": {
165792
+ * "reason": "replied",
165793
+ * "at_step": "3a9d6e52-1f48-5c3b-8e0d-7a4c2b6f9d21",
165794
+ * "at": "2026-10-22T12:00:00.000Z"
165795
+ * },
165796
+ * "notes": []
165797
+ * }
165798
+ * }
165799
+ */
165800
+ "application/json": {
165801
+ data: components["schemas"]["SequenceSimulation"];
165802
+ };
165803
+ };
165804
+ };
165805
+ /** @description Validation error */
165806
+ 400: {
165807
+ headers: {
165808
+ [name: string]: unknown;
165809
+ };
165810
+ content: {
165811
+ "application/json": components["schemas"]["Error"];
165812
+ };
165813
+ };
165814
+ /** @description Unauthorized */
165815
+ 401: {
165816
+ headers: {
165817
+ [name: string]: unknown;
165818
+ };
165819
+ content: {
165820
+ "application/json": components["schemas"]["Error"];
165821
+ };
165822
+ };
165823
+ /** @description Forbidden */
165824
+ 403: {
165825
+ headers: {
165826
+ [name: string]: unknown;
165827
+ };
165828
+ content: {
165829
+ "application/json": components["schemas"]["Error"];
165830
+ };
165831
+ };
165832
+ /** @description Not found */
165833
+ 404: {
165834
+ headers: {
165835
+ [name: string]: unknown;
165836
+ };
165837
+ content: {
165838
+ "application/json": components["schemas"]["Error"];
165839
+ };
165840
+ };
165841
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
165842
+ 409: {
165843
+ headers: {
165844
+ [name: string]: unknown;
165845
+ };
165846
+ content: {
165847
+ "application/json": components["schemas"]["Error"];
165848
+ };
165849
+ };
165850
+ /** @description Rate limited */
165851
+ 429: {
165852
+ headers: {
165853
+ [name: string]: unknown;
165854
+ };
165855
+ content: {
165856
+ "application/json": components["schemas"]["Error"];
165857
+ };
165858
+ };
165859
+ };
165860
+ };
165861
+ delete?: never;
165862
+ options?: never;
165863
+ head?: never;
165864
+ patch?: never;
165865
+ trace?: never;
165866
+ };
163366
165867
  "/help-centers": {
163367
165868
  parameters: {
163368
165869
  query?: never;
@@ -237516,39 +240017,796 @@ interface paths {
237516
240017
  };
237517
240018
  };
237518
240019
  };
237519
- put?: never;
237520
- post?: never;
240020
+ put?: never;
240021
+ post?: never;
240022
+ delete?: never;
240023
+ options?: never;
240024
+ head?: never;
240025
+ /**
240026
+ * Mark the catalog reviewed, or that the store sells without one
240027
+ * @description The owner’s two marks no table can know: `catalog_reviewed` (`true` stamps the review, `false` clears it) and `sells_without_store` (no Shopify / WooCommerce to connect; the Vitrina catalog is the store). Answers with the recomputed setup. Requires `tenant:write`.
240028
+ */
240029
+ patch: {
240030
+ parameters: {
240031
+ query?: never;
240032
+ header?: never;
240033
+ path?: never;
240034
+ cookie?: never;
240035
+ };
240036
+ requestBody?: {
240037
+ content: {
240038
+ /**
240039
+ * @example {
240040
+ * "catalog_reviewed": true
240041
+ * }
240042
+ */
240043
+ "application/json": {
240044
+ /** @description `true` stamps the catalog as reviewed now (kept if already stamped); `false` clears it. */
240045
+ catalog_reviewed?: boolean;
240046
+ /** @description `true` = no Shopify / WooCommerce to connect: the business sells from the Vitrina catalog, and «Conecta tu tienda» is done. */
240047
+ sells_without_store?: boolean;
240048
+ };
240049
+ };
240050
+ };
240051
+ responses: {
240052
+ /** @description The store setup after the change */
240053
+ 200: {
240054
+ headers: {
240055
+ [name: string]: unknown;
240056
+ };
240057
+ content: {
240058
+ /**
240059
+ * @example {
240060
+ * "data": {
240061
+ * "applies": true,
240062
+ * "complete": false,
240063
+ * "steps": [
240064
+ * {
240065
+ * "key": "store",
240066
+ * "status": "done"
240067
+ * },
240068
+ * {
240069
+ * "key": "catalog",
240070
+ * "status": "todo"
240071
+ * },
240072
+ * {
240073
+ * "key": "mercadopago",
240074
+ * "status": "todo"
240075
+ * }
240076
+ * ],
240077
+ * "order_payment": {
240078
+ * "mode": "mp_first",
240079
+ * "source": "tenant",
240080
+ * "default_mode": "mp_first"
240081
+ * },
240082
+ * "store": {
240083
+ * "connections": [
240084
+ * {
240085
+ * "provider": "shopify",
240086
+ * "status": "connected",
240087
+ * "account": "Tienda Ejemplo"
240088
+ * },
240089
+ * {
240090
+ * "provider": "woocommerce",
240091
+ * "status": "not_connected",
240092
+ * "account": null
240093
+ * }
240094
+ * ],
240095
+ * "sells_without_store": false
240096
+ * },
240097
+ * "catalog": {
240098
+ * "active": 42,
240099
+ * "native": 0,
240100
+ * "synced": 42,
240101
+ * "without_price": 1,
240102
+ * "without_photo": 3,
240103
+ * "reviewed_at": null
240104
+ * },
240105
+ * "mercadopago": {
240106
+ * "configured": true,
240107
+ * "connected": false,
240108
+ * "account": null
240109
+ * },
240110
+ * "bank_accounts": {
240111
+ * "active": 0
240112
+ * }
240113
+ * }
240114
+ * }
240115
+ */
240116
+ "application/json": {
240117
+ data: {
240118
+ /** @description The workspace is an ecommerce one: Home shows the steps. */
240119
+ applies: boolean;
240120
+ /** @description Every step is `done`. */
240121
+ complete: boolean;
240122
+ steps: {
240123
+ /**
240124
+ * @description `store` «Conecta tu tienda» · `catalog` «Revisa tu catálogo» · `mercadopago` «Conecta Mercado Pago» (only when native orders can be paid by link) · `bank_account` «Agrega tu cuenta para transferencias» (only when they are paid by transfer first or only).
240125
+ * @enum {string}
240126
+ */
240127
+ key: "store" | "catalog" | "mercadopago" | "bank_account";
240128
+ /**
240129
+ * @description `attention` = the step was done and broke (the store asks to be reconnected).
240130
+ * @enum {string}
240131
+ */
240132
+ status: "todo" | "done" | "attention";
240133
+ }[];
240134
+ /** @description How a native order (built from the Vitrina catalog) is paid: the workspace’s `final` charging mode. Written with `PUT /payment-settings/charging` (`{ final }`). */
240135
+ order_payment: {
240136
+ /**
240137
+ * @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
240138
+ * @enum {string}
240139
+ */
240140
+ mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
240141
+ /** @enum {string} */
240142
+ source: "tenant" | "default";
240143
+ /**
240144
+ * @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
240145
+ * @enum {string}
240146
+ */
240147
+ default_mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
240148
+ };
240149
+ store: {
240150
+ connections: {
240151
+ /** @enum {string} */
240152
+ provider: "shopify" | "woocommerce";
240153
+ /** @enum {string} */
240154
+ status: "not_connected" | "pending" | "connected" | "needs_reconnect";
240155
+ /** @description The shop’s name (Shopify) or URL (WooCommerce). */
240156
+ account: string | null;
240157
+ }[];
240158
+ /** @description The owner said the business sells from the Vitrina catalog alone. */
240159
+ sells_without_store: boolean;
240160
+ };
240161
+ catalog: {
240162
+ active: number;
240163
+ native: number;
240164
+ synced: number;
240165
+ without_price: number;
240166
+ without_photo: number;
240167
+ reviewed_at: string | null;
240168
+ };
240169
+ mercadopago: {
240170
+ /** @description This deployment can connect Mercado Pago at all. */
240171
+ configured: boolean;
240172
+ connected: boolean;
240173
+ account: string | null;
240174
+ };
240175
+ bank_accounts: {
240176
+ active: number;
240177
+ };
240178
+ };
240179
+ };
240180
+ };
240181
+ };
240182
+ /** @description Validation error */
240183
+ 400: {
240184
+ headers: {
240185
+ [name: string]: unknown;
240186
+ };
240187
+ content: {
240188
+ "application/json": components["schemas"]["Error"];
240189
+ };
240190
+ };
240191
+ /** @description Unauthorized */
240192
+ 401: {
240193
+ headers: {
240194
+ [name: string]: unknown;
240195
+ };
240196
+ content: {
240197
+ "application/json": components["schemas"]["Error"];
240198
+ };
240199
+ };
240200
+ /** @description Forbidden */
240201
+ 403: {
240202
+ headers: {
240203
+ [name: string]: unknown;
240204
+ };
240205
+ content: {
240206
+ "application/json": components["schemas"]["Error"];
240207
+ };
240208
+ };
240209
+ /** @description Not found */
240210
+ 404: {
240211
+ headers: {
240212
+ [name: string]: unknown;
240213
+ };
240214
+ content: {
240215
+ "application/json": components["schemas"]["Error"];
240216
+ };
240217
+ };
240218
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
240219
+ 409: {
240220
+ headers: {
240221
+ [name: string]: unknown;
240222
+ };
240223
+ content: {
240224
+ "application/json": components["schemas"]["Error"];
240225
+ };
240226
+ };
240227
+ /** @description Rate limited */
240228
+ 429: {
240229
+ headers: {
240230
+ [name: string]: unknown;
240231
+ };
240232
+ content: {
240233
+ "application/json": components["schemas"]["Error"];
240234
+ };
240235
+ };
240236
+ };
240237
+ };
240238
+ trace?: never;
240239
+ };
240240
+ "/outbound/approvals": {
240241
+ parameters: {
240242
+ query?: never;
240243
+ header?: never;
240244
+ path?: never;
240245
+ cookie?: never;
240246
+ };
240247
+ /**
240248
+ * List proactive messages waiting on a person
240249
+ * @description Every composed outbound message this workspace is holding for a human decision, oldest OBLIGATION first — ordered by `due_at` rather than by when the draft was written, because what is running out of time is the obligation, not the proposal. Each entry carries the draft exactly as it would be sent, the model's operator-facing `reason` (never shown to a customer), who was asked, and `expired: true` once the obligation passed its lateness bound — those stay in the list on purpose, so a reviewer sees that one ran out of time rather than finding it silently gone. Filter by `rail` for one rail's queue, or by `assignee_user_id` for one person's. An entry with a null `assignee_user_id` was routed to the workspace admins, which is a real answer and not a missing one. Rail `api` holds the sends a CONNECTED APP made past its fan-out limit (ADR 0106 §3.2); those entries carry `via: { kind, name }` — the app that wrote them («vía Claude») — and `via` is null on every other rail. `whyNow` is the owner-facing reason, in the product's register (null when the composer wrote none; `reason` stays audit material). Rail `recontacto` entries carry `recontacto: { attempt_id, step_label, auto_send_at, auto_send_at_label, template, window_closes_at, window_note }`: the step as «Si no responde» names it and, for a handed-off conversation's draft, when it sends itself if nobody reviews it («mañana 18:00», the conversation strip's own words), and whether the draft rides an approved WhatsApp template; for a free-text WhatsApp or Instagram draft, when its 24 h window closes (`window_closes_at`, tenant clock) and that in the owner’s words (`window_note`: «Envíalo antes de mañana 14:05; después sale como plantilla aprobada»). Approving a WhatsApp draft past its window re-composes it as an approved template (outcome `deferred` when it must wait for one); an Instagram one past its window is dropped (outcome `stale`, G53). `due_at` is not that moment. Null on every other rail.
240250
+ */
240251
+ get: {
240252
+ parameters: {
240253
+ query?: {
240254
+ rail?: "service_lifecycle" | "recontacto" | "seguimiento" | "campaign" | "first_touch" | "api" | "budget_followup";
240255
+ assignee_user_id?: string;
240256
+ limit?: number;
240257
+ };
240258
+ header?: never;
240259
+ path?: never;
240260
+ cookie?: never;
240261
+ };
240262
+ requestBody?: never;
240263
+ responses: {
240264
+ /** @description Pending approvals */
240265
+ 200: {
240266
+ headers: {
240267
+ [name: string]: unknown;
240268
+ };
240269
+ content: {
240270
+ /**
240271
+ * @example {
240272
+ * "data": {
240273
+ * "items": [
240274
+ * {
240275
+ * "actionId": "5c1d2e3f-4a5b-4c6d-8e7f-901a2b3c4d5e",
240276
+ * "rail": "recontacto",
240277
+ * "purpose": "recontacto_stalled",
240278
+ * "obligationClass": "follow_up",
240279
+ * "contactId": "6d2e3f4a-5b6c-4d7e-8f90-1a2b3c4d5e6f",
240280
+ * "subjectType": "lead",
240281
+ * "subjectId": "7e3f4a5b-6c7d-4e8f-901a-2b3c4d5e6f70",
240282
+ * "conversationId": "8f4a5b6c-7d8e-4f90-a12b-3c4d5e6f7081",
240283
+ * "dueAt": "2026-11-03T13:00:00.000Z",
240284
+ * "requestedAt": "2026-11-03T12:05:00.000Z",
240285
+ * "assigneeUserId": "9a5b6c7d-8e9f-4a01-b23c-4d5e6f708192",
240286
+ * "message": "Hola Camila, te escribo por el iPhone 15 Pro que viste. Te sigue interesando?",
240287
+ * "subject": null,
240288
+ * "reason": "Asked about the 15 Pro two days ago and did not answer the price.",
240289
+ * "whyNow": "Preguntó por el iPhone 15 Pro hace dos días y no respondió.",
240290
+ * "recontacto": {
240291
+ * "attempt_id": "ab6c7d8e-9f0a-4b12-834d-5e6f708192a3",
240292
+ * "step_label": "Conversó y dejó de responder · paso 3 de 4",
240293
+ * "auto_send_at": null,
240294
+ * "auto_send_at_label": null,
240295
+ * "template": true,
240296
+ * "handoff": null,
240297
+ * "window_closes_at": null,
240298
+ * "window_note": null
240299
+ * },
240300
+ * "channel": "whatsapp",
240301
+ * "via": null,
240302
+ * "decisionVersion": 1,
240303
+ * "expired": false
240304
+ * }
240305
+ * ],
240306
+ * "total": 1
240307
+ * }
240308
+ * }
240309
+ */
240310
+ "application/json": {
240311
+ data?: unknown;
240312
+ meta?: {
240313
+ [key: string]: unknown;
240314
+ };
240315
+ };
240316
+ };
240317
+ };
240318
+ /** @description Validation error */
240319
+ 400: {
240320
+ headers: {
240321
+ [name: string]: unknown;
240322
+ };
240323
+ content: {
240324
+ "application/json": components["schemas"]["Error"];
240325
+ };
240326
+ };
240327
+ /** @description Unauthorized */
240328
+ 401: {
240329
+ headers: {
240330
+ [name: string]: unknown;
240331
+ };
240332
+ content: {
240333
+ "application/json": components["schemas"]["Error"];
240334
+ };
240335
+ };
240336
+ /** @description Forbidden */
240337
+ 403: {
240338
+ headers: {
240339
+ [name: string]: unknown;
240340
+ };
240341
+ content: {
240342
+ "application/json": components["schemas"]["Error"];
240343
+ };
240344
+ };
240345
+ /** @description Not found */
240346
+ 404: {
240347
+ headers: {
240348
+ [name: string]: unknown;
240349
+ };
240350
+ content: {
240351
+ "application/json": components["schemas"]["Error"];
240352
+ };
240353
+ };
240354
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
240355
+ 409: {
240356
+ headers: {
240357
+ [name: string]: unknown;
240358
+ };
240359
+ content: {
240360
+ "application/json": components["schemas"]["Error"];
240361
+ };
240362
+ };
240363
+ /** @description Rate limited */
240364
+ 429: {
240365
+ headers: {
240366
+ [name: string]: unknown;
240367
+ };
240368
+ content: {
240369
+ "application/json": components["schemas"]["Error"];
240370
+ };
240371
+ };
240372
+ };
240373
+ };
240374
+ put?: never;
240375
+ post?: never;
240376
+ delete?: never;
240377
+ options?: never;
240378
+ head?: never;
240379
+ patch?: never;
240380
+ trace?: never;
240381
+ };
240382
+ "/outbound/approvals/{id}": {
240383
+ parameters: {
240384
+ query?: never;
240385
+ header?: never;
240386
+ path?: never;
240387
+ cookie?: never;
240388
+ };
240389
+ /**
240390
+ * Read one pending approval
240391
+ * @description One queue entry by `outbound_action` id. 404 both when it does not exist and when it belongs to another workspace — the difference is exactly what an existence oracle would leak.
240392
+ */
240393
+ get: {
240394
+ parameters: {
240395
+ query?: never;
240396
+ header?: never;
240397
+ path: {
240398
+ id: string;
240399
+ };
240400
+ cookie?: never;
240401
+ };
240402
+ requestBody?: never;
240403
+ responses: {
240404
+ /** @description The queue entry */
240405
+ 200: {
240406
+ headers: {
240407
+ [name: string]: unknown;
240408
+ };
240409
+ content: {
240410
+ /**
240411
+ * @example {
240412
+ * "data": {
240413
+ * "actionId": "5c1d2e3f-4a5b-4c6d-8e7f-901a2b3c4d5e",
240414
+ * "rail": "recontacto",
240415
+ * "purpose": "recontacto_stalled",
240416
+ * "obligationClass": "follow_up",
240417
+ * "contactId": "6d2e3f4a-5b6c-4d7e-8f90-1a2b3c4d5e6f",
240418
+ * "subjectType": "lead",
240419
+ * "subjectId": "7e3f4a5b-6c7d-4e8f-901a-2b3c4d5e6f70",
240420
+ * "conversationId": "8f4a5b6c-7d8e-4f90-a12b-3c4d5e6f7081",
240421
+ * "dueAt": "2026-11-03T13:00:00.000Z",
240422
+ * "requestedAt": "2026-11-03T12:05:00.000Z",
240423
+ * "assigneeUserId": "9a5b6c7d-8e9f-4a01-b23c-4d5e6f708192",
240424
+ * "message": "Hola Camila, te escribo por el iPhone 15 Pro que viste. Te sigue interesando?",
240425
+ * "subject": null,
240426
+ * "reason": "Asked about the 15 Pro two days ago and did not answer the price.",
240427
+ * "whyNow": "Preguntó por el iPhone 15 Pro hace dos días y no respondió.",
240428
+ * "recontacto": {
240429
+ * "attempt_id": "ab6c7d8e-9f0a-4b12-834d-5e6f708192a3",
240430
+ * "step_label": "Conversó y dejó de responder · paso 3 de 4",
240431
+ * "auto_send_at": null,
240432
+ * "auto_send_at_label": null,
240433
+ * "template": true,
240434
+ * "handoff": null,
240435
+ * "window_closes_at": null,
240436
+ * "window_note": null
240437
+ * },
240438
+ * "channel": "whatsapp",
240439
+ * "via": null,
240440
+ * "decisionVersion": 1,
240441
+ * "expired": false
240442
+ * }
240443
+ * }
240444
+ */
240445
+ "application/json": {
240446
+ data?: unknown;
240447
+ meta?: {
240448
+ [key: string]: unknown;
240449
+ };
240450
+ };
240451
+ };
240452
+ };
240453
+ /** @description Validation error */
240454
+ 400: {
240455
+ headers: {
240456
+ [name: string]: unknown;
240457
+ };
240458
+ content: {
240459
+ "application/json": components["schemas"]["Error"];
240460
+ };
240461
+ };
240462
+ /** @description Unauthorized */
240463
+ 401: {
240464
+ headers: {
240465
+ [name: string]: unknown;
240466
+ };
240467
+ content: {
240468
+ "application/json": components["schemas"]["Error"];
240469
+ };
240470
+ };
240471
+ /** @description Forbidden */
240472
+ 403: {
240473
+ headers: {
240474
+ [name: string]: unknown;
240475
+ };
240476
+ content: {
240477
+ "application/json": components["schemas"]["Error"];
240478
+ };
240479
+ };
240480
+ /** @description Not found */
240481
+ 404: {
240482
+ headers: {
240483
+ [name: string]: unknown;
240484
+ };
240485
+ content: {
240486
+ "application/json": components["schemas"]["Error"];
240487
+ };
240488
+ };
240489
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
240490
+ 409: {
240491
+ headers: {
240492
+ [name: string]: unknown;
240493
+ };
240494
+ content: {
240495
+ "application/json": components["schemas"]["Error"];
240496
+ };
240497
+ };
240498
+ /** @description Rate limited */
240499
+ 429: {
240500
+ headers: {
240501
+ [name: string]: unknown;
240502
+ };
240503
+ content: {
240504
+ "application/json": components["schemas"]["Error"];
240505
+ };
240506
+ };
240507
+ };
240508
+ };
240509
+ put?: never;
240510
+ post?: never;
240511
+ delete?: never;
240512
+ options?: never;
240513
+ head?: never;
240514
+ patch?: never;
240515
+ trace?: never;
240516
+ };
240517
+ "/outbound/approvals/{id}/approve": {
240518
+ parameters: {
240519
+ query?: never;
240520
+ header?: never;
240521
+ path?: never;
240522
+ cookie?: never;
240523
+ };
240524
+ get?: never;
240525
+ put?: never;
240526
+ /**
240527
+ * Approve (and optionally edit) a pending message
240528
+ * @description Sends it — through the shared executor, which re-runs the full policy kernel in enforce mode and re-checks freshness immediately before the provider. Approving is therefore a decision to send, not an instruction to bypass anything. The response `outcome` says what actually happened: `sent`; `stale` (the customer wrote while the proposal waited — nothing was sent and the obligation went back for a fresh evaluation); `deferred` (quiet hours, a lost arbitration, a transport backoff — it will come back on its own); or `blocked` (the kernel or the provider refused, and `reason` says which). An optional `message` replaces the draft text and NOTHING else: not the purpose, the legal basis, the channel or the obligation class, which came from the protocol and are not editable through a review screen. Recontacto proposals refuse edits outright — that rail's drafts can be approved WhatsApp templates, whose body belongs to Meta. So do `api` drafts: a member approves what the connected app wrote, or refuses it. Approving one waives its Advertencias (the approving member is the acknowledgment) and still stops on any Bloqueo. Requires `outbound_approvals:write`, `campaigns:write` AND `messages:send`. 409 when the entry is no longer pending, or when the obligation passed its lateness bound.
240529
+ */
240530
+ post: {
240531
+ parameters: {
240532
+ query?: never;
240533
+ header?: {
240534
+ /** @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. */
240535
+ "Idempotency-Key"?: string;
240536
+ };
240537
+ path: {
240538
+ id: string;
240539
+ };
240540
+ cookie?: never;
240541
+ };
240542
+ requestBody?: {
240543
+ content: {
240544
+ /**
240545
+ * @example {
240546
+ * "message": null,
240547
+ * "note": "Revisado"
240548
+ * }
240549
+ */
240550
+ "application/json": {
240551
+ message?: string | null;
240552
+ subject?: string | null;
240553
+ note?: string | null;
240554
+ };
240555
+ };
240556
+ };
240557
+ responses: {
240558
+ /** @description What happened */
240559
+ 200: {
240560
+ headers: {
240561
+ [name: string]: unknown;
240562
+ };
240563
+ content: {
240564
+ /**
240565
+ * @example {
240566
+ * "data": {
240567
+ * "outcome": "sent",
240568
+ * "actionId": "5c1d2e3f-4a5b-4c6d-8e7f-901a2b3c4d5e",
240569
+ * "reason": null,
240570
+ * "runId": null
240571
+ * }
240572
+ * }
240573
+ */
240574
+ "application/json": {
240575
+ data?: unknown;
240576
+ meta?: {
240577
+ [key: string]: unknown;
240578
+ };
240579
+ };
240580
+ };
240581
+ };
240582
+ /** @description Validation error */
240583
+ 400: {
240584
+ headers: {
240585
+ [name: string]: unknown;
240586
+ };
240587
+ content: {
240588
+ "application/json": components["schemas"]["Error"];
240589
+ };
240590
+ };
240591
+ /** @description Unauthorized */
240592
+ 401: {
240593
+ headers: {
240594
+ [name: string]: unknown;
240595
+ };
240596
+ content: {
240597
+ "application/json": components["schemas"]["Error"];
240598
+ };
240599
+ };
240600
+ /** @description Forbidden */
240601
+ 403: {
240602
+ headers: {
240603
+ [name: string]: unknown;
240604
+ };
240605
+ content: {
240606
+ "application/json": components["schemas"]["Error"];
240607
+ };
240608
+ };
240609
+ /** @description Not found */
240610
+ 404: {
240611
+ headers: {
240612
+ [name: string]: unknown;
240613
+ };
240614
+ content: {
240615
+ "application/json": components["schemas"]["Error"];
240616
+ };
240617
+ };
240618
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
240619
+ 409: {
240620
+ headers: {
240621
+ [name: string]: unknown;
240622
+ };
240623
+ content: {
240624
+ "application/json": components["schemas"]["Error"];
240625
+ };
240626
+ };
240627
+ /** @description Rate limited */
240628
+ 429: {
240629
+ headers: {
240630
+ [name: string]: unknown;
240631
+ };
240632
+ content: {
240633
+ "application/json": components["schemas"]["Error"];
240634
+ };
240635
+ };
240636
+ };
240637
+ };
240638
+ delete?: never;
240639
+ options?: never;
240640
+ head?: never;
240641
+ patch?: never;
240642
+ trace?: never;
240643
+ };
240644
+ "/outbound/approvals/{id}/reject": {
240645
+ parameters: {
240646
+ query?: never;
240647
+ header?: never;
240648
+ path?: never;
240649
+ cookie?: never;
240650
+ };
240651
+ get?: never;
240652
+ put?: never;
240653
+ /**
240654
+ * Refuse a pending message
240655
+ * @description Cancels the action, with the reviewer and the reason recorded on it. The action is CANCELLED rather than left in the queue on purpose: a refused proposal that stays pending is a proposal the next drain can execute. It does not stop the run — later steps of the same protocol are separate obligations and are unaffected (use the service-lifecycle stop or pause verbs for that). Requires only `outbound_approvals:write`: refusing to send is never the dangerous direction. Rail `recontacto`: `reason_code` `wrong_moment` / `wrong_wording` (or free text) drops this message only and the follow-up continues (G53 `draft_rejected`); `already_handled` / `should_not_contact` — or a `reason` that says so, such as «A esta persona no hay que escribirle» — also stops the follow-up (G33 `operator_dismissed`), as `/dismiss` does. The response says which in `stopped`.
240656
+ */
240657
+ post: {
240658
+ parameters: {
240659
+ query?: never;
240660
+ header?: {
240661
+ /** @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. */
240662
+ "Idempotency-Key"?: string;
240663
+ };
240664
+ path: {
240665
+ id: string;
240666
+ };
240667
+ cookie?: never;
240668
+ };
240669
+ requestBody?: {
240670
+ content: {
240671
+ /**
240672
+ * @example {
240673
+ * "reason_code": "wrong_moment",
240674
+ * "reason": null
240675
+ * }
240676
+ */
240677
+ "application/json": {
240678
+ reason?: string | null;
240679
+ /** @enum {string|null} */
240680
+ reason_code?: "wrong_moment" | "wrong_wording" | "already_handled" | "should_not_contact" | null;
240681
+ };
240682
+ };
240683
+ };
240684
+ responses: {
240685
+ /** @description The rejection */
240686
+ 200: {
240687
+ headers: {
240688
+ [name: string]: unknown;
240689
+ };
240690
+ content: {
240691
+ /**
240692
+ * @example {
240693
+ * "data": {
240694
+ * "outcome": "rejected",
240695
+ * "actionId": "5c1d2e3f-4a5b-4c6d-8e7f-901a2b3c4d5e",
240696
+ * "reason": "wrong_moment",
240697
+ * "stopped": false
240698
+ * }
240699
+ * }
240700
+ */
240701
+ "application/json": {
240702
+ data?: unknown;
240703
+ meta?: {
240704
+ [key: string]: unknown;
240705
+ };
240706
+ };
240707
+ };
240708
+ };
240709
+ /** @description Validation error */
240710
+ 400: {
240711
+ headers: {
240712
+ [name: string]: unknown;
240713
+ };
240714
+ content: {
240715
+ "application/json": components["schemas"]["Error"];
240716
+ };
240717
+ };
240718
+ /** @description Unauthorized */
240719
+ 401: {
240720
+ headers: {
240721
+ [name: string]: unknown;
240722
+ };
240723
+ content: {
240724
+ "application/json": components["schemas"]["Error"];
240725
+ };
240726
+ };
240727
+ /** @description Forbidden */
240728
+ 403: {
240729
+ headers: {
240730
+ [name: string]: unknown;
240731
+ };
240732
+ content: {
240733
+ "application/json": components["schemas"]["Error"];
240734
+ };
240735
+ };
240736
+ /** @description Not found */
240737
+ 404: {
240738
+ headers: {
240739
+ [name: string]: unknown;
240740
+ };
240741
+ content: {
240742
+ "application/json": components["schemas"]["Error"];
240743
+ };
240744
+ };
240745
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
240746
+ 409: {
240747
+ headers: {
240748
+ [name: string]: unknown;
240749
+ };
240750
+ content: {
240751
+ "application/json": components["schemas"]["Error"];
240752
+ };
240753
+ };
240754
+ /** @description Rate limited */
240755
+ 429: {
240756
+ headers: {
240757
+ [name: string]: unknown;
240758
+ };
240759
+ content: {
240760
+ "application/json": components["schemas"]["Error"];
240761
+ };
240762
+ };
240763
+ };
240764
+ };
237521
240765
  delete?: never;
237522
240766
  options?: never;
237523
240767
  head?: never;
240768
+ patch?: never;
240769
+ trace?: never;
240770
+ };
240771
+ "/outbound/approvals/{id}/dismiss": {
240772
+ parameters: {
240773
+ query?: never;
240774
+ header?: never;
240775
+ path?: never;
240776
+ cookie?: never;
240777
+ };
240778
+ get?: never;
240779
+ put?: never;
237524
240780
  /**
237525
- * Mark the catalog reviewed, or that the store sells without one
237526
- * @description The owner’s two marks no table can know: `catalog_reviewed` (`true` stamps the review, `false` clears it) and `sells_without_store` (no Shopify / WooCommerce to connect; the Vitrina catalog is the store). Answers with the recomputed setup. Requires `tenant:write`.
240781
+ * Refuse a pending message and stop the follow-up
240782
+ * @description «Descartar seguimiento». Cancels the action exactly as `/reject` does, and tells the rail to stop the follow-up too. Rail `recontacto`: the person's ladder halts (G33 `operator_dismissed`): no later step of this path is drafted or sent; a new message from the customer starts a new episode. Rails with no notion of stopping treat it as a refusal. The response is the rejection, with `stopped: true` when the follow-up stopped. Requires only `outbound_approvals:write`.
237527
240783
  */
237528
- patch: {
240784
+ post: {
237529
240785
  parameters: {
237530
240786
  query?: never;
237531
- header?: never;
237532
- path?: never;
240787
+ header?: {
240788
+ /** @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. */
240789
+ "Idempotency-Key"?: string;
240790
+ };
240791
+ path: {
240792
+ id: string;
240793
+ };
237533
240794
  cookie?: never;
237534
240795
  };
237535
240796
  requestBody?: {
237536
240797
  content: {
237537
240798
  /**
237538
240799
  * @example {
237539
- * "catalog_reviewed": true
240800
+ * "reason": "Ya compró en la tienda"
237540
240801
  * }
237541
240802
  */
237542
240803
  "application/json": {
237543
- /** @description `true` stamps the catalog as reviewed now (kept if already stamped); `false` clears it. */
237544
- catalog_reviewed?: boolean;
237545
- /** @description `true` = no Shopify / WooCommerce to connect: the business sells from the Vitrina catalog, and «Conecta tu tienda» is done. */
237546
- sells_without_store?: boolean;
240804
+ reason?: string | null;
237547
240805
  };
237548
240806
  };
237549
240807
  };
237550
240808
  responses: {
237551
- /** @description The store setup after the change */
240809
+ /** @description The dismissal */
237552
240810
  200: {
237553
240811
  headers: {
237554
240812
  [name: string]: unknown;
@@ -237557,123 +240815,17 @@ interface paths {
237557
240815
  /**
237558
240816
  * @example {
237559
240817
  * "data": {
237560
- * "applies": true,
237561
- * "complete": false,
237562
- * "steps": [
237563
- * {
237564
- * "key": "store",
237565
- * "status": "done"
237566
- * },
237567
- * {
237568
- * "key": "catalog",
237569
- * "status": "todo"
237570
- * },
237571
- * {
237572
- * "key": "mercadopago",
237573
- * "status": "todo"
237574
- * }
237575
- * ],
237576
- * "order_payment": {
237577
- * "mode": "mp_first",
237578
- * "source": "tenant",
237579
- * "default_mode": "mp_first"
237580
- * },
237581
- * "store": {
237582
- * "connections": [
237583
- * {
237584
- * "provider": "shopify",
237585
- * "status": "connected",
237586
- * "account": "Tienda Ejemplo"
237587
- * },
237588
- * {
237589
- * "provider": "woocommerce",
237590
- * "status": "not_connected",
237591
- * "account": null
237592
- * }
237593
- * ],
237594
- * "sells_without_store": false
237595
- * },
237596
- * "catalog": {
237597
- * "active": 42,
237598
- * "native": 0,
237599
- * "synced": 42,
237600
- * "without_price": 1,
237601
- * "without_photo": 3,
237602
- * "reviewed_at": null
237603
- * },
237604
- * "mercadopago": {
237605
- * "configured": true,
237606
- * "connected": false,
237607
- * "account": null
237608
- * },
237609
- * "bank_accounts": {
237610
- * "active": 0
237611
- * }
240818
+ * "outcome": "rejected",
240819
+ * "actionId": "5c1d2e3f-4a5b-4c6d-8e7f-901a2b3c4d5e",
240820
+ * "reason": "Ya compró en la tienda",
240821
+ * "stopped": true
237612
240822
  * }
237613
240823
  * }
237614
240824
  */
237615
240825
  "application/json": {
237616
- data: {
237617
- /** @description The workspace is an ecommerce one: Home shows the steps. */
237618
- applies: boolean;
237619
- /** @description Every step is `done`. */
237620
- complete: boolean;
237621
- steps: {
237622
- /**
237623
- * @description `store` «Conecta tu tienda» · `catalog` «Revisa tu catálogo» · `mercadopago` «Conecta Mercado Pago» (only when native orders can be paid by link) · `bank_account` «Agrega tu cuenta para transferencias» (only when they are paid by transfer first or only).
237624
- * @enum {string}
237625
- */
237626
- key: "store" | "catalog" | "mercadopago" | "bank_account";
237627
- /**
237628
- * @description `attention` = the step was done and broke (the store asks to be reconnected).
237629
- * @enum {string}
237630
- */
237631
- status: "todo" | "done" | "attention";
237632
- }[];
237633
- /** @description How a native order (built from the Vitrina catalog) is paid: the workspace’s `final` charging mode. Written with `PUT /payment-settings/charging` (`{ final }`). */
237634
- order_payment: {
237635
- /**
237636
- * @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
237637
- * @enum {string}
237638
- */
237639
- mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
237640
- /** @enum {string} */
237641
- source: "tenant" | "default";
237642
- /**
237643
- * @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
237644
- * @enum {string}
237645
- */
237646
- default_mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
237647
- };
237648
- store: {
237649
- connections: {
237650
- /** @enum {string} */
237651
- provider: "shopify" | "woocommerce";
237652
- /** @enum {string} */
237653
- status: "not_connected" | "pending" | "connected" | "needs_reconnect";
237654
- /** @description The shop’s name (Shopify) or URL (WooCommerce). */
237655
- account: string | null;
237656
- }[];
237657
- /** @description The owner said the business sells from the Vitrina catalog alone. */
237658
- sells_without_store: boolean;
237659
- };
237660
- catalog: {
237661
- active: number;
237662
- native: number;
237663
- synced: number;
237664
- without_price: number;
237665
- without_photo: number;
237666
- reviewed_at: string | null;
237667
- };
237668
- mercadopago: {
237669
- /** @description This deployment can connect Mercado Pago at all. */
237670
- configured: boolean;
237671
- connected: boolean;
237672
- account: string | null;
237673
- };
237674
- bank_accounts: {
237675
- active: number;
237676
- };
240826
+ data?: unknown;
240827
+ meta?: {
240828
+ [key: string]: unknown;
237677
240829
  };
237678
240830
  };
237679
240831
  };
@@ -237734,6 +240886,10 @@ interface paths {
237734
240886
  };
237735
240887
  };
237736
240888
  };
240889
+ delete?: never;
240890
+ options?: never;
240891
+ head?: never;
240892
+ patch?: never;
237737
240893
  trace?: never;
237738
240894
  };
237739
240895
  "/sandbox/clinic": {
@@ -267082,6 +270238,256 @@ interface components {
267082
270238
  requestId?: string;
267083
270239
  };
267084
270240
  };
270241
+ SequenceStep: {
270242
+ /** Format: uuid */
270243
+ id: string;
270244
+ key: string;
270245
+ situation: string | null;
270246
+ /** @enum {string} */
270247
+ kind: "message";
270248
+ position: number;
270249
+ /** @enum {string} */
270250
+ channel: "whatsapp" | "same_chat" | "instagram" | "email" | "call" | "sms";
270251
+ /** @enum {string|null} */
270252
+ fallback_channel: "whatsapp" | "same_chat" | "instagram" | "email" | "call" | "sms" | null;
270253
+ wait: {
270254
+ /** @enum {string} */
270255
+ type: "duration";
270256
+ value: number;
270257
+ /** @enum {string} */
270258
+ unit: "minutes" | "hours" | "days";
270259
+ /** @enum {string} */
270260
+ from: "previous_step" | "start";
270261
+ from_step: string | null;
270262
+ hours: number;
270263
+ } | {
270264
+ /** @enum {string} */
270265
+ type: "event";
270266
+ event: string;
270267
+ } | {
270268
+ /** @enum {string} */
270269
+ type: "agreed_time";
270270
+ };
270271
+ wait_after_previous: {
270272
+ value: number;
270273
+ /** @enum {string} */
270274
+ unit: "minutes" | "hours" | "days";
270275
+ } | null;
270276
+ at_hours: number | null;
270277
+ /** @enum {string} */
270278
+ mode: "auto" | "auto_unless_assigned" | "approval" | "skip";
270279
+ /** @enum {string} */
270280
+ mode_effective: "auto" | "auto_unless_assigned" | "approval" | "skip";
270281
+ sends: boolean;
270282
+ not_sent_reason: string | null;
270283
+ needs_template: boolean;
270284
+ content: {
270285
+ /** @enum {string} */
270286
+ type: "ai_message";
270287
+ template_after_window: boolean;
270288
+ } | {
270289
+ /** @enum {string} */
270290
+ type: "template_ladder";
270291
+ templates: {
270292
+ name: string;
270293
+ language: string;
270294
+ }[];
270295
+ } | {
270296
+ /** @enum {string} */
270297
+ type: "email";
270298
+ subject: string | null;
270299
+ custom_body: boolean;
270300
+ } | {
270301
+ /** @enum {string} */
270302
+ type: "promise";
270303
+ /** Format: uuid */
270304
+ followup_id: string;
270305
+ trigger_key: string;
270306
+ };
270307
+ config_ref: {
270308
+ /** @enum {string} */
270309
+ type: "recontacto";
270310
+ /** @enum {string} */
270311
+ rail: "unanswered_message" | "stalled" | "never_replied" | "lost";
270312
+ step: number;
270313
+ after_hours: number;
270314
+ /** @enum {string|null} */
270315
+ unit: "d" | "h" | null;
270316
+ /** @enum {string} */
270317
+ autonomy: "auto" | "assignee" | "approval";
270318
+ /** @enum {string|null} */
270319
+ channel: "whatsapp" | "instagram" | "email" | "voice" | null;
270320
+ min_score: number | null;
270321
+ } | {
270322
+ /** @enum {string} */
270323
+ type: "first_touch";
270324
+ source: string;
270325
+ /** @enum {string} */
270326
+ config_origin: "configured" | "inherited" | "platform_default";
270327
+ } | {
270328
+ /** @enum {string} */
270329
+ type: "followup";
270330
+ /** Format: uuid */
270331
+ followup_id: string;
270332
+ trigger_key: string;
270333
+ };
270334
+ warnings: string[];
270335
+ stats: {
270336
+ waiting_now: number | null;
270337
+ sent_30d: number;
270338
+ reply_rate_30d: number | null;
270339
+ daily_14d: number[];
270340
+ };
270341
+ };
270342
+ Sequence: {
270343
+ /** Format: uuid */
270344
+ id: string;
270345
+ key: string;
270346
+ /** @enum {string} */
270347
+ kind: "builtin" | "custom";
270348
+ name: string;
270349
+ description: string;
270350
+ /** @enum {string} */
270351
+ status: "active" | "paused";
270352
+ entry: {
270353
+ /** @enum {string} */
270354
+ type: "event";
270355
+ /** @enum {string} */
270356
+ event: "lead_arrived" | "customer_went_quiet" | "customer_asked_reminder";
270357
+ filters: {
270358
+ field: string;
270359
+ /** @enum {string} */
270360
+ op: "in";
270361
+ values: string[];
270362
+ }[];
270363
+ } | {
270364
+ /** @enum {string} */
270365
+ type: "list";
270366
+ /** Format: uuid */
270367
+ list_id: string;
270368
+ };
270369
+ goal: {
270370
+ /** @enum {string} */
270371
+ type: "reply" | "promise_kept";
270372
+ label: string;
270373
+ };
270374
+ /** Format: uuid */
270375
+ agent_id: string | null;
270376
+ priority: number;
270377
+ situations: {
270378
+ key: string;
270379
+ name: string;
270380
+ enabled: boolean;
270381
+ first_step: string | null;
270382
+ waiting_now: number | null;
270383
+ notes: string[];
270384
+ }[];
270385
+ steps: components["schemas"]["SequenceStep"][];
270386
+ connections: {
270387
+ from: string;
270388
+ to: string;
270389
+ /** @enum {string} */
270390
+ kind: "next" | "reply_exit" | "end";
270391
+ situation: string | null;
270392
+ }[];
270393
+ window_markers: {
270394
+ situation: string | null;
270395
+ after_step: string | null;
270396
+ label: string;
270397
+ }[];
270398
+ ends: {
270399
+ key: string;
270400
+ situation: string | null;
270401
+ /** @enum {string} */
270402
+ type: "mark_lost" | "finish" | "continue";
270403
+ after: {
270404
+ value: number;
270405
+ /** @enum {string} */
270406
+ unit: "minutes" | "hours" | "days";
270407
+ } | null;
270408
+ at_hours: number | null;
270409
+ label: string;
270410
+ detail: string | null;
270411
+ continues_in: {
270412
+ sequence_key: string;
270413
+ situation: string | null;
270414
+ } | null;
270415
+ }[];
270416
+ stats: {
270417
+ waiting_now: number | null;
270418
+ sent_30d: number;
270419
+ reply_rate_30d: number | null;
270420
+ daily_14d: number[];
270421
+ };
270422
+ };
270423
+ SequenceSimulation: {
270424
+ timeline: {
270425
+ /** Format: uuid */
270426
+ step_id: string;
270427
+ step_key: string;
270428
+ /** @enum {string} */
270429
+ channel: "whatsapp" | "same_chat" | "instagram" | "email" | "call" | "sms";
270430
+ /** Format: date-time */
270431
+ planned_at: string;
270432
+ /** Format: date-time */
270433
+ shifted_at: string;
270434
+ /** @enum {string} */
270435
+ shift_reason?: "outside_contact_hours" | "previous_late" | "unanswered_hold" | "agreed_reminder" | "min_gap" | "max_per_day" | "automated_gap" | "person_ceiling" | "appointment_soon" | "daily_cap";
270436
+ preview?: string;
270437
+ /** @enum {string} */
270438
+ status: "sends" | "awaits_approval" | "skipped_no_channel" | "skipped_no_template";
270439
+ }[];
270440
+ end: {
270441
+ /** @enum {string} */
270442
+ reason: "replied" | "end_of_sequence" | "marked_lost" | "no_fitting_approved_message" | "no_channel_left" | "message_limit_reached" | "opted_out";
270443
+ /** Format: uuid */
270444
+ at_step?: string;
270445
+ /** Format: date-time */
270446
+ at: string;
270447
+ };
270448
+ notes: string[];
270449
+ };
270450
+ SequenceSimulateRequest: {
270451
+ /**
270452
+ * Format: uuid
270453
+ * @description A real contact: WhatsApp and opted-out are read from it.
270454
+ */
270455
+ contact_id?: string;
270456
+ /** @description A test person. Exactly one of contact_id or persona. */
270457
+ persona?: {
270458
+ name?: string;
270459
+ has_whatsapp: boolean;
270460
+ opted_out: boolean;
270461
+ };
270462
+ /**
270463
+ * Format: date-time
270464
+ * @description When our last message to the person went out. Default: now.
270465
+ */
270466
+ last_message_at?: string;
270467
+ /**
270468
+ * @description Which path of «Si no responde». Default: derived from the contact (conversed when they ever wrote), else never_replied.
270469
+ * @enum {string}
270470
+ */
270471
+ situation?: "conversed" | "never_replied" | "lost";
270472
+ behavior: {
270473
+ /** @enum {string} */
270474
+ kind: "never_replies";
270475
+ } | {
270476
+ /** @enum {string} */
270477
+ kind: "replies_after_step";
270478
+ step: number;
270479
+ } | {
270480
+ /** @enum {string} */
270481
+ kind: "pays";
270482
+ at_step: number;
270483
+ } | {
270484
+ /** @enum {string} */
270485
+ kind: "promises_date";
270486
+ date: string;
270487
+ };
270488
+ /** @description `published` (default), `draft` or a version id. Drafts and versions are resolved by the drafts feature (app#6448); until it ships only `published` resolves. */
270489
+ version?: string;
270490
+ };
267085
270491
  MetaAdsAccount: {
267086
270492
  external_account_id: string;
267087
270493
  name: string;