@vitrina/api 11.16.1 → 11.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -80382,6 +80382,962 @@ interface paths {
80382
80382
  patch?: never;
80383
80383
  trace?: never;
80384
80384
  };
80385
+ "/copilot/email-voice": {
80386
+ parameters: {
80387
+ query?: never;
80388
+ header?: never;
80389
+ path?: never;
80390
+ cookie?: never;
80391
+ };
80392
+ /**
80393
+ * The workspace's email voice — read it before writing an email
80394
+ * @description Everything an AI needs to write an email that sounds like THIS workspace, in one read and with no model call: the workspace language (`locale`), its written style guide, the persona of the AI agent that serves its email (`agent_instructions` — take its tone, ignore its channel mechanics), up to five real emails people of the workspace recently sent (quoted history and signatures stripped, each capped at ~1,200 characters), the caller's default signature, and — with `contact_id` — the recipient.
80395
+ *
80396
+ * **If you are a user's own assistant connected through the Vitrina MCP, call this before drafting an email**, write in `locale`, imitate the sample emails (never copy their facts), then save the result with `POST /email-drafts` for a person to review and send. Leave the signature out of the body: it is appended when the person sends.
80397
+ *
80398
+ * The voice is the WORKSPACE's, not a member's: most human replies are typed straight into the connected mailbox, so the samples are the team's mail, not the caller's.
80399
+ */
80400
+ get: {
80401
+ parameters: {
80402
+ query?: {
80403
+ contact_id?: string;
80404
+ };
80405
+ header?: never;
80406
+ path?: never;
80407
+ cookie?: never;
80408
+ };
80409
+ requestBody?: never;
80410
+ responses: {
80411
+ /** @description The workspace email voice */
80412
+ 200: {
80413
+ headers: {
80414
+ [name: string]: unknown;
80415
+ };
80416
+ content: {
80417
+ /**
80418
+ * @example {
80419
+ * "data": {
80420
+ * "locale": "es",
80421
+ * "style_guide": "Cercano y claro. Tuteamos. Frases cortas. Nunca prometemos plazos que no controlamos.",
80422
+ * "agent_instructions": "Eres el asistente del equipo. Respondes con calidez y precisión, tuteas y cierras siempre con un próximo paso concreto.",
80423
+ * "agent": {
80424
+ * "id": "33333333-0000-4000-8000-000000000001",
80425
+ * "name": "Asistente"
80426
+ * },
80427
+ * "sample_emails": [
80428
+ * {
80429
+ * "subject": "Tu cotización",
80430
+ * "body_text": "Hola Pedro,\n\nTe adjunto la cotización que conversamos. Cualquier duda me escribes por aquí o al WhatsApp.\n\nUn abrazo,",
80431
+ * "sent_at": "2026-09-20T13:40:00.000Z"
80432
+ * }
80433
+ * ],
80434
+ * "signature": {
80435
+ * "id": "44444444-0000-4000-8000-000000000001",
80436
+ * "name": "Firma principal",
80437
+ * "text": "Persona del equipo\nEquipo comercial"
80438
+ * },
80439
+ * "contact": {
80440
+ * "id": "22222222-0000-4000-8000-000000000001",
80441
+ * "name": "María González",
80442
+ * "email": "maria.gonzalez@example.cl"
80443
+ * }
80444
+ * }
80445
+ * }
80446
+ */
80447
+ "application/json": {
80448
+ data?: unknown;
80449
+ meta?: {
80450
+ [key: string]: unknown;
80451
+ };
80452
+ };
80453
+ };
80454
+ };
80455
+ /** @description Validation error */
80456
+ 400: {
80457
+ headers: {
80458
+ [name: string]: unknown;
80459
+ };
80460
+ content: {
80461
+ "application/json": components["schemas"]["Error"];
80462
+ };
80463
+ };
80464
+ /** @description Unauthorized */
80465
+ 401: {
80466
+ headers: {
80467
+ [name: string]: unknown;
80468
+ };
80469
+ content: {
80470
+ "application/json": components["schemas"]["Error"];
80471
+ };
80472
+ };
80473
+ /** @description Forbidden */
80474
+ 403: {
80475
+ headers: {
80476
+ [name: string]: unknown;
80477
+ };
80478
+ content: {
80479
+ "application/json": components["schemas"]["Error"];
80480
+ };
80481
+ };
80482
+ /** @description Not found */
80483
+ 404: {
80484
+ headers: {
80485
+ [name: string]: unknown;
80486
+ };
80487
+ content: {
80488
+ "application/json": components["schemas"]["Error"];
80489
+ };
80490
+ };
80491
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
80492
+ 409: {
80493
+ headers: {
80494
+ [name: string]: unknown;
80495
+ };
80496
+ content: {
80497
+ "application/json": components["schemas"]["Error"];
80498
+ };
80499
+ };
80500
+ /** @description Rate limited */
80501
+ 429: {
80502
+ headers: {
80503
+ [name: string]: unknown;
80504
+ };
80505
+ content: {
80506
+ "application/json": components["schemas"]["Error"];
80507
+ };
80508
+ };
80509
+ };
80510
+ };
80511
+ put?: never;
80512
+ post?: never;
80513
+ delete?: never;
80514
+ options?: never;
80515
+ head?: never;
80516
+ patch?: never;
80517
+ trace?: never;
80518
+ };
80519
+ "/email-drafts": {
80520
+ parameters: {
80521
+ query?: never;
80522
+ header?: never;
80523
+ path?: never;
80524
+ cookie?: never;
80525
+ };
80526
+ /**
80527
+ * List email drafts
80528
+ * @description Drafts newest first (by last edit). `mine=true` (the default) lists the caller's own; `mine=false` every draft of the workspace — except for a member whose role narrows record visibility, who always sees only their own. Keyset-paginated: pass `next_cursor` back as `cursor`.
80529
+ */
80530
+ get: {
80531
+ parameters: {
80532
+ query?: {
80533
+ mine?: boolean | ("true" | "false");
80534
+ limit?: number;
80535
+ cursor?: string;
80536
+ };
80537
+ header?: never;
80538
+ path?: never;
80539
+ cookie?: never;
80540
+ };
80541
+ requestBody?: never;
80542
+ responses: {
80543
+ /** @description A page of drafts */
80544
+ 200: {
80545
+ headers: {
80546
+ [name: string]: unknown;
80547
+ };
80548
+ content: {
80549
+ /**
80550
+ * @example {
80551
+ * "data": [
80552
+ * {
80553
+ * "id": "5d5d5d5d-0000-4000-8000-000000000001",
80554
+ * "contact": {
80555
+ * "id": "22222222-0000-4000-8000-000000000001",
80556
+ * "name": "María González",
80557
+ * "email": "maria.gonzalez@example.cl"
80558
+ * },
80559
+ * "conversation_id": null,
80560
+ * "to_address": "maria.gonzalez@example.cl",
80561
+ * "cc": [],
80562
+ * "subject": "Resumen de lo que conversamos hoy",
80563
+ * "body_html": "<p>Hola María,</p><p>Te dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].</p><p>Saludos,</p>",
80564
+ * "body_text": "Hola María,\n\nTe dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].\n\nSaludos,",
80565
+ * "signature_id": null,
80566
+ * "origin": "mcp",
80567
+ * "created_by": {
80568
+ * "id": "11111111-0000-4000-8000-000000000001",
80569
+ * "name": "Persona del equipo"
80570
+ * },
80571
+ * "created_at": "2026-09-24T14:02:11.000Z",
80572
+ * "updated_at": "2026-09-24T14:05:40.000Z"
80573
+ * }
80574
+ * ],
80575
+ * "next_cursor": null,
80576
+ * "meta": {
80577
+ * "pagination": {
80578
+ * "nextCursor": null,
80579
+ * "limit": 20
80580
+ * }
80581
+ * }
80582
+ * }
80583
+ */
80584
+ "application/json": {
80585
+ data?: unknown;
80586
+ meta?: {
80587
+ [key: string]: unknown;
80588
+ };
80589
+ };
80590
+ };
80591
+ };
80592
+ /** @description Validation error */
80593
+ 400: {
80594
+ headers: {
80595
+ [name: string]: unknown;
80596
+ };
80597
+ content: {
80598
+ "application/json": components["schemas"]["Error"];
80599
+ };
80600
+ };
80601
+ /** @description Unauthorized */
80602
+ 401: {
80603
+ headers: {
80604
+ [name: string]: unknown;
80605
+ };
80606
+ content: {
80607
+ "application/json": components["schemas"]["Error"];
80608
+ };
80609
+ };
80610
+ /** @description Forbidden */
80611
+ 403: {
80612
+ headers: {
80613
+ [name: string]: unknown;
80614
+ };
80615
+ content: {
80616
+ "application/json": components["schemas"]["Error"];
80617
+ };
80618
+ };
80619
+ /** @description Not found */
80620
+ 404: {
80621
+ headers: {
80622
+ [name: string]: unknown;
80623
+ };
80624
+ content: {
80625
+ "application/json": components["schemas"]["Error"];
80626
+ };
80627
+ };
80628
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
80629
+ 409: {
80630
+ headers: {
80631
+ [name: string]: unknown;
80632
+ };
80633
+ content: {
80634
+ "application/json": components["schemas"]["Error"];
80635
+ };
80636
+ };
80637
+ /** @description Rate limited */
80638
+ 429: {
80639
+ headers: {
80640
+ [name: string]: unknown;
80641
+ };
80642
+ content: {
80643
+ "application/json": components["schemas"]["Error"];
80644
+ };
80645
+ };
80646
+ };
80647
+ };
80648
+ put?: never;
80649
+ /**
80650
+ * Save an email draft for a person to review and send
80651
+ * @description Prepares a new email WITHOUT sending it. This is how an assistant connected through the Vitrina MCP hands an email to a person: read `GET /copilot/email-voice` first so it sounds like the workspace, save it here, and a person reviews and sends it from Vitrina. `origin` is set by the server from the credential — `mcp` for an API key, personal token or connected app, `human` for a signed-in member.
80652
+ *
80653
+ * Every field is optional — a draft is work in progress, so an empty subject, an empty body or no recipient yet are all storable; what is SENDABLE is decided by `POST /email-drafts/{id}/send`. Recipient: `contact_id` (wins when both are set) or `to_address`. `body_text` is the plain text (≤8,000 characters) and what is sent as the text part; `body_html` the rich version, optional. `signature_id`: one of the sender's saved signatures, `"none"` for no signature, or `null` for the sender's default at send time. Never put a signature in the body.
80654
+ */
80655
+ post: {
80656
+ parameters: {
80657
+ query?: never;
80658
+ header?: {
80659
+ /** @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. */
80660
+ "Idempotency-Key"?: string;
80661
+ };
80662
+ path?: never;
80663
+ cookie?: never;
80664
+ };
80665
+ requestBody?: {
80666
+ content: {
80667
+ /**
80668
+ * @example {
80669
+ * "contact_id": "22222222-0000-4000-8000-000000000001",
80670
+ * "subject": "Resumen de lo que conversamos hoy",
80671
+ * "body_text": "Hola María,\n\nTe dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].\n\nSaludos,"
80672
+ * }
80673
+ */
80674
+ "application/json": {
80675
+ /** Format: uuid */
80676
+ contact_id?: string | null;
80677
+ /** Format: email */
80678
+ to_address?: string | null;
80679
+ cc?: string[];
80680
+ subject?: string;
80681
+ body_html?: string;
80682
+ body_text?: string;
80683
+ signature_id?: string | "none" | null;
80684
+ /** Format: uuid */
80685
+ conversation_id?: string | null;
80686
+ };
80687
+ };
80688
+ };
80689
+ responses: {
80690
+ /** @description The saved draft */
80691
+ 201: {
80692
+ headers: {
80693
+ [name: string]: unknown;
80694
+ };
80695
+ content: {
80696
+ /**
80697
+ * @example {
80698
+ * "data": {
80699
+ * "id": "5d5d5d5d-0000-4000-8000-000000000001",
80700
+ * "contact": {
80701
+ * "id": "22222222-0000-4000-8000-000000000001",
80702
+ * "name": "María González",
80703
+ * "email": "maria.gonzalez@example.cl"
80704
+ * },
80705
+ * "conversation_id": null,
80706
+ * "to_address": "maria.gonzalez@example.cl",
80707
+ * "cc": [],
80708
+ * "subject": "Resumen de lo que conversamos hoy",
80709
+ * "body_html": "<p>Hola María,</p><p>Te dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].</p><p>Saludos,</p>",
80710
+ * "body_text": "Hola María,\n\nTe dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].\n\nSaludos,",
80711
+ * "signature_id": null,
80712
+ * "origin": "mcp",
80713
+ * "created_by": {
80714
+ * "id": "11111111-0000-4000-8000-000000000001",
80715
+ * "name": "Persona del equipo"
80716
+ * },
80717
+ * "created_at": "2026-09-24T14:02:11.000Z",
80718
+ * "updated_at": "2026-09-24T14:05:40.000Z"
80719
+ * }
80720
+ * }
80721
+ */
80722
+ "application/json": {
80723
+ data?: unknown;
80724
+ };
80725
+ };
80726
+ };
80727
+ /** @description Validation error */
80728
+ 400: {
80729
+ headers: {
80730
+ [name: string]: unknown;
80731
+ };
80732
+ content: {
80733
+ "application/json": components["schemas"]["Error"];
80734
+ };
80735
+ };
80736
+ /** @description Unauthorized */
80737
+ 401: {
80738
+ headers: {
80739
+ [name: string]: unknown;
80740
+ };
80741
+ content: {
80742
+ "application/json": components["schemas"]["Error"];
80743
+ };
80744
+ };
80745
+ /** @description Forbidden */
80746
+ 403: {
80747
+ headers: {
80748
+ [name: string]: unknown;
80749
+ };
80750
+ content: {
80751
+ "application/json": components["schemas"]["Error"];
80752
+ };
80753
+ };
80754
+ /** @description Not found */
80755
+ 404: {
80756
+ headers: {
80757
+ [name: string]: unknown;
80758
+ };
80759
+ content: {
80760
+ "application/json": components["schemas"]["Error"];
80761
+ };
80762
+ };
80763
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
80764
+ 409: {
80765
+ headers: {
80766
+ [name: string]: unknown;
80767
+ };
80768
+ content: {
80769
+ "application/json": components["schemas"]["Error"];
80770
+ };
80771
+ };
80772
+ /** @description Rate limited */
80773
+ 429: {
80774
+ headers: {
80775
+ [name: string]: unknown;
80776
+ };
80777
+ content: {
80778
+ "application/json": components["schemas"]["Error"];
80779
+ };
80780
+ };
80781
+ };
80782
+ };
80783
+ delete?: never;
80784
+ options?: never;
80785
+ head?: never;
80786
+ patch?: never;
80787
+ trace?: never;
80788
+ };
80789
+ "/email-drafts/{id}": {
80790
+ parameters: {
80791
+ query?: never;
80792
+ header?: never;
80793
+ path?: never;
80794
+ cookie?: never;
80795
+ };
80796
+ /**
80797
+ * Get an email draft
80798
+ * @description One draft. A draft a narrowed member may not see answers 404, the same as one that does not exist.
80799
+ */
80800
+ get: {
80801
+ parameters: {
80802
+ query?: never;
80803
+ header?: never;
80804
+ path: {
80805
+ id: string;
80806
+ };
80807
+ cookie?: never;
80808
+ };
80809
+ requestBody?: never;
80810
+ responses: {
80811
+ /** @description The draft */
80812
+ 200: {
80813
+ headers: {
80814
+ [name: string]: unknown;
80815
+ };
80816
+ content: {
80817
+ /**
80818
+ * @example {
80819
+ * "data": {
80820
+ * "id": "5d5d5d5d-0000-4000-8000-000000000001",
80821
+ * "contact": {
80822
+ * "id": "22222222-0000-4000-8000-000000000001",
80823
+ * "name": "María González",
80824
+ * "email": "maria.gonzalez@example.cl"
80825
+ * },
80826
+ * "conversation_id": null,
80827
+ * "to_address": "maria.gonzalez@example.cl",
80828
+ * "cc": [],
80829
+ * "subject": "Resumen de lo que conversamos hoy",
80830
+ * "body_html": "<p>Hola María,</p><p>Te dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].</p><p>Saludos,</p>",
80831
+ * "body_text": "Hola María,\n\nTe dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].\n\nSaludos,",
80832
+ * "signature_id": null,
80833
+ * "origin": "mcp",
80834
+ * "created_by": {
80835
+ * "id": "11111111-0000-4000-8000-000000000001",
80836
+ * "name": "Persona del equipo"
80837
+ * },
80838
+ * "created_at": "2026-09-24T14:02:11.000Z",
80839
+ * "updated_at": "2026-09-24T14:05:40.000Z"
80840
+ * }
80841
+ * }
80842
+ */
80843
+ "application/json": {
80844
+ data?: unknown;
80845
+ meta?: {
80846
+ [key: string]: unknown;
80847
+ };
80848
+ };
80849
+ };
80850
+ };
80851
+ /** @description Validation error */
80852
+ 400: {
80853
+ headers: {
80854
+ [name: string]: unknown;
80855
+ };
80856
+ content: {
80857
+ "application/json": components["schemas"]["Error"];
80858
+ };
80859
+ };
80860
+ /** @description Unauthorized */
80861
+ 401: {
80862
+ headers: {
80863
+ [name: string]: unknown;
80864
+ };
80865
+ content: {
80866
+ "application/json": components["schemas"]["Error"];
80867
+ };
80868
+ };
80869
+ /** @description Forbidden */
80870
+ 403: {
80871
+ headers: {
80872
+ [name: string]: unknown;
80873
+ };
80874
+ content: {
80875
+ "application/json": components["schemas"]["Error"];
80876
+ };
80877
+ };
80878
+ /** @description Not found */
80879
+ 404: {
80880
+ headers: {
80881
+ [name: string]: unknown;
80882
+ };
80883
+ content: {
80884
+ "application/json": components["schemas"]["Error"];
80885
+ };
80886
+ };
80887
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
80888
+ 409: {
80889
+ headers: {
80890
+ [name: string]: unknown;
80891
+ };
80892
+ content: {
80893
+ "application/json": components["schemas"]["Error"];
80894
+ };
80895
+ };
80896
+ /** @description Rate limited */
80897
+ 429: {
80898
+ headers: {
80899
+ [name: string]: unknown;
80900
+ };
80901
+ content: {
80902
+ "application/json": components["schemas"]["Error"];
80903
+ };
80904
+ };
80905
+ };
80906
+ };
80907
+ put?: never;
80908
+ post?: never;
80909
+ /**
80910
+ * Discard an email draft
80911
+ * @description The draft is gone; there is no undo.
80912
+ */
80913
+ delete: {
80914
+ parameters: {
80915
+ query?: never;
80916
+ header?: never;
80917
+ path: {
80918
+ id: string;
80919
+ };
80920
+ cookie?: never;
80921
+ };
80922
+ requestBody?: never;
80923
+ responses: {
80924
+ /** @description No content */
80925
+ 204: {
80926
+ headers: {
80927
+ [name: string]: unknown;
80928
+ };
80929
+ content?: never;
80930
+ };
80931
+ /** @description Validation error */
80932
+ 400: {
80933
+ headers: {
80934
+ [name: string]: unknown;
80935
+ };
80936
+ content: {
80937
+ "application/json": components["schemas"]["Error"];
80938
+ };
80939
+ };
80940
+ /** @description Unauthorized */
80941
+ 401: {
80942
+ headers: {
80943
+ [name: string]: unknown;
80944
+ };
80945
+ content: {
80946
+ "application/json": components["schemas"]["Error"];
80947
+ };
80948
+ };
80949
+ /** @description Forbidden */
80950
+ 403: {
80951
+ headers: {
80952
+ [name: string]: unknown;
80953
+ };
80954
+ content: {
80955
+ "application/json": components["schemas"]["Error"];
80956
+ };
80957
+ };
80958
+ /** @description Not found */
80959
+ 404: {
80960
+ headers: {
80961
+ [name: string]: unknown;
80962
+ };
80963
+ content: {
80964
+ "application/json": components["schemas"]["Error"];
80965
+ };
80966
+ };
80967
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
80968
+ 409: {
80969
+ headers: {
80970
+ [name: string]: unknown;
80971
+ };
80972
+ content: {
80973
+ "application/json": components["schemas"]["Error"];
80974
+ };
80975
+ };
80976
+ /** @description Rate limited */
80977
+ 429: {
80978
+ headers: {
80979
+ [name: string]: unknown;
80980
+ };
80981
+ content: {
80982
+ "application/json": components["schemas"]["Error"];
80983
+ };
80984
+ };
80985
+ };
80986
+ };
80987
+ options?: never;
80988
+ head?: never;
80989
+ /**
80990
+ * Edit an email draft
80991
+ * @description Partial update: only the fields sent change.
80992
+ *
80993
+ * Every field is optional — a draft is work in progress, so an empty subject, an empty body or no recipient yet are all storable; what is SENDABLE is decided by `POST /email-drafts/{id}/send`. Recipient: `contact_id` (wins when both are set) or `to_address`. `body_text` is the plain text (≤8,000 characters) and what is sent as the text part; `body_html` the rich version, optional. `signature_id`: one of the sender's saved signatures, `"none"` for no signature, or `null` for the sender's default at send time. Never put a signature in the body.
80994
+ */
80995
+ patch: {
80996
+ parameters: {
80997
+ query?: never;
80998
+ header?: never;
80999
+ path: {
81000
+ id: string;
81001
+ };
81002
+ cookie?: never;
81003
+ };
81004
+ requestBody?: {
81005
+ content: {
81006
+ /**
81007
+ * @example {
81008
+ * "subject": "Resumen de nuestra reunión",
81009
+ * "cc": [
81010
+ * "operaciones@example.cl"
81011
+ * ]
81012
+ * }
81013
+ */
81014
+ "application/json": {
81015
+ /** Format: uuid */
81016
+ contact_id?: string | null;
81017
+ /** Format: email */
81018
+ to_address?: string | null;
81019
+ cc?: string[];
81020
+ subject?: string;
81021
+ body_html?: string;
81022
+ body_text?: string;
81023
+ signature_id?: string | "none" | null;
81024
+ };
81025
+ };
81026
+ };
81027
+ responses: {
81028
+ /** @description The updated draft */
81029
+ 200: {
81030
+ headers: {
81031
+ [name: string]: unknown;
81032
+ };
81033
+ content: {
81034
+ /**
81035
+ * @example {
81036
+ * "data": {
81037
+ * "id": "5d5d5d5d-0000-4000-8000-000000000001",
81038
+ * "contact": {
81039
+ * "id": "22222222-0000-4000-8000-000000000001",
81040
+ * "name": "María González",
81041
+ * "email": "maria.gonzalez@example.cl"
81042
+ * },
81043
+ * "conversation_id": null,
81044
+ * "to_address": "maria.gonzalez@example.cl",
81045
+ * "cc": [],
81046
+ * "subject": "Resumen de lo que conversamos hoy",
81047
+ * "body_html": "<p>Hola María,</p><p>Te dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].</p><p>Saludos,</p>",
81048
+ * "body_text": "Hola María,\n\nTe dejo por escrito lo que revisamos hoy. Quedamos en coordinar la próxima reunión para el [fecha].\n\nSaludos,",
81049
+ * "signature_id": null,
81050
+ * "origin": "mcp",
81051
+ * "created_by": {
81052
+ * "id": "11111111-0000-4000-8000-000000000001",
81053
+ * "name": "Persona del equipo"
81054
+ * },
81055
+ * "created_at": "2026-09-24T14:02:11.000Z",
81056
+ * "updated_at": "2026-09-24T14:05:40.000Z"
81057
+ * }
81058
+ * }
81059
+ */
81060
+ "application/json": {
81061
+ data?: unknown;
81062
+ meta?: {
81063
+ [key: string]: unknown;
81064
+ };
81065
+ };
81066
+ };
81067
+ };
81068
+ /** @description Validation error */
81069
+ 400: {
81070
+ headers: {
81071
+ [name: string]: unknown;
81072
+ };
81073
+ content: {
81074
+ "application/json": components["schemas"]["Error"];
81075
+ };
81076
+ };
81077
+ /** @description Unauthorized */
81078
+ 401: {
81079
+ headers: {
81080
+ [name: string]: unknown;
81081
+ };
81082
+ content: {
81083
+ "application/json": components["schemas"]["Error"];
81084
+ };
81085
+ };
81086
+ /** @description Forbidden */
81087
+ 403: {
81088
+ headers: {
81089
+ [name: string]: unknown;
81090
+ };
81091
+ content: {
81092
+ "application/json": components["schemas"]["Error"];
81093
+ };
81094
+ };
81095
+ /** @description Not found */
81096
+ 404: {
81097
+ headers: {
81098
+ [name: string]: unknown;
81099
+ };
81100
+ content: {
81101
+ "application/json": components["schemas"]["Error"];
81102
+ };
81103
+ };
81104
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
81105
+ 409: {
81106
+ headers: {
81107
+ [name: string]: unknown;
81108
+ };
81109
+ content: {
81110
+ "application/json": components["schemas"]["Error"];
81111
+ };
81112
+ };
81113
+ /** @description Rate limited */
81114
+ 429: {
81115
+ headers: {
81116
+ [name: string]: unknown;
81117
+ };
81118
+ content: {
81119
+ "application/json": components["schemas"]["Error"];
81120
+ };
81121
+ };
81122
+ };
81123
+ };
81124
+ trace?: never;
81125
+ };
81126
+ "/email-drafts/{id}/send": {
81127
+ parameters: {
81128
+ query?: never;
81129
+ header?: never;
81130
+ path?: never;
81131
+ cookie?: never;
81132
+ };
81133
+ get?: never;
81134
+ put?: never;
81135
+ /**
81136
+ * Send an email draft
81137
+ * @description Sends the draft exactly as `POST /conversations/email` would — same sending mailbox resolution (refused 422 `EMAIL_SENDER_UNRESOLVED` when none resolves), a new thread under HUMAN control assigned to the sender, the sender's signature appended, no unsubscribe footer — and returns the same response. The draft is deleted once the email has left; a send that fails leaves it in place. A draft that is not sendable yet (no recipient, empty subject or body) is refused 422 with `error.field_errors` naming the draft fields. Needs `messages:send`: this is the moment a message leaves Vitrina, and it must be a signed-in person or a token acting as one.
81138
+ */
81139
+ post: {
81140
+ parameters: {
81141
+ query?: never;
81142
+ header?: {
81143
+ /** @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. */
81144
+ "Idempotency-Key"?: string;
81145
+ };
81146
+ path: {
81147
+ id: string;
81148
+ };
81149
+ cookie?: never;
81150
+ };
81151
+ requestBody?: never;
81152
+ responses: {
81153
+ /** @description The originated conversation, its first message, and the resolved recipient Contact */
81154
+ 201: {
81155
+ headers: {
81156
+ [name: string]: unknown;
81157
+ };
81158
+ content: {
81159
+ /**
81160
+ * @example {
81161
+ * "data": {
81162
+ * "conversation": {
81163
+ * "id": "bbbbbbbb-0000-4000-8000-000000000001",
81164
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
81165
+ * "display_seq": 132,
81166
+ * "display_id": "C-132",
81167
+ * "channel": "email",
81168
+ * "external_id": "web:visitor-9f2c1a",
81169
+ * "messaging_account_id": "16161616-0000-4000-8000-000000000001",
81170
+ * "brand": null,
81171
+ * "contact_id": "22222222-0000-4000-8000-000000000001",
81172
+ * "ticket_id": "dddddddd-0000-4000-8000-000000000001",
81173
+ * "status": "open",
81174
+ * "handler": "human",
81175
+ * "assignee_user_id": "11111111-0000-4000-8000-000000000001",
81176
+ * "assignee_assigned_at": "2026-09-22T11:06:54.183Z",
81177
+ * "snoozed_until": null,
81178
+ * "resolved_at": null,
81179
+ * "resolved_by": null,
81180
+ * "closed_at": null,
81181
+ * "close_deferred_until": null,
81182
+ * "transfer_immediately": false,
81183
+ * "filtered_at": null,
81184
+ * "filtered_reason": null,
81185
+ * "summary": null,
81186
+ * "summarized_at": null,
81187
+ * "history_summary": null,
81188
+ * "history_summary_upto_message_id": null,
81189
+ * "first_billable_at": null,
81190
+ * "billable": null,
81191
+ * "billing_reason": null,
81192
+ * "assigned_unanswered_alerted_at": null,
81193
+ * "assigned_unanswered_realerted_at": null,
81194
+ * "bot_gate_override_at": null,
81195
+ * "bot_gate_override_by": null,
81196
+ * "source": null,
81197
+ * "awaiting_human_since": null,
81198
+ * "awaiting_payment_since": null,
81199
+ * "awaiting_payment_escalated_at": null,
81200
+ * "awaiting_obligation_id": null,
81201
+ * "ad_referral": null,
81202
+ * "ad_join": null,
81203
+ * "ad_welcome": null,
81204
+ * "metadata": null,
81205
+ * "ai_control_source": "legacy",
81206
+ * "ai_control_changed_at": null,
81207
+ * "ai_control_revision": 0,
81208
+ * "ai_control_window_start": null,
81209
+ * "ai_control_window_end": null,
81210
+ * "ai_control_account_revision": null,
81211
+ * "ai_blocked_until": null,
81212
+ * "ai_keep_with_human": false,
81213
+ * "external_id_provisional": false,
81214
+ * "originated_at": null,
81215
+ * "originated_by_kind": null,
81216
+ * "originated_by_ai_agent_id": null,
81217
+ * "originated_by_user_id": null,
81218
+ * "originated_outbound_action_id": null,
81219
+ * "last_message_date": "2026-09-22T11:08:10.882Z",
81220
+ * "created_at": "2026-09-22T11:06:33.744Z",
81221
+ * "updated_at": "2026-09-22T11:08:10.882Z"
81222
+ * },
81223
+ * "message": {
81224
+ * "id": "eeeeeeee-0000-4000-8000-000000000002",
81225
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
81226
+ * "conversation_id": "bbbbbbbb-0000-4000-8000-000000000001",
81227
+ * "content": "Hola Rodrigo, te confirmo la visita del jueves a las 10:00.",
81228
+ * "type": "text",
81229
+ * "sender_role": "assistant",
81230
+ * "sender_type": "api_key",
81231
+ * "sender_id": "c1c1c1c1-0000-4000-8000-000000000001",
81232
+ * "correlation_id": null,
81233
+ * "external_message_id": null,
81234
+ * "media_urls": null,
81235
+ * "media_sensitivity": null,
81236
+ * "media_processing_state": null,
81237
+ * "media_expires_at": null,
81238
+ * "derived_context_expires_at": null,
81239
+ * "metadata": null,
81240
+ * "tokens": 0,
81241
+ * "tool_calls": null,
81242
+ * "tool_call_id": null,
81243
+ * "delivery_status": "sent",
81244
+ * "delivery_error": null,
81245
+ * "delivery_attempt": 1,
81246
+ * "next_attempt_at": null,
81247
+ * "delivered_at": null,
81248
+ * "read_at": null,
81249
+ * "author": {
81250
+ * "kind": "api_key",
81251
+ * "id": "c1c1c1c1-0000-4000-8000-000000000001",
81252
+ * "name": "CRM propio"
81253
+ * },
81254
+ * "created_at": "2026-09-22T11:08:10.882Z",
81255
+ * "updated_at": "2026-09-22T11:08:10.882Z"
81256
+ * },
81257
+ * "contact": {
81258
+ * "id": "22222222-0000-4000-8000-000000000001",
81259
+ * "created": false,
81260
+ * "email": "maria.gonzalez@example.cl"
81261
+ * }
81262
+ * }
81263
+ * }
81264
+ */
81265
+ "application/json": {
81266
+ data?: unknown;
81267
+ };
81268
+ };
81269
+ };
81270
+ /** @description Validation error */
81271
+ 400: {
81272
+ headers: {
81273
+ [name: string]: unknown;
81274
+ };
81275
+ content: {
81276
+ "application/json": components["schemas"]["Error"];
81277
+ };
81278
+ };
81279
+ /** @description Unauthorized */
81280
+ 401: {
81281
+ headers: {
81282
+ [name: string]: unknown;
81283
+ };
81284
+ content: {
81285
+ "application/json": components["schemas"]["Error"];
81286
+ };
81287
+ };
81288
+ /** @description Forbidden */
81289
+ 403: {
81290
+ headers: {
81291
+ [name: string]: unknown;
81292
+ };
81293
+ content: {
81294
+ "application/json": components["schemas"]["Error"];
81295
+ };
81296
+ };
81297
+ /** @description Not found */
81298
+ 404: {
81299
+ headers: {
81300
+ [name: string]: unknown;
81301
+ };
81302
+ content: {
81303
+ "application/json": components["schemas"]["Error"];
81304
+ };
81305
+ };
81306
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
81307
+ 409: {
81308
+ headers: {
81309
+ [name: string]: unknown;
81310
+ };
81311
+ content: {
81312
+ "application/json": components["schemas"]["Error"];
81313
+ };
81314
+ };
81315
+ /** @description Not sendable yet (`VALIDATION_ERROR`, with `field_errors`) or no sending mailbox resolves (`EMAIL_SENDER_UNRESOLVED`) */
81316
+ 422: {
81317
+ headers: {
81318
+ [name: string]: unknown;
81319
+ };
81320
+ content: {
81321
+ "application/json": components["schemas"]["Error"];
81322
+ };
81323
+ };
81324
+ /** @description Rate limited */
81325
+ 429: {
81326
+ headers: {
81327
+ [name: string]: unknown;
81328
+ };
81329
+ content: {
81330
+ "application/json": components["schemas"]["Error"];
81331
+ };
81332
+ };
81333
+ };
81334
+ };
81335
+ delete?: never;
81336
+ options?: never;
81337
+ head?: never;
81338
+ patch?: never;
81339
+ trace?: never;
81340
+ };
80385
81341
  "/help-centers": {
80386
81342
  parameters: {
80387
81343
  query?: never;
@@ -87887,6 +88843,7 @@ interface paths {
87887
88843
  * "status": "connected",
87888
88844
  * "account_label": "Cuenta Meta Ads",
87889
88845
  * "connected_at": "2026-09-23T15:04:00.000Z",
88846
+ * "disconnected_at": null,
87890
88847
  * "account": {
87891
88848
  * "external_account_id": "act_1234567890",
87892
88849
  * "name": "Automotora Ejemplo",
@@ -88012,6 +88969,7 @@ interface paths {
88012
88969
  * "status": "disconnected",
88013
88970
  * "account_label": "Cuenta Meta Ads",
88014
88971
  * "connected_at": "2026-09-20T12:00:00.000Z",
88972
+ * "disconnected_at": "2026-09-23T15:10:00.000Z",
88015
88973
  * "account": null,
88016
88974
  * "error": null,
88017
88975
  * "handoff": null,
@@ -88143,6 +89101,7 @@ interface paths {
88143
89101
  * "status": "connected",
88144
89102
  * "account_label": "Cuenta Meta Ads",
88145
89103
  * "connected_at": "2026-09-23T15:04:00.000Z",
89104
+ * "disconnected_at": null,
88146
89105
  * "account": {
88147
89106
  * "external_account_id": "act_1234567890",
88148
89107
  * "name": "Automotora Ejemplo",
@@ -89090,9 +90049,11 @@ interface paths {
89090
90049
  };
89091
90050
  /**
89092
90051
  * Campaign performance for a window
89093
- * @description Proxies Atribu’s `campaigns` operation (the ranked top-N shape — no `level` is ever sent, so this is always the campaign rollup, not the per-ad-set/per-ad ranking). One row per campaign: spend, attributed outcome count/value and ROAS, plus the direct/inherited cash split when Atribu can compute it.
90052
+ * @description The attribution engine’s campaign ranking (the ranked top-N shape — always the campaign rollup, never the per-ad-set/per-ad ranking). One row per campaign: spend, attributed outcome count/value and ROAS, plus the direct/inherited cash split when the engine can compute it.
89094
90053
  *
89095
90054
  * `campaign_external_id` on each row is the PLATFORM id — pass it as `campaign_id` to `/ads/attributed-sales` for the drill-down.
90055
+ *
90056
+ * `closed_outcome_count` is the period’s closes credited to the campaign (recorded at the closed stage, matched to an ad) — a period-true count that does not depend on how much of `/ads/feed` was loaded; `null` while that credit is unknown.
89096
90057
  */
89097
90058
  get: {
89098
90059
  parameters: {
@@ -89135,6 +90096,7 @@ interface paths {
89135
90096
  * "roas": 3.69,
89136
90097
  * "direct_cash_value": 2100000,
89137
90098
  * "inherited_cash_value": 600000,
90099
+ * "closed_outcome_count": 9,
89138
90100
  * "top_ad": {
89139
90101
  * "external_id": "120212000000000009",
89140
90102
  * "name": "Video testimonio 15s",
@@ -90654,7 +91616,11 @@ interface paths {
90654
91616
  };
90655
91617
  /**
90656
91618
  * The suggested actions for one Ads screen
90657
- * @description Up to 6 suggested actions for a screen, primary first, derived from the screen’s figures and the open recommendations of the measurement engine: pause a worn-out ad, raise a winning ad set’s budget, re-check the conversion wiring, re-scan the ad links — or, when Meta is not connected, only a `nav` card to reconnect it. Nothing here runs by itself: preview → confirm → execute.
91619
+ * @description Up to 6 suggested actions for a screen, primary first, derived from the screen’s figures and the open recommendations of the measurement engine: pause a worn-out ad, pause the delivering ads of a campaign that spent with no results in the period (one card per ad), raise a winning ad set’s budget, re-check the conversion wiring, re-scan the ad links — or, when Meta is not connected, only a `nav` card to reconnect it. Nothing here runs by itself: preview → confirm → execute.
91620
+ *
91621
+ * `nav` cards only open a page and never execute (dismissable like any card): Campañas — «Mira quién llegó por …», the lowest cost per result among campaigns with 3 or more results, into the attributed list filtered by that campaign; Creativos — «Prepara una variante de …» for a worn-out ad and «Usa … como base» for the best-scored ad that is not worn out, both opening the ad in Meta Ads Manager; Salud — «Instalar el tag en …» when the tag sent nothing in the last 24 hours while Meta is connected, into the set-up’s tag step.
91622
+ *
91623
+ * `window` (Creativos only) derives the rail on the same rolling creatives window as `GET /ads/creatives`; pass the same `window` to preview.
90658
91624
  *
90659
91625
  * A `key` is `<kind>:<target external id>:<YYYY-MM-DD>` and is stable for the day. Dismissed actions stay on the list with `dismissed_until` set, sorted last. `include=adset_duplicate_swap` also lists the duplicate-and-swap actions (hidden by default).
90660
91626
  *
@@ -90667,6 +91633,8 @@ interface paths {
90667
91633
  screen: "resumen" | "campanas" | "atribuidos" | "creativos" | "salud";
90668
91634
  from: string;
90669
91635
  to: string;
91636
+ /** @description `creativos` only: the creatives window the rail is derived for — the same rolling lookback as `GET /ads/creatives?window=`, so a card’s figures (the worn-out ad’s spend) match the gallery. Defaults to `28d`. Sent with any other screen → 400. */
91637
+ window?: "7d" | "14d" | "28d" | "lifetime";
90670
91638
  /** @description `adset_duplicate_swap` also lists the duplicate-and-swap actions (Salud). Hidden by default: it rebuilds an ad set (new id, learning reset) and is offered as the alternative after a `promoted_object_frozen` refusal. */
90671
91639
  include?: "adset_duplicate_swap";
90672
91640
  /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
@@ -90692,7 +91660,8 @@ interface paths {
90692
91660
  * "kind": "pause_ad",
90693
91661
  * "screen": [
90694
91662
  * "creativos",
90695
- * "resumen"
91663
+ * "resumen",
91664
+ * "campanas"
90696
91665
  * ],
90697
91666
  * "primary": true,
90698
91667
  * "title": "Pausar «Video testimonio · 30 s»",
@@ -90702,7 +91671,11 @@ interface paths {
90702
91671
  * "level": "ad",
90703
91672
  * "external_id": "120212000000000006",
90704
91673
  * "name": "Video testimonio · 30 s",
90705
- * "campaign_external_id": null
91674
+ * "campaign_external_id": null,
91675
+ * "campaign": {
91676
+ * "external_id": "120210000000000003",
91677
+ * "name": "Blanqueamiento · Septiembre"
91678
+ * }
90706
91679
  * },
90707
91680
  * "params": {},
90708
91681
  * "reversible": true,
@@ -90732,7 +91705,11 @@ interface paths {
90732
91705
  * "level": "ad_set",
90733
91706
  * "external_id": "120211000000000077",
90734
91707
  * "name": "Implantes · Conjunto principal",
90735
- * "campaign_external_id": null
91708
+ * "campaign_external_id": null,
91709
+ * "campaign": {
91710
+ * "external_id": "120210000000000001",
91711
+ * "name": "Implantes · Septiembre"
91712
+ * }
90736
91713
  * },
90737
91714
  * "params": {
90738
91715
  * "budget_change_pct": 20
@@ -90748,6 +91725,34 @@ interface paths {
90748
91725
  * "best_campaign_roas"
90749
91726
  * ],
90750
91727
  * "dismissed_until": null
91728
+ * },
91729
+ * {
91730
+ * "key": "nav:cheapest:120210000000000002:2026-09-23",
91731
+ * "kind": "nav",
91732
+ * "screen": [
91733
+ * "campanas"
91734
+ * ],
91735
+ * "primary": false,
91736
+ * "title": "Mira quién llegó por «Ortodoncia invisible · Sept»",
91737
+ * "why": "Es la campaña con el costo más bajo por tratamiento del período: **$19.800** por tratamiento, con 9 tratamientos. Vale la pena ver en qué etapa están antes de moverle presupuesto.",
91738
+ * "effect": null,
91739
+ * "target": {
91740
+ * "level": "campaign",
91741
+ * "external_id": "120210000000000002",
91742
+ * "name": "Ortodoncia invisible · Sept",
91743
+ * "campaign": {
91744
+ * "external_id": "120210000000000002",
91745
+ * "name": "Ortodoncia invisible · Sept"
91746
+ * }
91747
+ * },
91748
+ * "params": {},
91749
+ * "reversible": false,
91750
+ * "risk": null,
91751
+ * "engine_ref": null,
91752
+ * "href": "/anuncios/atribuidos?c=120210000000000002",
91753
+ * "cta": "Ver tratamientos",
91754
+ * "facts": [],
91755
+ * "dismissed_until": null
90751
91756
  * }
90752
91757
  * ]
90753
91758
  * }
@@ -90896,6 +91901,11 @@ interface paths {
90896
91901
  "application/json": {
90897
91902
  from: string;
90898
91903
  to: string;
91904
+ /**
91905
+ * @description The creatives `window` the card was listed with (`GET /ads/actions?screen=creativos&window=`), so the action is re-derived on the same reads. Defaults to `28d`.
91906
+ * @enum {string}
91907
+ */
91908
+ window?: "7d" | "14d" | "28d" | "lifetime";
90899
91909
  sample?: boolean;
90900
91910
  };
90901
91911
  };
@@ -91275,7 +92285,8 @@ interface paths {
91275
92285
  * "target": {
91276
92286
  * "level": "ad",
91277
92287
  * "external_id": "120212000000000006",
91278
- * "name": "Blanqueamiento · Sonrisa"
92288
+ * "name": "Blanqueamiento · Sonrisa",
92289
+ * "campaign_name": "Blanqueamiento · Septiembre"
91279
92290
  * },
91280
92291
  * "created_by": "Dueña Ejemplo"
91281
92292
  * },
@@ -91298,7 +92309,8 @@ interface paths {
91298
92309
  * "target": {
91299
92310
  * "level": "ad_set",
91300
92311
  * "external_id": "120211000000000077",
91301
- * "name": "Implantes · Las Condes"
92312
+ * "name": "Implantes · Las Condes",
92313
+ * "campaign_name": "Implantes · Septiembre"
91302
92314
  * },
91303
92315
  * "created_by": null
91304
92316
  * }
@@ -91426,7 +92438,7 @@ interface paths {
91426
92438
  };
91427
92439
  /**
91428
92440
  * The status of an action execution
91429
- * @description `queued → running → succeeded | failed | refused`; a succeeded execution becomes `rolled_back` when its rollback succeeds. `error.reason` is one of `promoted_object_frozen` (Meta froze the ad set’s conversion — the duplicate-and-swap is the alternative), `reconnect_required`, `permission_gap` (Meta connected without permission to manage ads — reconnect keeping it), `rate_limited`, `not_reversible`, `forbidden` (no person could be put on the record for the change — not a Meta grant problem), `consent_required` (the duplicate-and-swap consent is missing or stale — preview again), `engine_error` (incl. `code: budget_change_out_of_bounds` — outside the ±50 % allowed per change — `code: not_active` and `code: no_recommendation`). `error.message` is Spanish copy ready for the card.
92441
+ * @description `queued → running → succeeded | failed | refused`; a succeeded execution becomes `rolled_back` when its rollback succeeds. `error.reason` is one of `promoted_object_frozen` (Meta froze the ad set’s conversion — the duplicate-and-swap is the alternative), `reconnect_required`, `permission_gap` (Meta connected without permission to manage ads — reconnect keeping it), `rate_limited`, `not_reversible`, `forbidden` (no person could be put on the record for the change — not a Meta grant problem), `consent_required` (the duplicate-and-swap consent is missing or stale — preview again), `engine_error` (incl. `code: budget_change_out_of_bounds` — outside the ±50 % allowed per change — `code: not_active` and `code: no_recommendation`). `error.message` is Spanish copy ready for the card. `target` is what the action touched (with `campaign_name`, the campaign the card named, on an ad-set budget change).
91430
92442
  */
91431
92443
  get: {
91432
92444
  parameters: {
@@ -91456,6 +92468,12 @@ interface paths {
91456
92468
  * "action_key": "budget_change:120211000000000077:2026-09-23",
91457
92469
  * "kind": "budget_change",
91458
92470
  * "status": "succeeded",
92471
+ * "target": {
92472
+ * "level": "ad_set",
92473
+ * "external_id": "120211000000000077",
92474
+ * "name": "Implantes · Las Condes",
92475
+ * "campaign_name": "Implantes · Septiembre"
92476
+ * },
91459
92477
  * "outcome": {
91460
92478
  * "summary": "Cambio aplicado en Meta.",
91461
92479
  * "engine_action_id": "f7f7f7f7-0000-4000-8000-000000000001",
@@ -92202,11 +93220,11 @@ interface paths {
92202
93220
  };
92203
93221
  /**
92204
93222
  * Is the tag installed? Last event seen, events in 24 h, domain
92205
- * @description Tag detection for the workspace's tracking key. `source: tracker` (the normal case) reads the measurement provider's per-key last-event time (`last_seen_at`), the tracker events of the last 24 hours (`events_24h`) and the hostname of the latest verified install check (`domain`). `installed` is `true` only when the tag sent an event in the last 30 days — never without a timestamp.
93223
+ * @description Tag detection for the workspace's tracking key. `source: tracker` (the normal case) reads the measurement provider's per-key last-event time (`last_seen_at`), the tracker events of the last 24 hours (`events_24h`) and the hostname of the latest verified install check (`domain`). `installed` is `true` only when the tag sent an event in the last 30 days — never without a timestamp — and it STAYS `true` for 30 days after the last event, so it does not mean «live»: `reporting` does (events in the last 24 hours).
92206
93224
  *
92207
- * When the per-key read is unavailable the answer falls back to the health read's daily UTM scan: `source: health`, `installed` = the refreshed scan counted events, `last_seen_at` / `events_24h` / `domain` = `null`. `events_24h` is `null` (never `0`) whenever the count could not be read.
93225
+ * When the per-key read is unavailable the answer falls back to the health read's daily UTM scan: `source: health`, `installed` = the refreshed scan counted events, `reporting: false` (unknown), `last_seen_at` / `events_24h` / `domain` = `null`. `events_24h` is `null` (never `0`) whenever the count could not be read.
92208
93226
  *
92209
- * Same entitlement gate as `GET /ads/tracking/key`, except that `sample=1` (or a sandbox workspace) answers a fixed sample status (`installed: true`, seen minutes ago, `source: tracker`) without the entitlement and without reading the real tag — like every other Ads read. Admin-scoped (`ads:read`).
93227
+ * Same entitlement gate as `GET /ads/tracking/key`, except that `sample=1` (or a sandbox workspace) answers a fixed sample status (`installed: true`, `reporting: true`, seen minutes ago, `source: tracker`) without the entitlement and without reading the real tag — like every other Ads read. Admin-scoped (`ads:read`).
92210
93228
  */
92211
93229
  get: {
92212
93230
  parameters: {
@@ -92230,6 +93248,7 @@ interface paths {
92230
93248
  * @example {
92231
93249
  * "data": {
92232
93250
  * "installed": true,
93251
+ * "reporting": true,
92233
93252
  * "last_seen_at": "2026-09-23T14:02:11.000Z",
92234
93253
  * "events_24h": 184,
92235
93254
  * "domain": "www.clinica-ejemplo.cl",
@@ -92568,7 +93587,7 @@ interface paths {
92568
93587
  };
92569
93588
  /**
92570
93589
  * One feed row’s path to its outcome
92571
- * @description The touches that led to one recorded outcome, oldest first, ending at the outcome: ad views and clicks (ad and campaign names), site visits, conversations. From the attribution engine (`source: engine`) when it credited the outcome and the delegated key may read people; otherwise Vitrina’s own record of this contact’s outcomes (`source: vitrina`) — still a path, without the ad touches. Never carries a URL, referrer, email or device. 404 when the id is not a live row of this workspace. With `sample=1` answers the sample dataset’s journey (pass the feed’s `from`/`to` when it was not the last 30 days).
93590
+ * @description The touches that led to one recorded outcome, oldest first, ending at the outcome: ad views and clicks (ad and campaign names), site visits, conversations. From the attribution engine (`source: engine`) when it credited the outcome and the delegated key may read people; otherwise Vitrina’s own record of this contact’s outcomes (`source: vitrina`) — still a path, without the ad touches, and `reason` says why (`unmatched` / `pending` / `role`). Never carries a URL, referrer, email or device. 404 when the id is not a live row of this workspace. With `sample=1` answers the sample dataset’s journey (pass the feed’s `from`/`to` when it was not the last 30 days).
92572
93591
  */
92573
93592
  get: {
92574
93593
  parameters: {
@@ -92630,7 +93649,8 @@ interface paths {
92630
93649
  * "touch_count": 3,
92631
93650
  * "credited_weight": 1,
92632
93651
  * "model": "last_touch",
92633
- * "source": "engine"
93652
+ * "source": "engine",
93653
+ * "reason": null
92634
93654
  * }
92635
93655
  * }
92636
93656
  */
@@ -112472,6 +113492,8 @@ interface components {
112472
113492
  status: "pending" | "pending_selection" | "connected" | "error" | "disconnected";
112473
113493
  account_label: string | null;
112474
113494
  connected_at: string | null;
113495
+ /** @description When the connection last stopped being `connected` (disconnected, access revoked, or the token stopped working) — the last day the ad figures are current («cifras hasta el …»). `null` while `connected`, when it was never connected, and for a stop recorded before this field existed. */
113496
+ disconnected_at: string | null;
112475
113497
  account: components["schemas"]["MetaAdsAccount"];
112476
113498
  error: {
112477
113499
  reason: string;
@@ -112622,11 +113644,14 @@ interface components {
112622
113644
  campaign_name: string;
112623
113645
  campaign_external_id: string | null;
112624
113646
  spend: number;
113647
+ /** @description Conversions the attribution engine credits to this campaign over the period, under `model` — every outcome kind it counts, not only closes; a multi-touch model splits one conversion across campaigns. Not the population of `closed_outcome_count`. */
112625
113648
  outcome_count: number;
112626
113649
  outcome_value: number;
112627
113650
  roas: number;
112628
113651
  direct_cash_value: number | null;
112629
113652
  inherited_cash_value: number | null;
113653
+ /** @description Closes over the WHOLE period credited to this campaign: the outcomes Vitrina recorded at the closed stage (`closed_won`) with `occurred_at` in the period (America/Santiago days) that the attribution engine matched to an ad, each counted once on its largest-credit campaign — the same rows the feed shows as `stage: closed_won, matched: true` with this `ad.campaign`, so it does not move while paging the feed. `null` = unknown (never 0): the campaign credit is not available yet (it warms in the background; retry shortly), the campaign is outside the credited set read (the top 25 by outcomes), or the period starts more than 92 days ago. */
113654
+ closed_outcome_count: number | null;
112630
113655
  /** @description The campaign’s highest-spend ad among the top-50 scored ads of the creatives read (the rolling window nearest this range: 7d / 14d / 28d); `null` when unknown. */
112631
113656
  top_ad: {
112632
113657
  /** @description The ad’s platform (Meta) id. */
@@ -112850,7 +113875,14 @@ interface components {
112850
113875
  /** @description The Meta id of the object (null for profile-level actions). */
112851
113876
  external_id: string | null;
112852
113877
  name: string | null;
113878
+ /** @description Legacy: set only on a budget change inside the best campaign. Read `campaign.external_id` instead. */
112853
113879
  campaign_external_id?: string | null;
113880
+ /** @description The campaign the card names — on an ad-set budget change, an ad pause and the navigation cards, whenever it is known. */
113881
+ campaign?: {
113882
+ /** @description The campaign’s Meta id. */
113883
+ external_id: string;
113884
+ name: string | null;
113885
+ } | null;
112854
113886
  };
112855
113887
  /** @description The engine’s own vocabulary, e.g. `{ budget_change_pct: 20 }`. */
112856
113888
  params: {
@@ -112865,7 +113897,7 @@ interface components {
112865
113897
  op: "recommendations.apply" | "ads.pause" | "wiring.ad_sets" | "quality.utm_refresh" | "wiring.recheck" | "actions.rollback";
112866
113898
  recommendation_id?: string;
112867
113899
  } | null;
112868
- /** @description `nav` only: a workspace-relative path. */
113900
+ /** @description `nav` only: a workspace-relative path (`/anuncios/atribuidos?c=…`, `/anuncios/activar?paso=tag`), or an absolute Meta Ads Manager URL built from Meta ids (`https://www.facebook.com/adsmanager/…`) — open it in a new tab; it changes nothing by itself. */
112869
113901
  href?: string;
112870
113902
  cta?: string;
112871
113903
  /** @description Fact keys the card is built from. */
@@ -112908,6 +113940,15 @@ interface components {
112908
113940
  kind: "pause_ad" | "budget_change" | "adset_duplicate_swap" | "utm_refresh" | "wiring_recheck";
112909
113941
  /** @enum {string} */
112910
113942
  status: "queued" | "running" | "succeeded" | "failed" | "refused" | "rolled_back";
113943
+ target: {
113944
+ /** @enum {string} */
113945
+ level: "ad" | "ad_set" | "campaign" | "profile";
113946
+ /** @description The Meta id of what was touched; `null` for a profile-level action. */
113947
+ external_id: string | null;
113948
+ name: string | null;
113949
+ /** @description The campaign the card named: set on an ad-set budget change (the card is titled with the campaign, the ad set is `name`) and on an ad pause whose campaign was known; `null` otherwise and on rows recorded before this field existed. */
113950
+ campaign_name: string | null;
113951
+ };
112911
113952
  outcome: {
112912
113953
  summary: string;
112913
113954
  engine_action_id: string | null;
@@ -112927,13 +113968,6 @@ interface components {
112927
113968
  finished_at: string | null;
112928
113969
  };
112929
113970
  AdsActionExecutionListItem: components["schemas"]["AdsActionExecution"] & {
112930
- target: {
112931
- /** @enum {string} */
112932
- level: "ad" | "ad_set" | "campaign" | "profile";
112933
- /** @description The Meta id of what was touched; `null` for a profile-level action. */
112934
- external_id: string | null;
112935
- name: string | null;
112936
- };
112937
113971
  /** @description Display name of the member who confirmed it — only for a caller holding `memberships:read` (sample mode included, for the rows the owner simulated); `null` otherwise, for an API key, and on the two sample example rows. Write «Vitrina» for `null`. */
112938
113972
  created_by: string | null;
112939
113973
  };
@@ -112956,7 +113990,10 @@ interface components {
112956
113990
  };
112957
113991
  /** @description No per-day series: tag events are counted over the last 24 hours only (`events_24h`); a day-by-day count is not available. */
112958
113992
  AdsTrackingStatus: {
113993
+ /** @description A timestamped event in the last 30 days. It STAYS `true` for 30 days after the last event (a removed tag, or a site without visits, keeps reading `true` for a month): read `reporting` to know whether the tag is sending events now. */
112959
113994
  installed: boolean;
113995
+ /** @description The tag sent events in the last 24 hours: `events_24h > 0`; when that count could not be read, a `last_seen_at` inside the last 24 hours. `false` with `source: health` means unknown (the daily scan says nothing about the last day), not silent. */
113996
+ reporting: boolean;
112960
113997
  last_seen_at: string | null;
112961
113998
  events_24h: number | null;
112962
113999
  domain: string | null;
@@ -113017,6 +114054,11 @@ interface components {
113017
114054
  * @enum {string}
113018
114055
  */
113019
114056
  source: "engine" | "vitrina";
114057
+ /**
114058
+ * @description Why the ad path is absent, beside `source: vitrina` (`null` exactly when `source` is `engine`): `unmatched` — the outcome was not matched to an ad, there is no ad path to show; `pending` — matched, but the ad credit or the path is not available yet (retry later); `role` — this workspace’s access does not include reading a person’s path.
114059
+ * @enum {string|null}
114060
+ */
114061
+ reason: "role" | "unmatched" | "pending" | null;
113020
114062
  };
113021
114063
  };
113022
114064
  responses: never;
@@ -113078,7 +114120,7 @@ declare function createClient(opts: CreateClientOptions): VitrinaClient;
113078
114120
  * is regenerated — narrow on the ones you handle, never assume this
113079
114121
  * list is exhaustive at runtime.
113080
114122
  */
113081
- type ErrorCode = 'VALIDATION_ERROR' | 'NOT_FOUND' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UNIQUE_CONFLICT' | 'IDEMPOTENCY_KEY_CONFLICT' | 'VERTICAL_NOT_ENABLED' | 'ENTITLEMENT_NOT_ACTIVE' | 'UNSUPPORTED_VEHICLE_TYPE' | 'NO_OFFERING_ADAPTER' | 'PAYLOAD_TOO_LARGE' | 'UNSUPPORTED_MEDIA_TYPE' | 'UPSTREAM_ERROR' | 'RATE_LIMITED' | 'GONE' | 'INTERNAL_ERROR' | 'MESSAGING_ACCOUNT_TENANT_MISSING' | 'COPILOT_APPROVALS_UNAVAILABLE' | 'COPILOT_APPROVAL_REPLAY_BLOCKED' | 'DEALER_SITES_NOT_CONFIGURED' | 'STOREFRONT_ZONES_NOT_CONFIGURED' | 'RECONTACTO_NOT_ENABLED' | 'SYNC_QUEUE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_MISMATCH' | 'ADS_KEY_NEEDS_REMINT' | 'ADS_ACTION_REPLAY_BLOCKED' | 'ADS_ACTION_NOT_AVAILABLE' | 'ADS_ACTION_NOT_REVERSIBLE' | 'ADS_ACTION_CONSENT_REQUIRED' | 'MISSING_SIGNATURE' | 'MALFORMED_SIGNATURE' | 'STALE_SIGNATURE' | 'INVALID_SIGNATURE' | 'REPLAY_DETECTED' | 'TURNSTILE_UNAVAILABLE' | 'TASADOR_QUOTA_EXHAUSTED' | 'TASADOR_ANON_DAILY_LIMIT' | 'TASADOR_CAPACITY_REACHED' | 'CLINIC_PLAN_REQUIRED' | 'TENANT_BILLING_PAUSED' | 'FACEBOOK_MARKETPLACE_NOT_AVAILABLE' | 'WORKSPACE_MEMBER_INACTIVE' | 'DEVICE_AGENT_ALREADY_PAIRED' | 'DEVICE_AGENT_SELF_REQUIRES_USER' | 'DEVICE_AGENT_KIND_NOT_ALLOWED' | 'DEVICE_TASK_STATUS_NOT_ALLOWED' | 'FACEBOOK_MARKETPLACE_NO_PHONE_AGENT' | 'FACEBOOK_MARKETPLACE_THREAD_NOT_ADDRESSABLE' | 'FACEBOOK_MARKETPLACE_ATTACHMENT_UNSUPPORTED' | 'REPLY_PACING_LOCKED' | 'SANDBOX_CHANNEL_FORBIDDEN' | 'SANDBOX_BILLING_FORBIDDEN' | 'SANDBOX_NOT_PROVISIONED' | 'SANDBOX_RESET_UNAVAILABLE' | 'CONNECTED_APP_SENSITIVE_DATA' | 'handoff_mismatch' | 'sync_in_flight' | 'atribu_refused' | 'start_again' | 'reconnect' | 'partner_token_invalid' | 'OUTBOUND_BLOCKED' | 'OUTBOUND_WARNING' | 'dpa_acceptance_required' | 'EMAIL_SENDER_UNRESOLVED' | 'CAMPAIGN_FROM_CONNECTED_MAILBOX' | 'BANK_FEED_NOT_CONFIGURED' | 'ADDON_NOT_PRICED' | 'MIRROR_LINES_UNMAPPED';
114123
+ type ErrorCode = 'VALIDATION_ERROR' | 'NOT_FOUND' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UNIQUE_CONFLICT' | 'IDEMPOTENCY_KEY_CONFLICT' | 'VERTICAL_NOT_ENABLED' | 'ENTITLEMENT_NOT_ACTIVE' | 'UNSUPPORTED_VEHICLE_TYPE' | 'NO_OFFERING_ADAPTER' | 'PAYLOAD_TOO_LARGE' | 'UNSUPPORTED_MEDIA_TYPE' | 'UPSTREAM_ERROR' | 'RATE_LIMITED' | 'GONE' | 'INTERNAL_ERROR' | 'MESSAGING_ACCOUNT_TENANT_MISSING' | 'COPILOT_APPROVALS_UNAVAILABLE' | 'COPILOT_APPROVAL_REPLAY_BLOCKED' | 'COPILOT_DISABLED' | 'COPILOT_BUDGET_EXCEEDED' | 'DEALER_SITES_NOT_CONFIGURED' | 'STOREFRONT_ZONES_NOT_CONFIGURED' | 'RECONTACTO_NOT_ENABLED' | 'SYNC_QUEUE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_MISMATCH' | 'ADS_KEY_NEEDS_REMINT' | 'ADS_ACTION_REPLAY_BLOCKED' | 'ADS_ACTION_NOT_AVAILABLE' | 'ADS_ACTION_NOT_REVERSIBLE' | 'ADS_ACTION_CONSENT_REQUIRED' | 'MISSING_SIGNATURE' | 'MALFORMED_SIGNATURE' | 'STALE_SIGNATURE' | 'INVALID_SIGNATURE' | 'REPLAY_DETECTED' | 'TURNSTILE_UNAVAILABLE' | 'TASADOR_QUOTA_EXHAUSTED' | 'TASADOR_ANON_DAILY_LIMIT' | 'TASADOR_CAPACITY_REACHED' | 'CLINIC_PLAN_REQUIRED' | 'TENANT_BILLING_PAUSED' | 'FACEBOOK_MARKETPLACE_NOT_AVAILABLE' | 'WORKSPACE_MEMBER_INACTIVE' | 'DEVICE_AGENT_ALREADY_PAIRED' | 'DEVICE_AGENT_SELF_REQUIRES_USER' | 'DEVICE_AGENT_KIND_NOT_ALLOWED' | 'DEVICE_TASK_STATUS_NOT_ALLOWED' | 'FACEBOOK_MARKETPLACE_NO_PHONE_AGENT' | 'FACEBOOK_MARKETPLACE_THREAD_NOT_ADDRESSABLE' | 'FACEBOOK_MARKETPLACE_ATTACHMENT_UNSUPPORTED' | 'REPLY_PACING_LOCKED' | 'SANDBOX_CHANNEL_FORBIDDEN' | 'SANDBOX_BILLING_FORBIDDEN' | 'SANDBOX_NOT_PROVISIONED' | 'SANDBOX_RESET_UNAVAILABLE' | 'CONNECTED_APP_SENSITIVE_DATA' | 'handoff_mismatch' | 'sync_in_flight' | 'atribu_refused' | 'start_again' | 'reconnect' | 'partner_token_invalid' | 'OUTBOUND_BLOCKED' | 'OUTBOUND_WARNING' | 'dpa_acceptance_required' | 'EMAIL_SENDER_UNRESOLVED' | 'CAMPAIGN_FROM_CONNECTED_MAILBOX' | 'BANK_FEED_NOT_CONFIGURED' | 'ADDON_NOT_PRICED' | 'MIRROR_LINES_UNMAPPED';
113082
114124
  declare const ERROR_CODES: readonly ErrorCode[];
113083
114125
 
113084
114126
  /**