@epilot/sdk 2.19.6-alpha.0 → 2.19.6

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 (133) hide show
  1. package/definitions/environments.json +17 -135
  2. package/definitions/targeting.json +65 -2
  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.d.cts +2 -2
  49. package/dist/apis/environments.d.ts +2 -2
  50. package/dist/apis/environments.js +1 -1
  51. package/dist/apis/event-catalog.cjs +6 -6
  52. package/dist/apis/event-catalog.js +1 -1
  53. package/dist/apis/file.cjs +6 -6
  54. package/dist/apis/file.js +1 -1
  55. package/dist/apis/iban.cjs +6 -6
  56. package/dist/apis/iban.js +1 -1
  57. package/dist/apis/integration-toolkit.cjs +6 -6
  58. package/dist/apis/integration-toolkit.js +1 -1
  59. package/dist/apis/journey.cjs +6 -6
  60. package/dist/apis/journey.js +1 -1
  61. package/dist/apis/kanban.cjs +6 -6
  62. package/dist/apis/kanban.js +1 -1
  63. package/dist/apis/message.cjs +6 -6
  64. package/dist/apis/message.js +1 -1
  65. package/dist/apis/metering.cjs +6 -6
  66. package/dist/apis/metering.js +1 -1
  67. package/dist/apis/notes.cjs +6 -6
  68. package/dist/apis/notes.js +1 -1
  69. package/dist/apis/notification.cjs +6 -6
  70. package/dist/apis/notification.js +1 -1
  71. package/dist/apis/organization.cjs +6 -6
  72. package/dist/apis/organization.js +1 -1
  73. package/dist/apis/partner-directory.cjs +6 -6
  74. package/dist/apis/partner-directory.js +1 -1
  75. package/dist/apis/permissions.cjs +6 -6
  76. package/dist/apis/permissions.js +1 -1
  77. package/dist/apis/pricing-tier.cjs +6 -6
  78. package/dist/apis/pricing-tier.js +1 -1
  79. package/dist/apis/pricing.cjs +6 -6
  80. package/dist/apis/pricing.js +1 -1
  81. package/dist/apis/purpose.cjs +6 -6
  82. package/dist/apis/purpose.js +1 -1
  83. package/dist/apis/query.cjs +6 -6
  84. package/dist/apis/query.js +1 -1
  85. package/dist/apis/sandbox.cjs +6 -6
  86. package/dist/apis/sandbox.js +1 -1
  87. package/dist/apis/sharing.cjs +6 -6
  88. package/dist/apis/sharing.js +1 -1
  89. package/dist/apis/snapshot.cjs +6 -6
  90. package/dist/apis/snapshot.js +1 -1
  91. package/dist/apis/submission.cjs +6 -6
  92. package/dist/apis/submission.js +1 -1
  93. package/dist/apis/target.cjs +6 -6
  94. package/dist/apis/target.js +1 -1
  95. package/dist/apis/targeting.cjs +6 -6
  96. package/dist/apis/targeting.d.cts +2 -2
  97. package/dist/apis/targeting.d.ts +2 -2
  98. package/dist/apis/targeting.js +1 -1
  99. package/dist/apis/template-variables.cjs +6 -6
  100. package/dist/apis/template-variables.js +1 -1
  101. package/dist/apis/user.cjs +6 -6
  102. package/dist/apis/user.js +1 -1
  103. package/dist/apis/validation-rules.cjs +6 -6
  104. package/dist/apis/validation-rules.js +1 -1
  105. package/dist/apis/webhooks.cjs +6 -6
  106. package/dist/apis/webhooks.js +1 -1
  107. package/dist/apis/workflow-definition.cjs +6 -6
  108. package/dist/apis/workflow-definition.js +1 -1
  109. package/dist/apis/workflow.cjs +6 -6
  110. package/dist/apis/workflow.js +1 -1
  111. package/dist/bin/cli.js +1 -1
  112. package/dist/{chunk-JCBXIJ45.js → chunk-2NCWQL55.js} +2 -2
  113. package/dist/{chunk-F4OENWBE.cjs → chunk-QVK7PWME.cjs} +2 -2
  114. package/dist/environments-PXJOTQVM.js +7 -0
  115. package/dist/environments-QJ4UMJ5C.cjs +7 -0
  116. package/dist/{environments.d-840_mC07.d.ts → environments.d-BvqvN-PD.d.cts} +32 -144
  117. package/dist/{environments.d-840_mC07.d.cts → environments.d-BvqvN-PD.d.ts} +32 -144
  118. package/dist/index.cjs +8 -8
  119. package/dist/index.d.cts +2 -2
  120. package/dist/index.d.ts +2 -2
  121. package/dist/index.js +1 -1
  122. package/dist/{js-yaml-UPZKYVRY.js → js-yaml-DLCVPJ7G.js} +17 -15
  123. package/dist/targeting-2JCGF4IR.cjs +7 -0
  124. package/dist/targeting-2NHAG7B5.js +7 -0
  125. package/dist/{targeting.d-KcawmWBB.d.cts → targeting.d-BYVSahmV.d.cts} +44 -1
  126. package/dist/{targeting.d-KcawmWBB.d.ts → targeting.d-BYVSahmV.d.ts} +44 -1
  127. package/docs/environments.md +20 -128
  128. package/docs/targeting.md +80 -1
  129. package/package.json +11 -12
  130. package/dist/environments-JP2CPDH2.cjs +0 -7
  131. package/dist/environments-PGRMZY5G.js +0 -7
  132. package/dist/targeting-5U4XGOXY.cjs +0 -7
  133. package/dist/targeting-R3G32HI4.js +0 -7
