@graph8/sdk 0.251.0 → 0.262.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 +105 -7
  4. package/dist/index.d.ts +105 -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 +103 -7
  10. package/dist/react.d.ts +103 -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 +1697 -0
  140. package/docs/api/deals.md +2436 -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,1440 @@
1
+ <!-- Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. -->
2
+
3
+ # `g8.api.documents`: Documents
4
+
5
+ 35 operations (10 read, 20 write, 4 destructive, 1 billable).
6
+
7
+ No hand-written client covers this area. Call it through `g8.api.documents.*` as shown below, or by operationId with `g8.api.call(operationId, input)`.
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: [documents.d.ts](documents.d.ts).
20
+
21
+ ## Operations
22
+
23
+ | Call | HTTP | Tier | Scope | Summary |
24
+ |---|---|---|---|---|
25
+ | [`approveQuestionnaireAnswer`](#op-approvequestionnaireanswer) | `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/approve` | write | `companies:write` | Approve Questionnaire Answer |
26
+ | [`createAccountCorrespondence`](#op-createaccountcorrespondence) | `POST /api/v1/accounts/{account_id}/correspondence` | write | `companies:write` | Create Account Correspondence |
27
+ | [`createLibraryDocument`](#op-createlibrarydocument) | `POST /api/v1/library/documents` | write | `knowledge:write` | Create Library Document |
28
+ | [`createLibraryFolder`](#op-createlibraryfolder) | `POST /api/v1/library/folders` | write | `knowledge:write` | Create Library Folder |
29
+ | [`deleteAccountCorrespondence`](#op-deleteaccountcorrespondence) | `DELETE /api/v1/accounts/{account_id}/correspondence/{correspondence_id}` | destructive | `companies:delete` | Delete Account Correspondence |
30
+ | [`deleteLibraryDocument`](#op-deletelibrarydocument) | `DELETE /api/v1/library/documents/{document_id}` | destructive | `knowledge:delete` | Delete Library Document |
31
+ | [`deleteLibraryFolder`](#op-deletelibraryfolder) | `DELETE /api/v1/library/folders/{folder_id}` | destructive | `knowledge:delete` | Delete Library Folder |
32
+ | [`deleteSecurityQuestionnaire`](#op-deletesecurityquestionnaire) | `DELETE /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}` | destructive | `companies:delete` | Delete Security Questionnaire |
33
+ | [`downloadLibraryDocument`](#op-downloadlibrarydocument) | `GET /api/v1/library/documents/{document_id}/download` | read | `knowledge:read` | Download Library Document |
34
+ | [`downloadSecurityQuestionnaire`](#op-downloadsecurityquestionnaire) | `GET /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/download` | read | `companies:read` | Download Security Questionnaire |
35
+ | [`escalateQuestionnaireQuestion`](#op-escalatequestionnairequestion) | `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/escalate` | write | `companies:write` | Escalate Questionnaire Question |
36
+ | [`flagQuestionnaireAnswer`](#op-flagquestionnaireanswer) | `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/mark-wrong` | write | `companies:write` | Flag Questionnaire Answer |
37
+ | [`getLibraryDocument`](#op-getlibrarydocument) | `GET /api/v1/library/documents/{document_id}` | read | `knowledge:read` | Get Library Document |
38
+ | [`getLibraryTree`](#op-getlibrarytree) | `GET /api/v1/library/tree` | read | `knowledge:read` | Get Library Tree |
39
+ | [`getSecurityQuestionnaire`](#op-getsecurityquestionnaire) | `GET /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}` | read | `companies:read` | Get Security Questionnaire |
40
+ | [`getSecurityQuestionnaireStatus`](#op-getsecurityquestionnairestatus) | `GET /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/status` | read | `companies:read` | Get Security Questionnaire Status |
41
+ | [`importAccountCorrespondence`](#op-importaccountcorrespondence) | `POST /api/v1/accounts/{account_id}/correspondence/import` | write | `companies:write` | Import Account Correspondence |
42
+ | [`listAccountCorrespondence`](#op-listaccountcorrespondence) | `GET /api/v1/accounts/{account_id}/correspondence` | read | `companies:read` | List Account Correspondence |
43
+ | [`listLibraryDocuments`](#op-listlibrarydocuments) | `GET /api/v1/library/documents` | read | `knowledge:read` | List Library Documents |
44
+ | [`listLibraryFolders`](#op-listlibraryfolders) | `GET /api/v1/library/folders` | read | `knowledge:read` | List Library Folders |
45
+ | [`listSecurityQuestionnaires`](#op-listsecurityquestionnaires) | `GET /api/v1/accounts/{account_id}/security-questionnaires` | read | `companies:read` | List Security Questionnaires |
46
+ | [`reextractAllLibraryDocuments`](#op-reextractalllibrarydocuments) | `POST /api/v1/library/documents/reextract-all` | write | `knowledge:write` | Reextract All Library Documents |
47
+ | [`reextractLibraryDocument`](#op-reextractlibrarydocument) | `POST /api/v1/library/documents/{document_id}/reextract` | write | `knowledge:write` | Reextract Library Document |
48
+ | [`refreshLibraryDocument`](#op-refreshlibrarydocument) | `POST /api/v1/library/documents/{document_id}/refresh` | write | `knowledge:write` | Refresh Library Document |
49
+ | [`renameLibraryFolder`](#op-renamelibraryfolder) | `PUT /api/v1/library/folders/{folder_id}` | write | `knowledge:write` | Rename Library Folder |
50
+ | [`restoreLibraryDocument`](#op-restorelibrarydocument) | `POST /api/v1/library/documents/{document_id}/restore` | write | `knowledge:write` | Restore Library Document |
51
+ | [`saveQuestionnaireAnswerToLibrary`](#op-savequestionnaireanswertolibrary) | `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/save-to-library` | write | `companies:write` | Save Questionnaire Answer To Library |
52
+ | [`skipQuestionnaireQuestion`](#op-skipquestionnairequestion) | `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/mark-skip` | write | `companies:write` | Skip Questionnaire Question |
53
+ | [`updateLibraryDocument`](#op-updatelibrarydocument) | `PUT /api/v1/library/documents/{document_id}` | write | `knowledge:write` | Update Library Document |
54
+ | [`updateQuestionnaireAnswer`](#op-updatequestionnaireanswer) | `PATCH /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}` | write | `companies:write` | Update Questionnaire Answer |
55
+ | [`updateSecurityQuestionnaire`](#op-updatesecurityquestionnaire) | `PATCH /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}` | write | `companies:write` | Update Security Questionnaire |
56
+ | [`uploadAccountCorrespondence`](#op-uploadaccountcorrespondence) | `POST /api/v1/accounts/{account_id}/correspondence/upload` | write | `companies:write` | Upload Account Correspondence |
57
+ | [`uploadLibraryDocument`](#op-uploadlibrarydocument) | `POST /api/v1/library/documents/upload` | write | `knowledge:write` | Upload Library Document |
58
+ | [`uploadLibraryDocuments`](#op-uploadlibrarydocuments) | `POST /api/v1/library/documents/upload-batch` | write | `knowledge:write` | Upload Library Documents |
59
+ | [`uploadSecurityQuestionnaire`](#op-uploadsecurityquestionnaire) | `POST /api/v1/accounts/{account_id}/security-questionnaires` | billable | `knowledge:run` | Upload Security Questionnaire |
60
+
61
+ ---
62
+
63
+ <a id="op-approvequestionnaireanswer"></a>
64
+
65
+ ### `g8.api.documents.approveQuestionnaireAnswer(input)`
66
+
67
+ **Approve Questionnaire Answer**
68
+
69
+ - HTTP: `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/approve`
70
+ - operationId: `approve_questionnaire_answer_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__approve_post` (also callable as `g8.api.call("approve_questionnaire_answer_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__approve_post", input)`)
71
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
72
+ - API-key scope: `companies:write`
73
+
74
+ Confirm an answer as correct. No body - approving is the whole message.
75
+
76
+ This is the signal that takes a questionnaire from `needs_review` towards
77
+ done; it changes no text.
78
+
79
+ **Input**
80
+
81
+ | Field | Type | Required | Description |
82
+ |---|---|---|---|
83
+ | `path.account_id` | `string` | yes | The account. |
84
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
85
+ | `path.question_id` | `string` | yes | Question id (UUID), from the questionnaire detail read. |
86
+
87
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
88
+
89
+ Other envelope fields: `pagination` (PaginationMeta).
90
+
91
+ **Example**
92
+
93
+ ```ts
94
+ const result = await g8.api.documents.approveQuestionnaireAnswer({
95
+ path: { account_id: "id", questionnaire_id: "id", question_id: "id" },
96
+ });
97
+ ```
98
+
99
+ ---
100
+
101
+ <a id="op-createaccountcorrespondence"></a>
102
+
103
+ ### `g8.api.documents.createAccountCorrespondence(input)`
104
+
105
+ **Create Account Correspondence**
106
+
107
+ - HTTP: `POST /api/v1/accounts/{account_id}/correspondence`
108
+ - operationId: `create_account_correspondence_accounts__account_id__correspondence_post` (also callable as `g8.api.call("create_account_correspondence_accounts__account_id__correspondence_post", input)`)
109
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
110
+ - API-key scope: `companies:write`
111
+
112
+ Record ONE message, call or note against an account.
113
+
114
+ `correspondence_date` is when it HAPPENED, not when it was recorded - the
115
+ generated documents read it as the relationship's timeline, so a wrong
116
+ date is worse than a missing record.
117
+
118
+ **Input**
119
+
120
+ | Field | Type | Required | Description |
121
+ |---|---|---|---|
122
+ | `path.account_id` | `string` | yes | The account. |
123
+ | `body` | `CorrespondenceCreateRequest` | yes | Request body; fields below. |
124
+
125
+ Body fields (`CorrespondenceCreateRequest`):
126
+
127
+ | Field | Type | Required | Description |
128
+ |---|---|---|---|
129
+ | `body.channel` | `string` | yes | `email`, `linkedin` or `call_notes`. |
130
+ | `body.content` | `string` | yes | The body. Indexed for retrieval. |
131
+ | `body.correspondence_date` | `string (date-time)` | yes | When it happened - NOT when it was recorded. Required. |
132
+ | `body.direction` | `string` | yes | `inbound` or `outbound`. |
133
+ | `body.external_id` | `string \| null` | no | Your id for this message. The app uses it to skip duplicates on `/correspondence/import`, so send it to make an import re-runnable. |
134
+ | `body.stakeholder_id` | `string \| null` | no | The person at the account, when known. |
135
+ | `body.subject` | `string \| null` | no | |
136
+
137
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
138
+
139
+ Other envelope fields: `pagination` (PaginationMeta).
140
+
141
+ **Example**
142
+
143
+ ```ts
144
+ const result = await g8.api.documents.createAccountCorrespondence({
145
+ path: { account_id: "id" },
146
+ body: {
147
+ channel: "example",
148
+ content: "example",
149
+ correspondence_date: "2026-01-01T09:00:00Z",
150
+ direction: "example",
151
+ },
152
+ });
153
+ ```
154
+
155
+ ---
156
+
157
+ <a id="op-createlibrarydocument"></a>
158
+
159
+ ### `g8.api.documents.createLibraryDocument(input)`
160
+
161
+ **Create Library Document**
162
+
163
+ - HTTP: `POST /api/v1/library/documents`
164
+ - operationId: `create_library_document_library_documents_post` (also callable as `g8.api.call("create_library_document_library_documents_post", input)`)
165
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
166
+ - API-key scope: `knowledge:write`
167
+
168
+ Create a TEXT document from a string.
169
+
170
+ The counterpart to `/documents/upload`: no file, no extraction, the
171
+ `content` you send is the content stored. Use it for material you already
172
+ have as text.
173
+
174
+ **Input**
175
+
176
+ | Field | Type | Required | Description |
177
+ |---|---|---|---|
178
+ | `body` | `LibraryDocumentCreateRequest` | yes | Request body; fields below. |
179
+
180
+ Body fields (`LibraryDocumentCreateRequest`):
181
+
182
+ | Field | Type | Required | Description |
183
+ |---|---|---|---|
184
+ | `body.content` | `string` | yes | The document text. Stored verbatim. |
185
+ | `body.display_name` | `string` | yes | How the document is listed. |
186
+ | `body.file_name` | `string` | yes | Stored file name. |
187
+ | `body.folder_path` | `string` | yes | Where it lands, e.g. `Library/Case Studies`. The folder must already exist. |
188
+ | `body.account_id` | `string \| null` | no | REQUIRED when `context_type` is `account`. |
189
+ | `body.campaign_id` | `string \| null` | no | REQUIRED when `context_type` is `campaign`. |
190
+ | `body.context_type` | `"global" \| "campaign" \| "account"` | no | Whose library this belongs to. default `"global"` |
191
+ | `body.copilot_session_id` | `string \| null` | no | The Copilot session that produced it, when `source` is `copilot`. |
192
+ | `body.source` | `string` | no | Where the text came from; `manual` or `copilot` are what the app writes. NOT validated by the app, so any value is accepted and stored as given. default `"manual"` |
193
+
194
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
195
+
196
+ Other envelope fields: `pagination` (PaginationMeta).
197
+
198
+ **Example**
199
+
200
+ ```ts
201
+ const result = await g8.api.documents.createLibraryDocument({
202
+ body: {
203
+ content: "example",
204
+ display_name: "Example",
205
+ file_name: "Example",
206
+ folder_path: "example",
207
+ },
208
+ });
209
+ ```
210
+
211
+ ---
212
+
213
+ <a id="op-createlibraryfolder"></a>
214
+
215
+ ### `g8.api.documents.createLibraryFolder(input)`
216
+
217
+ **Create Library Folder**
218
+
219
+ - HTTP: `POST /api/v1/library/folders`
220
+ - operationId: `create_library_folder_library_folders_post` (also callable as `g8.api.call("create_library_folder_library_folders_post", input)`)
221
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
222
+ - API-key scope: `knowledge:write`
223
+
224
+ Create a folder. `parent_path` `Library` is the root.
225
+
226
+ **Input**
227
+
228
+ | Field | Type | Required | Description |
229
+ |---|---|---|---|
230
+ | `body` | `LibraryFolderCreateRequest` | yes | Request body; fields below. |
231
+
232
+ Body fields (`LibraryFolderCreateRequest`):
233
+
234
+ | Field | Type | Required | Description |
235
+ |---|---|---|---|
236
+ | `body.name` | `string` | yes | Folder name, not a path. |
237
+ | `body.account_id` | `string \| null` | no | REQUIRED when `context_type` is `account`. |
238
+ | `body.campaign_id` | `string \| null` | no | REQUIRED when `context_type` is `campaign`. |
239
+ | `body.context_type` | `"global" \| "campaign" \| "account"` | no | default `"global"` |
240
+ | `body.parent_path` | `string` | no | Where it hangs. `Library` is the root. default `"Library"` |
241
+
242
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
243
+
244
+ Other envelope fields: `pagination` (PaginationMeta).
245
+
246
+ **Example**
247
+
248
+ ```ts
249
+ const result = await g8.api.documents.createLibraryFolder({ body: { name: "Example" } });
250
+ ```
251
+
252
+ ---
253
+
254
+ <a id="op-deleteaccountcorrespondence"></a>
255
+
256
+ ### `g8.api.documents.deleteAccountCorrespondence(input)`
257
+
258
+ **Delete Account Correspondence**
259
+
260
+ - HTTP: `DELETE /api/v1/accounts/{account_id}/correspondence/{correspondence_id}`
261
+ - operationId: `delete_account_correspondence_accounts__account_id__correspondence__correspondence_id__delete` (also callable as `g8.api.call("delete_account_correspondence_accounts__account_id__correspondence__correspondence_id__delete", input)`)
262
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
263
+ - API-key scope: `companies:delete`
264
+
265
+ Delete one correspondence record. 204, matching the app.
266
+
267
+ The generated documents that already cited it are not rewritten - this
268
+ removes the source, not its consequences.
269
+
270
+ **Input**
271
+
272
+ | Field | Type | Required | Description |
273
+ |---|---|---|---|
274
+ | `path.account_id` | `string` | yes | The account. |
275
+ | `path.correspondence_id` | `string` | yes | The record to remove. |
276
+
277
+ **Returns**: no JSON body is declared for the success response.
278
+
279
+ **Example**
280
+
281
+ ```ts
282
+ // destructive: deletes or archives data; confirm with a human before calling.
283
+ const result = await g8.api.documents.deleteAccountCorrespondence({ path: { account_id: "id", correspondence_id: "id" } });
284
+ ```
285
+
286
+ ---
287
+
288
+ <a id="op-deletelibrarydocument"></a>
289
+
290
+ ### `g8.api.documents.deleteLibraryDocument(input)`
291
+
292
+ **Delete Library Document**
293
+
294
+ - HTTP: `DELETE /api/v1/library/documents/{document_id}`
295
+ - operationId: `delete_library_document_library_documents__document_id__delete` (also callable as `g8.api.call("delete_library_document_library_documents__document_id__delete", input)`)
296
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
297
+ - API-key scope: `knowledge:delete`
298
+
299
+ Delete a document PERMANENTLY. The row and its bytes go.
300
+
301
+ This is the app's hard delete, not the soft delete `/documents/{id}/restore`
302
+ reverses - a document removed here cannot be restored.
303
+
304
+ **Input**
305
+
306
+ | Field | Type | Required | Description |
307
+ |---|---|---|---|
308
+ | `path.document_id` | `string` | yes | Document id. |
309
+
310
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
311
+
312
+ Other envelope fields: `pagination` (PaginationMeta).
313
+
314
+ **Example**
315
+
316
+ ```ts
317
+ // destructive: deletes or archives data; confirm with a human before calling.
318
+ const result = await g8.api.documents.deleteLibraryDocument({ path: { document_id: "id" } });
319
+ ```
320
+
321
+ ---
322
+
323
+ <a id="op-deletelibraryfolder"></a>
324
+
325
+ ### `g8.api.documents.deleteLibraryFolder(input)`
326
+
327
+ **Delete Library Folder**
328
+
329
+ - HTTP: `DELETE /api/v1/library/folders/{folder_id}`
330
+ - operationId: `delete_library_folder_library_folders__folder_id__delete` (also callable as `g8.api.call("delete_library_folder_library_folders__folder_id__delete", input)`)
331
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
332
+ - API-key scope: `knowledge:delete`
333
+
334
+ Delete a folder. It must be EMPTY - this never deletes documents.
335
+
336
+ **Input**
337
+
338
+ | Field | Type | Required | Description |
339
+ |---|---|---|---|
340
+ | `path.folder_id` | `string` | yes | Folder id. |
341
+
342
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
343
+
344
+ Other envelope fields: `pagination` (PaginationMeta).
345
+
346
+ **Example**
347
+
348
+ ```ts
349
+ // destructive: deletes or archives data; confirm with a human before calling.
350
+ const result = await g8.api.documents.deleteLibraryFolder({ path: { folder_id: "id" } });
351
+ ```
352
+
353
+ ---
354
+
355
+ <a id="op-deletesecurityquestionnaire"></a>
356
+
357
+ ### `g8.api.documents.deleteSecurityQuestionnaire(input)`
358
+
359
+ **Delete Security Questionnaire**
360
+
361
+ - HTTP: `DELETE /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}`
362
+ - operationId: `delete_security_questionnaire_accounts__account_id__security_questionnaires__questionnaire_id__delete` (also callable as `g8.api.call("delete_security_questionnaire_accounts__account_id__security_questionnaires__questionnaire_id__delete", input)`)
363
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
364
+ - API-key scope: `companies:delete`
365
+
366
+ Delete a questionnaire AND every question on it. Not reversible.
367
+
368
+ 204 with no body, matching the app - there is nothing left to describe.
369
+
370
+ **Input**
371
+
372
+ | Field | Type | Required | Description |
373
+ |---|---|---|---|
374
+ | `path.account_id` | `string` | yes | The account. |
375
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
376
+
377
+ **Returns**: no JSON body is declared for the success response.
378
+
379
+ **Example**
380
+
381
+ ```ts
382
+ // destructive: deletes or archives data; confirm with a human before calling.
383
+ const result = await g8.api.documents.deleteSecurityQuestionnaire({ path: { account_id: "id", questionnaire_id: "id" } });
384
+ ```
385
+
386
+ ---
387
+
388
+ <a id="op-downloadlibrarydocument"></a>
389
+
390
+ ### `g8.api.documents.downloadLibraryDocument(input)`
391
+
392
+ **Download Library Document**
393
+
394
+ - HTTP: `GET /api/v1/library/documents/{document_id}/download`
395
+ - operationId: `download_library_document_library_documents__document_id__download_get` (also callable as `g8.api.call("download_library_document_library_documents__document_id__download_get", input)`)
396
+ - Tier: `read`: reads data; safe to call and to retry
397
+ - API-key scope: `knowledge:read`
398
+
399
+ The document's ORIGINAL bytes, with its own content type.
400
+
401
+ The one route on this surface that is NOT the `ApiResponse` envelope: a
402
+ PDF wrapped in JSON is not a PDF. Same precedent as
403
+ `GET /knowledge/export`. Content type and filename come from the stored
404
+ document, so a text document comes back as text and a PDF as a PDF.
405
+
406
+ **Input**
407
+
408
+ | Field | Type | Required | Description |
409
+ |---|---|---|---|
410
+ | `path.document_id` | `string` | yes | Document id. |
411
+
412
+ **Returns**: no JSON body is declared for the success response.
413
+
414
+ **Example**
415
+
416
+ ```ts
417
+ const result = await g8.api.documents.downloadLibraryDocument({ path: { document_id: "id" } });
418
+ ```
419
+
420
+ ---
421
+
422
+ <a id="op-downloadsecurityquestionnaire"></a>
423
+
424
+ ### `g8.api.documents.downloadSecurityQuestionnaire(input)`
425
+
426
+ **Download Security Questionnaire**
427
+
428
+ - HTTP: `GET /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/download`
429
+ - operationId: `download_security_questionnaire_accounts__account_id__security_questionnaires__questionnaire_id__download_get` (also callable as `g8.api.call("download_security_questionnaire_accounts__account_id__security_questionnaires__questionnaire_id__download_get", input)`)
430
+ - Tier: `read`: reads data; safe to call and to retry
431
+ - API-key scope: `companies:read`
432
+
433
+ The FILLED workbook, as XLSX bytes.
434
+
435
+ Not the `ApiResponse` envelope - a spreadsheet wrapped in JSON is not a
436
+ spreadsheet. Same precedent as `GET /knowledge/export`.
437
+
438
+ Only available once the questionnaire is `completed` or `needs_review`;
439
+ asking earlier is refused rather than returning a half-filled file.
440
+
441
+ **Input**
442
+
443
+ | Field | Type | Required | Description |
444
+ |---|---|---|---|
445
+ | `path.account_id` | `string` | yes | The account. |
446
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
447
+
448
+ **Returns**: no JSON body is declared for the success response.
449
+
450
+ **Example**
451
+
452
+ ```ts
453
+ const result = await g8.api.documents.downloadSecurityQuestionnaire({ path: { account_id: "id", questionnaire_id: "id" } });
454
+ ```
455
+
456
+ ---
457
+
458
+ <a id="op-escalatequestionnairequestion"></a>
459
+
460
+ ### `g8.api.documents.escalateQuestionnaireQuestion(input)`
461
+
462
+ **Escalate Questionnaire Question**
463
+
464
+ - HTTP: `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/escalate`
465
+ - operationId: `escalate_questionnaire_question_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__escalate_post` (also callable as `g8.api.call("escalate_questionnaire_question_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__escalate_post", input)`)
466
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
467
+ - API-key scope: `companies:write`
468
+
469
+ Hand a question to the security team.
470
+
471
+ For the questions the answer library genuinely cannot settle. `notes` is
472
+ what the person picking it up reads, so it is worth sending even though
473
+ the app allows it to be empty.
474
+
475
+ **Input**
476
+
477
+ | Field | Type | Required | Description |
478
+ |---|---|---|---|
479
+ | `path.account_id` | `string` | yes | The account. |
480
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
481
+ | `path.question_id` | `string` | yes | Question id (UUID), from the questionnaire detail read. |
482
+ | `body` | `QuestionNoteRequest` | no | Request body; fields below. |
483
+
484
+ Body fields (`QuestionNoteRequest`):
485
+
486
+ | Field | Type | Required | Description |
487
+ |---|---|---|---|
488
+ | `body.notes` | `string \| null` | no | Why. Shown to whoever picks the question up. |
489
+
490
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
491
+
492
+ Other envelope fields: `pagination` (PaginationMeta).
493
+
494
+ **Example**
495
+
496
+ ```ts
497
+ const result = await g8.api.documents.escalateQuestionnaireQuestion({
498
+ path: { account_id: "id", questionnaire_id: "id", question_id: "id" },
499
+ });
500
+ ```
501
+
502
+ ---
503
+
504
+ <a id="op-flagquestionnaireanswer"></a>
505
+
506
+ ### `g8.api.documents.flagQuestionnaireAnswer(input)`
507
+
508
+ **Flag Questionnaire Answer**
509
+
510
+ - HTTP: `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/mark-wrong`
511
+ - operationId: `flag_questionnaire_answer_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__mark_wrong_post` (also callable as `g8.api.call("flag_questionnaire_answer_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__mark_wrong_post", input)`)
512
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
513
+ - API-key scope: `companies:write`
514
+
515
+ Say the AI's answer is WRONG and needs replacing.
516
+
517
+ The feedback signal, not a fix: it flags the answer for a human to
518
+ rewrite with `PATCH .../questions/{question_id}`.
519
+
520
+ **Input**
521
+
522
+ | Field | Type | Required | Description |
523
+ |---|---|---|---|
524
+ | `path.account_id` | `string` | yes | The account. |
525
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
526
+ | `path.question_id` | `string` | yes | Question id (UUID), from the questionnaire detail read. |
527
+ | `body` | `QuestionNoteRequest` | no | Request body; fields below. |
528
+
529
+ Body fields (`QuestionNoteRequest`):
530
+
531
+ | Field | Type | Required | Description |
532
+ |---|---|---|---|
533
+ | `body.notes` | `string \| null` | no | Why. Shown to whoever picks the question up. |
534
+
535
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
536
+
537
+ Other envelope fields: `pagination` (PaginationMeta).
538
+
539
+ **Example**
540
+
541
+ ```ts
542
+ const result = await g8.api.documents.flagQuestionnaireAnswer({
543
+ path: { account_id: "id", questionnaire_id: "id", question_id: "id" },
544
+ });
545
+ ```
546
+
547
+ ---
548
+
549
+ <a id="op-getlibrarydocument"></a>
550
+
551
+ ### `g8.api.documents.getLibraryDocument(input)`
552
+
553
+ **Get Library Document**
554
+
555
+ - HTTP: `GET /api/v1/library/documents/{document_id}`
556
+ - operationId: `get_library_document_library_documents__document_id__get` (also callable as `g8.api.call("get_library_document_library_documents__document_id__get", input)`)
557
+ - Tier: `read`: reads data; safe to call and to retry
558
+ - API-key scope: `knowledge:read`
559
+
560
+ One document, with its extracted text.
561
+
562
+ For the original bytes use `/documents/{id}/download`.
563
+
564
+ **Input**
565
+
566
+ | Field | Type | Required | Description |
567
+ |---|---|---|---|
568
+ | `path.document_id` | `string` | yes | Document id. |
569
+
570
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
571
+
572
+ Other envelope fields: `pagination` (PaginationMeta).
573
+
574
+ **Example**
575
+
576
+ ```ts
577
+ const result = await g8.api.documents.getLibraryDocument({ path: { document_id: "id" } });
578
+ ```
579
+
580
+ ---
581
+
582
+ <a id="op-getlibrarytree"></a>
583
+
584
+ ### `g8.api.documents.getLibraryTree(input?)`
585
+
586
+ **Get Library Tree**
587
+
588
+ - HTTP: `GET /api/v1/library/tree`
589
+ - operationId: `get_library_tree_library_tree_get` (also callable as `g8.api.call("get_library_tree_library_tree_get", input)`)
590
+ - Tier: `read`: reads data; safe to call and to retry
591
+ - API-key scope: `knowledge:read`
592
+
593
+ Folders and their documents, nested - the whole library in one call.
594
+
595
+ The read to build a file browser from. `/library/folders` and
596
+ `/library/documents` are the flat halves of the same data.
597
+
598
+ **Input**
599
+
600
+ | Field | Type | Required | Description |
601
+ |---|---|---|---|
602
+ | `query.context_type` | `"global" \| "campaign" \| "account"` | no | Whose library to read. `campaign` and `account` additionally need the matching id below; without it the app reads the GLOBAL library, which is a different set of documents rather than an error. default `"global"` |
603
+ | `query.campaign_id` | `string \| null` | no | Campaign id. Only read when `context_type` is `campaign`. |
604
+ | `query.account_id` | `string \| null` | no | Account id. Only read when `context_type` is `account`. |
605
+
606
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
607
+
608
+ Other envelope fields: `pagination` (PaginationMeta).
609
+
610
+ **Example**
611
+
612
+ ```ts
613
+ const result = await g8.api.documents.getLibraryTree();
614
+ ```
615
+
616
+ ---
617
+
618
+ <a id="op-getsecurityquestionnaire"></a>
619
+
620
+ ### `g8.api.documents.getSecurityQuestionnaire(input)`
621
+
622
+ **Get Security Questionnaire**
623
+
624
+ - HTTP: `GET /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}`
625
+ - operationId: `get_security_questionnaire_accounts__account_id__security_questionnaires__questionnaire_id__get` (also callable as `g8.api.call("get_security_questionnaire_accounts__account_id__security_questionnaires__questionnaire_id__get", input)`)
626
+ - Tier: `read`: reads data; safe to call and to retry
627
+ - API-key scope: `companies:read`
628
+
629
+ One questionnaire, with every question and its answer.
630
+
631
+ The read the review loop is built on: each question carries the AI's
632
+ answer, the human's edit if there is one, the confidence, and whether it
633
+ has been approved, escalated, skipped or marked wrong.
634
+
635
+ **Input**
636
+
637
+ | Field | Type | Required | Description |
638
+ |---|---|---|---|
639
+ | `path.account_id` | `string` | yes | The account. |
640
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
641
+
642
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
643
+
644
+ Other envelope fields: `pagination` (PaginationMeta).
645
+
646
+ **Example**
647
+
648
+ ```ts
649
+ const result = await g8.api.documents.getSecurityQuestionnaire({ path: { account_id: "id", questionnaire_id: "id" } });
650
+ ```
651
+
652
+ ---
653
+
654
+ <a id="op-getsecurityquestionnairestatus"></a>
655
+
656
+ ### `g8.api.documents.getSecurityQuestionnaireStatus(input)`
657
+
658
+ **Get Security Questionnaire Status**
659
+
660
+ - HTTP: `GET /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/status`
661
+ - operationId: `get_security_questionnaire_status_accounts__account_id__security_questionnaires__questionnaire_id__status_get` (also callable as `g8.api.call("get_security_questionnaire_status_accounts__account_id__security_questionnaires__questionnaire_id__status_get", input)`)
662
+ - Tier: `read`: reads data; safe to call and to retry
663
+ - API-key scope: `companies:read`
664
+
665
+ Progress only - the cheap read to POLL.
666
+
667
+ The full detail read returns every question and grows with the document;
668
+ this one answers "is it done yet" without transferring it.
669
+
670
+ **Input**
671
+
672
+ | Field | Type | Required | Description |
673
+ |---|---|---|---|
674
+ | `path.account_id` | `string` | yes | The account. |
675
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
676
+
677
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
678
+
679
+ Other envelope fields: `pagination` (PaginationMeta).
680
+
681
+ **Example**
682
+
683
+ ```ts
684
+ const result = await g8.api.documents.getSecurityQuestionnaireStatus({ path: { account_id: "id", questionnaire_id: "id" } });
685
+ ```
686
+
687
+ ---
688
+
689
+ <a id="op-importaccountcorrespondence"></a>
690
+
691
+ ### `g8.api.documents.importAccountCorrespondence(input)`
692
+
693
+ **Import Account Correspondence**
694
+
695
+ - HTTP: `POST /api/v1/accounts/{account_id}/correspondence/import`
696
+ - operationId: `import_account_correspondence_accounts__account_id__correspondence_import_post` (also callable as `g8.api.call("import_account_correspondence_accounts__account_id__correspondence_import_post", input)`)
697
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
698
+ - API-key scope: `companies:write`
699
+
700
+ Import a batch of correspondence. PARTIAL SUCCESS IS NORMAL.
701
+
702
+ The response reports `imported`, `skipped` and `errors` and the status
703
+ stays 200 even when rows failed - read the body, not the status. Send
704
+ `external_id` on each item to make the import re-runnable: a row whose
705
+ `external_id` is already stored is SKIPPED rather than duplicated.
706
+
707
+ **Input**
708
+
709
+ | Field | Type | Required | Description |
710
+ |---|---|---|---|
711
+ | `path.account_id` | `string` | yes | The account. |
712
+ | `body` | `CorrespondenceImportRequest` | yes | Request body; fields below. |
713
+
714
+ Body fields (`CorrespondenceImportRequest`):
715
+
716
+ | Field | Type | Required | Description |
717
+ |---|---|---|---|
718
+ | `body.items` | `Array<CorrespondenceCreateRequest>` | yes | The records. Bounded at 500 by this contract - the app has no ceiling, and an unbounded body on a synchronous per-row insert is a request that times out halfway through having written some rows. min items 1, max items 500 |
719
+
720
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
721
+
722
+ Other envelope fields: `pagination` (PaginationMeta).
723
+
724
+ **Example**
725
+
726
+ ```ts
727
+ const result = await g8.api.documents.importAccountCorrespondence({
728
+ path: { account_id: "id" },
729
+ body: {
730
+ items: [
731
+ {
732
+ channel: "example",
733
+ content: "example",
734
+ correspondence_date: "2026-01-01T09:00:00Z",
735
+ direction: "example",
736
+ },
737
+ ],
738
+ },
739
+ });
740
+ ```
741
+
742
+ ---
743
+
744
+ <a id="op-listaccountcorrespondence"></a>
745
+
746
+ ### `g8.api.documents.listAccountCorrespondence(input)`
747
+
748
+ **List Account Correspondence**
749
+
750
+ - HTTP: `GET /api/v1/accounts/{account_id}/correspondence`
751
+ - operationId: `list_account_correspondence_accounts__account_id__correspondence_get` (also callable as `g8.api.call("list_account_correspondence_accounts__account_id__correspondence_get", input)`)
752
+ - Tier: `read`: reads data; safe to call and to retry
753
+ - API-key scope: `companies:read`
754
+
755
+ What has been said to this account, across channels.
756
+
757
+ **Input**
758
+
759
+ | Field | Type | Required | Description |
760
+ |---|---|---|---|
761
+ | `path.account_id` | `string` | yes | The account. |
762
+ | `query.channel` | `string \| null` | no | `email`, `linkedin` or `call_notes`. Omit for all. |
763
+ | `query.stakeholder_id` | `string \| null` | no | Only what was said to or by this person. |
764
+ | `query.limit` | `integer` | no | default `50` |
765
+ | `query.offset` | `integer` | no | default `0` |
766
+
767
+ **Returns** `ApiResponse_DocumentListPayload_`: the envelope `{ data: DocumentListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
768
+
769
+ Other envelope fields: `pagination` (PaginationMeta).
770
+
771
+ `DocumentListPayload` fields:
772
+
773
+ | Field | Type | Required | Description |
774
+ |---|---|---|---|
775
+ | `items` | `Array<unknown>` | no | |
776
+
777
+ **Example**
778
+
779
+ ```ts
780
+ const result = await g8.api.documents.listAccountCorrespondence({ path: { account_id: "id" } });
781
+ ```
782
+
783
+ ---
784
+
785
+ <a id="op-listlibrarydocuments"></a>
786
+
787
+ ### `g8.api.documents.listLibraryDocuments(input?)`
788
+
789
+ **List Library Documents**
790
+
791
+ - HTTP: `GET /api/v1/library/documents`
792
+ - operationId: `list_library_documents_library_documents_get` (also callable as `g8.api.call("list_library_documents_library_documents_get", input)`)
793
+ - Tier: `read`: reads data; safe to call and to retry
794
+ - API-key scope: `knowledge:read`
795
+
796
+ What is in the library.
797
+
798
+ **Input**
799
+
800
+ | Field | Type | Required | Description |
801
+ |---|---|---|---|
802
+ | `query.context_type` | `"global" \| "campaign" \| "account"` | no | Whose library to read. `campaign` and `account` additionally need the matching id below; without it the app reads the GLOBAL library, which is a different set of documents rather than an error. default `"global"` |
803
+ | `query.campaign_id` | `string \| null` | no | Campaign id. Only read when `context_type` is `campaign`. |
804
+ | `query.account_id` | `string \| null` | no | Account id. Only read when `context_type` is `account`. |
805
+ | `query.folder_path` | `string \| null` | no | Only this folder. |
806
+ | `query.include_deleted` | `boolean` | no | Include soft-deleted documents, which is how you find something to pass to `/documents/{id}/restore`. default `false` |
807
+
808
+ **Returns** `ApiResponse_DocumentListPayload_`: the envelope `{ data: DocumentListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
809
+
810
+ Other envelope fields: `pagination` (PaginationMeta).
811
+
812
+ `DocumentListPayload` fields:
813
+
814
+ | Field | Type | Required | Description |
815
+ |---|---|---|---|
816
+ | `items` | `Array<unknown>` | no | |
817
+
818
+ **Example**
819
+
820
+ ```ts
821
+ const result = await g8.api.documents.listLibraryDocuments();
822
+ ```
823
+
824
+ ---
825
+
826
+ <a id="op-listlibraryfolders"></a>
827
+
828
+ ### `g8.api.documents.listLibraryFolders(input?)`
829
+
830
+ **List Library Folders**
831
+
832
+ - HTTP: `GET /api/v1/library/folders`
833
+ - operationId: `list_library_folders_library_folders_get` (also callable as `g8.api.call("list_library_folders_library_folders_get", input)`)
834
+ - Tier: `read`: reads data; safe to call and to retry
835
+ - API-key scope: `knowledge:read`
836
+
837
+ The folders, flat. For the nested shape use `/library/tree`.
838
+
839
+ **Input**
840
+
841
+ | Field | Type | Required | Description |
842
+ |---|---|---|---|
843
+ | `query.context_type` | `"global" \| "campaign" \| "account"` | no | Whose library to read. `campaign` and `account` additionally need the matching id below; without it the app reads the GLOBAL library, which is a different set of documents rather than an error. default `"global"` |
844
+ | `query.campaign_id` | `string \| null` | no | Campaign id. Only read when `context_type` is `campaign`. |
845
+ | `query.account_id` | `string \| null` | no | Account id. Only read when `context_type` is `account`. |
846
+
847
+ **Returns** `ApiResponse_DocumentListPayload_`: the envelope `{ data: DocumentListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
848
+
849
+ Other envelope fields: `pagination` (PaginationMeta).
850
+
851
+ `DocumentListPayload` fields:
852
+
853
+ | Field | Type | Required | Description |
854
+ |---|---|---|---|
855
+ | `items` | `Array<unknown>` | no | |
856
+
857
+ **Example**
858
+
859
+ ```ts
860
+ const result = await g8.api.documents.listLibraryFolders();
861
+ ```
862
+
863
+ ---
864
+
865
+ <a id="op-listsecurityquestionnaires"></a>
866
+
867
+ ### `g8.api.documents.listSecurityQuestionnaires(input)`
868
+
869
+ **List Security Questionnaires**
870
+
871
+ - HTTP: `GET /api/v1/accounts/{account_id}/security-questionnaires`
872
+ - operationId: `list_security_questionnaires_accounts__account_id__security_questionnaires_get` (also callable as `g8.api.call("list_security_questionnaires_accounts__account_id__security_questionnaires_get", input)`)
873
+ - Tier: `read`: reads data; safe to call and to retry
874
+ - API-key scope: `companies:read`
875
+
876
+ Every questionnaire for this account.
877
+
878
+ **Input**
879
+
880
+ | Field | Type | Required | Description |
881
+ |---|---|---|---|
882
+ | `path.account_id` | `string` | yes | The account. |
883
+ | `query.status` | `string \| null` | no | Only questionnaires in this state: `processing`, `completed`, `needs_review` or `failed`. Omit for all. |
884
+ | `query.limit` | `integer` | no | default `50` |
885
+ | `query.offset` | `integer` | no | default `0` |
886
+
887
+ **Returns** `ApiResponse_DocumentListPayload_`: the envelope `{ data: DocumentListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
888
+
889
+ Other envelope fields: `pagination` (PaginationMeta).
890
+
891
+ `DocumentListPayload` fields:
892
+
893
+ | Field | Type | Required | Description |
894
+ |---|---|---|---|
895
+ | `items` | `Array<unknown>` | no | |
896
+
897
+ **Example**
898
+
899
+ ```ts
900
+ const result = await g8.api.documents.listSecurityQuestionnaires({ path: { account_id: "id" } });
901
+ ```
902
+
903
+ ---
904
+
905
+ <a id="op-reextractalllibrarydocuments"></a>
906
+
907
+ ### `g8.api.documents.reextractAllLibraryDocuments(input?)`
908
+
909
+ **Reextract All Library Documents**
910
+
911
+ - HTTP: `POST /api/v1/library/documents/reextract-all`
912
+ - operationId: `reextract_all_library_documents_library_documents_reextract_all_post` (also callable as `g8.api.call("reextract_all_library_documents_library_documents_reextract_all_post", input)`)
913
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
914
+ - API-key scope: `knowledge:write`
915
+
916
+ Re-run text extraction across a folder, or the whole library.
917
+
918
+ Use it after an extraction improvement, or when documents uploaded before
919
+ a fix have empty or garbled text. It replaces the stored text; the
920
+ original bytes are untouched.
921
+
922
+ **Input**
923
+
924
+ | Field | Type | Required | Description |
925
+ |---|---|---|---|
926
+ | `query.folder_path` | `string \| null` | no | Limit to one folder. Omit to re-extract EVERY PDF and DOCX in the library, which on a large library is a long job. |
927
+
928
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
929
+
930
+ Other envelope fields: `pagination` (PaginationMeta).
931
+
932
+ **Example**
933
+
934
+ ```ts
935
+ const result = await g8.api.documents.reextractAllLibraryDocuments();
936
+ ```
937
+
938
+ ---
939
+
940
+ <a id="op-reextractlibrarydocument"></a>
941
+
942
+ ### `g8.api.documents.reextractLibraryDocument(input)`
943
+
944
+ **Reextract Library Document**
945
+
946
+ - HTTP: `POST /api/v1/library/documents/{document_id}/reextract`
947
+ - operationId: `reextract_library_document_library_documents__document_id__reextract_post` (also callable as `g8.api.call("reextract_library_document_library_documents__document_id__reextract_post", input)`)
948
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
949
+ - API-key scope: `knowledge:write`
950
+
951
+ Re-run text extraction on ONE PDF or DOCX.
952
+
953
+ The single-document form of `/documents/reextract-all`. The stored bytes
954
+ are the input and are not changed.
955
+
956
+ **Input**
957
+
958
+ | Field | Type | Required | Description |
959
+ |---|---|---|---|
960
+ | `path.document_id` | `string` | yes | Document id. |
961
+
962
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
963
+
964
+ Other envelope fields: `pagination` (PaginationMeta).
965
+
966
+ **Example**
967
+
968
+ ```ts
969
+ const result = await g8.api.documents.reextractLibraryDocument({ path: { document_id: "id" } });
970
+ ```
971
+
972
+ ---
973
+
974
+ <a id="op-refreshlibrarydocument"></a>
975
+
976
+ ### `g8.api.documents.refreshLibraryDocument(input)`
977
+
978
+ **Refresh Library Document**
979
+
980
+ - HTTP: `POST /api/v1/library/documents/{document_id}/refresh`
981
+ - operationId: `refresh_library_document_library_documents__document_id__refresh_post` (also callable as `g8.api.call("refresh_library_document_library_documents__document_id__refresh_post", input)`)
982
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
983
+ - API-key scope: `knowledge:write`
984
+
985
+ Re-fetch a document that was SCRAPED from a URL.
986
+
987
+ Only meaningful for a document whose `source` is `scrape`; anything else
988
+ is refused, because there is no URL to go back to.
989
+
990
+ **Input**
991
+
992
+ | Field | Type | Required | Description |
993
+ |---|---|---|---|
994
+ | `path.document_id` | `string` | yes | Document id. |
995
+
996
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
997
+
998
+ Other envelope fields: `pagination` (PaginationMeta).
999
+
1000
+ **Example**
1001
+
1002
+ ```ts
1003
+ const result = await g8.api.documents.refreshLibraryDocument({ path: { document_id: "id" } });
1004
+ ```
1005
+
1006
+ ---
1007
+
1008
+ <a id="op-renamelibraryfolder"></a>
1009
+
1010
+ ### `g8.api.documents.renameLibraryFolder(input)`
1011
+
1012
+ **Rename Library Folder**
1013
+
1014
+ - HTTP: `PUT /api/v1/library/folders/{folder_id}`
1015
+ - operationId: `rename_library_folder_library_folders__folder_id__put` (also callable as `g8.api.call("rename_library_folder_library_folders__folder_id__put", input)`)
1016
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1017
+ - API-key scope: `knowledge:write`
1018
+
1019
+ Rename a folder. The documents inside keep their ids.
1020
+
1021
+ **Input**
1022
+
1023
+ | Field | Type | Required | Description |
1024
+ |---|---|---|---|
1025
+ | `path.folder_id` | `string` | yes | Folder id. |
1026
+ | `body` | `LibraryFolderRenameRequest` | yes | Request body; fields below. |
1027
+
1028
+ Body fields (`LibraryFolderRenameRequest`):
1029
+
1030
+ | Field | Type | Required | Description |
1031
+ |---|---|---|---|
1032
+ | `body.name` | `string` | yes | The new name. Documents inside keep their ids. |
1033
+
1034
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1035
+
1036
+ Other envelope fields: `pagination` (PaginationMeta).
1037
+
1038
+ **Example**
1039
+
1040
+ ```ts
1041
+ const result = await g8.api.documents.renameLibraryFolder({ path: { folder_id: "id" }, body: { name: "Example" } });
1042
+ ```
1043
+
1044
+ ---
1045
+
1046
+ <a id="op-restorelibrarydocument"></a>
1047
+
1048
+ ### `g8.api.documents.restoreLibraryDocument(input)`
1049
+
1050
+ **Restore Library Document**
1051
+
1052
+ - HTTP: `POST /api/v1/library/documents/{document_id}/restore`
1053
+ - operationId: `restore_library_document_library_documents__document_id__restore_post` (also callable as `g8.api.call("restore_library_document_library_documents__document_id__restore_post", input)`)
1054
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1055
+ - API-key scope: `knowledge:write`
1056
+
1057
+ Undo a SOFT delete.
1058
+
1059
+ Find the id with `GET /library/documents?include_deleted=true`. This
1060
+ cannot bring back a document removed by `DELETE`, which is permanent.
1061
+
1062
+ **Input**
1063
+
1064
+ | Field | Type | Required | Description |
1065
+ |---|---|---|---|
1066
+ | `path.document_id` | `string` | yes | Document id. |
1067
+
1068
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1069
+
1070
+ Other envelope fields: `pagination` (PaginationMeta).
1071
+
1072
+ **Example**
1073
+
1074
+ ```ts
1075
+ const result = await g8.api.documents.restoreLibraryDocument({ path: { document_id: "id" } });
1076
+ ```
1077
+
1078
+ ---
1079
+
1080
+ <a id="op-savequestionnaireanswertolibrary"></a>
1081
+
1082
+ ### `g8.api.documents.saveQuestionnaireAnswerToLibrary(input)`
1083
+
1084
+ **Save Questionnaire Answer To Library**
1085
+
1086
+ - HTTP: `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/save-to-library`
1087
+ - operationId: `save_questionnaire_answer_to_library_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__save_to_library_post` (also callable as `g8.api.call("save_questionnaire_answer_to_library_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__save_to_library_post", input)`)
1088
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1089
+ - API-key scope: `companies:write`
1090
+
1091
+ Promote this answer into the reusable answer library.
1092
+
1093
+ The compounding step: an answer saved here is what the NEXT questionnaire
1094
+ is answered from, so a reviewed answer stops being a one-off edit and
1095
+ starts being org knowledge.
1096
+
1097
+ **Input**
1098
+
1099
+ | Field | Type | Required | Description |
1100
+ |---|---|---|---|
1101
+ | `path.account_id` | `string` | yes | The account. |
1102
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
1103
+ | `path.question_id` | `string` | yes | Question id (UUID), from the questionnaire detail read. |
1104
+
1105
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1106
+
1107
+ Other envelope fields: `pagination` (PaginationMeta).
1108
+
1109
+ **Example**
1110
+
1111
+ ```ts
1112
+ const result = await g8.api.documents.saveQuestionnaireAnswerToLibrary({
1113
+ path: { account_id: "id", questionnaire_id: "id", question_id: "id" },
1114
+ });
1115
+ ```
1116
+
1117
+ ---
1118
+
1119
+ <a id="op-skipquestionnairequestion"></a>
1120
+
1121
+ ### `g8.api.documents.skipQuestionnaireQuestion(input)`
1122
+
1123
+ **Skip Questionnaire Question**
1124
+
1125
+ - HTTP: `POST /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}/mark-skip`
1126
+ - operationId: `skip_questionnaire_question_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__mark_skip_post` (also callable as `g8.api.call("skip_questionnaire_question_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__mark_skip_post", input)`)
1127
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1128
+ - API-key scope: `companies:write`
1129
+
1130
+ Mark a question as NOT APPLICABLE to this organisation.
1131
+
1132
+ Different from escalating: nobody is going to answer this one, and the
1133
+ filled workbook says so rather than leaving it blank.
1134
+
1135
+ **Input**
1136
+
1137
+ | Field | Type | Required | Description |
1138
+ |---|---|---|---|
1139
+ | `path.account_id` | `string` | yes | The account. |
1140
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
1141
+ | `path.question_id` | `string` | yes | Question id (UUID), from the questionnaire detail read. |
1142
+ | `body` | `QuestionNoteRequest` | no | Request body; fields below. |
1143
+
1144
+ Body fields (`QuestionNoteRequest`):
1145
+
1146
+ | Field | Type | Required | Description |
1147
+ |---|---|---|---|
1148
+ | `body.notes` | `string \| null` | no | Why. Shown to whoever picks the question up. |
1149
+
1150
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1151
+
1152
+ Other envelope fields: `pagination` (PaginationMeta).
1153
+
1154
+ **Example**
1155
+
1156
+ ```ts
1157
+ const result = await g8.api.documents.skipQuestionnaireQuestion({
1158
+ path: { account_id: "id", questionnaire_id: "id", question_id: "id" },
1159
+ });
1160
+ ```
1161
+
1162
+ ---
1163
+
1164
+ <a id="op-updatelibrarydocument"></a>
1165
+
1166
+ ### `g8.api.documents.updateLibraryDocument(input)`
1167
+
1168
+ **Update Library Document**
1169
+
1170
+ - HTTP: `PUT /api/v1/library/documents/{document_id}`
1171
+ - operationId: `update_library_document_library_documents__document_id__put` (also callable as `g8.api.call("update_library_document_library_documents__document_id__put", input)`)
1172
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1173
+ - API-key scope: `knowledge:write`
1174
+
1175
+ Edit a document: rename it, replace its text, or move it.
1176
+
1177
+ PARTIAL despite the PUT verb - an omitted field is left alone, which is
1178
+ the app's own shape. `meta_data` REPLACES the stored object rather than
1179
+ merging into it.
1180
+
1181
+ **Input**
1182
+
1183
+ | Field | Type | Required | Description |
1184
+ |---|---|---|---|
1185
+ | `path.document_id` | `string` | yes | Document id. |
1186
+ | `body` | `LibraryDocumentUpdateRequest` | yes | Request body; fields below. |
1187
+
1188
+ Body fields (`LibraryDocumentUpdateRequest`):
1189
+
1190
+ | Field | Type | Required | Description |
1191
+ |---|---|---|---|
1192
+ | `body.content` | `string \| null` | no | Replaces the whole document body when given. |
1193
+ | `body.display_name` | `string \| null` | no | |
1194
+ | `body.folder_path` | `string \| null` | no | Moves the document to another folder when given. |
1195
+ | `body.meta_data` | `Record<string, unknown> \| null` | no | Free-form metadata. REPLACES the stored object rather than merging. |
1196
+
1197
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1198
+
1199
+ Other envelope fields: `pagination` (PaginationMeta).
1200
+
1201
+ **Example**
1202
+
1203
+ ```ts
1204
+ const result = await g8.api.documents.updateLibraryDocument({ path: { document_id: "id" }, body: {} });
1205
+ ```
1206
+
1207
+ ---
1208
+
1209
+ <a id="op-updatequestionnaireanswer"></a>
1210
+
1211
+ ### `g8.api.documents.updateQuestionnaireAnswer(input)`
1212
+
1213
+ **Update Questionnaire Answer**
1214
+
1215
+ - HTTP: `PATCH /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}/questions/{question_id}`
1216
+ - operationId: `update_questionnaire_answer_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__patch` (also callable as `g8.api.call("update_questionnaire_answer_accounts__account_id__security_questionnaires__questionnaire_id__questions__question_id__patch", input)`)
1217
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1218
+ - API-key scope: `companies:write`
1219
+
1220
+ Replace one answer with a human-written one.
1221
+
1222
+ The edit lands in `final_answer` and is what the downloaded workbook
1223
+ carries. The model's original answer is KEPT alongside it, so the two can
1224
+ still be compared afterwards.
1225
+
1226
+ **Input**
1227
+
1228
+ | Field | Type | Required | Description |
1229
+ |---|---|---|---|
1230
+ | `path.account_id` | `string` | yes | The account. |
1231
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
1232
+ | `path.question_id` | `string` | yes | Question id (UUID), from the questionnaire detail read. |
1233
+ | `body` | `QuestionAnswerUpdateRequest` | yes | Request body; fields below. |
1234
+
1235
+ Body fields (`QuestionAnswerUpdateRequest`):
1236
+
1237
+ | Field | Type | Required | Description |
1238
+ |---|---|---|---|
1239
+ | `body.final_answer` | `string` | yes | The edited answer text. |
1240
+
1241
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1242
+
1243
+ Other envelope fields: `pagination` (PaginationMeta).
1244
+
1245
+ **Example**
1246
+
1247
+ ```ts
1248
+ const result = await g8.api.documents.updateQuestionnaireAnswer({
1249
+ path: { account_id: "id", questionnaire_id: "id", question_id: "id" },
1250
+ body: { final_answer: "example" },
1251
+ });
1252
+ ```
1253
+
1254
+ ---
1255
+
1256
+ <a id="op-updatesecurityquestionnaire"></a>
1257
+
1258
+ ### `g8.api.documents.updateSecurityQuestionnaire(input)`
1259
+
1260
+ **Update Security Questionnaire**
1261
+
1262
+ - HTTP: `PATCH /api/v1/accounts/{account_id}/security-questionnaires/{questionnaire_id}`
1263
+ - operationId: `update_security_questionnaire_accounts__account_id__security_questionnaires__questionnaire_id__patch` (also callable as `g8.api.call("update_security_questionnaire_accounts__account_id__security_questionnaires__questionnaire_id__patch", input)`)
1264
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1265
+ - API-key scope: `companies:write`
1266
+
1267
+ Rename a questionnaire. Metadata only - it never touches an answer.
1268
+
1269
+ **Input**
1270
+
1271
+ | Field | Type | Required | Description |
1272
+ |---|---|---|---|
1273
+ | `path.account_id` | `string` | yes | The account. |
1274
+ | `path.questionnaire_id` | `string` | yes | Questionnaire id (UUID). |
1275
+ | `body` | `QuestionnaireUpdateRequest` | yes | Request body; fields below. |
1276
+
1277
+ Body fields (`QuestionnaireUpdateRequest`):
1278
+
1279
+ | Field | Type | Required | Description |
1280
+ |---|---|---|---|
1281
+ | `body.display_name` | `string \| null` | no | User-friendly name for the questionnaire. |
1282
+
1283
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1284
+
1285
+ Other envelope fields: `pagination` (PaginationMeta).
1286
+
1287
+ **Example**
1288
+
1289
+ ```ts
1290
+ const result = await g8.api.documents.updateSecurityQuestionnaire({ path: { account_id: "id", questionnaire_id: "id" }, body: {} });
1291
+ ```
1292
+
1293
+ ---
1294
+
1295
+ <a id="op-uploadaccountcorrespondence"></a>
1296
+
1297
+ ### `g8.api.documents.uploadAccountCorrespondence(input)`
1298
+
1299
+ **Upload Account Correspondence**
1300
+
1301
+ - HTTP: `POST /api/v1/accounts/{account_id}/correspondence/upload`
1302
+ - operationId: `upload_account_correspondence_accounts__account_id__correspondence_upload_post` (also callable as `g8.api.call("upload_account_correspondence_accounts__account_id__correspondence_upload_post", input)`)
1303
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1304
+ - API-key scope: `companies:write`
1305
+
1306
+ Record correspondence from a FILE rather than a JSON body.
1307
+
1308
+ The route for a forwarded `.eml` or an exported thread: the file's text
1309
+ becomes the content, and the record is created in the same call.
1310
+
1311
+ This handler is `async def` but takes the SYNC session, so it is awaited
1312
+ directly rather than going through the threadpool helper.
1313
+
1314
+ **Input**
1315
+
1316
+ | Field | Type | Required | Description |
1317
+ |---|---|---|---|
1318
+ | `path.account_id` | `string` | yes | The account. |
1319
+
1320
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1321
+
1322
+ Other envelope fields: `pagination` (PaginationMeta).
1323
+
1324
+ **Example**
1325
+
1326
+ ```ts
1327
+ const result = await g8.api.documents.uploadAccountCorrespondence({ path: { account_id: "id" } });
1328
+ ```
1329
+
1330
+ ---
1331
+
1332
+ <a id="op-uploadlibrarydocument"></a>
1333
+
1334
+ ### `g8.api.documents.uploadLibraryDocument(input?)`
1335
+
1336
+ **Upload Library Document**
1337
+
1338
+ - HTTP: `POST /api/v1/library/documents/upload`
1339
+ - operationId: `upload_library_document_library_documents_upload_post` (also callable as `g8.api.call("upload_library_document_library_documents_upload_post", input)`)
1340
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1341
+ - API-key scope: `knowledge:write`
1342
+
1343
+ Upload ONE file to the Library. Multipart, like the app.
1344
+
1345
+ The app's rules are enforced by the app and documented here so a caller
1346
+ sees them before spending the upload: 50 MB maximum, and the extension
1347
+ must be one of pdf, docx, doc, txt, md, mdx, csv, json, png, jpg, jpeg,
1348
+ xls, xlsx, ppt, pptx. Text-bearing types are extracted and indexed for
1349
+ retrieval; the rest are stored as bytes.
1350
+
1351
+ **Input**: none.
1352
+
1353
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1354
+
1355
+ Other envelope fields: `pagination` (PaginationMeta).
1356
+
1357
+ **Example**
1358
+
1359
+ ```ts
1360
+ const result = await g8.api.documents.uploadLibraryDocument();
1361
+ ```
1362
+
1363
+ ---
1364
+
1365
+ <a id="op-uploadlibrarydocuments"></a>
1366
+
1367
+ ### `g8.api.documents.uploadLibraryDocuments(input?)`
1368
+
1369
+ **Upload Library Documents**
1370
+
1371
+ - HTTP: `POST /api/v1/library/documents/upload-batch`
1372
+ - operationId: `upload_library_documents_library_documents_upload_batch_post` (also callable as `g8.api.call("upload_library_documents_library_documents_upload_batch_post", input)`)
1373
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
1374
+ - API-key scope: `knowledge:write`
1375
+
1376
+ Upload SEVERAL files in one request.
1377
+
1378
+ PARTIAL SUCCESS IS THE NORMAL OUTCOME. Each file is processed on its own
1379
+ session, so one rejected file does not roll the others back and the status
1380
+ stays 201. Read the per-file result in the body, not the HTTP status.
1381
+
1382
+ Named `upload-batch` rather than the app's `upload-multi`: the same
1383
+ operation, spelled the way the rest of this contract spells a bulk verb.
1384
+
1385
+ **Input**: none.
1386
+
1387
+ **Returns** `ApiResponse_DocumentListPayload_`: the envelope `{ data: DocumentListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1388
+
1389
+ Other envelope fields: `pagination` (PaginationMeta).
1390
+
1391
+ `DocumentListPayload` fields:
1392
+
1393
+ | Field | Type | Required | Description |
1394
+ |---|---|---|---|
1395
+ | `items` | `Array<unknown>` | no | |
1396
+
1397
+ **Example**
1398
+
1399
+ ```ts
1400
+ const result = await g8.api.documents.uploadLibraryDocuments();
1401
+ ```
1402
+
1403
+ ---
1404
+
1405
+ <a id="op-uploadsecurityquestionnaire"></a>
1406
+
1407
+ ### `g8.api.documents.uploadSecurityQuestionnaire(input)`
1408
+
1409
+ **Upload Security Questionnaire**
1410
+
1411
+ - HTTP: `POST /api/v1/accounts/{account_id}/security-questionnaires`
1412
+ - operationId: `upload_security_questionnaire_accounts__account_id__security_questionnaires_post` (also callable as `g8.api.call("upload_security_questionnaire_accounts__account_id__security_questionnaires_post", input)`)
1413
+ - Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
1414
+ - API-key scope: `knowledge:run`
1415
+
1416
+ Upload a questionnaire and start answering it. ASYNCHRONOUS.
1417
+
1418
+ Answering runs in the background against the org's answer library and
1419
+ policy documents, so this returns as soon as the file is accepted. Poll
1420
+ `/security-questionnaires/{id}/status` for progress and
1421
+ `/security-questionnaires/{id}` for the questions as they land.
1422
+
1423
+ Multipart, like the app.
1424
+
1425
+ **Input**
1426
+
1427
+ | Field | Type | Required | Description |
1428
+ |---|---|---|---|
1429
+ | `path.account_id` | `string` | yes | The account the questionnaire came from. |
1430
+
1431
+ **Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
1432
+
1433
+ Other envelope fields: `pagination` (PaginationMeta).
1434
+
1435
+ **Example**
1436
+
1437
+ ```ts
1438
+ // billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
1439
+ const result = await g8.api.documents.uploadSecurityQuestionnaire({ path: { account_id: "id" } });
1440
+ ```