@vitrina/api 11.31.0 → 11.33.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.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +760 -30
- package/dist/index.d.ts +760 -30
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -65665,6 +65665,8 @@ interface paths {
|
|
|
65665
65665
|
* Export and erasure requests
|
|
65666
65666
|
* @description The durable record of who asked for what, when, and what came back — including a refused erasure and the date its window closes. Requires `clinic_record:read`.
|
|
65667
65667
|
*
|
|
65668
|
+
* An erasure’s `result.engine` is the attribution-data half: `status` `owed` → `queued` → `confirming` → `done` (or `skipped` / `failed`; `done` only once the attribution engine confirms it); `ficha` `erased` | `retained` (retained by law, marketing data erased); `marketing_blocked`; `scrubbed {outbox_rows, threads}` (Vitrina’s own copies of the marketing identifiers removed); `skipped` `no_self_contact` (the ficha has no contact of its own — a guardian is never erased for the patient) or `no_engine_profile`; `receipts[]` `{erasure_id, engine_status, completed_at}`. Say «datos de marketing eliminados» only at `done`. `engine_skipped_no_self_contact` counts the requests that skipped for lack of a contact of their own.
|
|
65669
|
+
*
|
|
65668
65670
|
* **Connected apps:** refused with `403 CONNECTED_APP_SENSITIVE_DATA`, whatever scopes they hold — this operation carries a dato sensible (ADR 0106 §4). Only an API key or a personal token of the workspace that holds the scope reaches it.
|
|
65669
65671
|
*/
|
|
65670
65672
|
get: {
|
|
@@ -66041,7 +66043,7 @@ interface paths {
|
|
|
66041
66043
|
put?: never;
|
|
66042
66044
|
/**
|
|
66043
66045
|
* Erasure request (Ley 21.719), bounded by the retention floor
|
|
66044
|
-
* @description INSIDE the 15-year window (Ley 20.584, Decreto 41) the request is REFUSED — with the legal reason and the date it may be executed — and the refusal is recorded; a silent refusal is as bad as a wrongful deletion. OUTSIDE it, the PII is tombstoned and the clinical rows stay for their own retention. A refusal answers 201, not a 4xx: the request was accepted and lawfully answered, and the row is the answer. Every call writes a `clinic_record_access_log` row; a call that cannot write its access event fails.
|
|
66046
|
+
* @description INSIDE the 15-year window (Ley 20.584, Decreto 41) the request is REFUSED — with the legal reason and the date it may be executed — and the refusal is recorded; a silent refusal is as bad as a wrongful deletion. OUTSIDE it, the PII is tombstoned and the clinical rows stay for their own retention. A refusal answers 201, not a 4xx: the request was accepted and lawfully answered, and the row is the answer. Either way the patient’s attribution/marketing data is erased too: `result.engine` starts `owed` and moves to `done` asynchronously (shape: see `GET /clinic/privacy-requests`); from then on no outcome, identity or link of that contact reaches the attribution engine again. Every call writes a `clinic_record_access_log` row; a call that cannot write its access event fails.
|
|
66045
66047
|
*
|
|
66046
66048
|
* **Connected apps:** refused with `403 CONNECTED_APP_SENSITIVE_DATA`, whatever scopes they hold — this operation carries a dato sensible (ADR 0106 §4). Only an API key or a personal token of the workspace that holds the scope reaches it.
|
|
66047
66049
|
*/
|
|
@@ -73857,6 +73859,8 @@ interface paths {
|
|
|
73857
73859
|
*
|
|
73858
73860
|
* Each row also carries `marketplaceWindow` — `{ open, closedAt, closedReason, lastEvent, lastEventReason, lastEventAt }` on a `facebook_marketplace` conversation, `null` on every other channel. `open` is whether a reply typed in Vitrina can be delivered right now.
|
|
73859
73861
|
*
|
|
73862
|
+
* Each row also carries `ad_origin` (the `AdOrigin` schema) — the Meta ad that opened the thread, in ONE shape whatever the channel (click-to-WhatsApp or an Instagram DM ad), or `null` for an organic thread. `platform` is the thread channel; `ad_external_id` is Meta's ad id (`null` for a boosted post); `ad_name` and `campaign_name` are `null` when the Ads read does not know them; `title` is the ADVERTISER'S copy, never the customer's words; `thumbnail_url` is Vitrina's durable copy of the creative when `media_archived` is `true`, else Meta's own link, which expires — render it with a fallback; `captured_at` is when the thread opened. Meta's own object stays on `ad_referral`, verbatim and write-once, in the channel's spelling (`source_id`/`ctwa_clid` on WhatsApp; `source: 'ADS'`, `ad_id`, `ads_context_data` on Instagram).
|
|
73863
|
+
*
|
|
73860
73864
|
* Rows here do NOT carry `ad_origin_nudge` — that field is single-conversation-read only, to avoid a per-row integration lookup on every page of the inbox.
|
|
73861
73865
|
*/
|
|
73862
73866
|
get: {
|
|
@@ -74012,6 +74016,7 @@ interface paths {
|
|
|
74012
74016
|
* "created_at": "2026-09-22T11:08:10.882Z"
|
|
74013
74017
|
* },
|
|
74014
74018
|
* "marketplaceWindow": null,
|
|
74019
|
+
* "ad_origin": null,
|
|
74015
74020
|
* "tags": [
|
|
74016
74021
|
* {
|
|
74017
74022
|
* "id": "12121212-0000-4000-8000-000000000001",
|
|
@@ -74020,6 +74025,142 @@ interface paths {
|
|
|
74020
74025
|
* }
|
|
74021
74026
|
* ],
|
|
74022
74027
|
* "last_call": null
|
|
74028
|
+
* },
|
|
74029
|
+
* {
|
|
74030
|
+
* "id": "bbbbbbbb-0000-4000-8000-000000000002",
|
|
74031
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
74032
|
+
* "display_seq": 133,
|
|
74033
|
+
* "display_id": "C-133",
|
|
74034
|
+
* "channel": "instagram",
|
|
74035
|
+
* "external_id": "<instagram-scoped-id>",
|
|
74036
|
+
* "messaging_account_id": "16161616-0000-4000-8000-000000000001",
|
|
74037
|
+
* "brand": null,
|
|
74038
|
+
* "contact_id": "22222222-0000-4000-8000-000000000001",
|
|
74039
|
+
* "ticket_id": null,
|
|
74040
|
+
* "status": "open",
|
|
74041
|
+
* "handler": "bot",
|
|
74042
|
+
* "assignee_user_id": null,
|
|
74043
|
+
* "assignee_assigned_at": null,
|
|
74044
|
+
* "snoozed_until": null,
|
|
74045
|
+
* "resolved_at": null,
|
|
74046
|
+
* "resolved_by": null,
|
|
74047
|
+
* "closed_at": null,
|
|
74048
|
+
* "close_deferred_until": null,
|
|
74049
|
+
* "transfer_immediately": false,
|
|
74050
|
+
* "filtered_at": null,
|
|
74051
|
+
* "filtered_reason": null,
|
|
74052
|
+
* "summary": null,
|
|
74053
|
+
* "summarized_at": null,
|
|
74054
|
+
* "history_summary": null,
|
|
74055
|
+
* "history_summary_upto_message_id": null,
|
|
74056
|
+
* "first_billable_at": null,
|
|
74057
|
+
* "billable": null,
|
|
74058
|
+
* "billing_reason": null,
|
|
74059
|
+
* "assigned_unanswered_alerted_at": null,
|
|
74060
|
+
* "assigned_unanswered_realerted_at": null,
|
|
74061
|
+
* "bot_gate_override_at": null,
|
|
74062
|
+
* "bot_gate_override_by": null,
|
|
74063
|
+
* "source": null,
|
|
74064
|
+
* "awaiting_human_since": null,
|
|
74065
|
+
* "awaiting_payment_since": null,
|
|
74066
|
+
* "awaiting_payment_escalated_at": null,
|
|
74067
|
+
* "awaiting_obligation_id": null,
|
|
74068
|
+
* "ad_referral": {
|
|
74069
|
+
* "ref": null,
|
|
74070
|
+
* "source": "ADS",
|
|
74071
|
+
* "type": "OPEN_THREAD",
|
|
74072
|
+
* "ad_id": "120236000000000001",
|
|
74073
|
+
* "ads_context_data": {
|
|
74074
|
+
* "ad_title": "Evaluación sin costo este mes",
|
|
74075
|
+
* "photo_url": null,
|
|
74076
|
+
* "video_url": "https://lookaside.fbsbx.com/ig_messaging_cdn/?asset_id=<asset>",
|
|
74077
|
+
* "post_id": "18000000000000001",
|
|
74078
|
+
* "product_id": null
|
|
74079
|
+
* }
|
|
74080
|
+
* },
|
|
74081
|
+
* "ad_join": null,
|
|
74082
|
+
* "ad_welcome": null,
|
|
74083
|
+
* "metadata": {
|
|
74084
|
+
* "ad_creative": {
|
|
74085
|
+
* "thumbnail_url": "https://media.vitrinadev.com/ad-creatives/a1a1a1a1-0000-4000-8000-000000000001/<digest>.jpg",
|
|
74086
|
+
* "source": "share_media",
|
|
74087
|
+
* "permalink": "https://www.instagram.com/p/<shortcode>/",
|
|
74088
|
+
* "archived_at": "2026-09-22T10:42:15.120Z"
|
|
74089
|
+
* }
|
|
74090
|
+
* },
|
|
74091
|
+
* "ai_control_source": "legacy",
|
|
74092
|
+
* "ai_control_changed_at": null,
|
|
74093
|
+
* "ai_control_revision": 0,
|
|
74094
|
+
* "ai_control_window_start": null,
|
|
74095
|
+
* "ai_control_window_end": null,
|
|
74096
|
+
* "ai_control_account_revision": null,
|
|
74097
|
+
* "ai_blocked_until": null,
|
|
74098
|
+
* "ai_keep_with_human": false,
|
|
74099
|
+
* "external_id_provisional": false,
|
|
74100
|
+
* "originated_at": null,
|
|
74101
|
+
* "originated_by_kind": null,
|
|
74102
|
+
* "originated_by_ai_agent_id": null,
|
|
74103
|
+
* "originated_by_user_id": null,
|
|
74104
|
+
* "originated_outbound_action_id": null,
|
|
74105
|
+
* "last_message_date": "2026-09-22T10:41:12.310Z",
|
|
74106
|
+
* "created_at": "2026-09-22T10:41:12.004Z",
|
|
74107
|
+
* "updated_at": "2026-09-22T10:41:12.310Z",
|
|
74108
|
+
* "contact": {
|
|
74109
|
+
* "id": "22222222-0000-4000-8000-000000000001",
|
|
74110
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
74111
|
+
* "name": "Rodrigo Pizarro",
|
|
74112
|
+
* "email": "rodrigo.pizarro@example.cl",
|
|
74113
|
+
* "phone": "+56977000021",
|
|
74114
|
+
* "external_id": "web:visitor-9f2c1a",
|
|
74115
|
+
* "avatar_url": null,
|
|
74116
|
+
* "city": null,
|
|
74117
|
+
* "country": null,
|
|
74118
|
+
* "language": "es",
|
|
74119
|
+
* "job_title": null,
|
|
74120
|
+
* "company_id": null,
|
|
74121
|
+
* "brand": null,
|
|
74122
|
+
* "social": {},
|
|
74123
|
+
* "social_stats": {},
|
|
74124
|
+
* "lifecycle_stage": "unknown",
|
|
74125
|
+
* "email_status": "subscribed",
|
|
74126
|
+
* "email_consent": false,
|
|
74127
|
+
* "outreach_consent_at": null,
|
|
74128
|
+
* "outreach_consent_source_url": null,
|
|
74129
|
+
* "outreach_consent_text_version": null,
|
|
74130
|
+
* "bot_replies_disabled_at": null,
|
|
74131
|
+
* "bot_replies_disabled_by": null,
|
|
74132
|
+
* "spam_at": null,
|
|
74133
|
+
* "blocked_at": null,
|
|
74134
|
+
* "archived_at": null,
|
|
74135
|
+
* "merged_at": null,
|
|
74136
|
+
* "merged_into_contact_id": null,
|
|
74137
|
+
* "search_text": "rodrigo pizarro rodrigo.pizarro@example.cl +56977000021",
|
|
74138
|
+
* "created_at": "2026-09-22T11:06:33.508Z",
|
|
74139
|
+
* "updated_at": "2026-09-22T11:06:33.508Z"
|
|
74140
|
+
* },
|
|
74141
|
+
* "ticket": null,
|
|
74142
|
+
* "lastMessage": {
|
|
74143
|
+
* "id": "eeeeeeee-0000-4000-8000-000000000001",
|
|
74144
|
+
* "content": "Hola, quiero más información",
|
|
74145
|
+
* "sender_type": "contact",
|
|
74146
|
+
* "created_at": "2026-09-22T10:41:12.310Z"
|
|
74147
|
+
* },
|
|
74148
|
+
* "marketplaceWindow": null,
|
|
74149
|
+
* "ad_origin": {
|
|
74150
|
+
* "platform": "instagram",
|
|
74151
|
+
* "kind": "ad",
|
|
74152
|
+
* "ad_external_id": "120236000000000001",
|
|
74153
|
+
* "ad_name": "Evaluación facial — septiembre",
|
|
74154
|
+
* "campaign_name": "Mensajes Instagram · Evaluación",
|
|
74155
|
+
* "title": "Evaluación sin costo este mes",
|
|
74156
|
+
* "thumbnail_url": "https://media.vitrinadev.com/ad-creatives/a1a1a1a1-0000-4000-8000-000000000001/<digest>.jpg",
|
|
74157
|
+
* "media_archived": true,
|
|
74158
|
+
* "video_url": "https://lookaside.fbsbx.com/ig_messaging_cdn/?asset_id=<asset>",
|
|
74159
|
+
* "source_url": "https://www.instagram.com/p/<shortcode>/",
|
|
74160
|
+
* "captured_at": "2026-09-22T10:41:12.004Z"
|
|
74161
|
+
* },
|
|
74162
|
+
* "tags": [],
|
|
74163
|
+
* "last_call": null
|
|
74023
74164
|
* }
|
|
74024
74165
|
* ],
|
|
74025
74166
|
* "meta": {
|
|
@@ -74041,7 +74182,9 @@ interface paths {
|
|
|
74041
74182
|
* }
|
|
74042
74183
|
*/
|
|
74043
74184
|
"application/json": {
|
|
74044
|
-
data
|
|
74185
|
+
data: {
|
|
74186
|
+
ad_origin: components["schemas"]["AdOrigin"];
|
|
74187
|
+
}[];
|
|
74045
74188
|
meta?: {
|
|
74046
74189
|
[key: string]: unknown;
|
|
74047
74190
|
};
|
|
@@ -74420,7 +74563,11 @@ interface paths {
|
|
|
74420
74563
|
*
|
|
74421
74564
|
* Pass `?exclude=messages` to opt into the SAME row without that embed. Any caller that re-reads this on a clock should: the embed has no limit, so a two-year-old thread returns two years of messages every time. `GET /conversations/{id}/messages` pages them properly.
|
|
74422
74565
|
*
|
|
74423
|
-
* Also carries `ad_origin_nudge: 'connect_meta_ads' | null`, non-null ONLY when the caller holds `integrations:write`, the conversation came from a Meta click-to-WhatsApp ad, and the workspace has no connected `meta_ads` integration. THIS ROUTE ONLY — deliberately absent from the list, where the predicate would be an N+1.
|
|
74566
|
+
* Also carries `ad_origin_nudge: 'connect_meta_ads' | null`, non-null ONLY when the caller holds `integrations:write`, the conversation came from a Meta ad (click-to-WhatsApp or an Instagram DM ad), and the workspace has no connected `meta_ads` integration. THIS ROUTE ONLY — deliberately absent from the list, where the predicate would be an N+1.
|
|
74567
|
+
*
|
|
74568
|
+
* And `handoff_resolved_suggested: boolean` (#2968) — true only on an open/pending AI-handoff thread whose customer is still waiting on us AND Jev already read their own pending words as saying the matter is resolved (checked once per customer message, at the next handoff re-notify tick). The inbox reads this to offer a one-click close. THIS ROUTE ONLY, same N+1 reasoning as `ad_origin_nudge`.
|
|
74569
|
+
*
|
|
74570
|
+
* Carries `ad_origin` exactly as `GET /conversations` rows do.
|
|
74424
74571
|
*/
|
|
74425
74572
|
get: {
|
|
74426
74573
|
parameters: {
|
|
@@ -74552,6 +74699,7 @@ interface paths {
|
|
|
74552
74699
|
* "created_at": "2026-09-22T11:08:10.882Z"
|
|
74553
74700
|
* },
|
|
74554
74701
|
* "marketplaceWindow": null,
|
|
74702
|
+
* "ad_origin": null,
|
|
74555
74703
|
* "tags": [
|
|
74556
74704
|
* {
|
|
74557
74705
|
* "id": "12121212-0000-4000-8000-000000000001",
|
|
@@ -74561,6 +74709,7 @@ interface paths {
|
|
|
74561
74709
|
* ],
|
|
74562
74710
|
* "last_call": null,
|
|
74563
74711
|
* "ad_origin_nudge": null,
|
|
74712
|
+
* "handoff_resolved_suggested": false,
|
|
74564
74713
|
* "message": [
|
|
74565
74714
|
* {
|
|
74566
74715
|
* "id": "eeeeeeee-0000-4000-8000-000000000001",
|
|
@@ -74577,7 +74726,9 @@ interface paths {
|
|
|
74577
74726
|
* }
|
|
74578
74727
|
*/
|
|
74579
74728
|
"application/json": {
|
|
74580
|
-
data
|
|
74729
|
+
data: {
|
|
74730
|
+
ad_origin: components["schemas"]["AdOrigin"];
|
|
74731
|
+
};
|
|
74581
74732
|
meta?: {
|
|
74582
74733
|
[key: string]: unknown;
|
|
74583
74734
|
};
|
|
@@ -93044,7 +93195,7 @@ interface paths {
|
|
|
93044
93195
|
* },
|
|
93045
93196
|
* "lines": [
|
|
93046
93197
|
* {
|
|
93047
|
-
* "text": "La mejor campaña fue «Evaluación sin costo · Meta», con 5,4× de retorno, y 36,4% de tus tratamientos
|
|
93198
|
+
* "text": "La mejor campaña fue «Evaluación sin costo · Meta», con 5,4× de retorno, y el 36,4% de tus tratamientos llegó desde anuncios.",
|
|
93048
93199
|
* "fact_keys": [
|
|
93049
93200
|
* "best_campaign_name",
|
|
93050
93201
|
* "best_campaign_roas",
|
|
@@ -93609,6 +93760,343 @@ interface paths {
|
|
|
93609
93760
|
patch?: never;
|
|
93610
93761
|
trace?: never;
|
|
93611
93762
|
};
|
|
93763
|
+
"/ads/share/resumen": {
|
|
93764
|
+
parameters: {
|
|
93765
|
+
query?: never;
|
|
93766
|
+
header?: never;
|
|
93767
|
+
path?: never;
|
|
93768
|
+
cookie?: never;
|
|
93769
|
+
};
|
|
93770
|
+
/**
|
|
93771
|
+
* One calendar month as the Resumen share card (data)
|
|
93772
|
+
* @description The month the monthly Ads email reports, as data: the card’s dominant figure (the return; the outcomes when there is no value yet; the spend when nothing came back), its caption and lines pre-formatted es-CL in the workspace’s nouns, up to three fact-built sentences (no model) and — when the engine’s recent measurement verdict is broken — the reason, printed after «Falta parte del seguimiento:». `period` = `YYYY-MM` (Santiago), default the previous month. No sample mode.
|
|
93773
|
+
*/
|
|
93774
|
+
get: {
|
|
93775
|
+
parameters: {
|
|
93776
|
+
query?: {
|
|
93777
|
+
/** @description Calendar month `YYYY-MM` (Santiago). Default: the previous month. The running month reads up to today; a month that has not started yet is a 400. */
|
|
93778
|
+
period?: string;
|
|
93779
|
+
/** @description Palette of the image. Default `light`. */
|
|
93780
|
+
theme?: "light" | "dark";
|
|
93781
|
+
};
|
|
93782
|
+
header?: never;
|
|
93783
|
+
path?: never;
|
|
93784
|
+
cookie?: never;
|
|
93785
|
+
};
|
|
93786
|
+
requestBody?: never;
|
|
93787
|
+
responses: {
|
|
93788
|
+
/** @description The month card */
|
|
93789
|
+
200: {
|
|
93790
|
+
headers: {
|
|
93791
|
+
[name: string]: unknown;
|
|
93792
|
+
};
|
|
93793
|
+
content: {
|
|
93794
|
+
/**
|
|
93795
|
+
* @example {
|
|
93796
|
+
* "data": {
|
|
93797
|
+
* "period": {
|
|
93798
|
+
* "month": "2026-08",
|
|
93799
|
+
* "from": "2026-08-01",
|
|
93800
|
+
* "to": "2026-08-31",
|
|
93801
|
+
* "closed": true,
|
|
93802
|
+
* "label": "Agosto · 1 – 31 ago 2026"
|
|
93803
|
+
* },
|
|
93804
|
+
* "vocabulary": "generic",
|
|
93805
|
+
* "has_activity": true,
|
|
93806
|
+
* "dominant": "roas",
|
|
93807
|
+
* "headline": "Agosto: 3,7× de retorno",
|
|
93808
|
+
* "tile": {
|
|
93809
|
+
* "number": "3,7×",
|
|
93810
|
+
* "unit": "retorno",
|
|
93811
|
+
* "caption": "$845.200 invertidos · $3.120.000 en cierres",
|
|
93812
|
+
* "lines": [
|
|
93813
|
+
* "31 cierres desde anuncios",
|
|
93814
|
+
* "Mejor campaña: «Temporada de primavera», 4,2× de retorno",
|
|
93815
|
+
* "En julio: 2,9× de retorno"
|
|
93816
|
+
* ]
|
|
93817
|
+
* },
|
|
93818
|
+
* "sentences": [
|
|
93819
|
+
* "Tus anuncios trajeron **$3.120.000** en cierres, con 31 cierres (el 73,8% del total).",
|
|
93820
|
+
* "La mejor campaña fue «Temporada de primavera», con 4,2× de retorno.",
|
|
93821
|
+
* "Son 7 cierres más que en julio."
|
|
93822
|
+
* ],
|
|
93823
|
+
* "tracking_issue": null,
|
|
93824
|
+
* "image_alt": "3,7× retorno en agosto. $845.200 invertidos · $3.120.000 en cierres. 31 cierres desde anuncios. Mejor campaña: «Temporada de primavera», 4,2× de retorno. En julio: 2,9× de retorno",
|
|
93825
|
+
* "figures": {
|
|
93826
|
+
* "spend": 845200,
|
|
93827
|
+
* "revenue": 3120000,
|
|
93828
|
+
* "roas": 3.69,
|
|
93829
|
+
* "attributed_outcomes": 31,
|
|
93830
|
+
* "best_campaign": "Temporada de primavera"
|
|
93831
|
+
* }
|
|
93832
|
+
* }
|
|
93833
|
+
* }
|
|
93834
|
+
*/
|
|
93835
|
+
"application/json": {
|
|
93836
|
+
data: components["schemas"]["AdsShareResumen"];
|
|
93837
|
+
};
|
|
93838
|
+
};
|
|
93839
|
+
};
|
|
93840
|
+
/** @description Validation error */
|
|
93841
|
+
400: {
|
|
93842
|
+
headers: {
|
|
93843
|
+
[name: string]: unknown;
|
|
93844
|
+
};
|
|
93845
|
+
content: {
|
|
93846
|
+
"application/json": components["schemas"]["Error"];
|
|
93847
|
+
};
|
|
93848
|
+
};
|
|
93849
|
+
/** @description Unauthorized */
|
|
93850
|
+
401: {
|
|
93851
|
+
headers: {
|
|
93852
|
+
[name: string]: unknown;
|
|
93853
|
+
};
|
|
93854
|
+
content: {
|
|
93855
|
+
"application/json": components["schemas"]["Error"];
|
|
93856
|
+
};
|
|
93857
|
+
};
|
|
93858
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
93859
|
+
402: {
|
|
93860
|
+
headers: {
|
|
93861
|
+
[name: string]: unknown;
|
|
93862
|
+
};
|
|
93863
|
+
content: {
|
|
93864
|
+
/**
|
|
93865
|
+
* @example {
|
|
93866
|
+
* "error": {
|
|
93867
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
93868
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
93869
|
+
* "details": {
|
|
93870
|
+
* "required": [
|
|
93871
|
+
* "vitrina_ads"
|
|
93872
|
+
* ],
|
|
93873
|
+
* "active": [],
|
|
93874
|
+
* "feature": "vitrina_ads",
|
|
93875
|
+
* "entitlement_state": "off"
|
|
93876
|
+
* }
|
|
93877
|
+
* }
|
|
93878
|
+
* }
|
|
93879
|
+
*/
|
|
93880
|
+
"application/json": components["schemas"]["Error"];
|
|
93881
|
+
};
|
|
93882
|
+
};
|
|
93883
|
+
/** @description Forbidden */
|
|
93884
|
+
403: {
|
|
93885
|
+
headers: {
|
|
93886
|
+
[name: string]: unknown;
|
|
93887
|
+
};
|
|
93888
|
+
content: {
|
|
93889
|
+
"application/json": components["schemas"]["Error"];
|
|
93890
|
+
};
|
|
93891
|
+
};
|
|
93892
|
+
/** @description Not found */
|
|
93893
|
+
404: {
|
|
93894
|
+
headers: {
|
|
93895
|
+
[name: string]: unknown;
|
|
93896
|
+
};
|
|
93897
|
+
content: {
|
|
93898
|
+
"application/json": components["schemas"]["Error"];
|
|
93899
|
+
};
|
|
93900
|
+
};
|
|
93901
|
+
/** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
|
|
93902
|
+
409: {
|
|
93903
|
+
headers: {
|
|
93904
|
+
[name: string]: unknown;
|
|
93905
|
+
};
|
|
93906
|
+
content: {
|
|
93907
|
+
/**
|
|
93908
|
+
* @example {
|
|
93909
|
+
* "error": {
|
|
93910
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
93911
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
93912
|
+
* "details": {
|
|
93913
|
+
* "key_kind": "core"
|
|
93914
|
+
* }
|
|
93915
|
+
* }
|
|
93916
|
+
* }
|
|
93917
|
+
*/
|
|
93918
|
+
"application/json": components["schemas"]["Error"];
|
|
93919
|
+
};
|
|
93920
|
+
};
|
|
93921
|
+
/** @description Rate limited */
|
|
93922
|
+
429: {
|
|
93923
|
+
headers: {
|
|
93924
|
+
[name: string]: unknown;
|
|
93925
|
+
};
|
|
93926
|
+
content: {
|
|
93927
|
+
"application/json": components["schemas"]["Error"];
|
|
93928
|
+
};
|
|
93929
|
+
};
|
|
93930
|
+
};
|
|
93931
|
+
};
|
|
93932
|
+
put?: never;
|
|
93933
|
+
post?: never;
|
|
93934
|
+
delete?: never;
|
|
93935
|
+
options?: never;
|
|
93936
|
+
head?: never;
|
|
93937
|
+
patch?: never;
|
|
93938
|
+
trace?: never;
|
|
93939
|
+
};
|
|
93940
|
+
"/ads/share/resumen.png": {
|
|
93941
|
+
parameters: {
|
|
93942
|
+
query?: never;
|
|
93943
|
+
header?: never;
|
|
93944
|
+
path?: never;
|
|
93945
|
+
cookie?: never;
|
|
93946
|
+
};
|
|
93947
|
+
/**
|
|
93948
|
+
* One calendar month as the Resumen share card (PNG)
|
|
93949
|
+
* @description The same card as `GET /ads/share/resumen`, drawn as the Resumen «Compartir» image: a 1200 × 630 PNG (the monthly Ads email carries its own shorter crop of the same facts instead). Aggregates and the workspace’s own campaign names only. Carries a strong `ETag` (a repeat with `If-None-Match` answers 304) and `Cache-Control: private` — a day for a closed month, five minutes for the running one.
|
|
93950
|
+
*/
|
|
93951
|
+
get: {
|
|
93952
|
+
parameters: {
|
|
93953
|
+
query?: {
|
|
93954
|
+
/** @description Calendar month `YYYY-MM` (Santiago). Default: the previous month. The running month reads up to today; a month that has not started yet is a 400. */
|
|
93955
|
+
period?: string;
|
|
93956
|
+
/** @description Palette of the image. Default `light`. */
|
|
93957
|
+
theme?: "light" | "dark";
|
|
93958
|
+
};
|
|
93959
|
+
header?: never;
|
|
93960
|
+
path?: never;
|
|
93961
|
+
cookie?: never;
|
|
93962
|
+
};
|
|
93963
|
+
requestBody?: never;
|
|
93964
|
+
responses: {
|
|
93965
|
+
/** @description The card image */
|
|
93966
|
+
200: {
|
|
93967
|
+
headers: {
|
|
93968
|
+
[name: string]: unknown;
|
|
93969
|
+
};
|
|
93970
|
+
content: {
|
|
93971
|
+
"image/png": string;
|
|
93972
|
+
};
|
|
93973
|
+
};
|
|
93974
|
+
/** @description Unchanged since the `ETag` sent */
|
|
93975
|
+
304: {
|
|
93976
|
+
headers: {
|
|
93977
|
+
[name: string]: unknown;
|
|
93978
|
+
};
|
|
93979
|
+
content?: never;
|
|
93980
|
+
};
|
|
93981
|
+
/** @description Validation error */
|
|
93982
|
+
400: {
|
|
93983
|
+
headers: {
|
|
93984
|
+
[name: string]: unknown;
|
|
93985
|
+
};
|
|
93986
|
+
content: {
|
|
93987
|
+
"application/json": components["schemas"]["Error"];
|
|
93988
|
+
};
|
|
93989
|
+
};
|
|
93990
|
+
/** @description Unauthorized */
|
|
93991
|
+
401: {
|
|
93992
|
+
headers: {
|
|
93993
|
+
[name: string]: unknown;
|
|
93994
|
+
};
|
|
93995
|
+
content: {
|
|
93996
|
+
"application/json": components["schemas"]["Error"];
|
|
93997
|
+
};
|
|
93998
|
+
};
|
|
93999
|
+
/** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
|
|
94000
|
+
402: {
|
|
94001
|
+
headers: {
|
|
94002
|
+
[name: string]: unknown;
|
|
94003
|
+
};
|
|
94004
|
+
content: {
|
|
94005
|
+
/**
|
|
94006
|
+
* @example {
|
|
94007
|
+
* "error": {
|
|
94008
|
+
* "code": "ENTITLEMENT_NOT_ACTIVE",
|
|
94009
|
+
* "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
|
|
94010
|
+
* "details": {
|
|
94011
|
+
* "required": [
|
|
94012
|
+
* "vitrina_ads"
|
|
94013
|
+
* ],
|
|
94014
|
+
* "active": [],
|
|
94015
|
+
* "feature": "vitrina_ads",
|
|
94016
|
+
* "entitlement_state": "off"
|
|
94017
|
+
* }
|
|
94018
|
+
* }
|
|
94019
|
+
* }
|
|
94020
|
+
*/
|
|
94021
|
+
"application/json": components["schemas"]["Error"];
|
|
94022
|
+
};
|
|
94023
|
+
};
|
|
94024
|
+
/** @description Forbidden */
|
|
94025
|
+
403: {
|
|
94026
|
+
headers: {
|
|
94027
|
+
[name: string]: unknown;
|
|
94028
|
+
};
|
|
94029
|
+
content: {
|
|
94030
|
+
"application/json": components["schemas"]["Error"];
|
|
94031
|
+
};
|
|
94032
|
+
};
|
|
94033
|
+
/** @description Not found */
|
|
94034
|
+
404: {
|
|
94035
|
+
headers: {
|
|
94036
|
+
[name: string]: unknown;
|
|
94037
|
+
};
|
|
94038
|
+
content: {
|
|
94039
|
+
"application/json": components["schemas"]["Error"];
|
|
94040
|
+
};
|
|
94041
|
+
};
|
|
94042
|
+
/** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
|
|
94043
|
+
409: {
|
|
94044
|
+
headers: {
|
|
94045
|
+
[name: string]: unknown;
|
|
94046
|
+
};
|
|
94047
|
+
content: {
|
|
94048
|
+
/**
|
|
94049
|
+
* @example {
|
|
94050
|
+
* "error": {
|
|
94051
|
+
* "code": "ADS_KEY_NEEDS_REMINT",
|
|
94052
|
+
* "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
|
|
94053
|
+
* "details": {
|
|
94054
|
+
* "key_kind": "core"
|
|
94055
|
+
* }
|
|
94056
|
+
* }
|
|
94057
|
+
* }
|
|
94058
|
+
*/
|
|
94059
|
+
"application/json": components["schemas"]["Error"];
|
|
94060
|
+
};
|
|
94061
|
+
};
|
|
94062
|
+
/** @description Rate limited */
|
|
94063
|
+
429: {
|
|
94064
|
+
headers: {
|
|
94065
|
+
[name: string]: unknown;
|
|
94066
|
+
};
|
|
94067
|
+
content: {
|
|
94068
|
+
"application/json": components["schemas"]["Error"];
|
|
94069
|
+
};
|
|
94070
|
+
};
|
|
94071
|
+
/** @description The image rasteriser is not available on this deployment. `error.code` is `SHARE_IMAGE_UNAVAILABLE`; retry after the `Retry-After` seconds. `GET /ads/share/resumen` (the data) is unaffected. */
|
|
94072
|
+
503: {
|
|
94073
|
+
headers: {
|
|
94074
|
+
/** @description Seconds to wait before retrying. */
|
|
94075
|
+
"Retry-After"?: number;
|
|
94076
|
+
[name: string]: unknown;
|
|
94077
|
+
};
|
|
94078
|
+
content: {
|
|
94079
|
+
/**
|
|
94080
|
+
* @example {
|
|
94081
|
+
* "error": {
|
|
94082
|
+
* "code": "SHARE_IMAGE_UNAVAILABLE",
|
|
94083
|
+
* "message": "La imagen del resumen no está disponible en este momento. Vuelve a intentarlo en unos minutos."
|
|
94084
|
+
* }
|
|
94085
|
+
* }
|
|
94086
|
+
*/
|
|
94087
|
+
"application/json": components["schemas"]["Error"];
|
|
94088
|
+
};
|
|
94089
|
+
};
|
|
94090
|
+
};
|
|
94091
|
+
};
|
|
94092
|
+
put?: never;
|
|
94093
|
+
post?: never;
|
|
94094
|
+
delete?: never;
|
|
94095
|
+
options?: never;
|
|
94096
|
+
head?: never;
|
|
94097
|
+
patch?: never;
|
|
94098
|
+
trace?: never;
|
|
94099
|
+
};
|
|
93612
94100
|
"/ads/actions": {
|
|
93613
94101
|
parameters: {
|
|
93614
94102
|
query?: never;
|
|
@@ -95704,12 +96192,18 @@ interface paths {
|
|
|
95704
96192
|
cookie?: never;
|
|
95705
96193
|
};
|
|
95706
96194
|
/**
|
|
95707
|
-
* One feed row’s
|
|
95708
|
-
* @description The
|
|
96195
|
+
* One feed row’s journey
|
|
96196
|
+
* @description The journey behind one recorded outcome, oldest first: the attribution engine’s touches (the ad — its name, ad set, campaign and thumbnail — the click that landed, site visits) interleaved with the steps Vitrina recorded itself (first message, booking, attended visit, presented quote, acceptance, payments). The credited touch is `credited: true` with its `join_method`; the row itself is `current: true`. Labels are ready to render in the workspace’s vocabulary, and `stage` carries the vocabulary key.
|
|
96197
|
+
*
|
|
96198
|
+
* `scope=conversion` (default) ends at this outcome; `scope=person` is the whole person — every touch and every recorded step, across repeat visits and devices — plus `person.attended_count` («vino n veces») and `person.conversion_count`.
|
|
96199
|
+
*
|
|
96200
|
+
* Never a 5xx for the engine: when its touches cannot be shown the journey is Vitrina’s own steps (`source: vitrina`) and `reason` says why (`unmatched` / `pending` / `unavailable` / `scope`). Never carries a URL, path, referrer, device, location, email or the engine’s own person ids. 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).
|
|
95709
96201
|
*/
|
|
95710
96202
|
get: {
|
|
95711
96203
|
parameters: {
|
|
95712
96204
|
query?: {
|
|
96205
|
+
/** @description `conversion` (default): the path to THIS outcome — the touches before it and the contact’s recorded steps up to it. `person`: the whole person — every touch and every recorded step, across repeat visits and devices — plus `person` (how many times they came, how many conversions). Use it for «Ver recorrido completo». */
|
|
96206
|
+
scope?: "conversion" | "person";
|
|
95713
96207
|
/** @description Sample mode only: the feed window the item came from (defaults to the last 30 days). Ignored for real data. */
|
|
95714
96208
|
from?: string;
|
|
95715
96209
|
/** @description Sample mode only — see `from`. */
|
|
@@ -95737,38 +96231,125 @@ interface paths {
|
|
|
95737
96231
|
* "data": {
|
|
95738
96232
|
* "steps": [
|
|
95739
96233
|
* {
|
|
96234
|
+
* "stage": null,
|
|
96235
|
+
* "detail": "Ortodoncia invisible · Septiembre",
|
|
96236
|
+
* "credited": false,
|
|
96237
|
+
* "join_method": null,
|
|
96238
|
+
* "click_id_kind": null,
|
|
96239
|
+
* "ad": {
|
|
96240
|
+
* "external_id": "120211000000000101",
|
|
96241
|
+
* "name": "Reel · Antes y después",
|
|
96242
|
+
* "ad_set_name": "Mujeres 30-45 · Providencia",
|
|
96243
|
+
* "campaign": {
|
|
96244
|
+
* "external_id": "120211000000000100",
|
|
96245
|
+
* "name": "Ortodoncia invisible · Septiembre"
|
|
96246
|
+
* },
|
|
96247
|
+
* "creative_thumbnail_url": null
|
|
96248
|
+
* },
|
|
96249
|
+
* "value": null,
|
|
96250
|
+
* "current": false,
|
|
96251
|
+
* "id": "b2f0c1d4-1a2b-4c3d-8e4f-5a6b7c8d9e01",
|
|
95740
96252
|
* "kind": "ad",
|
|
96253
|
+
* "origin": "engine",
|
|
95741
96254
|
* "label": "Reel · Antes y después",
|
|
95742
|
-
* "detail": "Ortodoncia invisible · Septiembre",
|
|
95743
96255
|
* "at": "2026-09-19T21:10:00.000Z",
|
|
95744
96256
|
* "channel": "meta"
|
|
95745
96257
|
* },
|
|
95746
96258
|
* {
|
|
96259
|
+
* "stage": null,
|
|
96260
|
+
* "detail": "Reel · Antes y después",
|
|
96261
|
+
* "credited": true,
|
|
96262
|
+
* "join_method": "click_id",
|
|
96263
|
+
* "click_id_kind": "fbclid",
|
|
96264
|
+
* "ad": {
|
|
96265
|
+
* "external_id": "120211000000000101",
|
|
96266
|
+
* "name": "Reel · Antes y después",
|
|
96267
|
+
* "ad_set_name": "Mujeres 30-45 · Providencia",
|
|
96268
|
+
* "campaign": {
|
|
96269
|
+
* "external_id": "120211000000000100",
|
|
96270
|
+
* "name": "Ortodoncia invisible · Septiembre"
|
|
96271
|
+
* },
|
|
96272
|
+
* "creative_thumbnail_url": null
|
|
96273
|
+
* },
|
|
96274
|
+
* "value": null,
|
|
96275
|
+
* "current": false,
|
|
96276
|
+
* "id": "b2f0c1d4-1a2b-4c3d-8e4f-5a6b7c8d9e02",
|
|
95747
96277
|
* "kind": "click",
|
|
95748
|
-
* "
|
|
95749
|
-
* "
|
|
96278
|
+
* "origin": "engine",
|
|
96279
|
+
* "label": "Visita desde el anuncio",
|
|
95750
96280
|
* "at": "2026-09-20T13:02:00.000Z",
|
|
95751
96281
|
* "channel": "meta"
|
|
95752
96282
|
* },
|
|
95753
96283
|
* {
|
|
96284
|
+
* "stage": "lead_created",
|
|
96285
|
+
* "detail": "Por WhatsApp",
|
|
96286
|
+
* "credited": false,
|
|
96287
|
+
* "join_method": null,
|
|
96288
|
+
* "click_id_kind": null,
|
|
96289
|
+
* "ad": null,
|
|
96290
|
+
* "value": null,
|
|
96291
|
+
* "current": false,
|
|
96292
|
+
* "id": "01926f3e-1111-7b2e-9f10-3a5b7c9d0e10",
|
|
95754
96293
|
* "kind": "chat",
|
|
95755
|
-
* "
|
|
95756
|
-
* "
|
|
96294
|
+
* "origin": "vitrina",
|
|
96295
|
+
* "label": "Contacto nuevo",
|
|
95757
96296
|
* "at": "2026-09-20T13:03:00.000Z",
|
|
95758
96297
|
* "channel": "whatsapp"
|
|
95759
96298
|
* },
|
|
95760
96299
|
* {
|
|
95761
|
-
* "
|
|
95762
|
-
* "
|
|
96300
|
+
* "stage": "appointment_attended",
|
|
96301
|
+
* "detail": null,
|
|
96302
|
+
* "credited": false,
|
|
96303
|
+
* "join_method": null,
|
|
96304
|
+
* "click_id_kind": null,
|
|
96305
|
+
* "ad": null,
|
|
96306
|
+
* "value": null,
|
|
96307
|
+
* "current": false,
|
|
96308
|
+
* "id": "01926f3e-2222-7b2e-9f10-3a5b7c9d0e11",
|
|
96309
|
+
* "kind": "attended",
|
|
96310
|
+
* "origin": "vitrina",
|
|
96311
|
+
* "label": "Cita atendida",
|
|
96312
|
+
* "at": "2026-09-21T14:00:00.000Z"
|
|
96313
|
+
* },
|
|
96314
|
+
* {
|
|
96315
|
+
* "stage": "quote_presented",
|
|
96316
|
+
* "detail": null,
|
|
96317
|
+
* "credited": false,
|
|
96318
|
+
* "join_method": null,
|
|
96319
|
+
* "click_id_kind": null,
|
|
96320
|
+
* "ad": null,
|
|
96321
|
+
* "value": 1200000,
|
|
96322
|
+
* "current": false,
|
|
96323
|
+
* "id": "01926f3e-3333-7b2e-9f10-3a5b7c9d0e12",
|
|
96324
|
+
* "kind": "quote",
|
|
96325
|
+
* "origin": "vitrina",
|
|
96326
|
+
* "label": "Presupuesto presentado",
|
|
96327
|
+
* "at": "2026-09-21T15:20:00.000Z"
|
|
96328
|
+
* },
|
|
96329
|
+
* {
|
|
96330
|
+
* "stage": "closed_won",
|
|
95763
96331
|
* "detail": null,
|
|
96332
|
+
* "credited": false,
|
|
96333
|
+
* "join_method": null,
|
|
96334
|
+
* "click_id_kind": null,
|
|
96335
|
+
* "ad": null,
|
|
96336
|
+
* "value": 1200000,
|
|
96337
|
+
* "current": true,
|
|
96338
|
+
* "id": "01926f3e-7c1a-7b2e-9f10-3a5b7c9d0e1f",
|
|
96339
|
+
* "kind": "accepted",
|
|
96340
|
+
* "origin": "vitrina",
|
|
96341
|
+
* "label": "Presupuesto aceptado",
|
|
95764
96342
|
* "at": "2026-09-22T19:40:12.000Z"
|
|
95765
96343
|
* }
|
|
95766
96344
|
* ],
|
|
95767
|
-
* "touch_count":
|
|
96345
|
+
* "touch_count": 2,
|
|
95768
96346
|
* "credited_weight": 1,
|
|
95769
96347
|
* "model": "last_touch",
|
|
95770
|
-
* "
|
|
95771
|
-
* "
|
|
96348
|
+
* "scope": "conversion",
|
|
96349
|
+
* "source": "mixed",
|
|
96350
|
+
* "reason": null,
|
|
96351
|
+
* "person": null,
|
|
96352
|
+
* "truncated": false
|
|
95772
96353
|
* }
|
|
95773
96354
|
* }
|
|
95774
96355
|
*/
|
|
@@ -116211,6 +116792,36 @@ interface components {
|
|
|
116211
116792
|
test_events_link: string | null;
|
|
116212
116793
|
simulated: boolean;
|
|
116213
116794
|
};
|
|
116795
|
+
AdOrigin: {
|
|
116796
|
+
/**
|
|
116797
|
+
* @description Where the thread lives — the conversation channel.
|
|
116798
|
+
* @enum {string}
|
|
116799
|
+
*/
|
|
116800
|
+
platform: "whatsapp" | "instagram" | "messenger";
|
|
116801
|
+
/**
|
|
116802
|
+
* @description `post` when the person tapped a boosted post, else `ad`.
|
|
116803
|
+
* @enum {string}
|
|
116804
|
+
*/
|
|
116805
|
+
kind: "ad" | "post";
|
|
116806
|
+
/** @description Meta's ad id; `null` for a post or when Meta sent none. */
|
|
116807
|
+
ad_external_id: string | null;
|
|
116808
|
+
/** @description The ad name in the ad account; `null` when unknown. */
|
|
116809
|
+
ad_name: string | null;
|
|
116810
|
+
/** @description The ad's campaign name; `null` when unknown. */
|
|
116811
|
+
campaign_name: string | null;
|
|
116812
|
+
/** @description The ad's headline — the ADVERTISER'S copy, never the customer's words. */
|
|
116813
|
+
title: string | null;
|
|
116814
|
+
/** @description Still image of the creative: our durable copy when `media_archived`, else Meta’s own link. */
|
|
116815
|
+
thumbnail_url: string | null;
|
|
116816
|
+
/** @description `true` when `thumbnail_url` is Vitrina’s durable copy; `false` when it is a Meta CDN link that expires (render with a fallback) or absent. */
|
|
116817
|
+
media_archived: boolean;
|
|
116818
|
+
/** @description The creative’s video when a video ad (a Meta CDN link — it expires). */
|
|
116819
|
+
video_url: string | null;
|
|
116820
|
+
/** @description Permalink to the ad or the post it promotes, when known. */
|
|
116821
|
+
source_url: string | null;
|
|
116822
|
+
/** @description When the thread opened from the ad (the conversation creation time). */
|
|
116823
|
+
captured_at: string | null;
|
|
116824
|
+
} | null;
|
|
116214
116825
|
Message: {
|
|
116215
116826
|
id: string;
|
|
116216
116827
|
conversation_id: string;
|
|
@@ -116675,6 +117286,54 @@ interface components {
|
|
|
116675
117286
|
/** @description `false` in sample mode: the goal was validated but not stored. */
|
|
116676
117287
|
persisted?: boolean;
|
|
116677
117288
|
} | null;
|
|
117289
|
+
AdsShareResumen: {
|
|
117290
|
+
period: {
|
|
117291
|
+
/** @description `YYYY-MM`. */
|
|
117292
|
+
month: string;
|
|
117293
|
+
from: string;
|
|
117294
|
+
to: string;
|
|
117295
|
+
/** @description `false` for the running month (figures still growing). */
|
|
117296
|
+
closed: boolean;
|
|
117297
|
+
/** @description The period line printed on the card, «Agosto · 1 – 31 ago 2026». */
|
|
117298
|
+
label: string;
|
|
117299
|
+
};
|
|
117300
|
+
/**
|
|
117301
|
+
* @description The noun family every label and sentence was written in.
|
|
117302
|
+
* @enum {string}
|
|
117303
|
+
*/
|
|
117304
|
+
vocabulary: "automotive" | "healthcare" | "generic";
|
|
117305
|
+
/** @description `true` when the month had spend or ad-attributed outcomes. `false` = nothing to report (the monthly email is not sent for such a month). */
|
|
117306
|
+
has_activity: boolean;
|
|
117307
|
+
/**
|
|
117308
|
+
* @description The figure the card leads with: the return when the month has value, else the outcomes, else the spend. `null` without activity.
|
|
117309
|
+
* @enum {string|null}
|
|
117310
|
+
*/
|
|
117311
|
+
dominant: "roas" | "outcomes" | "spend" | null;
|
|
117312
|
+
/** @description The dominant figure as a title, month first («Agosto: 3,7× de retorno»). */
|
|
117313
|
+
headline: string;
|
|
117314
|
+
/** @description The card as drawn, pre-formatted es-CL, in the tenant’s nouns. */
|
|
117315
|
+
tile: {
|
|
117316
|
+
/** @description Display number («3,7×»). */
|
|
117317
|
+
number: string;
|
|
117318
|
+
/** @description Its unit («retorno»). */
|
|
117319
|
+
unit: string | null;
|
|
117320
|
+
caption: string;
|
|
117321
|
+
lines: string[];
|
|
117322
|
+
};
|
|
117323
|
+
/** @description Up to three fact-built sentences (no model) — the value, count, best campaign and change the image does not carry. `**x**` marks the lead figure. */
|
|
117324
|
+
sentences: string[];
|
|
117325
|
+
/** @description Set when the engine’s measurement verdict for the trailing 30 days (on the 1st–3rd, roughly the month just closed) is broken — the reason in plain words («el tag de tu sitio no envió datos»), printed after «Falta parte del seguimiento:». Never from today’s Meta or tag state. `null` when measurement was sound or could not be read. */
|
|
117326
|
+
tracking_issue: string | null;
|
|
117327
|
+
/** @description Alt text for the card image. */
|
|
117328
|
+
image_alt: string;
|
|
117329
|
+
figures: {
|
|
117330
|
+
spend: number | null;
|
|
117331
|
+
revenue: number | null;
|
|
117332
|
+
roas: number | null;
|
|
117333
|
+
attributed_outcomes: number | null;
|
|
117334
|
+
best_campaign: string | null;
|
|
117335
|
+
};
|
|
117336
|
+
};
|
|
116678
117337
|
AdsAction: {
|
|
116679
117338
|
/** @description `<kind>:<target external id>:<YYYY-MM-DD>` — a composite key, stable for a day. */
|
|
116680
117339
|
key: string;
|
|
@@ -116837,6 +117496,11 @@ interface components {
|
|
|
116837
117496
|
domain: string | null;
|
|
116838
117497
|
/** @enum {string} */
|
|
116839
117498
|
source: "tracker" | "health";
|
|
117499
|
+
/**
|
|
117500
|
+
* @description Where the tag sends its events: `same_origin` — a collector on the site’s own domain (the only setup Safari does not cap; visitors stay recognised across weeks); `cname` — a verified tracking subdomain (Safari still caps it); `none` — the default endpoint. `null` when it could not be read.
|
|
117501
|
+
* @enum {string|null}
|
|
117502
|
+
*/
|
|
117503
|
+
collector: "same_origin" | "cname" | "none" | null;
|
|
116840
117504
|
};
|
|
116841
117505
|
AdsFeedItem: {
|
|
116842
117506
|
/** Format: uuid */
|
|
@@ -116878,28 +117542,94 @@ interface components {
|
|
|
116878
117542
|
credited_weight: number | null;
|
|
116879
117543
|
touch_count: number | null;
|
|
116880
117544
|
};
|
|
117545
|
+
AdsJourneyStepAd: {
|
|
117546
|
+
/** @description The ad’s PLATFORM id; `null` when only the campaign is known. */
|
|
117547
|
+
external_id: string | null;
|
|
117548
|
+
name: string | null;
|
|
117549
|
+
ad_set_name: string | null;
|
|
117550
|
+
campaign: {
|
|
117551
|
+
/** @description The campaign’s PLATFORM id. */
|
|
117552
|
+
external_id: string | null;
|
|
117553
|
+
name: string | null;
|
|
117554
|
+
} | null;
|
|
117555
|
+
/** @description The ad’s thumbnail when known; render the megaphone glyph for `null`. */
|
|
117556
|
+
creative_thumbnail_url: string | null;
|
|
117557
|
+
} | null;
|
|
117558
|
+
AdsJourneyStep: {
|
|
117559
|
+
/** @description Stable key for the step. For a step recorded by Vitrina it is the feed item id (`GET /ads/feed` `data[].id`). */
|
|
117560
|
+
id: string;
|
|
117561
|
+
/**
|
|
117562
|
+
* @description Touches: `ad` (an off-site ad touch — an ad click or a click-to-WhatsApp referral), `click` (a visit that landed from an ad click, or a tracked link click), `visit` (a site visit), `chat` (the first message, or a social interaction). Recorded steps, in funnel order: `chat` (first message), `booking`, `attended`, `quote`, `accepted` (a presupuesto accepted / a sale closed), `payment`; `outcome` for anything else.
|
|
117563
|
+
* @enum {string}
|
|
117564
|
+
*/
|
|
117565
|
+
kind: "ad" | "click" | "visit" | "chat" | "outcome" | "booking" | "attended" | "quote" | "accepted" | "payment";
|
|
117566
|
+
/**
|
|
117567
|
+
* @description `engine` = a touch the attribution engine observed; `vitrina` = a step Vitrina recorded itself.
|
|
117568
|
+
* @enum {string}
|
|
117569
|
+
*/
|
|
117570
|
+
origin: "engine" | "vitrina";
|
|
117571
|
+
/**
|
|
117572
|
+
* @description The outcome stage of a recorded step (the vocabulary key); `null` on a touch. `first_payment` is a plan’s first payment (shown once, in place of that payment’s `payment_received`).
|
|
117573
|
+
* @enum {string|null}
|
|
117574
|
+
*/
|
|
117575
|
+
stage: "lead_created" | "appointment_booked" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received" | "first_payment" | null;
|
|
117576
|
+
/** @description Ready to render, in the workspace’s own vocabulary. */
|
|
117577
|
+
label: string;
|
|
117578
|
+
detail: string | null;
|
|
117579
|
+
/** @description When it happened (ISO 8601). */
|
|
117580
|
+
at: string;
|
|
117581
|
+
/** @description A channel word: `meta`, `google`, `instagram`, `whatsapp`, `web`, `email`, `phone`, … Never a URL or a domain. */
|
|
117582
|
+
channel?: string;
|
|
117583
|
+
/** @description The touch the outcome was credited to, under `model`. */
|
|
117584
|
+
credited: boolean;
|
|
117585
|
+
/**
|
|
117586
|
+
* @description How the touch is tied to this person, when proven: `ctwa_referral` (the click-to-WhatsApp / Instagram ad referral), `click_id` (the ad click id the outcome carried), `link_token` (a link Vitrina sent), `anonymous_id` (the same browser). `null` on recorded steps.
|
|
117587
|
+
* @enum {string|null}
|
|
117588
|
+
*/
|
|
117589
|
+
join_method: "ctwa_referral" | "click_id" | "link_token" | "anonymous_id" | null;
|
|
117590
|
+
/** @description The KIND of ad click id the touch carried (`fbclid`, `gclid`, `gbraid`, `wbraid`, `ctwa_clid`, …) — never its value. */
|
|
117591
|
+
click_id_kind: string | null;
|
|
117592
|
+
ad: components["schemas"]["AdsJourneyStepAd"];
|
|
117593
|
+
/** @description CLP on money steps (`quote`, `accepted`, `payment`); `null` otherwise. */
|
|
117594
|
+
value: number | null;
|
|
117595
|
+
/** @description This step is the feed row the journey was opened from. */
|
|
117596
|
+
current: boolean;
|
|
117597
|
+
};
|
|
117598
|
+
/** @description Set exactly when `scope` is `person`. */
|
|
117599
|
+
AdsJourneyPerson: {
|
|
117600
|
+
/** @description Every conversion of the person, whole history — each stage counts (a lead, a booking and a payment are three). */
|
|
117601
|
+
conversion_count: number;
|
|
117602
|
+
/** @description «Veces que vino»: the attended entry citas recorded for this contact («Cita atendida» — distinct `appointment_attended` steps). Clinics only for now: other workspaces record no attended stage, so it is `0` there. Never inferred from bookings. Show a «vino n veces» badge from 2 on. */
|
|
117603
|
+
attended_count: number;
|
|
117604
|
+
/** @description Marketing touches, whole history. */
|
|
117605
|
+
touch_count: number;
|
|
117606
|
+
first_touch_at: string | null;
|
|
117607
|
+
last_touch_at: string | null;
|
|
117608
|
+
} | null;
|
|
116881
117609
|
AdsJourney: {
|
|
116882
|
-
|
|
116883
|
-
|
|
116884
|
-
kind: "ad" | "click" | "visit" | "chat" | "outcome";
|
|
116885
|
-
label: string;
|
|
116886
|
-
detail: string | null;
|
|
116887
|
-
at: string;
|
|
116888
|
-
channel?: string;
|
|
116889
|
-
}[];
|
|
117610
|
+
/** @description Oldest first; at the same instant a touch precedes the step it led to, then by `id` — the same order on every read. */
|
|
117611
|
+
steps: components["schemas"]["AdsJourneyStep"][];
|
|
116890
117612
|
touch_count: number;
|
|
116891
117613
|
credited_weight: number | null;
|
|
116892
117614
|
model: string;
|
|
116893
117615
|
/**
|
|
116894
|
-
* @description
|
|
117616
|
+
* @description The scope the journey was read at (see the `scope` parameter).
|
|
117617
|
+
* @enum {string}
|
|
117618
|
+
*/
|
|
117619
|
+
scope: "conversion" | "person";
|
|
117620
|
+
/**
|
|
117621
|
+
* @description `mixed` = the attribution engine’s touches interleaved with the steps Vitrina recorded; `engine` = touches only; `vitrina` = only the steps Vitrina recorded (see `reason`).
|
|
116895
117622
|
* @enum {string}
|
|
116896
117623
|
*/
|
|
116897
|
-
source: "engine" | "vitrina";
|
|
117624
|
+
source: "engine" | "mixed" | "vitrina";
|
|
116898
117625
|
/**
|
|
116899
|
-
* @description Why the ad path is absent
|
|
117626
|
+
* @description Why the ad path is absent or incomplete — set whenever `source` is `vitrina`, and `unavailable` also when the touches could only be read in part within the time budget: `unmatched` — no touch leads to this outcome / person (arrived without an ad or a visit that can be traced); `pending` — not readable yet (retry later); `unavailable` — the attribution engine could not be read now; `scope` — the workspace’s attribution access refused the read. `role` is retired and never sent.
|
|
116900
117627
|
* @enum {string|null}
|
|
116901
117628
|
*/
|
|
116902
|
-
reason: "role" | "unmatched" | "pending" | null;
|
|
117629
|
+
reason: "role" | "unmatched" | "pending" | "unavailable" | "scope" | null;
|
|
117630
|
+
person: components["schemas"]["AdsJourneyPerson"];
|
|
117631
|
+
/** @description `true` when the OLDEST touches of a long history were left out: `steps` is the newest window (the credited touch and the latest steps are always in it). Not a degraded state — `person` carries the whole-history totals. Show «mostrando lo más reciente». */
|
|
117632
|
+
truncated: boolean;
|
|
116903
117633
|
};
|
|
116904
117634
|
};
|
|
116905
117635
|
responses: never;
|
|
@@ -116961,7 +117691,7 @@ declare function createClient(opts: CreateClientOptions): VitrinaClient;
|
|
|
116961
117691
|
* is regenerated — narrow on the ones you handle, never assume this
|
|
116962
117692
|
* list is exhaustive at runtime.
|
|
116963
117693
|
*/
|
|
116964
|
-
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';
|
|
117694
|
+
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' | 'SHARE_IMAGE_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';
|
|
116965
117695
|
declare const ERROR_CODES: readonly ErrorCode[];
|
|
116966
117696
|
|
|
116967
117697
|
/**
|