@epilot/sdk 2.14.0 → 2.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/definitions/targeting-runtime.json +1 -1
  2. package/definitions/targeting.json +291 -0
  3. package/dist/apis/access-token.cjs +6 -6
  4. package/dist/apis/access-token.js +1 -1
  5. package/dist/apis/address-suggestions.cjs +6 -6
  6. package/dist/apis/address-suggestions.js +1 -1
  7. package/dist/apis/address.cjs +6 -6
  8. package/dist/apis/address.js +1 -1
  9. package/dist/apis/ai-agents.cjs +6 -6
  10. package/dist/apis/ai-agents.js +1 -1
  11. package/dist/apis/app.cjs +6 -6
  12. package/dist/apis/app.js +1 -1
  13. package/dist/apis/audit-logs.cjs +6 -6
  14. package/dist/apis/audit-logs.js +1 -1
  15. package/dist/apis/automation.cjs +6 -6
  16. package/dist/apis/automation.js +1 -1
  17. package/dist/apis/billing.cjs +6 -6
  18. package/dist/apis/billing.js +1 -1
  19. package/dist/apis/blueprint-manifest.cjs +6 -6
  20. package/dist/apis/blueprint-manifest.js +1 -1
  21. package/dist/apis/calendar.cjs +6 -6
  22. package/dist/apis/calendar.js +1 -1
  23. package/dist/apis/configuration-hub.cjs +6 -6
  24. package/dist/apis/configuration-hub.js +1 -1
  25. package/dist/apis/consent.cjs +6 -6
  26. package/dist/apis/consent.js +1 -1
  27. package/dist/apis/customer-portal.cjs +6 -6
  28. package/dist/apis/customer-portal.js +1 -1
  29. package/dist/apis/dashboard.cjs +6 -6
  30. package/dist/apis/dashboard.js +1 -1
  31. package/dist/apis/data-governance.cjs +6 -6
  32. package/dist/apis/data-governance.js +1 -1
  33. package/dist/apis/deduplication.cjs +6 -6
  34. package/dist/apis/deduplication.js +1 -1
  35. package/dist/apis/design.cjs +6 -6
  36. package/dist/apis/design.js +1 -1
  37. package/dist/apis/document.cjs +6 -6
  38. package/dist/apis/document.js +1 -1
  39. package/dist/apis/email-settings.cjs +6 -6
  40. package/dist/apis/email-settings.js +1 -1
  41. package/dist/apis/email-template.cjs +6 -6
  42. package/dist/apis/email-template.js +1 -1
  43. package/dist/apis/entity-mapping.cjs +6 -6
  44. package/dist/apis/entity-mapping.js +1 -1
  45. package/dist/apis/entity.cjs +6 -6
  46. package/dist/apis/entity.js +1 -1
  47. package/dist/apis/environments.cjs +6 -6
  48. package/dist/apis/environments.js +1 -1
  49. package/dist/apis/event-catalog.cjs +6 -6
  50. package/dist/apis/event-catalog.js +1 -1
  51. package/dist/apis/file.cjs +6 -6
  52. package/dist/apis/file.js +1 -1
  53. package/dist/apis/iban.cjs +6 -6
  54. package/dist/apis/iban.js +1 -1
  55. package/dist/apis/integration-toolkit.cjs +6 -6
  56. package/dist/apis/integration-toolkit.js +1 -1
  57. package/dist/apis/journey.cjs +6 -6
  58. package/dist/apis/journey.js +1 -1
  59. package/dist/apis/kanban.cjs +6 -6
  60. package/dist/apis/kanban.js +1 -1
  61. package/dist/apis/message.cjs +6 -6
  62. package/dist/apis/message.js +1 -1
  63. package/dist/apis/metering.cjs +6 -6
  64. package/dist/apis/metering.js +1 -1
  65. package/dist/apis/notes.cjs +6 -6
  66. package/dist/apis/notes.js +1 -1
  67. package/dist/apis/notification.cjs +6 -6
  68. package/dist/apis/notification.js +1 -1
  69. package/dist/apis/organization.cjs +6 -6
  70. package/dist/apis/organization.js +1 -1
  71. package/dist/apis/partner-directory.cjs +6 -6
  72. package/dist/apis/partner-directory.js +1 -1
  73. package/dist/apis/permissions.cjs +6 -6
  74. package/dist/apis/permissions.js +1 -1
  75. package/dist/apis/pricing-tier.cjs +6 -6
  76. package/dist/apis/pricing-tier.js +1 -1
  77. package/dist/apis/pricing.cjs +6 -6
  78. package/dist/apis/pricing.js +1 -1
  79. package/dist/apis/purpose.cjs +6 -6
  80. package/dist/apis/purpose.js +1 -1
  81. package/dist/apis/query.cjs +6 -6
  82. package/dist/apis/query.js +1 -1
  83. package/dist/apis/sandbox.cjs +6 -6
  84. package/dist/apis/sandbox.js +1 -1
  85. package/dist/apis/sharing.cjs +6 -6
  86. package/dist/apis/sharing.js +1 -1
  87. package/dist/apis/snapshot.cjs +6 -6
  88. package/dist/apis/snapshot.js +1 -1
  89. package/dist/apis/submission.cjs +6 -6
  90. package/dist/apis/submission.js +1 -1
  91. package/dist/apis/target.cjs +6 -6
  92. package/dist/apis/target.js +1 -1
  93. package/dist/apis/targeting.cjs +8 -8
  94. package/dist/apis/targeting.d.cts +2 -2
  95. package/dist/apis/targeting.d.ts +2 -2
  96. package/dist/apis/targeting.js +2 -2
  97. package/dist/apis/template-variables.cjs +6 -6
  98. package/dist/apis/template-variables.js +1 -1
  99. package/dist/apis/user.cjs +6 -6
  100. package/dist/apis/user.js +1 -1
  101. package/dist/apis/validation-rules.cjs +6 -6
  102. package/dist/apis/validation-rules.js +1 -1
  103. package/dist/apis/webhooks.cjs +6 -6
  104. package/dist/apis/webhooks.js +1 -1
  105. package/dist/apis/workflow-definition.cjs +6 -6
  106. package/dist/apis/workflow-definition.js +1 -1
  107. package/dist/apis/workflow.cjs +6 -6
  108. package/dist/apis/workflow.js +1 -1
  109. package/dist/{chunk-NUUEJRUH.js → chunk-OJLX6U66.js} +2 -2
  110. package/dist/{chunk-2FBNQV76.cjs → chunk-SNERI3PK.cjs} +2 -2
  111. package/dist/chunk-UH24GU2Z.js +14 -0
  112. package/dist/chunk-W3SPZ6V5.cjs +14 -0
  113. package/dist/index.cjs +10 -10
  114. package/dist/index.d.cts +1 -1
  115. package/dist/index.d.ts +1 -1
  116. package/dist/index.js +2 -2
  117. package/dist/js-yaml-DLCVPJ7G.js +0 -0
  118. package/dist/targeting-A2X6X7BF.js +7 -0
  119. package/dist/targeting-CSGKITGV.cjs +7 -0
  120. package/dist/{targeting-runtime-X3DQ527N.cjs → targeting-runtime-HWL6PLJF.cjs} +2 -2
  121. package/dist/{targeting-runtime-QI7322HB.js → targeting-runtime-L5RGDNSH.js} +1 -1
  122. package/dist/{targeting.d-Bq3onSes.d.cts → targeting.d-DaK3kwZg.d.cts} +286 -1
  123. package/dist/{targeting.d-Bq3onSes.d.ts → targeting.d-DaK3kwZg.d.ts} +286 -1
  124. package/docs/targeting.md +192 -0
  125. package/package.json +11 -12
  126. package/definitions/focus-pocus-runtime.json +0 -1
  127. package/definitions/focus-pocus.json +0 -757
  128. package/dist/chunk-7ILTRJDQ.cjs +0 -14
  129. package/dist/chunk-H3NMCCSA.js +0 -14
  130. package/dist/targeting-4YMBBPDW.cjs +0 -7
  131. package/dist/targeting-VCENULF6.js +0 -7
