@graph8/sdk 0.251.0 → 0.260.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/README.md +9 -2
  2. package/dist/cli.js +216 -0
  3. package/dist/index.d.mts +104 -7
  4. package/dist/index.d.ts +104 -7
  5. package/dist/index.js +44 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +44 -3
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/react.d.mts +102 -7
  10. package/dist/react.d.ts +102 -7
  11. package/dist/react.js +62 -11
  12. package/dist/react.js.map +1 -1
  13. package/dist/react.mjs +53 -12
  14. package/dist/react.mjs.map +1 -1
  15. package/dist/types/README.md +7 -0
  16. package/dist/types/agency.d.ts +20 -0
  17. package/dist/types/agentSetup.d.ts +57 -0
  18. package/dist/types/api.d.ts +127 -0
  19. package/dist/types/appClient.d.ts +99 -0
  20. package/dist/types/appPlatform.d.ts +269 -0
  21. package/dist/types/appTokens.d.ts +125 -0
  22. package/dist/types/apps.d.ts +130 -0
  23. package/dist/types/audiences.d.ts +88 -0
  24. package/dist/types/calendar.d.ts +55 -0
  25. package/dist/types/campaigns.d.ts +61 -0
  26. package/dist/types/chat.d.ts +35 -0
  27. package/dist/types/cli.d.ts +14 -0
  28. package/dist/types/companies.d.ts +123 -0
  29. package/dist/types/contacts.d.ts +200 -0
  30. package/dist/types/copilot.d.ts +31 -0
  31. package/dist/types/core.d.ts +1052 -0
  32. package/dist/types/deals.d.ts +215 -0
  33. package/dist/types/enrich.d.ts +51 -0
  34. package/dist/types/fields.d.ts +84 -0
  35. package/dist/types/forms.d.ts +16 -0
  36. package/dist/types/http.d.ts +141 -0
  37. package/dist/types/inbox.d.ts +123 -0
  38. package/dist/types/index.d.ts +63 -0
  39. package/dist/types/intent.d.ts +196 -0
  40. package/dist/types/lists.d.ts +44 -0
  41. package/dist/types/mailboxes.d.ts +240 -0
  42. package/dist/types/marketplace.d.ts +62 -0
  43. package/dist/types/meetings.d.ts +70 -0
  44. package/dist/types/newsletter.d.ts +212 -0
  45. package/dist/types/notes.d.ts +57 -0
  46. package/dist/types/objects.d.ts +281 -0
  47. package/dist/types/pipelines.d.ts +135 -0
  48. package/dist/types/quotes.d.ts +143 -0
  49. package/dist/types/react.d.ts +978 -0
  50. package/dist/types/search.d.ts +99 -0
  51. package/dist/types/sequences.d.ts +255 -0
  52. package/dist/types/signals.d.ts +28 -0
  53. package/dist/types/skills.d.ts +176 -0
  54. package/dist/types/snippet.d.ts +24 -0
  55. package/dist/types/studio.d.ts +161 -0
  56. package/dist/types/tasks.d.ts +101 -0
  57. package/dist/types/types.d.ts +45 -0
  58. package/dist/types/utils.d.ts +21 -0
  59. package/dist/types/version.d.ts +10 -0
  60. package/dist/types/visitors.d.ts +29 -0
  61. package/dist/types/voice.d.ts +304 -0
  62. package/dist/types/webhooks.d.ts +71 -0
  63. package/dist/types/workflows.d.ts +229 -0
  64. package/docs/agents.md +748 -0
  65. package/docs/api/README.md +165 -0
  66. package/docs/api/accounts.d.ts +396 -0
  67. package/docs/api/accounts.md +644 -0
  68. package/docs/api/adCampaigns.d.ts +707 -0
  69. package/docs/api/adCampaigns.md +1091 -0
  70. package/docs/api/adCreatives.d.ts +996 -0
  71. package/docs/api/adCreatives.md +1708 -0
  72. package/docs/api/agency.d.ts +556 -0
  73. package/docs/api/agency.md +845 -0
  74. package/docs/api/agent.d.ts +330 -0
  75. package/docs/api/agent.md +514 -0
  76. package/docs/api/agents.d.ts +1622 -0
  77. package/docs/api/agents.md +2860 -0
  78. package/docs/api/aiInbox.d.ts +1984 -0
  79. package/docs/api/aiInbox.md +3490 -0
  80. package/docs/api/analytics.d.ts +1273 -0
  81. package/docs/api/analytics.md +2095 -0
  82. package/docs/api/apiKeys.d.ts +252 -0
  83. package/docs/api/apiKeys.md +318 -0
  84. package/docs/api/appDeployments.d.ts +236 -0
  85. package/docs/api/appDeployments.md +471 -0
  86. package/docs/api/appDomains.d.ts +171 -0
  87. package/docs/api/appDomains.md +281 -0
  88. package/docs/api/appLogs.d.ts +120 -0
  89. package/docs/api/appLogs.md +159 -0
  90. package/docs/api/appObjects.d.ts +415 -0
  91. package/docs/api/appObjects.md +568 -0
  92. package/docs/api/appPages.d.ts +557 -0
  93. package/docs/api/appPages.md +796 -0
  94. package/docs/api/appPlatformTokens.d.ts +123 -0
  95. package/docs/api/appPlatformTokens.md +172 -0
  96. package/docs/api/appointments.d.ts +2361 -0
  97. package/docs/api/appointments.md +3917 -0
  98. package/docs/api/apps.d.ts +822 -0
  99. package/docs/api/apps.md +1342 -0
  100. package/docs/api/assertUpsert.d.ts +286 -0
  101. package/docs/api/assertUpsert.md +370 -0
  102. package/docs/api/audienceSyncs.d.ts +259 -0
  103. package/docs/api/audienceSyncs.md +395 -0
  104. package/docs/api/brandKit.d.ts +686 -0
  105. package/docs/api/brandKit.md +1133 -0
  106. package/docs/api/bugReports.d.ts +181 -0
  107. package/docs/api/bugReports.md +268 -0
  108. package/docs/api/by-path.md +3260 -0
  109. package/docs/api/calendarInvites.d.ts +117 -0
  110. package/docs/api/calendarInvites.md +148 -0
  111. package/docs/api/campaignWorkflows.d.ts +152 -0
  112. package/docs/api/campaignWorkflows.md +200 -0
  113. package/docs/api/campaigns.d.ts +721 -0
  114. package/docs/api/campaigns.md +1236 -0
  115. package/docs/api/channels.d.ts +171 -0
  116. package/docs/api/channels.md +235 -0
  117. package/docs/api/cliCampaigns.d.ts +205 -0
  118. package/docs/api/cliCampaigns.md +256 -0
  119. package/docs/api/cliPipelines.d.ts +324 -0
  120. package/docs/api/cliPipelines.md +562 -0
  121. package/docs/api/clickHouse.d.ts +115 -0
  122. package/docs/api/clickHouse.md +138 -0
  123. package/docs/api/companies.d.ts +1636 -0
  124. package/docs/api/companies.md +2211 -0
  125. package/docs/api/companyIntelligence.d.ts +299 -0
  126. package/docs/api/companyIntelligence.md +488 -0
  127. package/docs/api/contacts.d.ts +2173 -0
  128. package/docs/api/contacts.md +3143 -0
  129. package/docs/api/content.d.ts +968 -0
  130. package/docs/api/content.md +1667 -0
  131. package/docs/api/contentGridSkills.d.ts +177 -0
  132. package/docs/api/contentGridSkills.md +271 -0
  133. package/docs/api/copilot.d.ts +1017 -0
  134. package/docs/api/copilot.md +1765 -0
  135. package/docs/api/crmSyncs.d.ts +215 -0
  136. package/docs/api/crmSyncs.md +301 -0
  137. package/docs/api/customerSuccess.d.ts +491 -0
  138. package/docs/api/customerSuccess.md +776 -0
  139. package/docs/api/deals.d.ts +1696 -0
  140. package/docs/api/deals.md +2432 -0
  141. package/docs/api/deliverability.d.ts +418 -0
  142. package/docs/api/deliverability.md +677 -0
  143. package/docs/api/desk.d.ts +1765 -0
  144. package/docs/api/desk.md +3007 -0
  145. package/docs/api/dialer.d.ts +1185 -0
  146. package/docs/api/dialer.md +2166 -0
  147. package/docs/api/dialerAnalytics.d.ts +187 -0
  148. package/docs/api/dialerAnalytics.md +257 -0
  149. package/docs/api/documents.d.ts +895 -0
  150. package/docs/api/documents.md +1440 -0
  151. package/docs/api/duplicates.d.ts +195 -0
  152. package/docs/api/duplicates.md +315 -0
  153. package/docs/api/eSign.d.ts +38 -0
  154. package/docs/api/eSign.md +54 -0
  155. package/docs/api/eSignature.d.ts +242 -0
  156. package/docs/api/eSignature.md +341 -0
  157. package/docs/api/enrichment.d.ts +3207 -0
  158. package/docs/api/enrichment.md +5225 -0
  159. package/docs/api/events.d.ts +115 -0
  160. package/docs/api/events.md +105 -0
  161. package/docs/api/fields.d.ts +482 -0
  162. package/docs/api/fields.md +566 -0
  163. package/docs/api/forms.d.ts +1012 -0
  164. package/docs/api/forms.md +1542 -0
  165. package/docs/api/gtmCampaigns.d.ts +662 -0
  166. package/docs/api/gtmCampaigns.md +1044 -0
  167. package/docs/api/gtmContext.d.ts +1187 -0
  168. package/docs/api/gtmContext.md +2112 -0
  169. package/docs/api/gtmDeliverability.d.ts +60 -0
  170. package/docs/api/gtmDeliverability.md +63 -0
  171. package/docs/api/gtmKnowledgeBase.d.ts +76 -0
  172. package/docs/api/gtmKnowledgeBase.md +91 -0
  173. package/docs/api/gtmLaunchHelpers.d.ts +123 -0
  174. package/docs/api/gtmLaunchHelpers.md +148 -0
  175. package/docs/api/gtmLibrary.d.ts +448 -0
  176. package/docs/api/gtmLibrary.md +780 -0
  177. package/docs/api/health.d.ts +39 -0
  178. package/docs/api/health.md +58 -0
  179. package/docs/api/imageLibrary.d.ts +341 -0
  180. package/docs/api/imageLibrary.md +569 -0
  181. package/docs/api/imports.d.ts +157 -0
  182. package/docs/api/imports.md +174 -0
  183. package/docs/api/inbox.d.ts +709 -0
  184. package/docs/api/inbox.md +1067 -0
  185. package/docs/api/install.d.ts +213 -0
  186. package/docs/api/install.md +317 -0
  187. package/docs/api/installedApps.d.ts +131 -0
  188. package/docs/api/installedApps.md +241 -0
  189. package/docs/api/integrationStatus.d.ts +142 -0
  190. package/docs/api/integrationStatus.md +205 -0
  191. package/docs/api/integrations.d.ts +2327 -0
  192. package/docs/api/integrations.md +3791 -0
  193. package/docs/api/intent.d.ts +482 -0
  194. package/docs/api/intent.md +858 -0
  195. package/docs/api/knowledge.d.ts +501 -0
  196. package/docs/api/knowledge.md +843 -0
  197. package/docs/api/knowledgeBase.d.ts +84 -0
  198. package/docs/api/knowledgeBase.md +96 -0
  199. package/docs/api/landingPages.d.ts +1411 -0
  200. package/docs/api/landingPages.md +2488 -0
  201. package/docs/api/leads.d.ts +133 -0
  202. package/docs/api/leads.md +180 -0
  203. package/docs/api/library.d.ts +217 -0
  204. package/docs/api/library.md +338 -0
  205. package/docs/api/linkedIn.d.ts +227 -0
  206. package/docs/api/linkedIn.md +289 -0
  207. package/docs/api/linkedInOutreach.d.ts +727 -0
  208. package/docs/api/linkedInOutreach.md +990 -0
  209. package/docs/api/lists.d.ts +1106 -0
  210. package/docs/api/lists.md +1609 -0
  211. package/docs/api/logs.d.ts +71 -0
  212. package/docs/api/logs.md +70 -0
  213. package/docs/api/mailboxes.d.ts +1050 -0
  214. package/docs/api/mailboxes.md +1690 -0
  215. package/docs/api/marketingIntelligence.d.ts +256 -0
  216. package/docs/api/marketingIntelligence.md +454 -0
  217. package/docs/api/marketplace.d.ts +3173 -0
  218. package/docs/api/marketplace.md +5953 -0
  219. package/docs/api/mcp.d.ts +69 -0
  220. package/docs/api/mcp.md +69 -0
  221. package/docs/api/me.d.ts +54 -0
  222. package/docs/api/me.md +56 -0
  223. package/docs/api/meetings.d.ts +539 -0
  224. package/docs/api/meetings.md +747 -0
  225. package/docs/api/newsletter.d.ts +1613 -0
  226. package/docs/api/newsletter.md +2746 -0
  227. package/docs/api/notes.d.ts +517 -0
  228. package/docs/api/notes.md +888 -0
  229. package/docs/api/notifications.d.ts +94 -0
  230. package/docs/api/notifications.md +105 -0
  231. package/docs/api/objects.d.ts +621 -0
  232. package/docs/api/objects.md +1098 -0
  233. package/docs/api/openSearch.d.ts +234 -0
  234. package/docs/api/openSearch.md +297 -0
  235. package/docs/api/ops.d.ts +299 -0
  236. package/docs/api/ops.md +339 -0
  237. package/docs/api/orgGovernance.d.ts +393 -0
  238. package/docs/api/orgGovernance.md +623 -0
  239. package/docs/api/orgVideos.d.ts +184 -0
  240. package/docs/api/orgVideos.md +252 -0
  241. package/docs/api/organizationSettings.d.ts +626 -0
  242. package/docs/api/organizationSettings.md +911 -0
  243. package/docs/api/phoneNumbers.d.ts +484 -0
  244. package/docs/api/phoneNumbers.md +777 -0
  245. package/docs/api/profile.d.ts +329 -0
  246. package/docs/api/profile.md +540 -0
  247. package/docs/api/programmaticPages.d.ts +400 -0
  248. package/docs/api/programmaticPages.md +626 -0
  249. package/docs/api/providerDomains.d.ts +866 -0
  250. package/docs/api/providerDomains.md +1446 -0
  251. package/docs/api/providerUsage.d.ts +129 -0
  252. package/docs/api/providerUsage.md +186 -0
  253. package/docs/api/public.d.ts +69 -0
  254. package/docs/api/public.md +78 -0
  255. package/docs/api/publicCopilot.d.ts +67 -0
  256. package/docs/api/publicCopilot.md +80 -0
  257. package/docs/api/publicSignals.d.ts +66 -0
  258. package/docs/api/publicSignals.md +71 -0
  259. package/docs/api/publicVisitors.d.ts +97 -0
  260. package/docs/api/publicVisitors.md +118 -0
  261. package/docs/api/quotes.d.ts +1564 -0
  262. package/docs/api/quotes.md +2553 -0
  263. package/docs/api/radar.d.ts +808 -0
  264. package/docs/api/radar.md +1431 -0
  265. package/docs/api/radarReports.d.ts +208 -0
  266. package/docs/api/radarReports.md +306 -0
  267. package/docs/api/recordRoles.d.ts +143 -0
  268. package/docs/api/recordRoles.md +175 -0
  269. package/docs/api/repos.d.ts +146 -0
  270. package/docs/api/repos.md +211 -0
  271. package/docs/api/research.d.ts +295 -0
  272. package/docs/api/research.md +534 -0
  273. package/docs/api/revenue.d.ts +402 -0
  274. package/docs/api/revenue.md +608 -0
  275. package/docs/api/revenueAnalytics.d.ts +147 -0
  276. package/docs/api/revenueAnalytics.md +212 -0
  277. package/docs/api/revenueLifecycle.d.ts +207 -0
  278. package/docs/api/revenueLifecycle.md +274 -0
  279. package/docs/api/revenueRecords.d.ts +372 -0
  280. package/docs/api/revenueRecords.md +563 -0
  281. package/docs/api/roles.d.ts +431 -0
  282. package/docs/api/roles.md +812 -0
  283. package/docs/api/salesCoach.d.ts +877 -0
  284. package/docs/api/salesCoach.md +1540 -0
  285. package/docs/api/sandbox.d.ts +210 -0
  286. package/docs/api/sandbox.md +380 -0
  287. package/docs/api/scans.d.ts +104 -0
  288. package/docs/api/scans.md +136 -0
  289. package/docs/api/scheduleBuy.d.ts +293 -0
  290. package/docs/api/scheduleBuy.md +431 -0
  291. package/docs/api/scraping.d.ts +266 -0
  292. package/docs/api/scraping.md +383 -0
  293. package/docs/api/sdrAnalytics.d.ts +138 -0
  294. package/docs/api/sdrAnalytics.md +246 -0
  295. package/docs/api/search.d.ts +598 -0
  296. package/docs/api/search.md +866 -0
  297. package/docs/api/seo.d.ts +447 -0
  298. package/docs/api/seo.md +660 -0
  299. package/docs/api/sequenceLifecycle.d.ts +439 -0
  300. package/docs/api/sequenceLifecycle.md +513 -0
  301. package/docs/api/sequences.d.ts +1936 -0
  302. package/docs/api/sequences.md +3232 -0
  303. package/docs/api/settings.d.ts +448 -0
  304. package/docs/api/settings.md +731 -0
  305. package/docs/api/signals.d.ts +1441 -0
  306. package/docs/api/signals.md +2526 -0
  307. package/docs/api/signatures.d.ts +719 -0
  308. package/docs/api/signatures.md +1247 -0
  309. package/docs/api/skills.d.ts +230 -0
  310. package/docs/api/skills.md +466 -0
  311. package/docs/api/snippet.d.ts +85 -0
  312. package/docs/api/snippet.md +106 -0
  313. package/docs/api/socialPublishing.d.ts +824 -0
  314. package/docs/api/socialPublishing.md +1245 -0
  315. package/docs/api/studioDocuments.d.ts +244 -0
  316. package/docs/api/studioDocuments.md +348 -0
  317. package/docs/api/support.d.ts +90 -0
  318. package/docs/api/support.md +76 -0
  319. package/docs/api/suppressions.d.ts +241 -0
  320. package/docs/api/suppressions.md +343 -0
  321. package/docs/api/surveys.d.ts +847 -0
  322. package/docs/api/surveys.md +1223 -0
  323. package/docs/api/tasks.d.ts +813 -0
  324. package/docs/api/tasks.md +1344 -0
  325. package/docs/api/teamMembers.d.ts +668 -0
  326. package/docs/api/teamMembers.md +1040 -0
  327. package/docs/api/teams.d.ts +784 -0
  328. package/docs/api/teams.md +1395 -0
  329. package/docs/api/usage.d.ts +277 -0
  330. package/docs/api/usage.md +389 -0
  331. package/docs/api/visitors.d.ts +690 -0
  332. package/docs/api/visitors.md +1075 -0
  333. package/docs/api/voice.d.ts +4661 -0
  334. package/docs/api/voice.md +7905 -0
  335. package/docs/api/webAnalytics.d.ts +964 -0
  336. package/docs/api/webAnalytics.md +1452 -0
  337. package/docs/api/webChat.d.ts +1704 -0
  338. package/docs/api/webChat.md +2048 -0
  339. package/docs/api/webhooks.d.ts +251 -0
  340. package/docs/api/webhooks.md +386 -0
  341. package/docs/api/websiteEditor.d.ts +324 -0
  342. package/docs/api/websiteEditor.md +517 -0
  343. package/docs/api/work.d.ts +2298 -0
  344. package/docs/api/work.md +3096 -0
  345. package/docs/api/workbench.d.ts +2962 -0
  346. package/docs/api/workbench.md +4884 -0
  347. package/docs/api/workflows.d.ts +1218 -0
  348. package/docs/api/workflows.md +2302 -0
  349. package/docs/sdk-clients.md +4339 -0
  350. package/package.json +10 -3