@@ -0,0 +1,7 @@
1
+ import "./chunk-YPSWSI3M.js";
2
+
3
+ // src/docs/targeting.json
4
+ var targeting_default = '# Targeting API\n\n- **Base URL:** `https://targeting.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/targeting](https://docs.epilot.io/api/targeting)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.targeting.changeCampaignStatus(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/targeting\'\n\nconst targetingClient = getClient()\nauthorize(targetingClient, () => \'<token>\')\nconst { data } = await targetingClient.changeCampaignStatus(...)\n```\n\n## Operations\n\n**Campaign**\n- [`changeCampaignStatus`](#changecampaignstatus)\n- [`getCampaignJobStatus`](#getcampaignjobstatus)\n- [`getCampaignPortals`](#getcampaignportals)\n- [`setupCampaign`](#setupcampaign)\n- [`matchCampaigns`](#matchcampaigns)\n- [`discoverCampaigns`](#discovercampaigns)\n\n**Campaign Delivery**\n- [`retriggerCampaignAutomations`](#retriggercampaignautomations)\n\n**Target**\n- [`matchTargets`](#matchtargets)\n- [`getTargetQueries`](#gettargetqueries)\n\n**Campaign Recipient**\n- [`createRecipient`](#createrecipient)\n- [`updateRecipient`](#updaterecipient)\n- [`updateRecipientPortalStatus`](#updaterecipientportalstatus)\n- [`updateRecipientEntityUiStatus`](#updaterecipiententityuistatus)\n- [`restoreRecipientEntityUiStatus`](#restorerecipiententityuistatus)\n- [`getRecipients`](#getrecipients)\n- [`getEmailStats`](#getemailstats)\n\n**Schemas**\n- [`BaseError`](#baseerror)\n- [`ServerError`](#servererror)\n- [`ClientError`](#clienterror)\n- [`BaseUUID`](#baseuuid)\n- [`BaseNanoID`](#basenanoid)\n- [`BaseTags`](#basetags)\n- [`BaseRelation`](#baserelation)\n- [`BaseSystemId`](#basesystemid)\n- [`BaseEntityOwner`](#baseentityowner)\n- [`BaseEntityAcl`](#baseentityacl)\n- [`BaseSystemFields`](#basesystemfields)\n- [`BaseSystemFieldsRequired`](#basesystemfieldsrequired)\n- [`CampaignStatus`](#campaignstatus)\n- [`ExecutionSummaryItem`](#executionsummaryitem)\n- [`JobStatus`](#jobstatus)\n- [`Campaign`](#campaign)\n- [`Target`](#target)\n- [`MatchCampaignParams`](#matchcampaignparams)\n- [`NextBestAction`](#nextbestaction)\n- [`DiscoverCampaignsParams`](#discovercampaignsparams)\n- [`DiscoverResult`](#discoverresult)\n- [`MatchTargetParams`](#matchtargetparams)\n- [`GetTargetQueriesParams`](#gettargetqueriesparams)\n- [`TargetQueryResult`](#targetqueryresult)\n- [`AutomationStatus`](#automationstatus)\n- [`PortalStatus`](#portalstatus)\n- [`EntityUiStatus`](#entityuistatus)\n- [`EmailStatus`](#emailstatus)\n- [`EmailBounceType`](#emailbouncetype)\n- [`Recipient`](#recipient)\n- [`BaseRecipientPayload`](#baserecipientpayload)\n- [`AutomationRecipientPayload`](#automationrecipientpayload)\n- [`PortalRecipientPayload`](#portalrecipientpayload)\n- [`CreateRecipientPayload`](#createrecipientpayload)\n- [`UpdateRecipientPayload`](#updaterecipientpayload)\n- [`RetriggerAutomationsRequest`](#retriggerautomationsrequest)\n- [`RetriggerAutomationsResult`](#retriggerautomationsresult)\n- [`UpdatePortalStatusRequest`](#updateportalstatusrequest)\n- [`UpdateEntityUiStatusRequest`](#updateentityuistatusrequest)\n- [`SetupCampaignRequest`](#setupcampaignrequest)\n- [`SetupTariffChangeCampaignRequest`](#setuptariffchangecampaignrequest)\n- [`SetupTariffChangeCampaignResponse`](#setuptariffchangecampaignresponse)\n\n### `changeCampaignStatus`\n\nChange the status of a campaign to a desired status.\n\n`POST /v1/campaign/{campaign_id}/status`\n\n```ts\nconst { data } = await client.changeCampaignStatus({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "campaign": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "goal": "string",\n "status": "draft",\n "start_date": "1970-01-01",\n "end_date": "1970-01-01",\n "flow_id": "string",\n "job_id": "string",\n "target": {\n "$relation": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_tags": ["string"]\n }\n ]\n }\n }\n}\n```\n\n</details>\n\n---\n\n### `getCampaignJobStatus`\n\nGet the status of a campaign\'s automation job\n\n`GET /v1/campaign/{campaign_id}/job`\n\n```ts\nconst { data } = await client.getCampaignJobStatus({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "status": "queued",\n "execution_summary": [\n {\n "execution_id": "string",\n "execution_status": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getCampaignPortals`\n\nGet the list of portals and its widgets where the campaign is used.\n\n`GET /v1/campaign/{campaign_id}/portals`\n\n```ts\nconst { data } = await client.getCampaignPortals({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "portal": {\n "origin": "string",\n "domain": "string",\n "name": "string"\n },\n "widgets": [\n {\n "id": "string",\n "headline": {\n "en": "string",\n "de": "string"\n }\n }\n ]\n }\n]\n```\n\n</details>\n\n---\n\n### `retriggerCampaignAutomations`\n\nRetrigger automation executions for specific campaign recipients that have failed.\n\n`POST /v1/campaign/{campaign_id}/automations:retrigger`\n\n```ts\nconst { data } = await client.retriggerCampaignAutomations(\n {\n campaign_id: \'example\',\n },\n {\n recipient_ids: [\'3fa85f64-5717-4562-b3fc-2c963f66afa6\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "message": "string",\n "results": [\n {\n "recipient_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "result": "success",\n "execution_id": "string",\n "error": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `setupCampaign`\n\nCreates a `campaign` entity together with its related entities and configurations in a single call.\nUsed by the campaign wizard UI, but not restricted to it.\n\n`POST /v1/campaign:setup`\n\n```ts\nconst { data } = await client.setupCampaign(\n null,\n {\n type: \'tariff_change\',\n product_recommendation: {\n name: \'string\',\n source_product_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n source_price_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n offers: [\n {\n target_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n items: [\n {\n product_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n price_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n highlight_config: {}\n }\n ]\n }\n ]\n },\n campaign: {\n name: \'string\',\n goal: \'string\',\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n journey: {\n journey_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\'\n },\n channels: {\n portal_widget: {\n portal_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n block_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\'\n },\n email: {\n automation_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n template_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\'\n }\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "type": "tariff_change",\n "product_recommendation_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "campaign_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "journey_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "portal_widget_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84"\n}\n```\n\n</details>\n\n---\n\n### `matchCampaigns`\n\nMatch campaigns based on target entities.\n\n`POST /v1/campaign:match`\n\n```ts\nconst { data } = await client.matchCampaigns(\n null,\n {\n entity_refs: [\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\'\n }\n ],\n campaign_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "campaign": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "goal": "string",\n "status": "draft",\n "start_date": "1970-01-01",\n "end_date": "1970-01-01",\n "flow_id": "string",\n "job_id": "string",\n "target": {\n "$relation": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_tags": ["string"]\n }\n ]\n }\n }\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `discoverCampaigns`\n\nGiven an entity, returns the Next Best Actions it should see on the Entity-UI channel.\n\n`POST /v1/campaign:discover`\n\n```ts\nconst { data } = await client.discoverCampaigns(\n null,\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "campaign_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "nba": {\n "category": "string",\n "icon": {\n "name": "string",\n "color": "string"\n },\n "title": "string",\n "body": "string",\n "priority": "medium",\n "is_dismissable": true,\n "cta": {\n "type": "journey",\n "target": "string",\n "context_params": [\n {\n "key": "string",\n "value": "string"\n }\n ]\n }\n },\n "status": "seen",\n "status_updated_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "dismissed": [\n {\n "campaign_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "nba": {\n "category": "string",\n "icon": {\n "name": "string",\n "color": "string"\n },\n "title": "string",\n "body": "string",\n "priority": "medium",\n "is_dismissable": true,\n "cta": {\n "type": "journey",\n "target": "string",\n "context_params": [\n {\n "key": "string",\n "value": "string"\n }\n ]\n }\n },\n "status": "seen",\n "status_updated_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `matchTargets`\n\nFind targets from the provided list that include the provide entities.\n\n`POST /v1/target:match`\n\n```ts\nconst { data } = await client.matchTargets(\n null,\n {\n entity_refs: [\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\'\n }\n ],\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "target": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "description": "string",\n "entity_schema": "string",\n "entity_filters": {}\n }\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getTargetQueries`\n\nTransform target filters into Lucene queries for the provided target IDs.\nReturns the transformed query string for each target along with any errors encountered.\n\n`POST /v1/target/queries`\n\n```ts\nconst { data } = await client.getTargetQueries(\n null,\n {\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "target_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "query": "string",\n "error": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createRecipient`\n\nCreates a new recipient associated with a campaign.\n\n`POST /v1/campaign/{campaign_id}/recipient`\n\n```ts\nconst { data } = await client.createRecipient(\n {\n campaign_id: \'example\',\n },\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\',\n automation_status: \'pending\',\n automation_execution_id: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "entity_ui_status": "seen",\n "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",\n "entity_ui_status_before_dismiss": "seen",\n "message_entity_id": "string",\n "email_status": "sent",\n "email_status_updated_at": "1970-01-01T00:00:00.000Z",\n "email_bounce_type": "permanent",\n "email_bounce_subtype": "string",\n "email_complaint_type": "string",\n "email_bounce_reason": "string",\n "email_send_error": {},\n "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",\n "email_open_count": 0,\n "email_first_opened_at": "1970-01-01T00:00:00.000Z",\n "email_last_opened_at": "1970-01-01T00:00:00.000Z",\n "email_click_count": 0,\n "email_first_clicked_at": "1970-01-01T00:00:00.000Z",\n "email_clicked_links": [\n {\n "url": "string",\n "clicked_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateRecipient`\n\nUpdates a recipient\'s attributes.\n\n`PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}`\n\n```ts\nconst { data } = await client.updateRecipient(\n {\n campaign_id: \'example\',\n recipient_id: \'example\',\n },\n {\n automation_status: \'pending\',\n automation_execution_id: \'string\',\n portal_status: \'sent\',\n portal_state: {}\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "entity_ui_status": "seen",\n "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",\n "entity_ui_status_before_dismiss": "seen",\n "message_entity_id": "string",\n "email_status": "sent",\n "email_status_updated_at": "1970-01-01T00:00:00.000Z",\n "email_bounce_type": "permanent",\n "email_bounce_subtype": "string",\n "email_complaint_type": "string",\n "email_bounce_reason": "string",\n "email_send_error": {},\n "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",\n "email_open_count": 0,\n "email_first_opened_at": "1970-01-01T00:00:00.000Z",\n "email_last_opened_at": "1970-01-01T00:00:00.000Z",\n "email_click_count": 0,\n "email_first_clicked_at": "1970-01-01T00:00:00.000Z",\n "email_clicked_links": [\n {\n "url": "string",\n "clicked_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateRecipientPortalStatus`\n\nUpdates the portal status for a specific campaign recipient.\nThe portal_status_updated_at timestamp is automatically set when the status changes.\n\n`PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}/portal:status`\n\n```ts\nconst { data } = await client.updateRecipientPortalStatus(\n {\n campaign_id: \'example\',\n recipient_id: \'example\',\n },\n {\n status: \'sent\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "entity_ui_status": "seen",\n "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",\n "entity_ui_status_before_dismiss": "seen",\n "message_entity_id": "string",\n "email_status": "sent",\n "email_status_updated_at": "1970-01-01T00:00:00.000Z",\n "email_bounce_type": "permanent",\n "email_bounce_subtype": "string",\n "email_complaint_type": "string",\n "email_bounce_reason": "string",\n "email_send_error": {},\n "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",\n "email_open_count": 0,\n "email_first_opened_at": "1970-01-01T00:00:00.000Z",\n "email_last_opened_at": "1970-01-01T00:00:00.000Z",\n "email_click_count": 0,\n "email_first_clicked_at": "1970-01-01T00:00:00.000Z",\n "email_clicked_links": [\n {\n "url": "string",\n "clicked_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateRecipientEntityUiStatus`\n\nRecords a Next Best Action interaction for a recipient on the Entity-UI channel.\n\n`PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}/entity_ui:status`\n\n```ts\nconst { data } = await client.updateRecipientEntityUiStatus(\n {\n campaign_id: \'example\',\n recipient_id: \'example\',\n },\n {\n status: \'seen\',\n entity_schema: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "entity_ui_status": "seen",\n "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",\n "entity_ui_status_before_dismiss": "seen",\n "message_entity_id": "string",\n "email_status": "sent",\n "email_status_updated_at": "1970-01-01T00:00:00.000Z",\n "email_bounce_type": "permanent",\n "email_bounce_subtype": "string",\n "email_complaint_type": "string",\n "email_bounce_reason": "string",\n "email_send_error": {},\n "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",\n "email_open_count": 0,\n "email_first_opened_at": "1970-01-01T00:00:00.000Z",\n "email_last_opened_at": "1970-01-01T00:00:00.000Z",\n "email_click_count": 0,\n "email_first_clicked_at": "1970-01-01T00:00:00.000Z",\n "email_clicked_links": [\n {\n "url": "string",\n "clicked_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `restoreRecipientEntityUiStatus`\n\nUndo a dismissal on the Entity-UI (Next Best Action) channel\n\n`POST /v1/campaign/{campaign_id}/recipient/{recipient_id}/entity_ui:restore`\n\n```ts\nconst { data } = await client.restoreRecipientEntityUiStatus({\n campaign_id: \'example\',\n recipient_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "entity_ui_status": "seen",\n "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",\n "entity_ui_status_before_dismiss": "seen",\n "message_entity_id": "string",\n "email_status": "sent",\n "email_status_updated_at": "1970-01-01T00:00:00.000Z",\n "email_bounce_type": "permanent",\n "email_bounce_subtype": "string",\n "email_complaint_type": "string",\n "email_bounce_reason": "string",\n "email_send_error": {},\n "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",\n "email_open_count": 0,\n "email_first_opened_at": "1970-01-01T00:00:00.000Z",\n "email_last_opened_at": "1970-01-01T00:00:00.000Z",\n "email_click_count": 0,\n "email_first_clicked_at": "1970-01-01T00:00:00.000Z",\n "email_clicked_links": [\n {\n "url": "string",\n "clicked_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `getRecipients`\n\nGet a paginated list of recipients for a campaign.\n\n`GET /v1/campaign/{campaign_id}/recipients`\n\n```ts\nconst { data } = await client.getRecipients({\n campaign_id: \'example\',\n limit: 1,\n next: \'example\',\n q: \'example\',\n automation_status: [\'...\'],\n portal_status: \'example\',\n email_status: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "entity_ui_status": "seen",\n "entity_ui_status_updated_at": "1970-01-01T00:00:00.000Z",\n "entity_ui_status_before_dismiss": "seen",\n "message_entity_id": "string",\n "email_status": "sent",\n "email_status_updated_at": "1970-01-01T00:00:00.000Z",\n "email_bounce_type": "permanent",\n "email_bounce_subtype": "string",\n "email_complaint_type": "string",\n "email_bounce_reason": "string",\n "email_send_error": {},\n "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",\n "email_open_count": 0,\n "email_first_opened_at": "1970-01-01T00:00:00.000Z",\n "email_last_opened_at": "1970-01-01T00:00:00.000Z",\n "email_click_count": 0,\n "email_first_clicked_at": "1970-01-01T00:00:00.000Z",\n "email_clicked_links": [\n {\n "url": "string",\n "clicked_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "next": "string",\n "total": 0\n}\n```\n\n</details>\n\n---\n\n### `getEmailStats`\n\nAggregate email delivery counts for a campaign, for the KPI summary on the campaign UI.\nCounts cover the email (automation) channel only; `total_emailed` is the number of\nrecipients with a recorded em\n\n`GET /v1/campaign/{campaign_id}/email-stats`\n\n```ts\nconst { data } = await client.getEmailStats({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "total_emailed": 0,\n "sent": 0,\n "delivered": 0,\n "bounced": 0,\n "bounced_hard": 0,\n "bounced_soft": 0,\n "complained": 0,\n "failed": 0,\n "unsubscribed": 0,\n "opened": 0,\n "clicked": 0,\n "total_opens": 0,\n "total_clicks": 0\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `BaseError`\n\n```ts\ntype BaseError = {\n status: number\n message: string\n}\n```\n\n### `ServerError`\n\n```ts\ntype ServerError = {\n status: number\n message: string\n}\n```\n\n### `ClientError`\n\nDescribes the structure of a client error response, which can be one of several types:\n1. `MessageError`: Contains a \'message\' field for general descriptive errors.\n2. `CodeError`: Contains a \'code\' field for specific, machine-readable error codes.\n3. `StatusedError`: Contains \'error\' and \'status\' f\n\n```ts\ntype ClientError = {\n message: string\n} | {\n code: "CAMPAIGN_NOT_FOUND" | "CAMPAIGN_HAS_NO_TARGET" | "CAMPAIGN_HAS_NO_DELIVERY_METHOD" | "INVALID_NEXT_BEST_ACTION" | "CAMPAIGN_HAS_JOB_IN_PROGRESS" | "CAMPAIGN_HAS_UNEXPECTED_STATUS" | "JOB_TOKEN_MISSING" | "TARGET_WITHOUT_FILTERS"\n} | {\n error: string\n status: number\n}\n```\n\n### `BaseUUID`\n\n```ts\ntype BaseUUID = string // uuid\n```\n\n### `BaseNanoID`\n\n```ts\ntype BaseNanoID = string\n```\n\n### `BaseTags`\n\n```ts\ntype BaseTags = string[]\n```\n\n### `BaseRelation`\n\n```ts\ntype BaseRelation = {\n $relation?: Array<{\n entity_id?: string // uuid\n _tags?: string[]\n }>\n}\n```\n\n### `BaseSystemId`\n\n```ts\ntype BaseSystemId = {\n _id: string // uuid\n}\n```\n\n### `BaseEntityOwner`\n\nThe user / organization owning this entity.\n\nNote: Owner implicitly has access to the entity regardless of ACLs.\n\n\n```ts\ntype BaseEntityOwner = {\n org_id: string\n user_id?: string\n}\n```\n\n### `BaseEntityAcl`\n\nAccess control list (ACL) for an entity. Defines sharing access to external orgs or users.\n\n```ts\ntype BaseEntityAcl = {\n view?: string[]\n edit?: string[]\n delete?: string[]\n}\n```\n\n### `BaseSystemFields`\n\n```ts\ntype BaseSystemFields = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n}\n```\n\n### `BaseSystemFieldsRequired`\n\n```ts\ntype BaseSystemFieldsRequired = object\n```\n\n### `CampaignStatus`\n\n```ts\ntype CampaignStatus = "draft" | "activating" | "active" | "inactive"\n```\n\n### `ExecutionSummaryItem`\n\n```ts\ntype ExecutionSummaryItem = {\n execution_id?: string\n execution_status?: string\n}\n```\n\n### `JobStatus`\n\n```ts\ntype JobStatus = {\n status?: "queued" | "processing" | "finished" | "failed" | "cancelled" | "send_report"\n execution_summary?: Array<{\n execution_id?: string\n execution_status?: string\n }>\n}\n```\n\n### `Campaign`\n\n```ts\ntype Campaign = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n goal?: string\n status?: "draft" | "activating" | "active" | "inactive"\n start_date?: string // date\n end_date?: string // date\n flow_id?: string\n job_id?: string\n target?: {\n $relation?: Array<{\n entity_id?: { ... }\n _tags?: { ... }\n }>\n }\n}\n```\n\n### `Target`\n\n```ts\ntype Target = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n description?: string\n entity_schema?: string\n entity_filters?: Record<string, unknown>\n}\n```\n\n### `MatchCampaignParams`\n\n```ts\ntype MatchCampaignParams = {\n entity_refs: Array<{\n entity_id: string // uuid\n entity_schema: string\n }>\n campaign_ids: string // uuid[]\n}\n```\n\n### `NextBestAction`\n\nA Next Best Action configured on a campaign\'s Entity-UI channel.\nThis is the canonical NBA contract shared by discovery (this API), authoring, and rendering.\nNBA content is single-language in v1; text fields may contain `{{placeholders}}` resolved at render time.\n\n\n```ts\ntype NextBestAction = {\n category?: string\n icon?: {\n name: string\n color?: string\n }\n title: string\n body?: string\n priority?: "low" | "medium" | "high"\n is_dismissable?: boolean\n cta: {\n type: "journey" | "workflow" | "flow"\n target: string\n context_params?: Array<{\n key: { ... }\n value: { ... }\n }>\n }\n}\n```\n\n### `DiscoverCampaignsParams`\n\n```ts\ntype DiscoverCampaignsParams = {\n entity_id: string // uuid\n entity_schema: string\n}\n```\n\n### `DiscoverResult`\n\nOne discovered Next Best Action, plus this entity\'s interaction state for it.\n\n```ts\ntype DiscoverResult = {\n campaign_id: string // uuid\n nba: {\n category?: string\n icon?: {\n name: { ... }\n color?: { ... }\n }\n title: string\n body?: string\n priority?: "low" | "medium" | "high"\n is_dismissable?: boolean\n cta: {\n type: { ... }\n target: { ... }\n context_params?: { ... }\n }\n }\n status?: "seen" | "dismissed" | "clicked"\n status_updated_at?: string // date-time\n}\n```\n\n### `MatchTargetParams`\n\n```ts\ntype MatchTargetParams = {\n entity_refs: Array<{\n entity_id: string // uuid\n entity_schema: string\n }>\n target_ids: string // uuid[]\n}\n```\n\n### `GetTargetQueriesParams`\n\n```ts\ntype GetTargetQueriesParams = {\n target_ids: string // uuid[]\n}\n```\n\n### `TargetQueryResult`\n\n```ts\ntype TargetQueryResult = {\n target_id: string // uuid\n query: string\n error?: string\n}\n```\n\n### `AutomationStatus`\n\n```ts\ntype AutomationStatus = "pending" | "in_progress" | "success" | "failed" | "cancelled"\n```\n\n### `PortalStatus`\n\n```ts\ntype PortalStatus = "sent" | "seen" | "dismissed" | "clicked"\n```\n\n### `EntityUiStatus`\n\nLifecycle status of a Next Best Action on the Entity-UI channel. Unlike the portal\nchannel there is no `sent` state: an NBA recipient is born at `seen`, the moment the\naction is first rendered to an agent.\n\n\n```ts\ntype EntityUiStatus = "seen" | "dismissed" | "clicked"\n```\n\n### `EmailStatus`\n\nDelivery status of the email a campaign\'s automation sends to a recipient. Set to `sent`\nonce the automation hands the email off, then updated asynchronously as SES notifications\narrive (`bounced` / `complained`; an SES Reject maps to `bounced`). `failed` is a send-time\nfailure (the automation execu\n\n```ts\ntype EmailStatus = "sent" | "delivered" | "bounced" | "complained" | "failed"\n```\n\n### `EmailBounceType`\n\nSES bounce classification: `permanent` (hard) or `transient` (soft).\n\n```ts\ntype EmailBounceType = "permanent" | "transient"\n```\n\n### `Recipient`\n\n```ts\ntype Recipient = {\n entity_id?: string // uuid\n entity_schema?: string\n title?: string\n automation_status?: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id?: string\n portal_status?: "sent" | "seen" | "dismissed" | "clicked"\n portal_status_updated_at?: string // date-time\n portal_state?: Record<string, unknown>\n entity_ui_status?: "seen" | "dismissed" | "clicked"\n entity_ui_status_updated_at?: string // date-time\n entity_ui_status_before_dismiss?: "seen" | "dismissed" | "clicked"\n message_entity_id?: string\n email_status?: "sent" | "delivered" | "bounced" | "complained" | "failed"\n email_status_updated_at?: string // date-time\n email_bounce_type?: "permanent" | "transient"\n email_bounce_subtype?: string\n email_complaint_type?: string\n email_bounce_reason?: string\n email_send_error?: Record<string, unknown>\n email_unsubscribed_at?: string // date-time\n email_open_count?: number\n email_first_opened_at?: string // date-time\n email_last_opened_at?: string // date-time\n email_click_count?: number\n email_first_clicked_at?: string // date-time\n email_clicked_links?: Array<{\n url: string\n clicked_at: string // date-time\n }>\n updated_at?: string // date-time\n}\n```\n\n### `BaseRecipientPayload`\n\n```ts\ntype BaseRecipientPayload = {\n entity_id: string // uuid\n entity_schema: string\n}\n```\n\n### `AutomationRecipientPayload`\n\n```ts\ntype AutomationRecipientPayload = {\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n}\n```\n\n### `PortalRecipientPayload`\n\n```ts\ntype PortalRecipientPayload = {\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `CreateRecipientPayload`\n\n```ts\ntype CreateRecipientPayload = {\n entity_id: string // uuid\n entity_schema: string\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n} | {\n entity_id: string // uuid\n entity_schema: string\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n} | {\n entity_id: string // uuid\n entity_schema: string\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `UpdateRecipientPayload`\n\n```ts\ntype UpdateRecipientPayload = {\n automation_status?: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id?: string\n portal_status?: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `RetriggerAutomationsRequest`\n\n```ts\ntype RetriggerAutomationsRequest = {\n recipient_ids: string // uuid[]\n}\n```\n\n### `RetriggerAutomationsResult`\n\n```ts\ntype RetriggerAutomationsResult = {\n recipient_id: string // uuid\n result: "success" | "failure" | "not_found" | "invalid_status"\n execution_id?: string\n error?: string\n}\n```\n\n### `UpdatePortalStatusRequest`\n\n```ts\ntype UpdatePortalStatusRequest = {\n status: "sent" | "seen" | "dismissed" | "clicked"\n}\n```\n\n### `UpdateEntityUiStatusRequest`\n\n```ts\ntype UpdateEntityUiStatusRequest = {\n status: "seen" | "dismissed" | "clicked"\n entity_schema?: string\n}\n```\n\n### `SetupCampaignRequest`\n\nDiscriminated by `type`. Each campaign variant has its own request shape;\nnew variants are added by introducing a new schema and extending the `oneOf` list.\n\n\n```ts\ntype SetupCampaignRequest = {\n type: "tariff_change"\n product_recommendation: {\n name?: string\n source_product_id?: string // uuid\n source_price_id?: string // uuid\n offers?: Array<{\n target_id?: { ... }\n items: { ... }\n }>\n }\n campaign: {\n name: string\n goal?: string\n target_ids: string // uuid[]\n }\n journey?: {\n journey_id: string // uuid\n }\n channels?: {\n portal_widget?: {\n portal_id: { ... }\n block_id: { ... }\n }\n email?: {\n automation_id?: { ... }\n template_id?: { ... }\n }\n }\n}\n```\n\n### `SetupTariffChangeCampaignRequest`\n\n```ts\ntype SetupTariffChangeCampaignRequest = {\n type: "tariff_change"\n product_recommendation: {\n name?: string\n source_product_id?: string // uuid\n source_price_id?: string // uuid\n offers?: Array<{\n target_id?: { ... }\n items: { ... }\n }>\n }\n campaign: {\n name: string\n goal?: string\n target_ids: string // uuid[]\n }\n journey?: {\n journey_id: string // uuid\n }\n channels?: {\n portal_widget?: {\n portal_id: { ... }\n block_id: { ... }\n }\n email?: {\n automation_id?: { ... }\n template_id?: { ... }\n }\n }\n}\n```\n\n### `SetupTariffChangeCampaignResponse`\n\n```ts\ntype SetupTariffChangeCampaignResponse = {\n type: "tariff_change"\n product_recommendation_id: string // uuid\n campaign_id: string // uuid\n journey_id?: string // uuid\n portal_widget_id?: string // uuid\n}\n```\n';
5
+ export {
6
+ targeting_default as default
7
+ };
@@ -94,7 +94,7 @@ declare namespace Components {
94
94
  total_emailed: number;
95
95
  sent: number;
96
96
  /**
97
- * Currently always 0 (Delivery events are not published yet).
97
+ * Recipients whose SES Delivery event was recorded (needs Delivery publishing enabled).
98
98
  */
99
99
  delivered: number;
100
100
  bounced: number;
@@ -112,6 +112,22 @@ declare namespace Components {
112
112
  * Recipients who opted out of email marketing.
113
113
  */
114
114
  unsubscribed: number;
115
+ /**
116
+ * Unique recipients with at least one open (only where open tracking is on).
117
+ */
118
+ opened: number;
119
+ /**
120
+ * Unique recipients with at least one link click (only where click tracking is on).
121
+ */
122
+ clicked: number;
123
+ /**
124
+ * Total opens across all recipients.
125
+ */
126
+ total_opens: number;
127
+ /**
128
+ * Total link clicks across all recipients.
129
+ */
130
+ total_clicks: number;
115
131
  }
116
132
  export interface GetTargetQueriesResponse {
117
133
  /**
@@ -1671,6 +1687,33 @@ declare namespace Components {
1671
1687
  * When the contact unsubscribed from email marketing (opted out). Server-managed.
1672
1688
  */
1673
1689
  email_unsubscribed_at?: string; // date-time
1690
+ /**
1691
+ * Number of SES opens recorded for this recipient (only where open tracking is on).
1692
+ */
1693
+ email_open_count?: number;
1694
+ /**
1695
+ * When the recipient first opened the email.
1696
+ */
1697
+ email_first_opened_at?: string; // date-time
1698
+ /**
1699
+ * When the recipient most recently opened the email.
1700
+ */
1701
+ email_last_opened_at?: string; // date-time
1702
+ /**
1703
+ * Number of SES link clicks recorded for this recipient (only where click tracking is on).
1704
+ */
1705
+ email_click_count?: number;
1706
+ /**
1707
+ * When the recipient first clicked a link.
1708
+ */
1709
+ email_first_clicked_at?: string; // date-time
1710
+ /**
1711
+ * Raw click events (URL + timestamp); aggregate per-URL on the client.
1712
+ */
1713
+ email_clicked_links?: {
1714
+ url: string;
1715
+ clicked_at: string; // date-time
1716
+ }[];
1674
1717
  updated_at?: string; // date-time
1675
1718
  }
1676
1719
  export interface RetriggerAutomationsRequest {
@@ -94,7 +94,7 @@ declare namespace Components {
94
94
  total_emailed: number;
95
95
  sent: number;
96
96
  /**
97
- * Currently always 0 (Delivery events are not published yet).
97
+ * Recipients whose SES Delivery event was recorded (needs Delivery publishing enabled).
98
98
  */
99
99
  delivered: number;
100
100
  bounced: number;
@@ -112,6 +112,22 @@ declare namespace Components {
112
112
  * Recipients who opted out of email marketing.
113
113
  */
114
114
  unsubscribed: number;
115
+ /**
116
+ * Unique recipients with at least one open (only where open tracking is on).
117
+ */
118
+ opened: number;
119
+ /**
120
+ * Unique recipients with at least one link click (only where click tracking is on).
121
+ */
122
+ clicked: number;
123
+ /**
124
+ * Total opens across all recipients.
125
+ */
126
+ total_opens: number;
127
+ /**
128
+ * Total link clicks across all recipients.
129
+ */
130
+ total_clicks: number;
115
131
  }
116
132
  export interface GetTargetQueriesResponse {
117
133
  /**
@@ -1671,6 +1687,33 @@ declare namespace Components {
1671
1687
  * When the contact unsubscribed from email marketing (opted out). Server-managed.
1672
1688
  */
1673
1689
  email_unsubscribed_at?: string; // date-time
1690
+ /**
1691
+ * Number of SES opens recorded for this recipient (only where open tracking is on).
1692
+ */
1693
+ email_open_count?: number;
1694
+ /**
1695
+ * When the recipient first opened the email.
1696
+ */
1697
+ email_first_opened_at?: string; // date-time
1698
+ /**
1699
+ * When the recipient most recently opened the email.
1700
+ */
1701
+ email_last_opened_at?: string; // date-time
1702
+ /**
1703
+ * Number of SES link clicks recorded for this recipient (only where click tracking is on).
1704
+ */
1705
+ email_click_count?: number;
1706
+ /**
1707
+ * When the recipient first clicked a link.
1708
+ */
1709
+ email_first_clicked_at?: string; // date-time
1710
+ /**
1711
+ * Raw click events (URL + timestamp); aggregate per-URL on the client.
1712
+ */
1713
+ email_clicked_links?: {
1714
+ url: string;
1715
+ clicked_at: string; // date-time
1716
+ }[];
1674
1717
  updated_at?: string; // date-time
1675
1718
  }
1676
1719
  export interface RetriggerAutomationsRequest {
@@ -36,9 +36,6 @@ const { data } = await environmentsClient.listEnvironmentVariables(...)
36
36
 
37
37
  **Schemas**
38
38
  - [`EnvironmentValueType`](#environmentvaluetype)
39
- - [`EnvironmentOption`](#environmentoption)
40
- - [`OptionsValue`](#optionsvalue)
41
- - [`EnvironmentValue`](#environmentvalue)
42
39
  - [`EnvironmentVariable`](#environmentvariable)
43
40
  - [`EnvironmentVariableListItem`](#environmentvariablelistitem)
44
41
  - [`EnvironmentVariableList`](#environmentvariablelist)
@@ -50,7 +47,7 @@ const { data } = await environmentsClient.listEnvironmentVariables(...)
50
47
 
51
48
  ### `listEnvironmentVariables`
52
49
 
53
- List all environment variables for the organization. Returns metadata only, no secret values.
50
+ List environment variables
54
51
 
55
52
  `GET /v1/environments`
56
53
 
@@ -70,7 +67,6 @@ const { data } = await client.listEnvironmentVariables()
70
67
  "description": "string",
71
68
  "group": "string",
72
69
  "value": "string",
73
- "protected": true,
74
70
  "created_at": "1970-01-01T00:00:00.000Z",
75
71
  "updated_at": "1970-01-01T00:00:00.000Z"
76
72
  }
@@ -84,7 +80,7 @@ const { data } = await client.listEnvironmentVariables()
84
80
 
85
81
  ### `createEnvironmentVariable`
86
82
 
87
- Create a new environment variable or secret for the organization. If `group` is provided and the group does not yet exist, it is created automatically.
83
+ Create environment variable
88
84
 
89
85
  `POST /v1/environments`
90
86
 
@@ -96,8 +92,7 @@ const { data } = await client.createEnvironmentVariable(
96
92
  type: 'String',
97
93
  description: 'string',
98
94
  group: 'string',
99
- value: 'string',
100
- protected: true
95
+ value: 'string'
101
96
  },
102
97
  )
103
98
  ```
@@ -112,7 +107,6 @@ const { data } = await client.createEnvironmentVariable(
112
107
  "description": "string",
113
108
  "group": "string",
114
109
  "value": "string",
115
- "protected": true,
116
110
  "created_at": "1970-01-01T00:00:00.000Z",
117
111
  "updated_at": "1970-01-01T00:00:00.000Z"
118
112
  }
@@ -124,7 +118,7 @@ const { data } = await client.createEnvironmentVariable(
124
118
 
125
119
  ### `listEnvironmentGroups`
126
120
 
127
- List all environment groups for the organization.
121
+ List environment groups
128
122
 
129
123
  `GET /v1/environments/groups`
130
124
 
@@ -154,8 +148,6 @@ const { data } = await client.listEnvironmentGroups()
154
148
 
155
149
  ### `putEnvironmentGroup`
156
150
 
157
- Create or update an environment group by name. Acts as an upsert — creates the group if it does not exist.
158
-
159
151
  `PUT /v1/environments/groups/{name}`
160
152
 
161
153
  ```ts
@@ -187,7 +179,7 @@ const { data } = await client.putEnvironmentGroup(
187
179
 
188
180
  ### `deleteEnvironmentGroup`
189
181
 
190
- Deletes a group. Variables assigned to this group become ungrouped.
182
+ Delete an environment group
191
183
 
192
184
  `DELETE /v1/environments/groups/{name}`
193
185
 
@@ -201,7 +193,7 @@ const { data } = await client.deleteEnvironmentGroup({
201
193
 
202
194
  ### `getEnvironmentVariable`
203
195
 
204
- Get an environment variable by key. Returns value for non-secret types, omitted for SecretString.
196
+ Get environment variable
205
197
 
206
198
  `GET /v1/environments/{key}`
207
199
 
@@ -221,7 +213,6 @@ const { data } = await client.getEnvironmentVariable({
221
213
  "description": "string",
222
214
  "group": "string",
223
215
  "value": "string",
224
- "protected": true,
225
216
  "created_at": "1970-01-01T00:00:00.000Z",
226
217
  "updated_at": "1970-01-01T00:00:00.000Z"
227
218
  }
@@ -233,7 +224,7 @@ const { data } = await client.getEnvironmentVariable({
233
224
 
234
225
  ### `updateEnvironmentVariable`
235
226
 
236
- Create or update an environment variable. Acts as an upsert — creates the variable if it does not exist. If `group` is provided and the group does not yet exist, it is created automatically.
227
+ Update environment variable
237
228
 
238
229
  `PUT /v1/environments/{key}`
239
230
 
@@ -246,8 +237,7 @@ const { data } = await client.updateEnvironmentVariable(
246
237
  type: 'String',
247
238
  value: 'string',
248
239
  description: 'string',
249
- group: 'string',
250
- protected: true
240
+ group: 'string'
251
241
  },
252
242
  )
253
243
  ```
@@ -262,7 +252,6 @@ const { data } = await client.updateEnvironmentVariable(
262
252
  "description": "string",
263
253
  "group": "string",
264
254
  "value": "string",
265
- "protected": true,
266
255
  "created_at": "1970-01-01T00:00:00.000Z",
267
256
  "updated_at": "1970-01-01T00:00:00.000Z"
268
257
  }
@@ -274,7 +263,7 @@ const { data } = await client.updateEnvironmentVariable(
274
263
 
275
264
  ### `deleteEnvironmentVariable`
276
265
 
277
- Delete an environment variable by key.
266
+ Delete environment variable
278
267
 
279
268
  `DELETE /v1/environments/{key}`
280
269
 
@@ -290,61 +279,8 @@ const { data } = await client.deleteEnvironmentVariable({
290
279
 
291
280
  ### `EnvironmentValueType`
292
281
 
293
- The structure a variable's value holds. `SecretString` is encrypted at rest and
294
- its value is never returned. `Text`, `Number`, `Boolean` and `Options` may be
295
- served to browser-facing consumers; `String` and `SecretString` may not.
296
-
297
-
298
282
  ```ts
299
- type EnvironmentValueType = "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Options"
300
- ```
301
-
302
- ### `EnvironmentOption`
303
-
304
- ```ts
305
- type EnvironmentOption = {
306
- value: string
307
- label: string
308
- } | {
309
- value: string
310
- labels: Record<string, string>
311
- }
312
- ```
313
-
314
- ### `OptionsValue`
315
-
316
- ```ts
317
- type OptionsValue = {
318
- fallbackLanguage?: string
319
- options: Array<{
320
- value: string
321
- label: string
322
- } | {
323
- value: string
324
- labels: Record<string, string>
325
- }>
326
- }
327
- ```
328
-
329
- ### `EnvironmentValue`
330
-
331
- A variable's value. The JSON type corresponds to the variable's `type`:
332
- `String`, `SecretString` and `Text` are strings, `Number` is a number,
333
- `Boolean` is a boolean, and `Options` is an object. Numbers are IEEE 754
334
- doubles; integers above 2^53 may lose precision on round-trip.
335
-
336
-
337
- ```ts
338
- type EnvironmentValue = string | number | boolean | {
339
- fallbackLanguage?: string
340
- options: Array<{
341
- value: string
342
- label: string
343
- } | {
344
- value: string
345
- labels: Record<string, string>
346
- }>
347
- }
283
+ type EnvironmentValueType = "String" | "SecretString"
348
284
  ```
349
285
 
350
286
  ### `EnvironmentVariable`
@@ -352,20 +288,10 @@ type EnvironmentValue = string | number | boolean | {
352
288
  ```ts
353
289
  type EnvironmentVariable = {
354
290
  key: string
355
- type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Options"
291
+ type: "String" | "SecretString"
356
292
  description?: string
357
293
  group?: string
358
- value?: string | number | boolean | {
359
- fallbackLanguage?: string
360
- options: Array<{
361
- value: { ... }
362
- label: { ... }
363
- } | {
364
- value: { ... }
365
- labels: { ... }
366
- }>
367
- }
368
- protected?: boolean
294
+ value?: string
369
295
  created_at: string // date-time
370
296
  updated_at: string // date-time
371
297
  }
@@ -376,20 +302,10 @@ type EnvironmentVariable = {
376
302
  ```ts
377
303
  type EnvironmentVariableListItem = {
378
304
  key: string
379
- type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Options"
305
+ type: "String" | "SecretString"
380
306
  description?: string
381
307
  group?: string
382
- value?: string | number | boolean | {
383
- fallbackLanguage?: string
384
- options: Array<{
385
- value: { ... }
386
- label: { ... }
387
- } | {
388
- value: { ... }
389
- labels: { ... }
390
- }>
391
- }
392
- protected?: boolean
308
+ value?: string
393
309
  created_at: string // date-time
394
310
  updated_at: string // date-time
395
311
  }
@@ -401,14 +317,10 @@ type EnvironmentVariableListItem = {
401
317
  type EnvironmentVariableList = {
402
318
  items: Array<{
403
319
  key: string
404
- type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Options"
320
+ type: "String" | "SecretString"
405
321
  description?: string
406
322
  group?: string
407
- value?: string | number | boolean | {
408
- fallbackLanguage?: { ... }
409
- options: { ... }
410
- }
411
- protected?: boolean
323
+ value?: string
412
324
  created_at: string // date-time
413
325
  updated_at: string // date-time
414
326
  }>
@@ -420,20 +332,10 @@ type EnvironmentVariableList = {
420
332
  ```ts
421
333
  type EnvironmentVariableCreateRequest = {
422
334
  key: string
423
- type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Options"
335
+ type: "String" | "SecretString"
424
336
  description?: string
425
337
  group?: string
426
- value?: string | number | boolean | {
427
- fallbackLanguage?: string
428
- options: Array<{
429
- value: { ... }
430
- label: { ... }
431
- } | {
432
- value: { ... }
433
- labels: { ... }
434
- }>
435
- }
436
- protected?: boolean
338
+ value?: string
437
339
  }
438
340
  ```
439
341
 
@@ -441,20 +343,10 @@ type EnvironmentVariableCreateRequest = {
441
343
 
442
344
  ```ts
443
345
  type EnvironmentVariableUpdateRequest = {
444
- type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Options"
445
- value?: string | number | boolean | {
446
- fallbackLanguage?: string
447
- options: Array<{
448
- value: { ... }
449
- label: { ... }
450
- } | {
451
- value: { ... }
452
- labels: { ... }
453
- }>
454
- }
346
+ type?: "String" | "SecretString"
347
+ value?: string
455
348
  description?: string
456
349
  group?: string
457
- protected?: boolean
458
350
  }
459
351
  ```
460
352
 
package/docs/targeting.md CHANGED
@@ -628,6 +628,17 @@ const { data } = await client.createRecipient(
628
628
  "email_bounce_reason": "string",
629
629
  "email_send_error": {},
630
630
  "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",
631
+ "email_open_count": 0,
632
+ "email_first_opened_at": "1970-01-01T00:00:00.000Z",
633
+ "email_last_opened_at": "1970-01-01T00:00:00.000Z",
634
+ "email_click_count": 0,
635
+ "email_first_clicked_at": "1970-01-01T00:00:00.000Z",
636
+ "email_clicked_links": [
637
+ {
638
+ "url": "string",
639
+ "clicked_at": "1970-01-01T00:00:00.000Z"
640
+ }
641
+ ],
631
642
  "updated_at": "1970-01-01T00:00:00.000Z"
632
643
  }
633
644
  ```
@@ -682,6 +693,17 @@ const { data } = await client.updateRecipient(
682
693
  "email_bounce_reason": "string",
683
694
  "email_send_error": {},
684
695
  "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",
696
+ "email_open_count": 0,
697
+ "email_first_opened_at": "1970-01-01T00:00:00.000Z",
698
+ "email_last_opened_at": "1970-01-01T00:00:00.000Z",
699
+ "email_click_count": 0,
700
+ "email_first_clicked_at": "1970-01-01T00:00:00.000Z",
701
+ "email_clicked_links": [
702
+ {
703
+ "url": "string",
704
+ "clicked_at": "1970-01-01T00:00:00.000Z"
705
+ }
706
+ ],
685
707
  "updated_at": "1970-01-01T00:00:00.000Z"
686
708
  }
687
709
  ```
@@ -734,6 +756,17 @@ const { data } = await client.updateRecipientPortalStatus(
734
756
  "email_bounce_reason": "string",
735
757
  "email_send_error": {},
736
758
  "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",
759
+ "email_open_count": 0,
760
+ "email_first_opened_at": "1970-01-01T00:00:00.000Z",
761
+ "email_last_opened_at": "1970-01-01T00:00:00.000Z",
762
+ "email_click_count": 0,
763
+ "email_first_clicked_at": "1970-01-01T00:00:00.000Z",
764
+ "email_clicked_links": [
765
+ {
766
+ "url": "string",
767
+ "clicked_at": "1970-01-01T00:00:00.000Z"
768
+ }
769
+ ],
737
770
  "updated_at": "1970-01-01T00:00:00.000Z"
738
771
  }
739
772
  ```
@@ -786,6 +819,17 @@ const { data } = await client.updateRecipientEntityUiStatus(
786
819
  "email_bounce_reason": "string",
787
820
  "email_send_error": {},
788
821
  "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",
822
+ "email_open_count": 0,
823
+ "email_first_opened_at": "1970-01-01T00:00:00.000Z",
824
+ "email_last_opened_at": "1970-01-01T00:00:00.000Z",
825
+ "email_click_count": 0,
826
+ "email_first_clicked_at": "1970-01-01T00:00:00.000Z",
827
+ "email_clicked_links": [
828
+ {
829
+ "url": "string",
830
+ "clicked_at": "1970-01-01T00:00:00.000Z"
831
+ }
832
+ ],
789
833
  "updated_at": "1970-01-01T00:00:00.000Z"
790
834
  }
791
835
  ```
@@ -832,6 +876,17 @@ const { data } = await client.restoreRecipientEntityUiStatus({
832
876
  "email_bounce_reason": "string",
833
877
  "email_send_error": {},
834
878
  "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",
879
+ "email_open_count": 0,
880
+ "email_first_opened_at": "1970-01-01T00:00:00.000Z",
881
+ "email_last_opened_at": "1970-01-01T00:00:00.000Z",
882
+ "email_click_count": 0,
883
+ "email_first_clicked_at": "1970-01-01T00:00:00.000Z",
884
+ "email_clicked_links": [
885
+ {
886
+ "url": "string",
887
+ "clicked_at": "1970-01-01T00:00:00.000Z"
888
+ }
889
+ ],
835
890
  "updated_at": "1970-01-01T00:00:00.000Z"
836
891
  }
837
892
  ```
@@ -885,6 +940,17 @@ const { data } = await client.getRecipients({
885
940
  "email_bounce_reason": "string",
886
941
  "email_send_error": {},
887
942
  "email_unsubscribed_at": "1970-01-01T00:00:00.000Z",
943
+ "email_open_count": 0,
944
+ "email_first_opened_at": "1970-01-01T00:00:00.000Z",
945
+ "email_last_opened_at": "1970-01-01T00:00:00.000Z",
946
+ "email_click_count": 0,
947
+ "email_first_clicked_at": "1970-01-01T00:00:00.000Z",
948
+ "email_clicked_links": [
949
+ {
950
+ "url": "string",
951
+ "clicked_at": "1970-01-01T00:00:00.000Z"
952
+ }
953
+ ],
888
954
  "updated_at": "1970-01-01T00:00:00.000Z"
889
955
  }
890
956
  ],
@@ -924,7 +990,11 @@ const { data } = await client.getEmailStats({
924
990
  "bounced_soft": 0,
925
991
  "complained": 0,
926
992
  "failed": 0,
927
- "unsubscribed": 0
993
+ "unsubscribed": 0,
994
+ "opened": 0,
995
+ "clicked": 0,
996
+ "total_opens": 0,
997
+ "total_clicks": 0
928
998
  }
929
999
  ```
930
1000
 
@@ -1326,6 +1396,15 @@ type Recipient = {
1326
1396
  email_bounce_reason?: string
1327
1397
  email_send_error?: Record<string, unknown>
1328
1398
  email_unsubscribed_at?: string // date-time
1399
+ email_open_count?: number
1400
+ email_first_opened_at?: string // date-time
1401
+ email_last_opened_at?: string // date-time
1402
+ email_click_count?: number
1403
+ email_first_clicked_at?: string // date-time
1404
+ email_clicked_links?: Array<{
1405
+ url: string
1406
+ clicked_at: string // date-time
1407
+ }>
1329
1408
  updated_at?: string // date-time
1330
1409
  }
1331
1410
  ```