@@ -65,6 +65,38 @@ declare namespace Components {
65
65
  *
66
66
  */
67
67
  Schemas.ClientError;
68
+ export interface DiscoverCampaignsResponse {
69
+ /**
70
+ * Number of matching NBAs.
71
+ */
72
+ hits: number;
73
+ /**
74
+ * Matching NBAs, sorted by priority (desc); one entry per campaign.
75
+ */
76
+ results: {
77
+ campaign_id: /**
78
+ * example:
79
+ * b8c01433-5556-4e2b-aad4-6f5348d1df84
80
+ */
81
+ Schemas.BaseUUID /* uuid */;
82
+ nba: /**
83
+ * A Next Best Action configured on a campaign's Entity-UI channel.
84
+ * This is the canonical NBA contract shared by discovery (this API), authoring, and rendering.
85
+ * NBA content is single-language in v1; text fields may contain `{{placeholders}}` resolved at render time.
86
+ *
87
+ */
88
+ Schemas.NextBestAction;
89
+ /**
90
+ * The recipient's current Entity-UI status for this campaign, present only
91
+ * when a recipient record already exists (i.e. the entity has previously seen
92
+ * or clicked this NBA). Absent when the entity has not yet interacted with it.
93
+ * Dismissed NBAs are filtered out server-side, so this is only ever `seen` or
94
+ * `clicked`. Lets the client skip a redundant `seen` call for NBAs already seen.
95
+ *
96
+ */
97
+ status?: "seen" | "dismissed" | "clicked";
98
+ }[];
99
+ }
68
100
  export interface GetTargetQueriesResponse {
69
101
  /**
70
102
  * List of target query results.
@@ -339,6 +371,24 @@ declare namespace Components {
339
371
  [name: string]: any;
340
372
  };
341
373
  };
374
+ export interface DiscoverCampaignsParams {
375
+ entity_id: /**
376
+ * example:
377
+ * b8c01433-5556-4e2b-aad4-6f5348d1df84
378
+ */
379
+ BaseUUID /* uuid */;
380
+ /**
381
+ * The schema slug of the entity (e.g. "contact" or "account").
382
+ */
383
+ entity_schema: string;
384
+ }
385
+ /**
386
+ * Lifecycle status of a Next Best Action on the Entity-UI channel. Unlike the portal
387
+ * channel there is no `sent` state: an NBA recipient is born at `seen`, the moment the
388
+ * action is first rendered to an agent.
389
+ *
390
+ */
391
+ export type EntityUiStatus = "seen" | "dismissed" | "clicked";
342
392
  export interface ExecutionSummaryItem {
343
393
  execution_id?: string;
344
394
  execution_status?: string;
@@ -1415,6 +1465,71 @@ declare namespace Components {
1415
1465
  BaseUUID /* uuid */?
1416
1466
  ];
1417
1467
  }
1468
+ /**
1469
+ * A Next Best Action configured on a campaign's Entity-UI channel.
1470
+ * This is the canonical NBA contract shared by discovery (this API), authoring, and rendering.
1471
+ * NBA content is single-language in v1; text fields may contain `{{placeholders}}` resolved at render time.
1472
+ *
1473
+ */
1474
+ export interface NextBestAction {
1475
+ /**
1476
+ * Light category label shown above the title. Free-form text.
1477
+ */
1478
+ category?: string;
1479
+ /**
1480
+ * Curated icon for the NBA.
1481
+ */
1482
+ icon?: {
1483
+ /**
1484
+ * Icon name from "@epilot360/icons".
1485
+ */
1486
+ name: string;
1487
+ /**
1488
+ * Optional icon color.
1489
+ */
1490
+ color?: string;
1491
+ };
1492
+ /**
1493
+ * Bold action title. Required. Supports `{{placeholders}}`.
1494
+ */
1495
+ title: string;
1496
+ /**
1497
+ * Optional description. Supports `{{placeholders}}` (incl. relative dates).
1498
+ */
1499
+ body?: string;
1500
+ /**
1501
+ * Display priority. NBAs are shown highest-priority first.
1502
+ */
1503
+ priority?: "low" | "medium" | "high";
1504
+ /**
1505
+ * Whether the agent can dismiss the NBA.
1506
+ */
1507
+ is_dismissable?: boolean;
1508
+ /**
1509
+ * The NBA's single call-to-action.
1510
+ */
1511
+ cta: {
1512
+ type: "journey" | "workflow" | "url";
1513
+ /**
1514
+ * Journey id, workflow definition id, or URL, depending on `type`.
1515
+ */
1516
+ target: string;
1517
+ /**
1518
+ * Optional CTA button label.
1519
+ */
1520
+ label?: string;
1521
+ /**
1522
+ * Journey context parameters (journey CTA only). Maps the journey's declared
1523
+ * context parameters so the journey knows which entity it is about. Discovery
1524
+ * returns them verbatim; they are passed to the journey when it launches.
1525
+ *
1526
+ */
1527
+ context_params?: {
1528
+ key: string;
1529
+ value: string;
1530
+ }[];
1531
+ };
1532
+ }
1418
1533
  export interface PortalRecipientPayload {
1419
1534
  portal_status: PortalStatus;
1420
1535
  portal_state?: {
@@ -1437,8 +1552,32 @@ declare namespace Components {
1437
1552
  portal_state?: {
1438
1553
  [name: string]: any;
1439
1554
  };
1555
+ entity_ui_status?: /**
1556
+ * Lifecycle status of a Next Best Action on the Entity-UI channel. Unlike the portal
1557
+ * channel there is no `sent` state: an NBA recipient is born at `seen`, the moment the
1558
+ * action is first rendered to an agent.
1559
+ *
1560
+ */
1561
+ EntityUiStatus;
1562
+ entity_ui_status_updated_at?: string; // date-time
1563
+ resolution?: /**
1564
+ * Cross-channel resolution of a campaign for a recipient. Unlike the per-channel `*_status`
1565
+ * fields (where `dismissed` is channel-local), a resolution suppresses the campaign on EVERY
1566
+ * channel — the 360 Entity-UI card and the portal teaser alike. Server-managed and read-only:
1567
+ * never sent by a client. Absence means unresolved.
1568
+ *
1569
+ */
1570
+ Resolution;
1440
1571
  updated_at?: string; // date-time
1441
1572
  }
1573
+ /**
1574
+ * Cross-channel resolution of a campaign for a recipient. Unlike the per-channel `*_status`
1575
+ * fields (where `dismissed` is channel-local), a resolution suppresses the campaign on EVERY
1576
+ * channel — the 360 Entity-UI card and the portal teaser alike. Server-managed and read-only:
1577
+ * never sent by a client. Absence means unresolved.
1578
+ *
1579
+ */
1580
+ export type Resolution = "accepted";
1442
1581
  export interface RetriggerAutomationsRequest {
1443
1582
  /**
1444
1583
  * List of recipient IDs to retrigger automations for
@@ -1669,6 +1808,21 @@ declare namespace Components {
1669
1808
  */
1670
1809
  error?: string;
1671
1810
  }
1811
+ export interface UpdateEntityUiStatusRequest {
1812
+ status: /**
1813
+ * Lifecycle status of a Next Best Action on the Entity-UI channel. Unlike the portal
1814
+ * channel there is no `sent` state: an NBA recipient is born at `seen`, the moment the
1815
+ * action is first rendered to an agent.
1816
+ *
1817
+ */
1818
+ EntityUiStatus;
1819
+ /**
1820
+ * Schema slug of the recipient entity (e.g. "contact"). Required when recording the
1821
+ * first `seen`, which lazily creates the recipient record; ignored on later transitions.
1822
+ *
1823
+ */
1824
+ entity_schema?: string;
1825
+ }
1672
1826
  export interface UpdatePortalStatusRequest {
1673
1827
  status: PortalStatus;
1674
1828
  }
@@ -1718,6 +1872,14 @@ declare namespace Paths {
1718
1872
  export type $500 = Components.Responses.ServerErrorResponse;
1719
1873
  }
1720
1874
  }
1875
+ namespace DiscoverCampaigns {
1876
+ export type RequestBody = Components.Schemas.DiscoverCampaignsParams;
1877
+ namespace Responses {
1878
+ export type $200 = Components.Responses.DiscoverCampaignsResponse;
1879
+ export type $400 = Components.Responses.ClientErrorResponse;
1880
+ export type $500 = Components.Responses.ServerErrorResponse;
1881
+ }
1882
+ }
1721
1883
  namespace GetCampaignJobStatus {
1722
1884
  namespace Parameters {
1723
1885
  export type CampaignId = /**
@@ -1861,6 +2023,32 @@ declare namespace Paths {
1861
2023
  export type $500 = Components.Responses.ServerErrorResponse;
1862
2024
  }
1863
2025
  }
2026
+ namespace UpdateRecipientEntityUiStatus {
2027
+ namespace Parameters {
2028
+ export type CampaignId = /**
2029
+ * example:
2030
+ * b8c01433-5556-4e2b-aad4-6f5348d1df84
2031
+ */
2032
+ Components.Schemas.BaseUUID /* uuid */;
2033
+ export type RecipientId = /**
2034
+ * example:
2035
+ * b8c01433-5556-4e2b-aad4-6f5348d1df84
2036
+ */
2037
+ Components.Schemas.BaseUUID /* uuid */;
2038
+ }
2039
+ export interface PathParameters {
2040
+ campaign_id: Parameters.CampaignId;
2041
+ recipient_id: Parameters.RecipientId;
2042
+ }
2043
+ export type RequestBody = Components.Schemas.UpdateEntityUiStatusRequest;
2044
+ namespace Responses {
2045
+ export type $200 = Components.Responses.RecipientResponse;
2046
+ export type $400 = Components.Responses.ClientErrorResponse;
2047
+ export type $404 = Components.Responses.ClientErrorResponse;
2048
+ export type $409 = Components.Responses.ClientErrorResponse;
2049
+ export type $500 = Components.Responses.ServerErrorResponse;
2050
+ }
2051
+ }
1864
2052
  namespace UpdateRecipientPortalStatus {
1865
2053
  namespace Parameters {
1866
2054
  export type CampaignId = /**
@@ -1969,6 +2157,24 @@ interface OperationMethods {
1969
2157
  data?: Paths.MatchCampaigns.RequestBody,
1970
2158
  config?: AxiosRequestConfig
1971
2159
  ): OperationResponse<Paths.MatchCampaigns.Responses.$200>
2160
+ /**
2161
+ * discoverCampaigns - Discover Entity-UI Next Best Actions for an entity
2162
+ *
2163
+ * Given an entity, returns the Next Best Actions it should see on the Entity-UI channel.
2164
+ *
2165
+ * Enumerates the organization's **active** campaigns that carry a valid Entity-UI Next Best
2166
+ * Action, live-matches each against the entity using the existing match engine, and returns
2167
+ * the matching NBAs priority-sorted (one per campaign).
2168
+ *
2169
+ * This is a pure read: it writes nothing. An entity that matches no campaigns returns an
2170
+ * empty list, not an error.
2171
+ *
2172
+ */
2173
+ 'discoverCampaigns'(
2174
+ parameters?: Parameters<UnknownParamsObject> | null,
2175
+ data?: Paths.DiscoverCampaigns.RequestBody,
2176
+ config?: AxiosRequestConfig
2177
+ ): OperationResponse<Paths.DiscoverCampaigns.Responses.$200>
1972
2178
  /**
1973
2179
  * matchTargets - Match targets
1974
2180
  *
@@ -2029,6 +2235,32 @@ interface OperationMethods {
2029
2235
  data?: Paths.UpdateRecipientPortalStatus.RequestBody,
2030
2236
  config?: AxiosRequestConfig
2031
2237
  ): OperationResponse<Paths.UpdateRecipientPortalStatus.Responses.$200>
2238
+ /**
2239
+ * updateRecipientEntityUiStatus - Update Entity-UI (Next Best Action) status for a campaign recipient
2240
+ *
2241
+ * Records a Next Best Action interaction for a recipient on the Entity-UI channel.
2242
+ *
2243
+ * Unlike the portal channel, an NBA recipient is created lazily: the first `seen` creates
2244
+ * the recipient record (and requires `entity_schema`). `seen` is idempotent — re-viewing an
2245
+ * NBA that is already seen/clicked/dismissed is a no-op success and never regresses the status.
2246
+ *
2247
+ * Status transition rules:
2248
+ * - `seen`: lazily creates the recipient; a no-op success if a status already exists
2249
+ * - From `seen`: can change to `clicked` or `dismissed`
2250
+ * - From `clicked`: can change to `dismissed`
2251
+ * - From `dismissed`: cannot be changed (final state)
2252
+ *
2253
+ * `dismissed` and `clicked` require an existing recipient (404 otherwise, since an NBA is
2254
+ * born at `seen`) and reject invalid transitions (409).
2255
+ *
2256
+ * The entity_ui_status_updated_at timestamp is automatically set when the status changes.
2257
+ *
2258
+ */
2259
+ 'updateRecipientEntityUiStatus'(
2260
+ parameters?: Parameters<Paths.UpdateRecipientEntityUiStatus.PathParameters> | null,
2261
+ data?: Paths.UpdateRecipientEntityUiStatus.RequestBody,
2262
+ config?: AxiosRequestConfig
2263
+ ): OperationResponse<Paths.UpdateRecipientEntityUiStatus.Responses.$200>
2032
2264
  /**
2033
2265
  * getRecipients - Get campaign recipients
2034
2266
  *
@@ -2132,6 +2364,26 @@ interface PathsDictionary {
2132
2364
  config?: AxiosRequestConfig
2133
2365
  ): OperationResponse<Paths.MatchCampaigns.Responses.$200>
2134
2366
  }
2367
+ ['/v1/campaign:discover']: {
2368
+ /**
2369
+ * discoverCampaigns - Discover Entity-UI Next Best Actions for an entity
2370
+ *
2371
+ * Given an entity, returns the Next Best Actions it should see on the Entity-UI channel.
2372
+ *
2373
+ * Enumerates the organization's **active** campaigns that carry a valid Entity-UI Next Best
2374
+ * Action, live-matches each against the entity using the existing match engine, and returns
2375
+ * the matching NBAs priority-sorted (one per campaign).
2376
+ *
2377
+ * This is a pure read: it writes nothing. An entity that matches no campaigns returns an
2378
+ * empty list, not an error.
2379
+ *
2380
+ */
2381
+ 'post'(
2382
+ parameters?: Parameters<UnknownParamsObject> | null,
2383
+ data?: Paths.DiscoverCampaigns.RequestBody,
2384
+ config?: AxiosRequestConfig
2385
+ ): OperationResponse<Paths.DiscoverCampaigns.Responses.$200>
2386
+ }
2135
2387
  ['/v1/target:match']: {
2136
2388
  /**
2137
2389
  * matchTargets - Match targets
@@ -2202,6 +2454,34 @@ interface PathsDictionary {
2202
2454
  config?: AxiosRequestConfig
2203
2455
  ): OperationResponse<Paths.UpdateRecipientPortalStatus.Responses.$200>
2204
2456
  }
2457
+ ['/v1/campaign/{campaign_id}/recipient/{recipient_id}/entity_ui:status']: {
2458
+ /**
2459
+ * updateRecipientEntityUiStatus - Update Entity-UI (Next Best Action) status for a campaign recipient
2460
+ *
2461
+ * Records a Next Best Action interaction for a recipient on the Entity-UI channel.
2462
+ *
2463
+ * Unlike the portal channel, an NBA recipient is created lazily: the first `seen` creates
2464
+ * the recipient record (and requires `entity_schema`). `seen` is idempotent — re-viewing an
2465
+ * NBA that is already seen/clicked/dismissed is a no-op success and never regresses the status.
2466
+ *
2467
+ * Status transition rules:
2468
+ * - `seen`: lazily creates the recipient; a no-op success if a status already exists
2469
+ * - From `seen`: can change to `clicked` or `dismissed`
2470
+ * - From `clicked`: can change to `dismissed`
2471
+ * - From `dismissed`: cannot be changed (final state)
2472
+ *
2473
+ * `dismissed` and `clicked` require an existing recipient (404 otherwise, since an NBA is
2474
+ * born at `seen`) and reject invalid transitions (409).
2475
+ *
2476
+ * The entity_ui_status_updated_at timestamp is automatically set when the status changes.
2477
+ *
2478
+ */
2479
+ 'patch'(
2480
+ parameters?: Parameters<Paths.UpdateRecipientEntityUiStatus.PathParameters> | null,
2481
+ data?: Paths.UpdateRecipientEntityUiStatus.RequestBody,
2482
+ config?: AxiosRequestConfig
2483
+ ): OperationResponse<Paths.UpdateRecipientEntityUiStatus.Responses.$200>
2484
+ }
2205
2485
  ['/v1/campaign/{campaign_id}/recipients']: {
2206
2486
  /**
2207
2487
  * getRecipients - Get campaign recipients
@@ -2236,14 +2516,18 @@ type Campaign = Components.Schemas.Campaign;
2236
2516
  type CampaignStatus = Components.Schemas.CampaignStatus;
2237
2517
  type ClientError = Components.Schemas.ClientError;
2238
2518
  type CreateRecipientPayload = Components.Schemas.CreateRecipientPayload;
2519
+ type DiscoverCampaignsParams = Components.Schemas.DiscoverCampaignsParams;
2520
+ type EntityUiStatus = Components.Schemas.EntityUiStatus;
2239
2521
  type ExecutionSummaryItem = Components.Schemas.ExecutionSummaryItem;
2240
2522
  type GetTargetQueriesParams = Components.Schemas.GetTargetQueriesParams;
2241
2523
  type JobStatus = Components.Schemas.JobStatus;
2242
2524
  type MatchCampaignParams = Components.Schemas.MatchCampaignParams;
2243
2525
  type MatchTargetParams = Components.Schemas.MatchTargetParams;
2526
+ type NextBestAction = Components.Schemas.NextBestAction;
2244
2527
  type PortalRecipientPayload = Components.Schemas.PortalRecipientPayload;
2245
2528
  type PortalStatus = Components.Schemas.PortalStatus;
2246
2529
  type Recipient = Components.Schemas.Recipient;
2530
+ type Resolution = Components.Schemas.Resolution;
2247
2531
  type RetriggerAutomationsRequest = Components.Schemas.RetriggerAutomationsRequest;
2248
2532
  type RetriggerAutomationsResult = Components.Schemas.RetriggerAutomationsResult;
2249
2533
  type ServerError = Components.Schemas.ServerError;
@@ -2252,7 +2536,8 @@ type SetupTariffChangeCampaignRequest = Components.Schemas.SetupTariffChangeCamp
2252
2536
  type SetupTariffChangeCampaignResponse = Components.Schemas.SetupTariffChangeCampaignResponse;
2253
2537
  type Target = Components.Schemas.Target;
2254
2538
  type TargetQueryResult = Components.Schemas.TargetQueryResult;
2539
+ type UpdateEntityUiStatusRequest = Components.Schemas.UpdateEntityUiStatusRequest;
2255
2540
  type UpdatePortalStatusRequest = Components.Schemas.UpdatePortalStatusRequest;
2256
2541
  type UpdateRecipientPayload = Components.Schemas.UpdateRecipientPayload;
2257
2542
 
2258
- export { type AutomationRecipientPayload as A, type BaseEntityAcl as B, type Client as C, type UpdateRecipientPayload as D, type ExecutionSummaryItem as E, type GetTargetQueriesParams as G, type JobStatus as J, type MatchCampaignParams as M, type OperationMethods as O, Paths as P, type Recipient as R, type ServerError as S, type Target as T, type UpdatePortalStatusRequest as U, Components as a, type PathsDictionary as b, type AutomationStatus as c, type BaseEntityOwner as d, type BaseError as e, type BaseNanoID as f, type BaseRecipientPayload as g, type BaseRelation as h, type BaseSystemFields as i, type BaseSystemFieldsRequired as j, type BaseSystemId as k, type BaseTags as l, type BaseUUID as m, type Campaign as n, type CampaignStatus as o, type ClientError as p, type CreateRecipientPayload as q, type MatchTargetParams as r, type PortalRecipientPayload as s, type PortalStatus as t, type RetriggerAutomationsRequest as u, type RetriggerAutomationsResult as v, type SetupCampaignRequest as w, type SetupTariffChangeCampaignRequest as x, type SetupTariffChangeCampaignResponse as y, type TargetQueryResult as z };
2543
+ export { type AutomationRecipientPayload as A, type BaseEntityAcl as B, type Client as C, type DiscoverCampaignsParams as D, type EntityUiStatus as E, type SetupTariffChangeCampaignResponse as F, type GetTargetQueriesParams as G, type TargetQueryResult as H, type UpdatePortalStatusRequest as I, type JobStatus as J, type UpdateRecipientPayload as K, type MatchCampaignParams as M, type NextBestAction as N, type OperationMethods as O, Paths as P, type Recipient as R, type ServerError as S, type Target as T, type UpdateEntityUiStatusRequest as U, Components as a, type PathsDictionary as b, type AutomationStatus as c, type BaseEntityOwner as d, type BaseError as e, type BaseNanoID as f, type BaseRecipientPayload as g, type BaseRelation as h, type BaseSystemFields as i, type BaseSystemFieldsRequired as j, type BaseSystemId as k, type BaseTags as l, type BaseUUID as m, type Campaign as n, type CampaignStatus as o, type ClientError as p, type CreateRecipientPayload as q, type ExecutionSummaryItem as r, type MatchTargetParams as s, type PortalRecipientPayload as t, type PortalStatus as u, type Resolution as v, type RetriggerAutomationsRequest as w, type RetriggerAutomationsResult as x, type SetupCampaignRequest as y, type SetupTariffChangeCampaignRequest as z };
package/docs/targeting.md CHANGED
@@ -30,6 +30,7 @@ const { data } = await targetingClient.changeCampaignStatus(...)
30
30
  - [`getCampaignPortals`](#getcampaignportals)
31
31
  - [`setupCampaign`](#setupcampaign)
32
32
  - [`matchCampaigns`](#matchcampaigns)
33
+ - [`discoverCampaigns`](#discovercampaigns)
33
34
 
34
35
  **Campaign Delivery**
35
36
  - [`retriggerCampaignAutomations`](#retriggercampaignautomations)
@@ -42,6 +43,7 @@ const { data } = await targetingClient.changeCampaignStatus(...)
42
43
  - [`createRecipient`](#createrecipient)
43
44
  - [`updateRecipient`](#updaterecipient)
44
45
  - [`updateRecipientPortalStatus`](#updaterecipientportalstatus)
46
+ - [`updateRecipientEntityUiStatus`](#updaterecipiententityuistatus)
45
47
  - [`getRecipients`](#getrecipients)
46
48
 
47
49
  **Schemas**
@@ -63,11 +65,15 @@ const { data } = await targetingClient.changeCampaignStatus(...)
63
65
  - [`Campaign`](#campaign)
64
66
  - [`Target`](#target)
65
67
  - [`MatchCampaignParams`](#matchcampaignparams)
68
+ - [`NextBestAction`](#nextbestaction)
69
+ - [`DiscoverCampaignsParams`](#discovercampaignsparams)
66
70
  - [`MatchTargetParams`](#matchtargetparams)
67
71
  - [`GetTargetQueriesParams`](#gettargetqueriesparams)
68
72
  - [`TargetQueryResult`](#targetqueryresult)
69
73
  - [`AutomationStatus`](#automationstatus)
70
74
  - [`PortalStatus`](#portalstatus)
75
+ - [`EntityUiStatus`](#entityuistatus)
76
+ - [`Resolution`](#resolution)
71
77
  - [`Recipient`](#recipient)
72
78
  - [`BaseRecipientPayload`](#baserecipientpayload)
73
79
  - [`AutomationRecipientPayload`](#automationrecipientpayload)
@@ -77,6 +83,7 @@ const { data } = await targetingClient.changeCampaignStatus(...)
77
83
  - [`RetriggerAutomationsRequest`](#retriggerautomationsrequest)
78
84
  - [`RetriggerAutomationsResult`](#retriggerautomationsresult)
79
85
  - [`UpdatePortalStatusRequest`](#updateportalstatusrequest)
86
+ - [`UpdateEntityUiStatusRequest`](#updateentityuistatusrequest)
80
87
  - [`SetupCampaignRequest`](#setupcampaignrequest)
81
88
  - [`SetupTariffChangeCampaignRequest`](#setuptariffchangecampaignrequest)
82
89
  - [`SetupTariffChangeCampaignResponse`](#setuptariffchangecampaignresponse)
@@ -389,6 +396,63 @@ const { data } = await client.matchCampaigns(
389
396
 
390
397
  ---
391
398
 
399
+ ### `discoverCampaigns`
400
+
401
+ Discover Entity-UI Next Best Actions for an entity
402
+
403
+ `POST /v1/campaign:discover`
404
+
405
+ ```ts
406
+ const { data } = await client.discoverCampaigns(
407
+ null,
408
+ {
409
+ entity_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84',
410
+ entity_schema: 'string'
411
+ },
412
+ )
413
+ ```
414
+
415
+ <details>
416
+ <summary>Response</summary>
417
+
418
+ ```json
419
+ {
420
+ "hits": 0,
421
+ "results": [
422
+ {
423
+ "campaign_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
424
+ "nba": {
425
+ "category": "string",
426
+ "icon": {
427
+ "name": "string",
428
+ "color": "string"
429
+ },
430
+ "title": "string",
431
+ "body": "string",
432
+ "priority": "medium",
433
+ "is_dismissable": true,
434
+ "cta": {
435
+ "type": "journey",
436
+ "target": "string",
437
+ "label": "string",
438
+ "context_params": [
439
+ {
440
+ "key": "string",
441
+ "value": "string"
442
+ }
443
+ ]
444
+ }
445
+ },
446
+ "status": "seen"
447
+ }
448
+ ]
449
+ }
450
+ ```
451
+
452
+ </details>
453
+
454
+ ---
455
+
392
456
  ### `matchTargets`
393
457
 
394
458
  Match targets
@@ -518,6 +582,9 @@ const { data } = await client.createRecipient(
518
582
  "portal_status": "sent",
519
583
  "portal_status_updated_at": "1970-01-01T00:00:00.000Z",
520
584
  "portal_state": {},
585
+ "entity_ui_status": "seen",
586
+ "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",
587
+ "resolution": "accepted",
521
588
  "updated_at": "1970-01-01T00:00:00.000Z"
522
589
  }
523
590
  ```
@@ -560,6 +627,9 @@ const { data } = await client.updateRecipient(
560
627
  "portal_status": "sent",
561
628
  "portal_status_updated_at": "1970-01-01T00:00:00.000Z",
562
629
  "portal_state": {},
630
+ "entity_ui_status": "seen",
631
+ "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",
632
+ "resolution": "accepted",
563
633
  "updated_at": "1970-01-01T00:00:00.000Z"
564
634
  }
565
635
  ```
@@ -599,6 +669,52 @@ const { data } = await client.updateRecipientPortalStatus(
599
669
  "portal_status": "sent",
600
670
  "portal_status_updated_at": "1970-01-01T00:00:00.000Z",
601
671
  "portal_state": {},
672
+ "entity_ui_status": "seen",
673
+ "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",
674
+ "resolution": "accepted",
675
+ "updated_at": "1970-01-01T00:00:00.000Z"
676
+ }
677
+ ```
678
+
679
+ </details>
680
+
681
+ ---
682
+
683
+ ### `updateRecipientEntityUiStatus`
684
+
685
+ Update Entity-UI (Next Best Action) status for a campaign recipient
686
+
687
+ `PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}/entity_ui:status`
688
+
689
+ ```ts
690
+ const { data } = await client.updateRecipientEntityUiStatus(
691
+ {
692
+ campaign_id: 'example',
693
+ recipient_id: 'example',
694
+ },
695
+ {
696
+ status: 'seen',
697
+ entity_schema: 'string'
698
+ },
699
+ )
700
+ ```
701
+
702
+ <details>
703
+ <summary>Response</summary>
704
+
705
+ ```json
706
+ {
707
+ "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",
708
+ "entity_schema": "string",
709
+ "title": "string",
710
+ "automation_status": "pending",
711
+ "automation_execution_id": "string",
712
+ "portal_status": "sent",
713
+ "portal_status_updated_at": "1970-01-01T00:00:00.000Z",
714
+ "portal_state": {},
715
+ "entity_ui_status": "seen",
716
+ "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",
717
+ "resolution": "accepted",
602
718
  "updated_at": "1970-01-01T00:00:00.000Z"
603
719
  }
604
720
  ```
@@ -639,6 +755,9 @@ const { data } = await client.getRecipients({
639
755
  "portal_status": "sent",
640
756
  "portal_status_updated_at": "1970-01-01T00:00:00.000Z",
641
757
  "portal_state": {},
758
+ "entity_ui_status": "seen",
759
+ "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",
760
+ "resolution": "accepted",
642
761
  "updated_at": "1970-01-01T00:00:00.000Z"
643
762
  }
644
763
  ],
@@ -883,6 +1002,45 @@ type MatchCampaignParams = {
883
1002
  }
884
1003
  ```
885
1004
 
1005
+ ### `NextBestAction`
1006
+
1007
+ A Next Best Action configured on a campaign's Entity-UI channel.
1008
+ This is the canonical NBA contract shared by discovery (this API), authoring, and rendering.
1009
+ NBA content is single-language in v1; text fields may contain `{{placeholders}}` resolved at render time.
1010
+
1011
+
1012
+ ```ts
1013
+ type NextBestAction = {
1014
+ category?: string
1015
+ icon?: {
1016
+ name: string
1017
+ color?: string
1018
+ }
1019
+ title: string
1020
+ body?: string
1021
+ priority?: "low" | "medium" | "high"
1022
+ is_dismissable?: boolean
1023
+ cta: {
1024
+ type: "journey" | "workflow" | "url"
1025
+ target: string
1026
+ label?: string
1027
+ context_params?: Array<{
1028
+ key: { ... }
1029
+ value: { ... }
1030
+ }>
1031
+ }
1032
+ }
1033
+ ```
1034
+
1035
+ ### `DiscoverCampaignsParams`
1036
+
1037
+ ```ts
1038
+ type DiscoverCampaignsParams = {
1039
+ entity_id: string // uuid
1040
+ entity_schema: string
1041
+ }
1042
+ ```
1043
+
886
1044
  ### `MatchTargetParams`
887
1045
 
888
1046
  ```ts
@@ -925,6 +1083,28 @@ type AutomationStatus = "pending" | "in_progress" | "success" | "failed" | "canc
925
1083
  type PortalStatus = "sent" | "seen" | "dismissed" | "clicked"
926
1084
  ```
927
1085
 
1086
+ ### `EntityUiStatus`
1087
+
1088
+ Lifecycle status of a Next Best Action on the Entity-UI channel. Unlike the portal
1089
+ channel there is no `sent` state: an NBA recipient is born at `seen`, the moment the
1090
+ action is first rendered to an agent.
1091
+
1092
+
1093
+ ```ts
1094
+ type EntityUiStatus = "seen" | "dismissed" | "clicked"
1095
+ ```
1096
+
1097
+ ### `Resolution`
1098
+
1099
+ Cross-channel resolution of a campaign for a recipient. Unlike the per-channel `*_status`
1100
+ fields (where `dismissed` is channel-local), a resolution suppresses the campaign on EVERY
1101
+ channel — the 360 Entity-UI card and the portal teaser alike. Server-managed and read-only:
1102
+ never sent by a client. Abs
1103
+
1104
+ ```ts
1105
+ type Resolution = "accepted"
1106
+ ```
1107
+
928
1108
  ### `Recipient`
929
1109
 
930
1110
  ```ts
@@ -937,6 +1117,9 @@ type Recipient = {
937
1117
  portal_status?: "sent" | "seen" | "dismissed" | "clicked"
938
1118
  portal_status_updated_at?: string // date-time
939
1119
  portal_state?: Record<string, unknown>
1120
+ entity_ui_status?: "seen" | "dismissed" | "clicked"
1121
+ entity_ui_status_updated_at?: string // date-time
1122
+ resolution?: "accepted"
940
1123
  updated_at?: string // date-time
941
1124
  }
942
1125
  ```
@@ -1029,6 +1212,15 @@ type UpdatePortalStatusRequest = {
1029
1212
  }
1030
1213
  ```
1031
1214
 
1215
+ ### `UpdateEntityUiStatusRequest`
1216
+
1217
+ ```ts
1218
+ type UpdateEntityUiStatusRequest = {
1219
+ status: "seen" | "dismissed" | "clicked"
1220
+ entity_schema?: string
1221
+ }
1222
+ ```
1223
+
1032
1224
  ### `SetupCampaignRequest`
1033
1225
 
1034
1226
  Discriminated by `type`. Each campaign variant has its own request shape;