@@ -0,0 +1,2746 @@
1
+ <!-- Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. -->
2
+
3
+ # `g8.api.newsletter`: Newsletter
4
+
5
+ 61 operations (19 read, 18 write, 5 destructive, 7 billable, 12 external).
6
+
7
+ 15 of these also have a hand-written method (`g8.newsletter`), marked **★** below. Prefer the hand-written method when one exists: it unwraps the `data` envelope and takes friendlier arguments. See [../sdk-clients.md](../sdk-clients.md).
8
+
9
+ Every example below assumes this setup (server-side, API key):
10
+
11
+ ```ts
12
+ import { g8 } from "@graph8/sdk";
13
+
14
+ g8.init({ apiKey: process.env.G8_API_KEY! });
15
+ ```
16
+
17
+ Example values are placeholders that match each field's type. Only required fields are shown. Every example is type-checked against the SDK in CI.
18
+
19
+ Exact TypeScript types for every operation on this page, and every schema they use: [newsletter.d.ts](newsletter.d.ts).
20
+
21
+ ## Operations
22
+
23
+ | Call | HTTP | Tier | Scope | Summary |
24
+ |---|---|---|---|---|
25
+ | [`activateNewsletter`](#op-activatenewsletter) | `POST /api/v1/newsletters/{newsletter_id}/activate` | external | `newsletter:run` | Activate Newsletter |
26
+ | [`addSubscriber`](#op-addsubscriber) ★ | `POST /api/v1/newsletters/{newsletter_id}/subscribers` | external | `newsletter:run` | Add Subscriber |
27
+ | [`batchTemplateGenerationStatus`](#op-batchtemplategenerationstatus) | `POST /api/v1/newsletters/templates/generation-status` | read | `newsletter:read` | Batch Template Generation Status |
28
+ | [`cancelSend`](#op-cancelsend) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send/cancel` | write | `newsletter:write` | Cancel Send |
29
+ | [`cloneTemplate`](#op-clonetemplate) | `POST /api/v1/newsletters/templates/clone` | billable | `newsletter:run` | Clone Template |
30
+ | [`completeNewsletter`](#op-completenewsletter) | `POST /api/v1/newsletters/{newsletter_id}/complete` | write | `newsletter:write` | Complete Newsletter |
31
+ | [`createIssue`](#op-createissue) ★ | `POST /api/v1/newsletters/{newsletter_id}/issues` | external | `newsletter:run` | Create Issue |
32
+ | [`createNewsletter`](#op-createnewsletter) ★ | `POST /api/v1/newsletters` | external | `newsletter:run` | Create Newsletter |
33
+ | [`createTemplateFromLayout`](#op-createtemplatefromlayout) | `POST /api/v1/newsletters/templates/layout` | billable | `newsletter:run` | Create Template From Layout |
34
+ | [`createTemplateFromPrompt`](#op-createtemplatefromprompt) | `POST /api/v1/newsletters/templates/custom` | billable | `newsletter:run` | Create Template From Prompt |
35
+ | [`deleteIssue`](#op-deleteissue) | `DELETE /api/v1/newsletters/{newsletter_id}/issues/{issue_id}` | destructive | `newsletter:delete` | Delete Issue |
36
+ | [`deleteNewsletterTemplate`](#op-deletenewslettertemplate) | `DELETE /api/v1/newsletters/templates/{template_id}` | destructive | `newsletter:delete` | Delete Newsletter Template |
37
+ | [`deleteSubscriber`](#op-deletesubscriber) | `DELETE /api/v1/newsletters/{newsletter_id}/subscribers/{subscriber_id}` | destructive | `newsletter:delete` | Delete Subscriber |
38
+ | [`disableNewsletterListSync`](#op-disablenewsletterlistsync) | `DELETE /api/v1/newsletters/{newsletter_id}/list-syncs/{audience_list_id}` | destructive | `newsletter:delete` | Disable Newsletter List Sync |
39
+ | [`duplicateIssue`](#op-duplicateissue) ★ | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/duplicate` | external | `newsletter:run` | Duplicate Issue |
40
+ | [`enableNewsletterListSync`](#op-enablenewsletterlistsync) | `POST /api/v1/newsletters/{newsletter_id}/list-syncs` | write | `newsletter:write` | Enable Newsletter List Sync |
41
+ | [`generateNewsletterIssue`](#op-generatenewsletterissue) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/generate` | billable | `newsletter:run` | Generate Newsletter Issue |
42
+ | [`getIssue`](#op-getissue) ★ | `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}` | read | `newsletter:read` | Get Issue |
43
+ | [`getIssueAnalyticsKpis`](#op-getissueanalyticskpis) ★ | `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/analytics/kpis` | read | `newsletter:read` | Get Issue Analytics Kpis |
44
+ | [`getIssueGenerationStatus`](#op-getissuegenerationstatus) | `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/generation-status` | read | `newsletter:read` | Get Issue Generation Status |
45
+ | [`getNewsletter`](#op-getnewsletter) ★ | `GET /api/v1/newsletters/{newsletter_id}` | read | `newsletter:read` | Get Newsletter |
46
+ | [`getNewsletterIssueConversation`](#op-getnewsletterissueconversation) | `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/conversation` | read | `newsletter:read` | Get Newsletter Issue Conversation |
47
+ | [`getNewsletterSettings`](#op-getnewslettersettings) | `GET /api/v1/newsletters/{newsletter_id}/settings` | read | `newsletter:read` | Get Newsletter Settings |
48
+ | [`getNewsletterSubscriberVerification`](#op-getnewslettersubscriberverification) | `GET /api/v1/newsletters/{newsletter_id}/subscribers/verify/status` | read | `newsletter:read` | Get Newsletter Subscriber Verification |
49
+ | [`getSendStatus`](#op-getsendstatus) | `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send` | read | `newsletter:read` | Get Send Status |
50
+ | [`getSubscriberTimeline`](#op-getsubscribertimeline) | `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/analytics/subscribers/{subscriber_id}/timeline` | read | `newsletter:read` | Get Subscriber Timeline |
51
+ | [`importSubscribersFromAudience`](#op-importsubscribersfromaudience) | `POST /api/v1/newsletters/{newsletter_id}/subscribers/import-audience` | billable | `newsletter:run` | Import Subscribers From Audience |
52
+ | [`linkNewsletterCampaign`](#op-linknewslettercampaign) | `PUT /api/v1/newsletters/{newsletter_id}/campaign` | write | `newsletter:write` | Link Newsletter Campaign |
53
+ | [`listIssues`](#op-listissues) ★ | `GET /api/v1/newsletters/{newsletter_id}/issues` | read | `newsletter:read` | List Issues |
54
+ | [`listNewsletterIssueVersions`](#op-listnewsletterissueversions) | `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/versions` | read | `newsletter:read` | List Newsletter Issue Versions |
55
+ | [`listNewsletterListSyncs`](#op-listnewsletterlistsyncs) | `GET /api/v1/newsletters/{newsletter_id}/list-syncs` | read | `newsletter:read` | List Newsletter List Syncs |
56
+ | [`listNewsletters`](#op-listnewsletters) ★ | `GET /api/v1/newsletters` | read | `newsletter:read` | List Newsletters |
57
+ | [`listSubscribers`](#op-listsubscribers) ★ | `GET /api/v1/newsletters/{newsletter_id}/subscribers` | read | `newsletter:read` | List Subscribers |
58
+ | [`listTemplates`](#op-listtemplates) ★ | `GET /api/v1/newsletters/templates` | read | `newsletter:read` | List Templates |
59
+ | [`newsletterDomainStatus`](#op-newsletterdomainstatus) | `GET /api/v1/newsletters/{newsletter_id}/settings/domain-status` | read | `newsletter:read` | Newsletter Domain Status |
60
+ | [`pauseNewsletter`](#op-pausenewsletter) | `POST /api/v1/newsletters/{newsletter_id}/pause` | write | `newsletter:write` | Pause Newsletter |
61
+ | [`pauseSend`](#op-pausesend) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send/pause` | write | `newsletter:write` | Pause Send |
62
+ | [`previewNewsletterSubscriberVerification`](#op-previewnewslettersubscriberverification) | `POST /api/v1/newsletters/{newsletter_id}/subscribers/verify/preview` | read | `newsletter:read` | Preview Newsletter Subscriber Verification |
63
+ | [`restoreNewsletterIssueVersion`](#op-restorenewsletterissueversion) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/versions/{version_num}/restore` | write | `newsletter:write` | Restore Newsletter Issue Version |
64
+ | [`resumeNewsletter`](#op-resumenewsletter) | `POST /api/v1/newsletters/{newsletter_id}/resume` | external | `newsletter:run` | Resume Newsletter |
65
+ | [`resumeSend`](#op-resumesend) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send/resume` | external | `newsletter:run` | Resume Send |
66
+ | [`rewriteIssueText`](#op-rewriteissuetext) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/rewrite-text` | billable | `newsletter:run` | Rewrite Issue Text |
67
+ | [`runNewsletterListSync`](#op-runnewsletterlistsync) | `POST /api/v1/newsletters/{newsletter_id}/list-syncs/{audience_list_id}/run` | write | `newsletter:write` | Run Newsletter List Sync |
68
+ | [`sendIssue`](#op-sendissue) ★ | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send` | external | `newsletter:run` | Send Issue |
69
+ | [`sendTestEmail`](#op-sendtestemail) ★ | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send-test` | external | `newsletter:run` | Send Test Email |
70
+ | [`setIssueButtonAction`](#op-setissuebuttonaction) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/set-button-action` | write | `newsletter:write` | Set Issue Button Action |
71
+ | [`setIssueMediaEdit`](#op-setissuemediaedit) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/set-media-edit` | write | `newsletter:write` | Set Issue Media Edit |
72
+ | [`setIssueText`](#op-setissuetext) | `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/set-text` | write | `newsletter:write` | Set Issue Text |
73
+ | [`setTemplateApproval`](#op-settemplateapproval) | `POST /api/v1/newsletters/templates/{template_id}/approval` | write | `newsletter:write` | Set Template Approval |
74
+ | [`setTemplateButtonAction`](#op-settemplatebuttonaction) | `POST /api/v1/newsletters/templates/{template_id}/set-button-action` | write | `newsletter:write` | Set Template Button Action |
75
+ | [`setTemplateMediaEdit`](#op-settemplatemediaedit) | `POST /api/v1/newsletters/templates/{template_id}/set-media-edit` | write | `newsletter:write` | Set Template Media Edit |
76
+ | [`templateGenerationStatus`](#op-templategenerationstatus) | `GET /api/v1/newsletters/templates/{template_id}/generation-status` | read | `newsletter:read` | Template Generation Status |
77
+ | [`unlinkNewsletterCampaign`](#op-unlinknewslettercampaign) | `DELETE /api/v1/newsletters/{newsletter_id}/campaign` | destructive | `newsletter:delete` | Unlink Newsletter Campaign |
78
+ | [`unsubscribeSubscriber`](#op-unsubscribesubscriber) ★ | `PATCH /api/v1/newsletters/{newsletter_id}/subscribers/{subscriber_id}/unsubscribe` | external | `newsletter:run` | Unsubscribe Subscriber |
79
+ | [`updateIssue`](#op-updateissue) ★ | `PUT /api/v1/newsletters/{newsletter_id}/issues/{issue_id}` | external | `newsletter:run` | Update Issue |
80
+ | [`updateNewsletter`](#op-updatenewsletter) | `PATCH /api/v1/newsletters/{newsletter_id}` | write | `newsletter:write` | Update Newsletter |
81
+ | [`updateNewsletterSettings`](#op-updatenewslettersettings) | `PUT /api/v1/newsletters/{newsletter_id}/settings` | write | `newsletter:write` | Update Newsletter Settings |
82
+ | [`updateNewsletterTemplate`](#op-updatenewslettertemplate) | `PATCH /api/v1/newsletters/templates/{template_id}` | write | `newsletter:write` | Update Newsletter Template |
83
+ | [`useTemplate`](#op-usetemplate) | `POST /api/v1/newsletters/templates/{template_id}/use` | write | `newsletter:write` | Use Template |
84
+ | [`verifyNewsletterDomain`](#op-verifynewsletterdomain) | `POST /api/v1/newsletters/{newsletter_id}/settings/verify-domain` | external | `newsletter:run` | Verify Newsletter Domain |
85
+ | [`verifyNewsletterSubscribers`](#op-verifynewslettersubscribers) | `POST /api/v1/newsletters/{newsletter_id}/subscribers/verify` | billable | `newsletter:run` | Verify Newsletter Subscribers |
86
+
87
+ ---
88
+
89
+ <a id="op-activatenewsletter"></a>
90
+
91
+ ### `g8.api.newsletter.activateNewsletter(input)`
92
+
93
+ **Activate Newsletter**
94
+
95
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/activate`
96
+ - operationId: `activate_newsletter_newsletters__newsletter_id__activate_post` (also callable as `g8.api.call("activate_newsletter_newsletters__newsletter_id__activate_post", input)`)
97
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
98
+ - API-key scope: `newsletter:run`
99
+
100
+ Take a draft newsletter live. LAUNCH-CLASS.
101
+
102
+ Once active, the scheduler will send any issue whose scheduled time has
103
+ passed - so this is not a metadata change, it is the switch that lets mail
104
+ leave the building. Gated on `campaigns:launch`, the same permission the
105
+ in-app route requires.
106
+
107
+ **Input**
108
+
109
+ | Field | Type | Required | Description |
110
+ |---|---|---|---|
111
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
112
+
113
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
114
+
115
+ Other envelope fields: `pagination` (PaginationMeta).
116
+
117
+ **Example**
118
+
119
+ ```ts
120
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
121
+ const result = await g8.api.newsletter.activateNewsletter({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
122
+ ```
123
+
124
+ ---
125
+
126
+ <a id="op-addsubscriber"></a>
127
+
128
+ ### `g8.api.newsletter.addSubscriber(input)`
129
+
130
+ **Add Subscriber**
131
+
132
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/subscribers`
133
+ - operationId: `add_subscriber_newsletters__newsletter_id__subscribers_post` (also callable as `g8.api.call("add_subscriber_newsletters__newsletter_id__subscribers_post", input)`)
134
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
135
+ - API-key scope: `newsletter:run`
136
+ - ★ Hand-written: [`g8.newsletter.addSubscriber()`](../sdk-clients.md#g8-newsletter-addsubscriber)
137
+
138
+ Add a single subscriber (staff action, status=subscribed). Also
139
+ creates/links a first-class CRM contact so the subscriber joins the
140
+ central suppression model (mirrors the manual public subscribe form).
141
+
142
+ **Input**
143
+
144
+ | Field | Type | Required | Description |
145
+ |---|---|---|---|
146
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
147
+ | `body` | `SubscriberAddRequest` | yes | Request body; fields below. |
148
+
149
+ Body fields (`SubscriberAddRequest`):
150
+
151
+ | Field | Type | Required | Description |
152
+ |---|---|---|---|
153
+ | `body.email` | `string` | yes | max length 255 |
154
+ | `body.first_name` | `string \| null` | no | max length 255 |
155
+ | `body.last_name` | `string \| null` | no | max length 255 |
156
+
157
+ **Returns** `ApiResponse_SubscriberSummary_`: the envelope `{ data: SubscriberSummary, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
158
+
159
+ Other envelope fields: `pagination` (PaginationMeta).
160
+
161
+ `SubscriberSummary` fields:
162
+
163
+ | Field | Type | Required | Description |
164
+ |---|---|---|---|
165
+ | `created_at` | `string \| null` | no | |
166
+ | `email` | `string \| null` | no | |
167
+ | `first_name` | `string \| null` | no | |
168
+ | `id` | `integer \| null` | no | |
169
+ | `last_name` | `string \| null` | no | |
170
+ | `status` | `string \| null` | no | |
171
+ | `verification_status` | `string \| null` | no | |
172
+
173
+ **Example**
174
+
175
+ ```ts
176
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
177
+ const result = await g8.api.newsletter.addSubscriber({
178
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
179
+ body: { email: "jane@acme.com" },
180
+ });
181
+ ```
182
+
183
+ ---
184
+
185
+ <a id="op-batchtemplategenerationstatus"></a>
186
+
187
+ ### `g8.api.newsletter.batchTemplateGenerationStatus(input)`
188
+
189
+ **Batch Template Generation Status**
190
+
191
+ - HTTP: `POST /api/v1/newsletters/templates/generation-status`
192
+ - operationId: `batch_template_generation_status_newsletters_templates_generation_status_post` (also callable as `g8.api.call("batch_template_generation_status_newsletters_templates_generation_status_post", input)`)
193
+ - Tier: `read`: reads data; safe to call and to retry
194
+ - API-key scope: `newsletter:read`
195
+
196
+ Poll many template builds at once.
197
+
198
+ A POST because the id list is the request, not a filter. Capped at 200 ids
199
+ - the cap is the app's, and it exists because this is polled every couple
200
+ of seconds.
201
+
202
+ **Input**
203
+
204
+ | Field | Type | Required | Description |
205
+ |---|---|---|---|
206
+ | `body` | `TemplateGenerationStatusBatchRequest` | yes | Request body; fields below. |
207
+
208
+ Body fields (`TemplateGenerationStatusBatchRequest`):
209
+
210
+ | Field | Type | Required | Description |
211
+ |---|---|---|---|
212
+ | `body.template_ids` | `Array<integer>` | yes | max items 200 |
213
+
214
+ **Returns** `ApiResponse_NewsletterListPayload_`: the envelope `{ data: NewsletterListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
215
+
216
+ Other envelope fields: `pagination` (PaginationMeta).
217
+
218
+ `NewsletterListPayload` fields:
219
+
220
+ | Field | Type | Required | Description |
221
+ |---|---|---|---|
222
+ | `items` | `Array<unknown>` | no | |
223
+
224
+ **Example**
225
+
226
+ ```ts
227
+ const result = await g8.api.newsletter.batchTemplateGenerationStatus({ body: { template_ids: [123] } });
228
+ ```
229
+
230
+ ---
231
+
232
+ <a id="op-cancelsend"></a>
233
+
234
+ ### `g8.api.newsletter.cancelSend(input)`
235
+
236
+ **Cancel Send**
237
+
238
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send/cancel`
239
+ - operationId: `cancel_send_newsletters__newsletter_id__issues__issue_id__send_cancel_post` (also callable as `g8.api.call("cancel_send_newsletters__newsletter_id__issues__issue_id__send_cancel_post", input)`)
240
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
241
+ - API-key scope: `newsletter:write`
242
+
243
+ Abandon a send for good.
244
+
245
+ Unlike pause, there is no resuming from here: whoever has already received
246
+ the issue has received it, and nobody else will. Ungated for the same
247
+ reason pause is.
248
+
249
+ **Input**
250
+
251
+ | Field | Type | Required | Description |
252
+ |---|---|---|---|
253
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
254
+ | `path.issue_id` | `integer` | yes | Issue id. |
255
+ | `body` | `SendControlRequest` | no | Request body; fields below. |
256
+
257
+ Body fields (`SendControlRequest`):
258
+
259
+ | Field | Type | Required | Description |
260
+ |---|---|---|---|
261
+ | `body.reason` | `string \| null` | no | |
262
+
263
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
264
+
265
+ Other envelope fields: `pagination` (PaginationMeta).
266
+
267
+ **Example**
268
+
269
+ ```ts
270
+ const result = await g8.api.newsletter.cancelSend({
271
+ path: {
272
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
273
+ issue_id: 123,
274
+ },
275
+ });
276
+ ```
277
+
278
+ ---
279
+
280
+ <a id="op-clonetemplate"></a>
281
+
282
+ ### `g8.api.newsletter.cloneTemplate(input)`
283
+
284
+ **Clone Template**
285
+
286
+ - HTTP: `POST /api/v1/newsletters/templates/clone`
287
+ - operationId: `clone_template_newsletters_templates_clone_post` (also callable as `g8.api.call("clone_template_newsletters_templates_clone_post", input)`)
288
+ - Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
289
+ - API-key scope: `newsletter:run`
290
+
291
+ Import an existing email as a template.
292
+
293
+ `source` decides which of `url`, `issue_id` and `html` is read - the other
294
+ two are ignored rather than rejected, so sending all three is not an error
295
+ and not a merge.
296
+
297
+ **Input**
298
+
299
+ | Field | Type | Required | Description |
300
+ |---|---|---|---|
301
+ | `body` | `TemplateCloneRequest` | yes | Request body; fields below. |
302
+
303
+ Body fields (`TemplateCloneRequest`):
304
+
305
+ | Field | Type | Required | Description |
306
+ |---|---|---|---|
307
+ | `body.source` | `string` | yes | `url`, `past_issue` or `html`. |
308
+ | `body.html` | `string \| null` | no | |
309
+ | `body.issue_id` | `string \| null` | no | |
310
+ | `body.keep_images` | `boolean` | no | Keep the original images rather than dropping them. default `false` |
311
+ | `body.reskin` | `boolean` | no | Restyle the import to the org's brand. default `true` |
312
+ | `body.url` | `string \| null` | no | |
313
+
314
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
315
+
316
+ Other envelope fields: `pagination` (PaginationMeta).
317
+
318
+ **Example**
319
+
320
+ ```ts
321
+ // billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
322
+ const result = await g8.api.newsletter.cloneTemplate({ body: { source: "example" } });
323
+ ```
324
+
325
+ ---
326
+
327
+ <a id="op-completenewsletter"></a>
328
+
329
+ ### `g8.api.newsletter.completeNewsletter(input)`
330
+
331
+ **Complete Newsletter**
332
+
333
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/complete`
334
+ - operationId: `complete_newsletter_newsletters__newsletter_id__complete_post` (also callable as `g8.api.call("complete_newsletter_newsletters__newsletter_id__complete_post", input)`)
335
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
336
+ - API-key scope: `newsletter:write`
337
+
338
+ Mark a newsletter completed. Terminal - it stops sending for good.
339
+
340
+ The internal handler validates the transition, so an illegal move from the
341
+ current status is refused there rather than silently applied.
342
+
343
+ **Input**
344
+
345
+ | Field | Type | Required | Description |
346
+ |---|---|---|---|
347
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
348
+
349
+ **Returns** `ApiResponse_NewsletterStatusResponse_`: the envelope `{ data: NewsletterStatusResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
350
+
351
+ Other envelope fields: `pagination` (PaginationMeta).
352
+
353
+ `NewsletterStatusResponse` fields:
354
+
355
+ | Field | Type | Required | Description |
356
+ |---|---|---|---|
357
+ | `id` | `string \| null` | no | |
358
+ | `status` | `string \| null` | no | Status after the transition, e.g. `paused`, `completed`. |
359
+
360
+ **Example**
361
+
362
+ ```ts
363
+ const result = await g8.api.newsletter.completeNewsletter({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
364
+ ```
365
+
366
+ ---
367
+
368
+ <a id="op-createissue"></a>
369
+
370
+ ### `g8.api.newsletter.createIssue(input)`
371
+
372
+ **Create Issue**
373
+
374
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues`
375
+ - operationId: `create_issue_newsletters__newsletter_id__issues_post` (also callable as `g8.api.call("create_issue_newsletters__newsletter_id__issues_post", input)`)
376
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
377
+ - API-key scope: `newsletter:run`
378
+ - ★ Hand-written: [`g8.newsletter.createIssue()`](../sdk-clients.md#g8-newsletter-createissue)
379
+
380
+ Create a draft newsletter issue.
381
+
382
+ **Input**
383
+
384
+ | Field | Type | Required | Description |
385
+ |---|---|---|---|
386
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
387
+ | `body` | `IssueCreateRequest` | yes | Request body; fields below. |
388
+
389
+ Body fields (`IssueCreateRequest`):
390
+
391
+ | Field | Type | Required | Description |
392
+ |---|---|---|---|
393
+ | `body.html_body` | `string` | yes | |
394
+ | `body.subject` | `string` | yes | max length 2000 |
395
+ | `body.plain_text` | `string \| null` | no | |
396
+ | `body.preview_text` | `string \| null` | no | max length 500 |
397
+ | `body.reply_to` | `string (email) \| null` | no | |
398
+ | `body.sender_email` | `string (email) \| null` | no | |
399
+ | `body.sender_name` | `string \| null` | no | max length 255 |
400
+
401
+ **Returns** `ApiResponse_IssueDetail_`: the envelope `{ data: IssueDetail, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
402
+
403
+ Other envelope fields: `pagination` (PaginationMeta).
404
+
405
+ `IssueDetail` fields:
406
+
407
+ | Field | Type | Required | Description |
408
+ |---|---|---|---|
409
+ | `created_at` | `string \| null` | no | |
410
+ | `id` | `integer \| null` | no | |
411
+ | `newsletter_id` | `string \| null` | no | |
412
+ | `sent_at` | `string \| null` | no | |
413
+ | `status` | `string \| null` | no | |
414
+ | `subject` | `string \| null` | no | |
415
+ | `updated_at` | `string \| null` | no | |
416
+
417
+ **Example**
418
+
419
+ ```ts
420
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
421
+ const result = await g8.api.newsletter.createIssue({
422
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
423
+ body: { html_body: "example", subject: "Example" },
424
+ });
425
+ ```
426
+
427
+ ---
428
+
429
+ <a id="op-createnewsletter"></a>
430
+
431
+ ### `g8.api.newsletter.createNewsletter(input)`
432
+
433
+ **Create Newsletter**
434
+
435
+ - HTTP: `POST /api/v1/newsletters`
436
+ - operationId: `create_newsletter_newsletters_post` (also callable as `g8.api.call("create_newsletter_newsletters_post", input)`)
437
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
438
+ - API-key scope: `newsletter:run`
439
+ - ★ Hand-written: [`g8.newsletter.create()`](../sdk-clients.md#g8-newsletter-create)
440
+
441
+ Create a new newsletter (the parent container issues live under).
442
+
443
+ **Input**
444
+
445
+ | Field | Type | Required | Description |
446
+ |---|---|---|---|
447
+ | `body` | `NewsletterCreateRequest` | yes | Request body; fields below. |
448
+
449
+ Body fields (`NewsletterCreateRequest`):
450
+
451
+ | Field | Type | Required | Description |
452
+ |---|---|---|---|
453
+ | `body.name` | `string` | yes | max length 255 |
454
+ | `body.goal` | `string \| null` | no | |
455
+
456
+ **Returns** `ApiResponse_NewsletterDetail_`: the envelope `{ data: NewsletterDetail, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
457
+
458
+ Other envelope fields: `pagination` (PaginationMeta).
459
+
460
+ `NewsletterDetail` fields:
461
+
462
+ | Field | Type | Required | Description |
463
+ |---|---|---|---|
464
+ | `audience_list_id` | `unknown \| null` | no | |
465
+ | `created_at` | `string \| null` | no | |
466
+ | `goal` | `string \| null` | no | |
467
+ | `id` | `string \| null` | no | |
468
+ | `name` | `string \| null` | no | |
469
+ | `slug` | `string \| null` | no | |
470
+ | `status` | `string \| null` | no | |
471
+ | `updated_at` | `string \| null` | no | |
472
+
473
+ **Example**
474
+
475
+ ```ts
476
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
477
+ const result = await g8.api.newsletter.createNewsletter({ body: { name: "Example" } });
478
+ ```
479
+
480
+ ---
481
+
482
+ <a id="op-createtemplatefromlayout"></a>
483
+
484
+ ### `g8.api.newsletter.createTemplateFromLayout(input)`
485
+
486
+ **Create Template From Layout**
487
+
488
+ - HTTP: `POST /api/v1/newsletters/templates/layout`
489
+ - operationId: `create_template_from_layout_newsletters_templates_layout_post` (also callable as `g8.api.call("create_template_from_layout_newsletters_templates_layout_post", input)`)
490
+ - Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
491
+ - API-key scope: `newsletter:run`
492
+
493
+ Build a template from a named layout archetype. ASYNC and AI-backed.
494
+
495
+ 202 rather than 201: the row exists immediately but the copy inside it is
496
+ still being generated. Poll
497
+ `GET /newsletters/templates/{template_id}/generation-status` - a template
498
+ read before that reports done is a half-written one.
499
+
500
+ **Input**
501
+
502
+ | Field | Type | Required | Description |
503
+ |---|---|---|---|
504
+ | `body` | `TemplateFromLayoutRequest` | yes | Request body; fields below. |
505
+
506
+ Body fields (`TemplateFromLayoutRequest`):
507
+
508
+ | Field | Type | Required | Description |
509
+ |---|---|---|---|
510
+ | `body.archetype_key` | `string` | yes | Which layout to build from. |
511
+ | `body.audience_id` | `string \| null` | no | Audience the copy is aimed at. |
512
+
513
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
514
+
515
+ Other envelope fields: `pagination` (PaginationMeta).
516
+
517
+ **Example**
518
+
519
+ ```ts
520
+ // billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
521
+ const result = await g8.api.newsletter.createTemplateFromLayout({ body: { archetype_key: "example" } });
522
+ ```
523
+
524
+ ---
525
+
526
+ <a id="op-createtemplatefromprompt"></a>
527
+
528
+ ### `g8.api.newsletter.createTemplateFromPrompt(input)`
529
+
530
+ **Create Template From Prompt**
531
+
532
+ - HTTP: `POST /api/v1/newsletters/templates/custom`
533
+ - operationId: `create_template_from_prompt_newsletters_templates_custom_post` (also callable as `g8.api.call("create_template_from_prompt_newsletters_templates_custom_post", input)`)
534
+ - Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
535
+ - API-key scope: `newsletter:run`
536
+
537
+ Build a template from a plain-language idea. ASYNC and AI-backed.
538
+
539
+ `voice_reference_issue_ids` points the model at past issues to imitate,
540
+ which is the difference between generic copy and something that sounds like
541
+ the organisation. Same polling contract as `/templates/layout`.
542
+
543
+ **Input**
544
+
545
+ | Field | Type | Required | Description |
546
+ |---|---|---|---|
547
+ | `body` | `TemplateFromPromptRequest` | yes | Request body; fields below. |
548
+
549
+ Body fields (`TemplateFromPromptRequest`):
550
+
551
+ | Field | Type | Required | Description |
552
+ |---|---|---|---|
553
+ | `body.idea` | `string` | yes | What the email should say, in plain words. |
554
+ | `body.audience_id` | `string \| null` | no | |
555
+ | `body.goal` | `string` | no | What it is for, e.g. `product`. default `"product"` |
556
+ | `body.length` | `string \| null` | no | |
557
+ | `body.tone` | `string \| null` | no | |
558
+ | `body.variants` | `integer \| null` | no | How many alternatives to generate. default `1` |
559
+ | `body.voice_reference_issue_ids` | `Array<string>` | no | Past issues to imitate the voice of. |
560
+
561
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
562
+
563
+ Other envelope fields: `pagination` (PaginationMeta).
564
+
565
+ **Example**
566
+
567
+ ```ts
568
+ // billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
569
+ const result = await g8.api.newsletter.createTemplateFromPrompt({ body: { idea: "example" } });
570
+ ```
571
+
572
+ ---
573
+
574
+ <a id="op-deleteissue"></a>
575
+
576
+ ### `g8.api.newsletter.deleteIssue(input)`
577
+
578
+ **Delete Issue**
579
+
580
+ - HTTP: `DELETE /api/v1/newsletters/{newsletter_id}/issues/{issue_id}`
581
+ - operationId: `delete_issue_newsletters__newsletter_id__issues__issue_id__delete` (also callable as `g8.api.call("delete_issue_newsletters__newsletter_id__issues__issue_id__delete", input)`)
582
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
583
+ - API-key scope: `newsletter:delete`
584
+
585
+ Delete a DRAFT issue.
586
+
587
+ Drafts only - an issue that has been sent is a record of mail real people
588
+ received and the app refuses to remove it.
589
+
590
+ **Input**
591
+
592
+ | Field | Type | Required | Description |
593
+ |---|---|---|---|
594
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
595
+ | `path.issue_id` | `integer` | yes | Issue id. |
596
+
597
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
598
+
599
+ Other envelope fields: `pagination` (PaginationMeta).
600
+
601
+ **Example**
602
+
603
+ ```ts
604
+ // destructive: deletes or archives data; confirm with a human before calling.
605
+ const result = await g8.api.newsletter.deleteIssue({
606
+ path: {
607
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
608
+ issue_id: 123,
609
+ },
610
+ });
611
+ ```
612
+
613
+ ---
614
+
615
+ <a id="op-deletenewslettertemplate"></a>
616
+
617
+ ### `g8.api.newsletter.deleteNewsletterTemplate(input)`
618
+
619
+ **Delete Newsletter Template**
620
+
621
+ - HTTP: `DELETE /api/v1/newsletters/templates/{template_id}`
622
+ - operationId: `delete_newsletter_template_newsletters_templates__template_id__delete` (also callable as `g8.api.call("delete_newsletter_template_newsletters_templates__template_id__delete", input)`)
623
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
624
+ - API-key scope: `newsletter:delete`
625
+
626
+ Delete an org template.
627
+
628
+ **Input**
629
+
630
+ | Field | Type | Required | Description |
631
+ |---|---|---|---|
632
+ | `path.template_id` | `integer` | yes | Template id. |
633
+
634
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
635
+
636
+ Other envelope fields: `pagination` (PaginationMeta).
637
+
638
+ **Example**
639
+
640
+ ```ts
641
+ // destructive: deletes or archives data; confirm with a human before calling.
642
+ const result = await g8.api.newsletter.deleteNewsletterTemplate({ path: { template_id: 123 } });
643
+ ```
644
+
645
+ ---
646
+
647
+ <a id="op-deletesubscriber"></a>
648
+
649
+ ### `g8.api.newsletter.deleteSubscriber(input)`
650
+
651
+ **Delete Subscriber**
652
+
653
+ - HTTP: `DELETE /api/v1/newsletters/{newsletter_id}/subscribers/{subscriber_id}`
654
+ - operationId: `delete_subscriber_newsletters__newsletter_id__subscribers__subscriber_id__delete` (also callable as `g8.api.call("delete_subscriber_newsletters__newsletter_id__subscribers__subscriber_id__delete", input)`)
655
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
656
+ - API-key scope: `newsletter:delete`
657
+
658
+ Remove a subscriber outright.
659
+
660
+ DIFFERENT from `PATCH .../subscribers/{id}/unsubscribe`, which keeps the
661
+ row and records that they opted out. Deleting loses that record, so the
662
+ same address can be re-imported and mailed again - which is usually not
663
+ what a person who unsubscribed wanted. Unsubscribe unless you are erasing
664
+ someone on request.
665
+
666
+ **Input**
667
+
668
+ | Field | Type | Required | Description |
669
+ |---|---|---|---|
670
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
671
+ | `path.subscriber_id` | `integer` | yes | Subscriber id. |
672
+
673
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
674
+
675
+ Other envelope fields: `pagination` (PaginationMeta).
676
+
677
+ **Example**
678
+
679
+ ```ts
680
+ // destructive: deletes or archives data; confirm with a human before calling.
681
+ const result = await g8.api.newsletter.deleteSubscriber({
682
+ path: {
683
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
684
+ subscriber_id: 123,
685
+ },
686
+ });
687
+ ```
688
+
689
+ ---
690
+
691
+ <a id="op-disablenewsletterlistsync"></a>
692
+
693
+ ### `g8.api.newsletter.disableNewsletterListSync(input)`
694
+
695
+ **Disable Newsletter List Sync**
696
+
697
+ - HTTP: `DELETE /api/v1/newsletters/{newsletter_id}/list-syncs/{audience_list_id}`
698
+ - operationId: `disable_newsletter_list_sync_newsletters__newsletter_id__list_syncs__audience_list_id__delete` (also callable as `g8.api.call("disable_newsletter_list_sync_newsletters__newsletter_id__list_syncs__audience_list_id__delete", input)`)
699
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
700
+ - API-key scope: `newsletter:delete`
701
+
702
+ Detach an audience list. Subscribers already added are NOT removed -
703
+ this stops future syncs, it does not unsubscribe anyone.
704
+
705
+ **Input**
706
+
707
+ | Field | Type | Required | Description |
708
+ |---|---|---|---|
709
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
710
+ | `path.audience_list_id` | `integer` | yes | Audience list id. |
711
+
712
+ **Returns** `ApiResponse_Any_`: the envelope `{ data: unknown, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
713
+
714
+ Other envelope fields: `pagination` (PaginationMeta).
715
+
716
+ **Example**
717
+
718
+ ```ts
719
+ // destructive: deletes or archives data; confirm with a human before calling.
720
+ const result = await g8.api.newsletter.disableNewsletterListSync({
721
+ path: {
722
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
723
+ audience_list_id: 123,
724
+ },
725
+ });
726
+ ```
727
+
728
+ ---
729
+
730
+ <a id="op-duplicateissue"></a>
731
+
732
+ ### `g8.api.newsletter.duplicateIssue(input)`
733
+
734
+ **Duplicate Issue**
735
+
736
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/duplicate`
737
+ - operationId: `duplicate_issue_newsletters__newsletter_id__issues__issue_id__duplicate_post` (also callable as `g8.api.call("duplicate_issue_newsletters__newsletter_id__issues__issue_id__duplicate_post", input)`)
738
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
739
+ - API-key scope: `newsletter:run`
740
+ - ★ Hand-written: [`g8.newsletter.duplicateIssue()`](../sdk-clients.md#g8-newsletter-duplicateissue)
741
+
742
+ Duplicate any issue as a new draft.
743
+
744
+ **Input**
745
+
746
+ | Field | Type | Required | Description |
747
+ |---|---|---|---|
748
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
749
+ | `path.issue_id` | `integer` | yes | Source issue id (any status) |
750
+
751
+ **Returns** `ApiResponse_IssueDetail_`: the envelope `{ data: IssueDetail, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
752
+
753
+ Other envelope fields: `pagination` (PaginationMeta).
754
+
755
+ `IssueDetail` fields:
756
+
757
+ | Field | Type | Required | Description |
758
+ |---|---|---|---|
759
+ | `created_at` | `string \| null` | no | |
760
+ | `id` | `integer \| null` | no | |
761
+ | `newsletter_id` | `string \| null` | no | |
762
+ | `sent_at` | `string \| null` | no | |
763
+ | `status` | `string \| null` | no | |
764
+ | `subject` | `string \| null` | no | |
765
+ | `updated_at` | `string \| null` | no | |
766
+
767
+ **Example**
768
+
769
+ ```ts
770
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
771
+ const result = await g8.api.newsletter.duplicateIssue({
772
+ path: {
773
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
774
+ issue_id: 123,
775
+ },
776
+ });
777
+ ```
778
+
779
+ ---
780
+
781
+ <a id="op-enablenewsletterlistsync"></a>
782
+
783
+ ### `g8.api.newsletter.enableNewsletterListSync(input)`
784
+
785
+ **Enable Newsletter List Sync**
786
+
787
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/list-syncs`
788
+ - operationId: `enable_newsletter_list_sync_newsletters__newsletter_id__list_syncs_post` (also callable as `g8.api.call("enable_newsletter_list_sync_newsletters__newsletter_id__list_syncs_post", input)`)
789
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
790
+ - API-key scope: `newsletter:write`
791
+
792
+ Attach an audience list, and run the first sync inline.
793
+
794
+ `attested_text` is stored VERBATIM: it is the consent wording the operator
795
+ saw when they asserted these people opted in, kept so the trail survives
796
+ future copy edits. Pass the exact text your UI showed - not a summary.
797
+
798
+ **Input**
799
+
800
+ | Field | Type | Required | Description |
801
+ |---|---|---|---|
802
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
803
+ | `body` | `ListSyncEnableRequest` | yes | Request body; fields below. |
804
+
805
+ Body fields (`ListSyncEnableRequest`):
806
+
807
+ | Field | Type | Required | Description |
808
+ |---|---|---|---|
809
+ | `body.audience_list_id` | `integer` | yes | Audience list to attach. |
810
+ | `body.attested_text` | `string \| null` | no | The exact consent wording shown to the operator, stored VERBATIM so the trail survives future copy edits. Send what your UI displayed, not a summary of it. |
811
+
812
+ **Returns** `ApiResponse_Any_`: the envelope `{ data: unknown, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
813
+
814
+ Other envelope fields: `pagination` (PaginationMeta).
815
+
816
+ **Example**
817
+
818
+ ```ts
819
+ const result = await g8.api.newsletter.enableNewsletterListSync({
820
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
821
+ body: { audience_list_id: 123 },
822
+ });
823
+ ```
824
+
825
+ ---
826
+
827
+ <a id="op-generatenewsletterissue"></a>
828
+
829
+ ### `g8.api.newsletter.generateNewsletterIssue(input)`
830
+
831
+ **Generate Newsletter Issue**
832
+
833
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/generate`
834
+ - operationId: `generate_newsletter_issue_newsletters__newsletter_id__issues__issue_id__generate_post` (also callable as `g8.api.call("generate_newsletter_issue_newsletters__newsletter_id__issues__issue_id__generate_post", input)`)
835
+ - Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
836
+ - API-key scope: `newsletter:run`
837
+
838
+ Generate the issue's content with AI (runs a model; billable). Poll `generation-status`.
839
+
840
+ **Input**
841
+
842
+ | Field | Type | Required | Description |
843
+ |---|---|---|---|
844
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
845
+ | `path.issue_id` | `integer` | yes | Issue id. |
846
+ | `body` | `NewsletterIssueGenerateRequest` | yes | Request body; fields below. |
847
+
848
+ Body fields (`NewsletterIssueGenerateRequest`):
849
+
850
+ | Field | Type | Required | Description |
851
+ |---|---|---|---|
852
+ | `body.html_mode` | `"email_safe" \| "modern"` | no | `email_safe`: table layout, inline CSS. `modern`: div layout. default `"email_safe"` |
853
+ | `body.prompt` | `string \| null` | no | What the issue should cover. |
854
+ | `body.template_id` | `integer \| null` | no | Base the issue on this template. |
855
+
856
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
857
+
858
+ Other envelope fields: `pagination` (PaginationMeta).
859
+
860
+ **Example**
861
+
862
+ ```ts
863
+ // billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
864
+ const result = await g8.api.newsletter.generateNewsletterIssue({
865
+ path: {
866
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
867
+ issue_id: 123,
868
+ },
869
+ body: {},
870
+ });
871
+ ```
872
+
873
+ ---
874
+
875
+ <a id="op-getissue"></a>
876
+
877
+ ### `g8.api.newsletter.getIssue(input)`
878
+
879
+ **Get Issue**
880
+
881
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}`
882
+ - operationId: `get_issue_newsletters__newsletter_id__issues__issue_id__get` (also callable as `g8.api.call("get_issue_newsletters__newsletter_id__issues__issue_id__get", input)`)
883
+ - Tier: `read`: reads data; safe to call and to retry
884
+ - API-key scope: `newsletter:read`
885
+ - ★ Hand-written: [`g8.newsletter.getIssue()`](../sdk-clients.md#g8-newsletter-getissue)
886
+
887
+ Get a single newsletter issue with stats.
888
+
889
+ **Input**
890
+
891
+ | Field | Type | Required | Description |
892
+ |---|---|---|---|
893
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
894
+ | `path.issue_id` | `integer` | yes | Issue id |
895
+
896
+ **Returns** `ApiResponse_IssueDetail_`: the envelope `{ data: IssueDetail, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
897
+
898
+ Other envelope fields: `pagination` (PaginationMeta).
899
+
900
+ `IssueDetail` fields:
901
+
902
+ | Field | Type | Required | Description |
903
+ |---|---|---|---|
904
+ | `created_at` | `string \| null` | no | |
905
+ | `id` | `integer \| null` | no | |
906
+ | `newsletter_id` | `string \| null` | no | |
907
+ | `sent_at` | `string \| null` | no | |
908
+ | `status` | `string \| null` | no | |
909
+ | `subject` | `string \| null` | no | |
910
+ | `updated_at` | `string \| null` | no | |
911
+
912
+ **Example**
913
+
914
+ ```ts
915
+ const result = await g8.api.newsletter.getIssue({
916
+ path: {
917
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
918
+ issue_id: 123,
919
+ },
920
+ });
921
+ ```
922
+
923
+ ---
924
+
925
+ <a id="op-getissueanalyticskpis"></a>
926
+
927
+ ### `g8.api.newsletter.getIssueAnalyticsKpis(input)`
928
+
929
+ **Get Issue Analytics Kpis**
930
+
931
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/analytics/kpis`
932
+ - operationId: `get_issue_analytics_kpis_newsletters__newsletter_id__issues__issue_id__analytics_kpis_get` (also callable as `g8.api.call("get_issue_analytics_kpis_newsletters__newsletter_id__issues__issue_id__analytics_kpis_get", input)`)
933
+ - Tier: `read`: reads data; safe to call and to retry
934
+ - API-key scope: `newsletter:read`
935
+ - ★ Hand-written: [`g8.newsletter.issueKpis()`](../sdk-clients.md#g8-newsletter-issuekpis)
936
+
937
+ Bucketed KPI counters for a sent issue (opens, clicks, bounces, ...).
938
+
939
+ Honors the stale-flag pattern: a backend read failure returns HTTP 200
940
+ with ``stale=true`` and an empty ``kpis`` bucket rather than a 500, so
941
+ callers can distinguish "genuinely zero engagement yet" from "read
942
+ failed" without a try/except.
943
+
944
+ **Input**
945
+
946
+ | Field | Type | Required | Description |
947
+ |---|---|---|---|
948
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
949
+ | `path.issue_id` | `integer` | yes | Issue id |
950
+
951
+ **Returns** `ApiResponse_IssueAnalyticsKpis_`: the envelope `{ data: IssueAnalyticsKpis, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
952
+
953
+ Other envelope fields: `pagination` (PaginationMeta).
954
+
955
+ `IssueAnalyticsKpis` fields:
956
+
957
+ | Field | Type | Required | Description |
958
+ |---|---|---|---|
959
+ | `kpis` | `Record<string, unknown>` | no | |
960
+ | `last_updated_at` | `string \| null` | no | |
961
+ | `stale` | `boolean \| null` | no | |
962
+
963
+ **Example**
964
+
965
+ ```ts
966
+ const result = await g8.api.newsletter.getIssueAnalyticsKpis({
967
+ path: {
968
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
969
+ issue_id: 123,
970
+ },
971
+ });
972
+ ```
973
+
974
+ ---
975
+
976
+ <a id="op-getissuegenerationstatus"></a>
977
+
978
+ ### `g8.api.newsletter.getIssueGenerationStatus(input)`
979
+
980
+ **Get Issue Generation Status**
981
+
982
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/generation-status`
983
+ - operationId: `get_issue_generation_status_newsletters__newsletter_id__issues__issue_id__generation_status_get` (also callable as `g8.api.call("get_issue_generation_status_newsletters__newsletter_id__issues__issue_id__generation_status_get", input)`)
984
+ - Tier: `read`: reads data; safe to call and to retry
985
+ - API-key scope: `newsletter:read`
986
+
987
+ How far along an issue's AI generation is.
988
+
989
+ Read this before sending a generated issue: an issue whose generation has
990
+ not finished has partial HTML, and sending it mails the partial version.
991
+
992
+ **Input**
993
+
994
+ | Field | Type | Required | Description |
995
+ |---|---|---|---|
996
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
997
+ | `path.issue_id` | `integer` | yes | Issue id. |
998
+
999
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1000
+
1001
+ Other envelope fields: `pagination` (PaginationMeta).
1002
+
1003
+ **Example**
1004
+
1005
+ ```ts
1006
+ const result = await g8.api.newsletter.getIssueGenerationStatus({
1007
+ path: {
1008
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1009
+ issue_id: 123,
1010
+ },
1011
+ });
1012
+ ```
1013
+
1014
+ ---
1015
+
1016
+ <a id="op-getnewsletter"></a>
1017
+
1018
+ ### `g8.api.newsletter.getNewsletter(input)`
1019
+
1020
+ **Get Newsletter**
1021
+
1022
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}`
1023
+ - operationId: `get_newsletter_newsletters__newsletter_id__get` (also callable as `g8.api.call("get_newsletter_newsletters__newsletter_id__get", input)`)
1024
+ - Tier: `read`: reads data; safe to call and to retry
1025
+ - API-key scope: `newsletter:read`
1026
+ - ★ Hand-written: [`g8.newsletter.get()`](../sdk-clients.md#g8-newsletter-get)
1027
+
1028
+ Get a single newsletter.
1029
+
1030
+ **Input**
1031
+
1032
+ | Field | Type | Required | Description |
1033
+ |---|---|---|---|
1034
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
1035
+
1036
+ **Returns** `ApiResponse_NewsletterDetail_`: the envelope `{ data: NewsletterDetail, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1037
+
1038
+ Other envelope fields: `pagination` (PaginationMeta).
1039
+
1040
+ `NewsletterDetail` fields:
1041
+
1042
+ | Field | Type | Required | Description |
1043
+ |---|---|---|---|
1044
+ | `audience_list_id` | `unknown \| null` | no | |
1045
+ | `created_at` | `string \| null` | no | |
1046
+ | `goal` | `string \| null` | no | |
1047
+ | `id` | `string \| null` | no | |
1048
+ | `name` | `string \| null` | no | |
1049
+ | `slug` | `string \| null` | no | |
1050
+ | `status` | `string \| null` | no | |
1051
+ | `updated_at` | `string \| null` | no | |
1052
+
1053
+ **Example**
1054
+
1055
+ ```ts
1056
+ const result = await g8.api.newsletter.getNewsletter({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1057
+ ```
1058
+
1059
+ ---
1060
+
1061
+ <a id="op-getnewsletterissueconversation"></a>
1062
+
1063
+ ### `g8.api.newsletter.getNewsletterIssueConversation(input)`
1064
+
1065
+ **Get Newsletter Issue Conversation**
1066
+
1067
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/conversation`
1068
+ - operationId: `get_newsletter_issue_conversation_newsletters__newsletter_id__issues__issue_id__conversation_get` (also callable as `g8.api.call("get_newsletter_issue_conversation_newsletters__newsletter_id__issues__issue_id__conversation_get", input)`)
1069
+ - Tier: `read`: reads data; safe to call and to retry
1070
+ - API-key scope: `newsletter:read`
1071
+
1072
+ The AI editing conversation recorded on an issue.
1073
+
1074
+ **Input**
1075
+
1076
+ | Field | Type | Required | Description |
1077
+ |---|---|---|---|
1078
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1079
+ | `path.issue_id` | `integer` | yes | Issue id. |
1080
+
1081
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1082
+
1083
+ Other envelope fields: `pagination` (PaginationMeta).
1084
+
1085
+ **Example**
1086
+
1087
+ ```ts
1088
+ const result = await g8.api.newsletter.getNewsletterIssueConversation({
1089
+ path: {
1090
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1091
+ issue_id: 123,
1092
+ },
1093
+ });
1094
+ ```
1095
+
1096
+ ---
1097
+
1098
+ <a id="op-getnewslettersettings"></a>
1099
+
1100
+ ### `g8.api.newsletter.getNewsletterSettings(input)`
1101
+
1102
+ **Get Newsletter Settings**
1103
+
1104
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/settings`
1105
+ - operationId: `get_newsletter_settings_newsletters__newsletter_id__settings_get` (also callable as `g8.api.call("get_newsletter_settings_newsletters__newsletter_id__settings_get", input)`)
1106
+ - Tier: `read`: reads data; safe to call and to retry
1107
+ - API-key scope: `newsletter:read`
1108
+
1109
+ Who this newsletter sends as, and whether double opt-in is active.
1110
+
1111
+ **Input**
1112
+
1113
+ | Field | Type | Required | Description |
1114
+ |---|---|---|---|
1115
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1116
+
1117
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1118
+
1119
+ Other envelope fields: `pagination` (PaginationMeta).
1120
+
1121
+ **Example**
1122
+
1123
+ ```ts
1124
+ const result = await g8.api.newsletter.getNewsletterSettings({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1125
+ ```
1126
+
1127
+ ---
1128
+
1129
+ <a id="op-getnewslettersubscriberverification"></a>
1130
+
1131
+ ### `g8.api.newsletter.getNewsletterSubscriberVerification(input)`
1132
+
1133
+ **Get Newsletter Subscriber Verification**
1134
+
1135
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/subscribers/verify/status`
1136
+ - operationId: `get_newsletter_subscriber_verification_newsletters__newsletter_id__subscribers_verify_status_get` (also callable as `g8.api.call("get_newsletter_subscriber_verification_newsletters__newsletter_id__subscribers_verify_status_get", input)`)
1137
+ - Tier: `read`: reads data; safe to call and to retry
1138
+ - API-key scope: `newsletter:read`
1139
+
1140
+ The verification job in progress for this newsletter, if any.
1141
+
1142
+ **Input**
1143
+
1144
+ | Field | Type | Required | Description |
1145
+ |---|---|---|---|
1146
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1147
+
1148
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1149
+
1150
+ Other envelope fields: `pagination` (PaginationMeta).
1151
+
1152
+ **Example**
1153
+
1154
+ ```ts
1155
+ const result = await g8.api.newsletter.getNewsletterSubscriberVerification({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1156
+ ```
1157
+
1158
+ ---
1159
+
1160
+ <a id="op-getsendstatus"></a>
1161
+
1162
+ ### `g8.api.newsletter.getSendStatus(input)`
1163
+
1164
+ **Get Send Status**
1165
+
1166
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send`
1167
+ - operationId: `get_send_status_newsletters__newsletter_id__issues__issue_id__send_get` (also callable as `g8.api.call("get_send_status_newsletters__newsletter_id__issues__issue_id__send_get", input)`)
1168
+ - Tier: `read`: reads data; safe to call and to retry
1169
+ - API-key scope: `newsletter:read`
1170
+
1171
+ Where an in-flight send has got to.
1172
+
1173
+ GET on the same path the published POST starts a send on. `{"active": false}`
1174
+ means nothing is running - which is also what you get after a send has
1175
+ finished, so this is a progress read rather than a history one.
1176
+
1177
+ **Input**
1178
+
1179
+ | Field | Type | Required | Description |
1180
+ |---|---|---|---|
1181
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1182
+ | `path.issue_id` | `integer` | yes | Issue id. |
1183
+
1184
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1185
+
1186
+ Other envelope fields: `pagination` (PaginationMeta).
1187
+
1188
+ **Example**
1189
+
1190
+ ```ts
1191
+ const result = await g8.api.newsletter.getSendStatus({
1192
+ path: {
1193
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1194
+ issue_id: 123,
1195
+ },
1196
+ });
1197
+ ```
1198
+
1199
+ ---
1200
+
1201
+ <a id="op-getsubscribertimeline"></a>
1202
+
1203
+ ### `g8.api.newsletter.getSubscriberTimeline(input)`
1204
+
1205
+ **Get Subscriber Timeline**
1206
+
1207
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/analytics/subscribers/{subscriber_id}/timeline`
1208
+ - operationId: `get_subscriber_timeline_newsletters__newsletter_id__issues__issue_id__analytics_subscribers__subscriber_id__timeline_get` (also callable as `g8.api.call("get_subscriber_timeline_newsletters__newsletter_id__issues__issue_id__analytics_subscribers__subscriber_id__timeline_get", input)`)
1209
+ - Tier: `read`: reads data; safe to call and to retry
1210
+ - API-key scope: `newsletter:read`
1211
+
1212
+ One subscriber's whole story for one issue: delivered, opened, clicked,
1213
+ bounced, complained, and when.
1214
+
1215
+ The published KPI read gives the totals; this answers "what happened to
1216
+ THIS person", which is what a support question actually needs.
1217
+
1218
+ **Input**
1219
+
1220
+ | Field | Type | Required | Description |
1221
+ |---|---|---|---|
1222
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1223
+ | `path.issue_id` | `integer` | yes | Issue id. |
1224
+ | `path.subscriber_id` | `integer` | yes | Subscriber id. |
1225
+
1226
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1227
+
1228
+ Other envelope fields: `pagination` (PaginationMeta).
1229
+
1230
+ **Example**
1231
+
1232
+ ```ts
1233
+ const result = await g8.api.newsletter.getSubscriberTimeline({
1234
+ path: {
1235
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1236
+ issue_id: 123,
1237
+ subscriber_id: 123,
1238
+ },
1239
+ });
1240
+ ```
1241
+
1242
+ ---
1243
+
1244
+ <a id="op-importsubscribersfromaudience"></a>
1245
+
1246
+ ### `g8.api.newsletter.importSubscribersFromAudience(input)`
1247
+
1248
+ **Import Subscribers From Audience**
1249
+
1250
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/subscribers/import-audience`
1251
+ - operationId: `import_subscribers_from_audience_newsletters__newsletter_id__subscribers_import_audience_post` (also callable as `g8.api.call("import_subscribers_from_audience_newsletters__newsletter_id__subscribers_import_audience_post", input)`)
1252
+ - Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
1253
+ - API-key scope: `newsletter:run`
1254
+
1255
+ Bulk-import an audience list's contacts as subscribers.
1256
+
1257
+ Asynchronous: the response acknowledges the job rather than reporting a
1258
+ final count. Whether the imported addresses are verified on the way in
1259
+ depends on `auto_verify_on_import` in the newsletter's settings, and
1260
+ verification SPENDS CREDIT.
1261
+
1262
+ **Input**
1263
+
1264
+ | Field | Type | Required | Description |
1265
+ |---|---|---|---|
1266
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1267
+ | `body` | `ImportAudienceRequest` | yes | Request body; fields below. |
1268
+
1269
+ Body fields (`ImportAudienceRequest`):
1270
+
1271
+ | Field | Type | Required | Description |
1272
+ |---|---|---|---|
1273
+ | `body.audience_id` | `integer` | yes | Integer audience id, not a UUID. |
1274
+
1275
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1276
+
1277
+ Other envelope fields: `pagination` (PaginationMeta).
1278
+
1279
+ **Example**
1280
+
1281
+ ```ts
1282
+ // billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
1283
+ const result = await g8.api.newsletter.importSubscribersFromAudience({
1284
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
1285
+ body: { audience_id: 123 },
1286
+ });
1287
+ ```
1288
+
1289
+ ---
1290
+
1291
+ <a id="op-linknewslettercampaign"></a>
1292
+
1293
+ ### `g8.api.newsletter.linkNewsletterCampaign(input)`
1294
+
1295
+ **Link Newsletter Campaign**
1296
+
1297
+ - HTTP: `PUT /api/v1/newsletters/{newsletter_id}/campaign`
1298
+ - operationId: `link_newsletter_campaign_newsletters__newsletter_id__campaign_put` (also callable as `g8.api.call("link_newsletter_campaign_newsletters__newsletter_id__campaign_put", input)`)
1299
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1300
+ - API-key scope: `newsletter:write`
1301
+
1302
+ Link a Studio campaign to this newsletter (replaces any existing link).
1303
+
1304
+ **Input**
1305
+
1306
+ | Field | Type | Required | Description |
1307
+ |---|---|---|---|
1308
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1309
+ | `body` | `NewsletterCampaignLinkRequest` | yes | Request body; fields below. |
1310
+
1311
+ Body fields (`NewsletterCampaignLinkRequest`):
1312
+
1313
+ | Field | Type | Required | Description |
1314
+ |---|---|---|---|
1315
+ | `body.campaign_id` | `string` | yes | The Studio campaign to link. |
1316
+
1317
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1318
+
1319
+ Other envelope fields: `pagination` (PaginationMeta).
1320
+
1321
+ **Example**
1322
+
1323
+ ```ts
1324
+ const result = await g8.api.newsletter.linkNewsletterCampaign({
1325
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
1326
+ body: { campaign_id: "id" },
1327
+ });
1328
+ ```
1329
+
1330
+ ---
1331
+
1332
+ <a id="op-listissues"></a>
1333
+
1334
+ ### `g8.api.newsletter.listIssues(input)`
1335
+
1336
+ **List Issues**
1337
+
1338
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/issues`
1339
+ - operationId: `list_issues_newsletters__newsletter_id__issues_get` (also callable as `g8.api.call("list_issues_newsletters__newsletter_id__issues_get", input)`)
1340
+ - Tier: `read`: reads data; safe to call and to retry
1341
+ - API-key scope: `newsletter:read`
1342
+ - ★ Hand-written: [`g8.newsletter.listIssues()`](../sdk-clients.md#g8-newsletter-listissues)
1343
+
1344
+ List all issues for a newsletter.
1345
+
1346
+ **Input**
1347
+
1348
+ | Field | Type | Required | Description |
1349
+ |---|---|---|---|
1350
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
1351
+
1352
+ **Returns** `ApiResponse_list_`: the envelope `{ data: Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1353
+
1354
+ Other envelope fields: `pagination` (PaginationMeta).
1355
+
1356
+ **Example**
1357
+
1358
+ ```ts
1359
+ const result = await g8.api.newsletter.listIssues({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1360
+ ```
1361
+
1362
+ ---
1363
+
1364
+ <a id="op-listnewsletterissueversions"></a>
1365
+
1366
+ ### `g8.api.newsletter.listNewsletterIssueVersions(input)`
1367
+
1368
+ **List Newsletter Issue Versions**
1369
+
1370
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/versions`
1371
+ - operationId: `list_newsletter_issue_versions_newsletters__newsletter_id__issues__issue_id__versions_get` (also callable as `g8.api.call("list_newsletter_issue_versions_newsletters__newsletter_id__issues__issue_id__versions_get", input)`)
1372
+ - Tier: `read`: reads data; safe to call and to retry
1373
+ - API-key scope: `newsletter:read`
1374
+
1375
+ An issue's saved versions, newest first.
1376
+
1377
+ **Input**
1378
+
1379
+ | Field | Type | Required | Description |
1380
+ |---|---|---|---|
1381
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1382
+ | `path.issue_id` | `integer` | yes | Issue id. |
1383
+
1384
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1385
+
1386
+ Other envelope fields: `pagination` (PaginationMeta).
1387
+
1388
+ **Example**
1389
+
1390
+ ```ts
1391
+ const result = await g8.api.newsletter.listNewsletterIssueVersions({
1392
+ path: {
1393
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1394
+ issue_id: 123,
1395
+ },
1396
+ });
1397
+ ```
1398
+
1399
+ ---
1400
+
1401
+ <a id="op-listnewsletterlistsyncs"></a>
1402
+
1403
+ ### `g8.api.newsletter.listNewsletterListSyncs(input)`
1404
+
1405
+ **List Newsletter List Syncs**
1406
+
1407
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/list-syncs`
1408
+ - operationId: `list_newsletter_list_syncs_newsletters__newsletter_id__list_syncs_get` (also callable as `g8.api.call("list_newsletter_list_syncs_newsletters__newsletter_id__list_syncs_get", input)`)
1409
+ - Tier: `read`: reads data; safe to call and to retry
1410
+ - API-key scope: `newsletter:read`
1411
+
1412
+ Audience lists feeding this newsletter's subscribers.
1413
+
1414
+ **Input**
1415
+
1416
+ | Field | Type | Required | Description |
1417
+ |---|---|---|---|
1418
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1419
+ | `query.audience_list_id` | `integer \| null` | no | Resolve a CANDIDATE list that has no saved row yet. Returns a synthetic disabled entry carrying the live name and count, so a rebuilt enable dialog can state the number the worker will actually act on rather than a stale one. |
1420
+
1421
+ **Returns** `ApiResponse_ListSyncListResponse_`: the envelope `{ data: ListSyncListResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1422
+
1423
+ Other envelope fields: `pagination` (PaginationMeta).
1424
+
1425
+ `ListSyncListResponse` fields:
1426
+
1427
+ | Field | Type | Required | Description |
1428
+ |---|---|---|---|
1429
+ | `list_syncs` | `Array<ListSync>` | no | |
1430
+ | `total` | `integer` | no | default `0` |
1431
+
1432
+ **Example**
1433
+
1434
+ ```ts
1435
+ const result = await g8.api.newsletter.listNewsletterListSyncs({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1436
+ ```
1437
+
1438
+ ---
1439
+
1440
+ <a id="op-listnewsletters"></a>
1441
+
1442
+ ### `g8.api.newsletter.listNewsletters(input?)`
1443
+
1444
+ **List Newsletters**
1445
+
1446
+ - HTTP: `GET /api/v1/newsletters`
1447
+ - operationId: `list_newsletters_newsletters_get` (also callable as `g8.api.call("list_newsletters_newsletters_get", input)`)
1448
+ - Tier: `read`: reads data; safe to call and to retry
1449
+ - API-key scope: `newsletter:read`
1450
+ - ★ Hand-written: [`g8.newsletter.list()`](../sdk-clients.md#g8-newsletter-list)
1451
+
1452
+ List all newsletters for the org.
1453
+
1454
+ **Input**: none.
1455
+
1456
+ **Returns** `ApiResponse_list_`: the envelope `{ data: Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1457
+
1458
+ Other envelope fields: `pagination` (PaginationMeta).
1459
+
1460
+ **Example**
1461
+
1462
+ ```ts
1463
+ const result = await g8.api.newsletter.listNewsletters();
1464
+ ```
1465
+
1466
+ ---
1467
+
1468
+ <a id="op-listsubscribers"></a>
1469
+
1470
+ ### `g8.api.newsletter.listSubscribers(input)`
1471
+
1472
+ **List Subscribers**
1473
+
1474
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/subscribers`
1475
+ - operationId: `list_subscribers_newsletters__newsletter_id__subscribers_get` (also callable as `g8.api.call("list_subscribers_newsletters__newsletter_id__subscribers_get", input)`)
1476
+ - Tier: `read`: reads data; safe to call and to retry
1477
+ - API-key scope: `newsletter:read`
1478
+ - ★ Hand-written: [`g8.newsletter.listSubscribers()`](../sdk-clients.md#g8-newsletter-listsubscribers)
1479
+
1480
+ Paginated subscriber list for a newsletter.
1481
+
1482
+ **Input**
1483
+
1484
+ | Field | Type | Required | Description |
1485
+ |---|---|---|---|
1486
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
1487
+ | `query.page` | `integer` | no | default `1` |
1488
+ | `query.page_size` | `integer` | no | default `25` |
1489
+ | `query.search` | `string \| null` | no | Free-text search over email/name |
1490
+ | `query.status` | `string \| null` | no | Comma-separated status filter (e.g. 'subscribed,bounced') |
1491
+
1492
+ **Returns** `ApiResponse_SubscriberListResponse_`: the envelope `{ data: SubscriberListResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1493
+
1494
+ Other envelope fields: `pagination` (PaginationMeta).
1495
+
1496
+ `SubscriberListResponse` fields:
1497
+
1498
+ | Field | Type | Required | Description |
1499
+ |---|---|---|---|
1500
+ | `items` | `Array<SubscriberSummary>` | no | |
1501
+ | `page` | `integer` | no | default `1` |
1502
+ | `page_size` | `integer` | no | default `25` |
1503
+ | `total` | `integer` | no | default `0` |
1504
+
1505
+ **Example**
1506
+
1507
+ ```ts
1508
+ const result = await g8.api.newsletter.listSubscribers({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1509
+ ```
1510
+
1511
+ ---
1512
+
1513
+ <a id="op-listtemplates"></a>
1514
+
1515
+ ### `g8.api.newsletter.listTemplates(input?)`
1516
+
1517
+ **List Templates**
1518
+
1519
+ - HTTP: `GET /api/v1/newsletters/templates`
1520
+ - operationId: `list_templates_newsletters_templates_get` (also callable as `g8.api.call("list_templates_newsletters_templates_get", input)`)
1521
+ - Tier: `read`: reads data; safe to call and to retry
1522
+ - API-key scope: `newsletter:read`
1523
+ - ★ Hand-written: [`g8.newsletter.templates()`](../sdk-clients.md#g8-newsletter-templates)
1524
+
1525
+ List org-level newsletter templates (reusable HTML scaffolds).
1526
+
1527
+ **Input**: none.
1528
+
1529
+ **Returns** `ApiResponse_list_`: the envelope `{ data: Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1530
+
1531
+ Other envelope fields: `pagination` (PaginationMeta).
1532
+
1533
+ **Example**
1534
+
1535
+ ```ts
1536
+ const result = await g8.api.newsletter.listTemplates();
1537
+ ```
1538
+
1539
+ ---
1540
+
1541
+ <a id="op-newsletterdomainstatus"></a>
1542
+
1543
+ ### `g8.api.newsletter.newsletterDomainStatus(input)`
1544
+
1545
+ **Newsletter Domain Status**
1546
+
1547
+ - HTTP: `GET /api/v1/newsletters/{newsletter_id}/settings/domain-status`
1548
+ - operationId: `newsletter_domain_status_newsletters__newsletter_id__settings_domain_status_get` (also callable as `g8.api.call("newsletter_domain_status_newsletters__newsletter_id__settings_domain_status_get", input)`)
1549
+ - Tier: `read`: reads data; safe to call and to retry
1550
+ - API-key scope: `newsletter:read`
1551
+
1552
+ Whether the sending domain and its DKIM keys have verified yet.
1553
+
1554
+ Poll this after adding the DNS records. It is not a passive read: when the
1555
+ provider reports the domain verified, this call is what promotes it into
1556
+ the sender picker.
1557
+
1558
+ **Input**
1559
+
1560
+ | Field | Type | Required | Description |
1561
+ |---|---|---|---|
1562
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1563
+ | `query.domain` | `string` | yes | The domain to check. |
1564
+
1565
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1566
+
1567
+ Other envelope fields: `pagination` (PaginationMeta).
1568
+
1569
+ **Example**
1570
+
1571
+ ```ts
1572
+ const result = await g8.api.newsletter.newsletterDomainStatus({
1573
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
1574
+ query: { domain: "acme.com" },
1575
+ });
1576
+ ```
1577
+
1578
+ ---
1579
+
1580
+ <a id="op-pausenewsletter"></a>
1581
+
1582
+ ### `g8.api.newsletter.pauseNewsletter(input)`
1583
+
1584
+ **Pause Newsletter**
1585
+
1586
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/pause`
1587
+ - operationId: `pause_newsletter_newsletters__newsletter_id__pause_post` (also callable as `g8.api.call("pause_newsletter_newsletters__newsletter_id__pause_post", input)`)
1588
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1589
+ - API-key scope: `newsletter:write`
1590
+
1591
+ Pause a running newsletter. Stops further sends; the newsletter and its
1592
+ issues are untouched and it can be resumed in the app.
1593
+
1594
+ **Input**
1595
+
1596
+ | Field | Type | Required | Description |
1597
+ |---|---|---|---|
1598
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1599
+
1600
+ **Returns** `ApiResponse_NewsletterStatusResponse_`: the envelope `{ data: NewsletterStatusResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1601
+
1602
+ Other envelope fields: `pagination` (PaginationMeta).
1603
+
1604
+ `NewsletterStatusResponse` fields:
1605
+
1606
+ | Field | Type | Required | Description |
1607
+ |---|---|---|---|
1608
+ | `id` | `string \| null` | no | |
1609
+ | `status` | `string \| null` | no | Status after the transition, e.g. `paused`, `completed`. |
1610
+
1611
+ **Example**
1612
+
1613
+ ```ts
1614
+ const result = await g8.api.newsletter.pauseNewsletter({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1615
+ ```
1616
+
1617
+ ---
1618
+
1619
+ <a id="op-pausesend"></a>
1620
+
1621
+ ### `g8.api.newsletter.pauseSend(input)`
1622
+
1623
+ **Pause Send**
1624
+
1625
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send/pause`
1626
+ - operationId: `pause_send_newsletters__newsletter_id__issues__issue_id__send_pause_post` (also callable as `g8.api.call("pause_send_newsletters__newsletter_id__issues__issue_id__send_pause_post", input)`)
1627
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1628
+ - API-key scope: `newsletter:write`
1629
+
1630
+ Ask a running send to stop. The stop button.
1631
+
1632
+ A REQUEST, not an instant state: recipients already leased by a worker are
1633
+ still delivered, and the reported state stays `pausing` until the
1634
+ reconciler confirms it settled. It does not lie about that, so poll
1635
+ `GET .../send` rather than assuming.
1636
+
1637
+ Deliberately NOT gated on the launch permission. Requiring a launch right
1638
+ to STOP a send would invert the safety model, and the app leaves it open
1639
+ for that reason.
1640
+
1641
+ **Input**
1642
+
1643
+ | Field | Type | Required | Description |
1644
+ |---|---|---|---|
1645
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1646
+ | `path.issue_id` | `integer` | yes | Issue id. |
1647
+ | `body` | `SendControlRequest` | no | Request body; fields below. |
1648
+
1649
+ Body fields (`SendControlRequest`):
1650
+
1651
+ | Field | Type | Required | Description |
1652
+ |---|---|---|---|
1653
+ | `body.reason` | `string \| null` | no | |
1654
+
1655
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1656
+
1657
+ Other envelope fields: `pagination` (PaginationMeta).
1658
+
1659
+ **Example**
1660
+
1661
+ ```ts
1662
+ const result = await g8.api.newsletter.pauseSend({
1663
+ path: {
1664
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1665
+ issue_id: 123,
1666
+ },
1667
+ });
1668
+ ```
1669
+
1670
+ ---
1671
+
1672
+ <a id="op-previewnewslettersubscriberverification"></a>
1673
+
1674
+ ### `g8.api.newsletter.previewNewsletterSubscriberVerification(input)`
1675
+
1676
+ **Preview Newsletter Subscriber Verification**
1677
+
1678
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/subscribers/verify/preview`
1679
+ - operationId: `preview_newsletter_subscriber_verification_newsletters__newsletter_id__subscribers_verify_preview_post` (also callable as `g8.api.call("preview_newsletter_subscriber_verification_newsletters__newsletter_id__subscribers_verify_preview_post", input)`)
1680
+ - Tier: `read`: reads data; safe to call and to retry
1681
+ - API-key scope: `newsletter:read`
1682
+
1683
+ How many addresses would be verified and what it would cost. Free; submits nothing.
1684
+
1685
+ **Input**
1686
+
1687
+ | Field | Type | Required | Description |
1688
+ |---|---|---|---|
1689
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1690
+
1691
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1692
+
1693
+ Other envelope fields: `pagination` (PaginationMeta).
1694
+
1695
+ **Example**
1696
+
1697
+ ```ts
1698
+ const result = await g8.api.newsletter.previewNewsletterSubscriberVerification({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1699
+ ```
1700
+
1701
+ ---
1702
+
1703
+ <a id="op-restorenewsletterissueversion"></a>
1704
+
1705
+ ### `g8.api.newsletter.restoreNewsletterIssueVersion(input)`
1706
+
1707
+ **Restore Newsletter Issue Version**
1708
+
1709
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/versions/{version_num}/restore`
1710
+ - operationId: `restore_newsletter_issue_version_newsletters__newsletter_id__issues__issue_id__versions__version_num__restore_post` (also callable as `g8.api.call("restore_newsletter_issue_version_newsletters__newsletter_id__issues__issue_id__versions__version_num__restore_post", input)`)
1711
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1712
+ - API-key scope: `newsletter:write`
1713
+
1714
+ Restore an issue to one of its saved versions.
1715
+
1716
+ **Input**
1717
+
1718
+ | Field | Type | Required | Description |
1719
+ |---|---|---|---|
1720
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1721
+ | `path.issue_id` | `integer` | yes | Issue id. |
1722
+ | `path.version_num` | `integer` | yes | The version to restore. |
1723
+
1724
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1725
+
1726
+ Other envelope fields: `pagination` (PaginationMeta).
1727
+
1728
+ **Example**
1729
+
1730
+ ```ts
1731
+ const result = await g8.api.newsletter.restoreNewsletterIssueVersion({
1732
+ path: {
1733
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1734
+ issue_id: 123,
1735
+ version_num: 1,
1736
+ },
1737
+ });
1738
+ ```
1739
+
1740
+ ---
1741
+
1742
+ <a id="op-resumenewsletter"></a>
1743
+
1744
+ ### `g8.api.newsletter.resumeNewsletter(input)`
1745
+
1746
+ **Resume Newsletter**
1747
+
1748
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/resume`
1749
+ - operationId: `resume_newsletter_newsletters__newsletter_id__resume_post` (also callable as `g8.api.call("resume_newsletter_newsletters__newsletter_id__resume_post", input)`)
1750
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
1751
+ - API-key scope: `newsletter:run`
1752
+
1753
+ Un-pause a newsletter. LAUNCH-CLASS, and the counterpart to the
1754
+ published `POST /newsletters/{id}/pause`.
1755
+
1756
+ Resuming alone can put mail in real inboxes: pausing reverts scheduled
1757
+ issues to draft, but nothing prevents an issue being scheduled while the
1758
+ newsletter is paused, and the scheduler's due-issue query filters on the
1759
+ NEWSLETTER's status. Gated on `campaigns:launch` for that reason.
1760
+
1761
+ **Input**
1762
+
1763
+ | Field | Type | Required | Description |
1764
+ |---|---|---|---|
1765
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1766
+
1767
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1768
+
1769
+ Other envelope fields: `pagination` (PaginationMeta).
1770
+
1771
+ **Example**
1772
+
1773
+ ```ts
1774
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
1775
+ const result = await g8.api.newsletter.resumeNewsletter({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
1776
+ ```
1777
+
1778
+ ---
1779
+
1780
+ <a id="op-resumesend"></a>
1781
+
1782
+ ### `g8.api.newsletter.resumeSend(input)`
1783
+
1784
+ **Resume Send**
1785
+
1786
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send/resume`
1787
+ - operationId: `resume_send_newsletters__newsletter_id__issues__issue_id__send_resume_post` (also callable as `g8.api.call("resume_send_newsletters__newsletter_id__issues__issue_id__send_resume_post", input)`)
1788
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
1789
+ - API-key scope: `newsletter:run`
1790
+
1791
+ Restart a paused send. LAUNCH-CLASS.
1792
+
1793
+ This is the one send control that starts delivery again, which is why it
1794
+ carries the `campaigns:launch` gate its two neighbours do not.
1795
+
1796
+ **Input**
1797
+
1798
+ | Field | Type | Required | Description |
1799
+ |---|---|---|---|
1800
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1801
+ | `path.issue_id` | `integer` | yes | Issue id. |
1802
+
1803
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1804
+
1805
+ Other envelope fields: `pagination` (PaginationMeta).
1806
+
1807
+ **Example**
1808
+
1809
+ ```ts
1810
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
1811
+ const result = await g8.api.newsletter.resumeSend({
1812
+ path: {
1813
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1814
+ issue_id: 123,
1815
+ },
1816
+ });
1817
+ ```
1818
+
1819
+ ---
1820
+
1821
+ <a id="op-rewriteissuetext"></a>
1822
+
1823
+ ### `g8.api.newsletter.rewriteIssueText(input)`
1824
+
1825
+ **Rewrite Issue Text**
1826
+
1827
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/rewrite-text`
1828
+ - operationId: `rewrite_issue_text_newsletters__newsletter_id__issues__issue_id__rewrite_text_post` (also callable as `g8.api.call("rewrite_issue_text_newsletters__newsletter_id__issues__issue_id__rewrite_text_post", input)`)
1829
+ - Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
1830
+ - API-key scope: `newsletter:run`
1831
+
1832
+ Rewrite one element with an AI instruction. THIS SPENDS AI CREDIT.
1833
+
1834
+ The deliberate counterpart to `set-text`: same target, but the model
1835
+ decides the wording. Use `set-text` when you already know what it should
1836
+ say - it is free, deterministic and cannot surprise you.
1837
+
1838
+ **Input**
1839
+
1840
+ | Field | Type | Required | Description |
1841
+ |---|---|---|---|
1842
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
1843
+ | `path.issue_id` | `integer` | yes | Issue id. |
1844
+ | `body` | `RewriteTextRequest` | yes | Request body; fields below. |
1845
+
1846
+ Body fields (`RewriteTextRequest`):
1847
+
1848
+ | Field | Type | Required | Description |
1849
+ |---|---|---|---|
1850
+ | `body.element_id` | `string` | yes | max length 200 |
1851
+ | `body.instruction` | `string` | yes | What to change, in plain words. max length 2000 |
1852
+
1853
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1854
+
1855
+ Other envelope fields: `pagination` (PaginationMeta).
1856
+
1857
+ **Example**
1858
+
1859
+ ```ts
1860
+ // billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
1861
+ const result = await g8.api.newsletter.rewriteIssueText({
1862
+ path: {
1863
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1864
+ issue_id: 123,
1865
+ },
1866
+ body: { element_id: "id", instruction: "example" },
1867
+ });
1868
+ ```
1869
+
1870
+ ---
1871
+
1872
+ <a id="op-runnewsletterlistsync"></a>
1873
+
1874
+ ### `g8.api.newsletter.runNewsletterListSync(input)`
1875
+
1876
+ **Run Newsletter List Sync**
1877
+
1878
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/list-syncs/{audience_list_id}/run`
1879
+ - operationId: `run_newsletter_list_sync_newsletters__newsletter_id__list_syncs__audience_list_id__run_post` (also callable as `g8.api.call("run_newsletter_list_sync_newsletters__newsletter_id__list_syncs__audience_list_id__run_post", input)`)
1880
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1881
+ - API-key scope: `newsletter:write`
1882
+
1883
+ Re-run a sync now rather than waiting for the worker.
1884
+
1885
+ Idempotent in effect: it reconciles the list into the subscriber base, so
1886
+ running it twice adds nobody twice.
1887
+
1888
+ **Input**
1889
+
1890
+ | Field | Type | Required | Description |
1891
+ |---|---|---|---|
1892
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
1893
+ | `path.audience_list_id` | `integer` | yes | Audience list id. |
1894
+
1895
+ **Returns** `ApiResponse_Any_`: the envelope `{ data: unknown, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1896
+
1897
+ Other envelope fields: `pagination` (PaginationMeta).
1898
+
1899
+ **Example**
1900
+
1901
+ ```ts
1902
+ const result = await g8.api.newsletter.runNewsletterListSync({
1903
+ path: {
1904
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1905
+ audience_list_id: 123,
1906
+ },
1907
+ });
1908
+ ```
1909
+
1910
+ ---
1911
+
1912
+ <a id="op-sendissue"></a>
1913
+
1914
+ ### `g8.api.newsletter.sendIssue(input)`
1915
+
1916
+ **Send Issue**
1917
+
1918
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send`
1919
+ - operationId: `send_issue_newsletters__newsletter_id__issues__issue_id__send_post` (also callable as `g8.api.call("send_issue_newsletters__newsletter_id__issues__issue_id__send_post", input)`)
1920
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
1921
+ - API-key scope: `newsletter:run`
1922
+ - ★ Hand-written: [`g8.newsletter.sendIssue()`](../sdk-clients.md#g8-newsletter-sendissue)
1923
+
1924
+ Enqueue or schedule a newsletter issue for sending.
1925
+
1926
+ 202 Accepted: the request is validated and handed to the send worker
1927
+ (or persisted as scheduled) — actual SES delivery happens
1928
+ asynchronously. Poll ``g8_newsletter_get_issue`` to observe completion.
1929
+ ``scheduled_at`` omitted/null sends immediately; a malformed
1930
+ ``scheduled_at`` string returns 422 (not 500).
1931
+
1932
+ **Input**
1933
+
1934
+ | Field | Type | Required | Description |
1935
+ |---|---|---|---|
1936
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
1937
+ | `path.issue_id` | `integer` | yes | Issue id |
1938
+ | `body` | `IssueSendRequest` | yes | Request body; fields below. |
1939
+
1940
+ Body fields (`IssueSendRequest`):
1941
+
1942
+ | Field | Type | Required | Description |
1943
+ |---|---|---|---|
1944
+ | `body.scheduled_at` | `string \| null` | no | |
1945
+
1946
+ **Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1947
+
1948
+ Other envelope fields: `pagination` (PaginationMeta).
1949
+
1950
+ **Example**
1951
+
1952
+ ```ts
1953
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
1954
+ const result = await g8.api.newsletter.sendIssue({
1955
+ path: {
1956
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
1957
+ issue_id: 123,
1958
+ },
1959
+ body: {},
1960
+ });
1961
+ ```
1962
+
1963
+ ---
1964
+
1965
+ <a id="op-sendtestemail"></a>
1966
+
1967
+ ### `g8.api.newsletter.sendTestEmail(input)`
1968
+
1969
+ **Send Test Email**
1970
+
1971
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/send-test`
1972
+ - operationId: `send_test_email_newsletters__newsletter_id__issues__issue_id__send_test_post` (also callable as `g8.api.call("send_test_email_newsletters__newsletter_id__issues__issue_id__send_test_post", input)`)
1973
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
1974
+ - API-key scope: `newsletter:run`
1975
+ - ★ Hand-written: [`g8.newsletter.sendTestEmail()`](../sdk-clients.md#g8-newsletter-sendtestemail)
1976
+
1977
+ Send a test email for a newsletter issue to a single address.
1978
+
1979
+ **Input**
1980
+
1981
+ | Field | Type | Required | Description |
1982
+ |---|---|---|---|
1983
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
1984
+ | `path.issue_id` | `integer` | yes | Issue id |
1985
+ | `body` | `IssueSendTestRequest` | yes | Request body; fields below. |
1986
+
1987
+ Body fields (`IssueSendTestRequest`):
1988
+
1989
+ | Field | Type | Required | Description |
1990
+ |---|---|---|---|
1991
+ | `body.test_email` | `string` | yes | max length 255 |
1992
+
1993
+ **Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1994
+
1995
+ Other envelope fields: `pagination` (PaginationMeta).
1996
+
1997
+ **Example**
1998
+
1999
+ ```ts
2000
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
2001
+ const result = await g8.api.newsletter.sendTestEmail({
2002
+ path: {
2003
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
2004
+ issue_id: 123,
2005
+ },
2006
+ body: { test_email: "jane@acme.com" },
2007
+ });
2008
+ ```
2009
+
2010
+ ---
2011
+
2012
+ <a id="op-setissuebuttonaction"></a>
2013
+
2014
+ ### `g8.api.newsletter.setIssueButtonAction(input)`
2015
+
2016
+ **Set Issue Button Action**
2017
+
2018
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/set-button-action`
2019
+ - operationId: `set_issue_button_action_newsletters__newsletter_id__issues__issue_id__set_button_action_post` (also callable as `g8.api.call("set_issue_button_action_newsletters__newsletter_id__issues__issue_id__set_button_action_post", input)`)
2020
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2021
+ - API-key scope: `newsletter:write`
2022
+
2023
+ Repoint a button in an issue. Deterministic - no AI, no credit.
2024
+
2025
+ **Input**
2026
+
2027
+ | Field | Type | Required | Description |
2028
+ |---|---|---|---|
2029
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
2030
+ | `path.issue_id` | `integer` | yes | Issue id. |
2031
+ | `body` | `SetButtonActionRequest` | yes | Request body; fields below. |
2032
+
2033
+ Body fields (`SetButtonActionRequest`):
2034
+
2035
+ | Field | Type | Required | Description |
2036
+ |---|---|---|---|
2037
+ | `body.action_type` | `"url" \| "mailto"` | yes | |
2038
+ | `body.g8_action_id` | `string` | yes | min length 1, max length 120 |
2039
+ | `body.email` | `string \| null` | no | For `mailto`. max length 320 |
2040
+ | `body.href` | `string \| null` | no | For `url`. max length 2048 |
2041
+ | `body.target` | `"_self" \| "_blank" \| null` | no | |
2042
+
2043
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2044
+
2045
+ Other envelope fields: `pagination` (PaginationMeta).
2046
+
2047
+ **Example**
2048
+
2049
+ ```ts
2050
+ const result = await g8.api.newsletter.setIssueButtonAction({
2051
+ path: {
2052
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
2053
+ issue_id: 123,
2054
+ },
2055
+ body: { action_type: "url", g8_action_id: "id" },
2056
+ });
2057
+ ```
2058
+
2059
+ ---
2060
+
2061
+ <a id="op-setissuemediaedit"></a>
2062
+
2063
+ ### `g8.api.newsletter.setIssueMediaEdit(input)`
2064
+
2065
+ **Set Issue Media Edit**
2066
+
2067
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/set-media-edit`
2068
+ - operationId: `set_issue_media_edit_newsletters__newsletter_id__issues__issue_id__set_media_edit_post` (also callable as `g8.api.call("set_issue_media_edit_newsletters__newsletter_id__issues__issue_id__set_media_edit_post", input)`)
2069
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2070
+ - API-key scope: `newsletter:write`
2071
+
2072
+ Change or remove an image in an issue. Deterministic - no AI.
2073
+
2074
+ **Input**
2075
+
2076
+ | Field | Type | Required | Description |
2077
+ |---|---|---|---|
2078
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
2079
+ | `path.issue_id` | `integer` | yes | Issue id. |
2080
+ | `body` | `SetMediaEditRequest` | yes | Request body; fields below. |
2081
+
2082
+ Body fields (`SetMediaEditRequest`):
2083
+
2084
+ | Field | Type | Required | Description |
2085
+ |---|---|---|---|
2086
+ | `body.g8_action_id` | `string` | yes | min length 1, max length 120 |
2087
+ | `body.align` | `"left" \| "center" \| "right" \| null` | no | |
2088
+ | `body.alt` | `string \| null` | no | max length 500 |
2089
+ | `body.height` | `integer \| null` | no | min 1, max 3000 |
2090
+ | `body.remove` | `boolean` | no | Delete the image. Other fields are then ignored. default `false` |
2091
+ | `body.src` | `string \| null` | no | max length 2048 |
2092
+ | `body.width` | `integer \| null` | no | min 1, max 3000 |
2093
+
2094
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2095
+
2096
+ Other envelope fields: `pagination` (PaginationMeta).
2097
+
2098
+ **Example**
2099
+
2100
+ ```ts
2101
+ const result = await g8.api.newsletter.setIssueMediaEdit({
2102
+ path: {
2103
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
2104
+ issue_id: 123,
2105
+ },
2106
+ body: { g8_action_id: "id" },
2107
+ });
2108
+ ```
2109
+
2110
+ ---
2111
+
2112
+ <a id="op-setissuetext"></a>
2113
+
2114
+ ### `g8.api.newsletter.setIssueText(input)`
2115
+
2116
+ **Set Issue Text**
2117
+
2118
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/issues/{issue_id}/set-text`
2119
+ - operationId: `set_issue_text_newsletters__newsletter_id__issues__issue_id__set_text_post` (also callable as `g8.api.call("set_issue_text_newsletters__newsletter_id__issues__issue_id__set_text_post", input)`)
2120
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2121
+ - API-key scope: `newsletter:write`
2122
+
2123
+ Replace one element's text, exactly as given. No AI and no credit.
2124
+
2125
+ `element_id` is the `g8` id in the issue's rendered HTML, which is what
2126
+ makes this addressable at all - it edits a named element rather than
2127
+ re-writing the document.
2128
+
2129
+ **Input**
2130
+
2131
+ | Field | Type | Required | Description |
2132
+ |---|---|---|---|
2133
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
2134
+ | `path.issue_id` | `integer` | yes | Issue id. |
2135
+ | `body` | `SetTextRequest` | yes | Request body; fields below. |
2136
+
2137
+ Body fields (`SetTextRequest`):
2138
+
2139
+ | Field | Type | Required | Description |
2140
+ |---|---|---|---|
2141
+ | `body.element_id` | `string` | yes | `g8` element id from the rendered HTML. max length 200 |
2142
+ | `body.new_text` | `string` | yes | max length 5000 |
2143
+
2144
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2145
+
2146
+ Other envelope fields: `pagination` (PaginationMeta).
2147
+
2148
+ **Example**
2149
+
2150
+ ```ts
2151
+ const result = await g8.api.newsletter.setIssueText({
2152
+ path: {
2153
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
2154
+ issue_id: 123,
2155
+ },
2156
+ body: { element_id: "id", new_text: "example" },
2157
+ });
2158
+ ```
2159
+
2160
+ ---
2161
+
2162
+ <a id="op-settemplateapproval"></a>
2163
+
2164
+ ### `g8.api.newsletter.setTemplateApproval(input)`
2165
+
2166
+ **Set Template Approval**
2167
+
2168
+ - HTTP: `POST /api/v1/newsletters/templates/{template_id}/approval`
2169
+ - operationId: `set_template_approval_newsletters_templates__template_id__approval_post` (also callable as `g8.api.call("set_template_approval_newsletters_templates__template_id__approval_post", input)`)
2170
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2171
+ - API-key scope: `newsletter:write`
2172
+
2173
+ Move a template through its lifecycle.
2174
+
2175
+ `approved` is what makes it usable in the gallery; `archived` takes it out
2176
+ of circulation without destroying it. One explicit status rather than
2177
+ separate approve and reject calls, so a retry is idempotent instead of
2178
+ toggling.
2179
+
2180
+ **Input**
2181
+
2182
+ | Field | Type | Required | Description |
2183
+ |---|---|---|---|
2184
+ | `path.template_id` | `integer` | yes | Template id. |
2185
+ | `body` | `SetTemplateApprovalRequest` | yes | Request body; fields below. |
2186
+
2187
+ Body fields (`SetTemplateApprovalRequest`):
2188
+
2189
+ | Field | Type | Required | Description |
2190
+ |---|---|---|---|
2191
+ | `body.status` | `"draft" \| "approved" \| "archived"` | yes | |
2192
+
2193
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2194
+
2195
+ Other envelope fields: `pagination` (PaginationMeta).
2196
+
2197
+ **Example**
2198
+
2199
+ ```ts
2200
+ const result = await g8.api.newsletter.setTemplateApproval({ path: { template_id: 123 }, body: { status: "draft" } });
2201
+ ```
2202
+
2203
+ ---
2204
+
2205
+ <a id="op-settemplatebuttonaction"></a>
2206
+
2207
+ ### `g8.api.newsletter.setTemplateButtonAction(input)`
2208
+
2209
+ **Set Template Button Action**
2210
+
2211
+ - HTTP: `POST /api/v1/newsletters/templates/{template_id}/set-button-action`
2212
+ - operationId: `set_template_button_action_newsletters_templates__template_id__set_button_action_post` (also callable as `g8.api.call("set_template_button_action_newsletters_templates__template_id__set_button_action_post", input)`)
2213
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2214
+ - API-key scope: `newsletter:write`
2215
+
2216
+ Repoint a button in a template. Deterministic - no AI, no credit.
2217
+
2218
+ **Input**
2219
+
2220
+ | Field | Type | Required | Description |
2221
+ |---|---|---|---|
2222
+ | `path.template_id` | `integer` | yes | Template id. |
2223
+ | `body` | `SetButtonActionRequest` | yes | Request body; fields below. |
2224
+
2225
+ Body fields (`SetButtonActionRequest`):
2226
+
2227
+ | Field | Type | Required | Description |
2228
+ |---|---|---|---|
2229
+ | `body.action_type` | `"url" \| "mailto"` | yes | |
2230
+ | `body.g8_action_id` | `string` | yes | min length 1, max length 120 |
2231
+ | `body.email` | `string \| null` | no | For `mailto`. max length 320 |
2232
+ | `body.href` | `string \| null` | no | For `url`. max length 2048 |
2233
+ | `body.target` | `"_self" \| "_blank" \| null` | no | |
2234
+
2235
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2236
+
2237
+ Other envelope fields: `pagination` (PaginationMeta).
2238
+
2239
+ **Example**
2240
+
2241
+ ```ts
2242
+ const result = await g8.api.newsletter.setTemplateButtonAction({
2243
+ path: { template_id: 123 },
2244
+ body: { action_type: "url", g8_action_id: "id" },
2245
+ });
2246
+ ```
2247
+
2248
+ ---
2249
+
2250
+ <a id="op-settemplatemediaedit"></a>
2251
+
2252
+ ### `g8.api.newsletter.setTemplateMediaEdit(input)`
2253
+
2254
+ **Set Template Media Edit**
2255
+
2256
+ - HTTP: `POST /api/v1/newsletters/templates/{template_id}/set-media-edit`
2257
+ - operationId: `set_template_media_edit_newsletters_templates__template_id__set_media_edit_post` (also callable as `g8.api.call("set_template_media_edit_newsletters_templates__template_id__set_media_edit_post", input)`)
2258
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2259
+ - API-key scope: `newsletter:write`
2260
+
2261
+ Change or remove an image in a template. Deterministic - no AI.
2262
+
2263
+ **Input**
2264
+
2265
+ | Field | Type | Required | Description |
2266
+ |---|---|---|---|
2267
+ | `path.template_id` | `integer` | yes | Template id. |
2268
+ | `body` | `SetMediaEditRequest` | yes | Request body; fields below. |
2269
+
2270
+ Body fields (`SetMediaEditRequest`):
2271
+
2272
+ | Field | Type | Required | Description |
2273
+ |---|---|---|---|
2274
+ | `body.g8_action_id` | `string` | yes | min length 1, max length 120 |
2275
+ | `body.align` | `"left" \| "center" \| "right" \| null` | no | |
2276
+ | `body.alt` | `string \| null` | no | max length 500 |
2277
+ | `body.height` | `integer \| null` | no | min 1, max 3000 |
2278
+ | `body.remove` | `boolean` | no | Delete the image. Other fields are then ignored. default `false` |
2279
+ | `body.src` | `string \| null` | no | max length 2048 |
2280
+ | `body.width` | `integer \| null` | no | min 1, max 3000 |
2281
+
2282
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2283
+
2284
+ Other envelope fields: `pagination` (PaginationMeta).
2285
+
2286
+ **Example**
2287
+
2288
+ ```ts
2289
+ const result = await g8.api.newsletter.setTemplateMediaEdit({ path: { template_id: 123 }, body: { g8_action_id: "id" } });
2290
+ ```
2291
+
2292
+ ---
2293
+
2294
+ <a id="op-templategenerationstatus"></a>
2295
+
2296
+ ### `g8.api.newsletter.templateGenerationStatus(input)`
2297
+
2298
+ **Template Generation Status**
2299
+
2300
+ - HTTP: `GET /api/v1/newsletters/templates/{template_id}/generation-status`
2301
+ - operationId: `template_generation_status_newsletters_templates__template_id__generation_status_get` (also callable as `g8.api.call("template_generation_status_newsletters_templates__template_id__generation_status_get", input)`)
2302
+ - Tier: `read`: reads data; safe to call and to retry
2303
+ - API-key scope: `newsletter:read`
2304
+
2305
+ How far along one template build is.
2306
+
2307
+ Durable, not in-memory: a poll that arrives after a worker restart still
2308
+ gets the truth rather than a reset.
2309
+
2310
+ **Input**
2311
+
2312
+ | Field | Type | Required | Description |
2313
+ |---|---|---|---|
2314
+ | `path.template_id` | `integer` | yes | Template id. |
2315
+
2316
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2317
+
2318
+ Other envelope fields: `pagination` (PaginationMeta).
2319
+
2320
+ **Example**
2321
+
2322
+ ```ts
2323
+ const result = await g8.api.newsletter.templateGenerationStatus({ path: { template_id: 123 } });
2324
+ ```
2325
+
2326
+ ---
2327
+
2328
+ <a id="op-unlinknewslettercampaign"></a>
2329
+
2330
+ ### `g8.api.newsletter.unlinkNewsletterCampaign(input)`
2331
+
2332
+ **Unlink Newsletter Campaign**
2333
+
2334
+ - HTTP: `DELETE /api/v1/newsletters/{newsletter_id}/campaign`
2335
+ - operationId: `unlink_newsletter_campaign_newsletters__newsletter_id__campaign_delete` (also callable as `g8.api.call("unlink_newsletter_campaign_newsletters__newsletter_id__campaign_delete", input)`)
2336
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
2337
+ - API-key scope: `newsletter:delete`
2338
+
2339
+ Unlink the Studio campaign. The campaign itself is untouched.
2340
+
2341
+ **Input**
2342
+
2343
+ | Field | Type | Required | Description |
2344
+ |---|---|---|---|
2345
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
2346
+
2347
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2348
+
2349
+ Other envelope fields: `pagination` (PaginationMeta).
2350
+
2351
+ **Example**
2352
+
2353
+ ```ts
2354
+ // destructive: deletes or archives data; confirm with a human before calling.
2355
+ const result = await g8.api.newsletter.unlinkNewsletterCampaign({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
2356
+ ```
2357
+
2358
+ ---
2359
+
2360
+ <a id="op-unsubscribesubscriber"></a>
2361
+
2362
+ ### `g8.api.newsletter.unsubscribeSubscriber(input)`
2363
+
2364
+ **Unsubscribe Subscriber**
2365
+
2366
+ - HTTP: `PATCH /api/v1/newsletters/{newsletter_id}/subscribers/{subscriber_id}/unsubscribe`
2367
+ - operationId: `unsubscribe_subscriber_newsletters__newsletter_id__subscribers__subscriber_id__unsubscribe_patch` (also callable as `g8.api.call("unsubscribe_subscriber_newsletters__newsletter_id__subscribers__subscriber_id__unsubscribe_patch", input)`)
2368
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
2369
+ - API-key scope: `newsletter:run`
2370
+ - ★ Hand-written: [`g8.newsletter.unsubscribe()`](../sdk-clients.md#g8-newsletter-unsubscribe)
2371
+
2372
+ Soft-unsubscribe a subscriber (sets status, preserves the row —
2373
+ does NOT hard-delete).
2374
+
2375
+ **Input**
2376
+
2377
+ | Field | Type | Required | Description |
2378
+ |---|---|---|---|
2379
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
2380
+ | `path.subscriber_id` | `integer` | yes | Subscriber id |
2381
+
2382
+ **Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2383
+
2384
+ Other envelope fields: `pagination` (PaginationMeta).
2385
+
2386
+ **Example**
2387
+
2388
+ ```ts
2389
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
2390
+ const result = await g8.api.newsletter.unsubscribeSubscriber({
2391
+ path: {
2392
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
2393
+ subscriber_id: 123,
2394
+ },
2395
+ });
2396
+ ```
2397
+
2398
+ ---
2399
+
2400
+ <a id="op-updateissue"></a>
2401
+
2402
+ ### `g8.api.newsletter.updateIssue(input)`
2403
+
2404
+ **Update Issue**
2405
+
2406
+ - HTTP: `PUT /api/v1/newsletters/{newsletter_id}/issues/{issue_id}`
2407
+ - operationId: `update_issue_newsletters__newsletter_id__issues__issue_id__put` (also callable as `g8.api.call("update_issue_newsletters__newsletter_id__issues__issue_id__put", input)`)
2408
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
2409
+ - API-key scope: `newsletter:run`
2410
+ - ★ Hand-written: [`g8.newsletter.updateIssue()`](../sdk-clients.md#g8-newsletter-updateissue)
2411
+
2412
+ Update a draft issue in place. Only fields sent are changed. Rejects
2413
+ with 400 for issues no longer in a draft-editable state (mirrors the
2414
+ internal handler's own ValueError -> 400 mapping).
2415
+
2416
+ **Input**
2417
+
2418
+ | Field | Type | Required | Description |
2419
+ |---|---|---|---|
2420
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter UUID |
2421
+ | `path.issue_id` | `integer` | yes | Issue id |
2422
+ | `body` | `IssueUpdateRequest` | yes | Request body; fields below. |
2423
+
2424
+ Body fields (`IssueUpdateRequest`):
2425
+
2426
+ | Field | Type | Required | Description |
2427
+ |---|---|---|---|
2428
+ | `body.html_body` | `string \| null` | no | |
2429
+ | `body.plain_text` | `string \| null` | no | |
2430
+ | `body.preview_text` | `string \| null` | no | max length 500 |
2431
+ | `body.reply_to` | `string (email) \| null` | no | |
2432
+ | `body.sender_email` | `string (email) \| null` | no | |
2433
+ | `body.sender_name` | `string \| null` | no | max length 255 |
2434
+ | `body.subject` | `string \| null` | no | max length 2000 |
2435
+
2436
+ **Returns** `ApiResponse_IssueDetail_`: the envelope `{ data: IssueDetail, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2437
+
2438
+ Other envelope fields: `pagination` (PaginationMeta).
2439
+
2440
+ `IssueDetail` fields:
2441
+
2442
+ | Field | Type | Required | Description |
2443
+ |---|---|---|---|
2444
+ | `created_at` | `string \| null` | no | |
2445
+ | `id` | `integer \| null` | no | |
2446
+ | `newsletter_id` | `string \| null` | no | |
2447
+ | `sent_at` | `string \| null` | no | |
2448
+ | `status` | `string \| null` | no | |
2449
+ | `subject` | `string \| null` | no | |
2450
+ | `updated_at` | `string \| null` | no | |
2451
+
2452
+ **Example**
2453
+
2454
+ ```ts
2455
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
2456
+ const result = await g8.api.newsletter.updateIssue({
2457
+ path: {
2458
+ newsletter_id: "00000000-0000-0000-0000-000000000000",
2459
+ issue_id: 123,
2460
+ },
2461
+ body: {},
2462
+ });
2463
+ ```
2464
+
2465
+ ---
2466
+
2467
+ <a id="op-updatenewsletter"></a>
2468
+
2469
+ ### `g8.api.newsletter.updateNewsletter(input)`
2470
+
2471
+ **Update Newsletter**
2472
+
2473
+ - HTTP: `PATCH /api/v1/newsletters/{newsletter_id}`
2474
+ - operationId: `update_newsletter_newsletters__newsletter_id__patch` (also callable as `g8.api.call("update_newsletter_newsletters__newsletter_id__patch", input)`)
2475
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2476
+ - API-key scope: `newsletter:write`
2477
+
2478
+ Rename a newsletter, restate its goal, or repoint its audience.
2479
+
2480
+ Repointing the audience changes where NEW subscribers come from. It does
2481
+ not move, remove or re-import anybody already subscribed.
2482
+
2483
+ **Input**
2484
+
2485
+ | Field | Type | Required | Description |
2486
+ |---|---|---|---|
2487
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
2488
+ | `body` | `UpdateNewsletterRequest` | yes | Request body; fields below. |
2489
+
2490
+ Body fields (`UpdateNewsletterRequest`):
2491
+
2492
+ | Field | Type | Required | Description |
2493
+ |---|---|---|---|
2494
+ | `body.audience_list_id` | `string \| null` | no | The audience new subscribers are drawn from. Changing it does NOT move anybody who is already subscribed. |
2495
+ | `body.goal` | `string \| null` | no | What the newsletter is for. Steers AI drafting. |
2496
+ | `body.name` | `string \| null` | no | max length 255 |
2497
+
2498
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2499
+
2500
+ Other envelope fields: `pagination` (PaginationMeta).
2501
+
2502
+ **Example**
2503
+
2504
+ ```ts
2505
+ const result = await g8.api.newsletter.updateNewsletter({
2506
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
2507
+ body: {},
2508
+ });
2509
+ ```
2510
+
2511
+ ---
2512
+
2513
+ <a id="op-updatenewslettersettings"></a>
2514
+
2515
+ ### `g8.api.newsletter.updateNewsletterSettings(input)`
2516
+
2517
+ **Update Newsletter Settings**
2518
+
2519
+ - HTTP: `PUT /api/v1/newsletters/{newsletter_id}/settings`
2520
+ - operationId: `update_newsletter_settings_newsletters__newsletter_id__settings_put` (also callable as `g8.api.call("update_newsletter_settings_newsletters__newsletter_id__settings_put", input)`)
2521
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2522
+ - API-key scope: `newsletter:write`
2523
+
2524
+ Set the sender identity and the opt-in policy.
2525
+
2526
+ Set `double_opt_in_intent` rather than `double_opt_in`: the active flag the
2527
+ send pipeline reads is promoted automatically once the domain is verified
2528
+ and a sender address exists, and writing the active flag directly asks for
2529
+ a state the pipeline is not ready for.
2530
+
2531
+ **Input**
2532
+
2533
+ | Field | Type | Required | Description |
2534
+ |---|---|---|---|
2535
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
2536
+ | `body` | `UpdateNewsletterSettingsRequest` | yes | Request body; fields below. |
2537
+
2538
+ Body fields (`UpdateNewsletterSettingsRequest`):
2539
+
2540
+ | Field | Type | Required | Description |
2541
+ |---|---|---|---|
2542
+ | `body.auto_verify_on_import` | `boolean \| null` | no | |
2543
+ | `body.default_reply_to` | `string \| null` | no | |
2544
+ | `body.default_sender_email` | `string \| null` | no | |
2545
+ | `body.default_sender_name` | `string \| null` | no | |
2546
+ | `body.double_opt_in` | `boolean \| null` | no | The ACTIVE double-opt-in flag the send pipeline reads. Legacy: a `true` written here is routed to `double_opt_in_intent` and the active flag is auto-promoted once the domain and sender are ready. |
2547
+ | `body.double_opt_in_intent` | `boolean \| null` | no | The REQUEST for double opt-in, independent of readiness. Set this rather than `double_opt_in` - it is promoted automatically. |
2548
+ | `body.sending_domain` | `string \| null` | no | Must be verified first - see `settings/verify-domain`. |
2549
+ | `body.skip_unverified_subscribers` | `boolean \| null` | no | |
2550
+
2551
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2552
+
2553
+ Other envelope fields: `pagination` (PaginationMeta).
2554
+
2555
+ **Example**
2556
+
2557
+ ```ts
2558
+ const result = await g8.api.newsletter.updateNewsletterSettings({
2559
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
2560
+ body: {},
2561
+ });
2562
+ ```
2563
+
2564
+ ---
2565
+
2566
+ <a id="op-updatenewslettertemplate"></a>
2567
+
2568
+ ### `g8.api.newsletter.updateNewsletterTemplate(input)`
2569
+
2570
+ **Update Newsletter Template**
2571
+
2572
+ - HTTP: `PATCH /api/v1/newsletters/templates/{template_id}`
2573
+ - operationId: `update_newsletter_template_newsletters_templates__template_id__patch` (also callable as `g8.api.call("update_newsletter_template_newsletters_templates__template_id__patch", input)`)
2574
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2575
+ - API-key scope: `newsletter:write`
2576
+
2577
+ Edit a template's name, subject, preview text or HTML.
2578
+
2579
+ **Input**
2580
+
2581
+ | Field | Type | Required | Description |
2582
+ |---|---|---|---|
2583
+ | `path.template_id` | `integer` | yes | Template id. |
2584
+ | `body` | `NewsletterTemplateUpdateRequest` | yes | Request body; fields below. |
2585
+
2586
+ Body fields (`NewsletterTemplateUpdateRequest`):
2587
+
2588
+ | Field | Type | Required | Description |
2589
+ |---|---|---|---|
2590
+ | `body.html_body` | `string \| null` | no | |
2591
+ | `body.name` | `string \| null` | no | |
2592
+ | `body.preview_text` | `string \| null` | no | |
2593
+ | `body.subject` | `string \| null` | no | |
2594
+
2595
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2596
+
2597
+ Other envelope fields: `pagination` (PaginationMeta).
2598
+
2599
+ **Example**
2600
+
2601
+ ```ts
2602
+ const result = await g8.api.newsletter.updateNewsletterTemplate({ path: { template_id: 123 }, body: {} });
2603
+ ```
2604
+
2605
+ ---
2606
+
2607
+ <a id="op-usetemplate"></a>
2608
+
2609
+ ### `g8.api.newsletter.useTemplate(input)`
2610
+
2611
+ **Use Template**
2612
+
2613
+ - HTTP: `POST /api/v1/newsletters/templates/{template_id}/use`
2614
+ - operationId: `use_template_newsletters_templates__template_id__use_post` (also callable as `g8.api.call("use_template_newsletters_templates__template_id__use_post", input)`)
2615
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
2616
+ - API-key scope: `newsletter:write`
2617
+
2618
+ Turn a template into a new DRAFT issue on a newsletter.
2619
+
2620
+ A copy, not a link: editing the issue afterwards leaves the template alone,
2621
+ and editing the template does not reach back into issues already made from
2622
+ it.
2623
+
2624
+ **Input**
2625
+
2626
+ | Field | Type | Required | Description |
2627
+ |---|---|---|---|
2628
+ | `path.template_id` | `integer` | yes | Template id. |
2629
+ | `body` | `UseTemplateRequest` | yes | Request body; fields below. |
2630
+
2631
+ Body fields (`UseTemplateRequest`):
2632
+
2633
+ | Field | Type | Required | Description |
2634
+ |---|---|---|---|
2635
+ | `body.newsletter_id` | `string (uuid)` | yes | Which newsletter the draft issue is created on. |
2636
+
2637
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2638
+
2639
+ Other envelope fields: `pagination` (PaginationMeta).
2640
+
2641
+ **Example**
2642
+
2643
+ ```ts
2644
+ const result = await g8.api.newsletter.useTemplate({
2645
+ path: { template_id: 123 },
2646
+ body: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
2647
+ });
2648
+ ```
2649
+
2650
+ ---
2651
+
2652
+ <a id="op-verifynewsletterdomain"></a>
2653
+
2654
+ ### `g8.api.newsletter.verifyNewsletterDomain(input)`
2655
+
2656
+ **Verify Newsletter Domain**
2657
+
2658
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/settings/verify-domain`
2659
+ - operationId: `verify_newsletter_domain_newsletters__newsletter_id__settings_verify_domain_post` (also callable as `g8.api.call("verify_newsletter_domain_newsletters__newsletter_id__settings_verify_domain_post", input)`)
2660
+ - Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
2661
+ - API-key scope: `newsletter:run`
2662
+
2663
+ Start verification of a sending domain and get the DNS records back.
2664
+
2665
+ The records include DMARC, which Gmail and Yahoo require of bulk senders -
2666
+ publishing SPF and DKIM alone will pass this check and still land in spam.
2667
+ Domains bought through graph8 have their DNS added automatically; for a
2668
+ domain you own, the records have to be added at your own provider.
2669
+
2670
+ **Input**
2671
+
2672
+ | Field | Type | Required | Description |
2673
+ |---|---|---|---|
2674
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id (UUID). |
2675
+ | `body` | `VerifyDomainRequest` | yes | Request body; fields below. |
2676
+
2677
+ Body fields (`VerifyDomainRequest`):
2678
+
2679
+ | Field | Type | Required | Description |
2680
+ |---|---|---|---|
2681
+ | `body.domain` | `string` | yes | Sending subdomain, e.g. `updates.acme.com`. |
2682
+
2683
+ **Returns** `ApiResponse_NewsletterPayload_`: the envelope `{ data: NewsletterPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2684
+
2685
+ Other envelope fields: `pagination` (PaginationMeta).
2686
+
2687
+ **Example**
2688
+
2689
+ ```ts
2690
+ // external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
2691
+ const result = await g8.api.newsletter.verifyNewsletterDomain({
2692
+ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" },
2693
+ body: { domain: "acme.com" },
2694
+ });
2695
+ ```
2696
+
2697
+ ---
2698
+
2699
+ <a id="op-verifynewslettersubscribers"></a>
2700
+
2701
+ ### `g8.api.newsletter.verifyNewsletterSubscribers(input)`
2702
+
2703
+ **Verify Newsletter Subscribers**
2704
+
2705
+ - HTTP: `POST /api/v1/newsletters/{newsletter_id}/subscribers/verify`
2706
+ - operationId: `verify_newsletter_subscribers_newsletters__newsletter_id__subscribers_verify_post` (also callable as `g8.api.call("verify_newsletter_subscribers_newsletters__newsletter_id__subscribers_verify_post", input)`)
2707
+ - Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
2708
+ - API-key scope: `newsletter:run`
2709
+
2710
+ Verify every unverified subscriber address (charges credits per address).
2711
+
2712
+ **Input**
2713
+
2714
+ | Field | Type | Required | Description |
2715
+ |---|---|---|---|
2716
+ | `path.newsletter_id` | `string (uuid)` | yes | Newsletter id. |
2717
+
2718
+ **Returns** `ApiResponse_NewsletterStudioPayload_`: the envelope `{ data: NewsletterStudioPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
2719
+
2720
+ Other envelope fields: `pagination` (PaginationMeta).
2721
+
2722
+ **Example**
2723
+
2724
+ ```ts
2725
+ // billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
2726
+ const result = await g8.api.newsletter.verifyNewsletterSubscribers({ path: { newsletter_id: "00000000-0000-0000-0000-000000000000" } });
2727
+ ```
2728
+
2729
+ ---
2730
+
2731
+ ## Referenced types
2732
+
2733
+ Named types that appear in the tables above. Full TypeScript definitions: `G8Contract.<Name>` (`import type { G8Contract } from "@graph8/sdk"`).
2734
+
2735
+ <a id="type-listsync"></a>
2736
+
2737
+ ### `ListSync`
2738
+
2739
+ One audience list feeding a newsletter's subscribers.
2740
+
2741
+ | Field | Type | Required | Description |
2742
+ |---|---|---|---|
2743
+ | `audience_list_id` | `integer \| null` | no | |
2744
+ | `contact_count` | `integer \| null` | no | Live count the worker will act on. |
2745
+ | `enabled` | `boolean \| null` | no | False on a SYNTHETIC candidate row - a list resolved by `?audience_list_id=` that has no saved sync yet. |
2746
+ | `name` | `string \| null` | no | Live list name. |