@graph8/sdk 0.245.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 +19 -5
  2. package/dist/cli.js +216 -0
  3. package/dist/index.d.mts +283 -12
  4. package/dist/index.d.ts +283 -12
  5. package/dist/index.js +88 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +88 -2
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/react.d.mts +274 -12
  10. package/dist/react.d.ts +274 -12
  11. package/dist/react.js +106 -10
  12. package/dist/react.js.map +1 -1
  13. package/dist/react.mjs +97 -11
  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,812 @@
1
+ <!-- Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. -->
2
+
3
+ # `g8.api.roles`: Roles
4
+
5
+ 20 operations (14 read, 2 write, 4 destructive).
6
+
7
+ No hand-written client covers this area. Call it through `g8.api.roles.*` 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: [roles.d.ts](roles.d.ts).
20
+
21
+ ## Operations
22
+
23
+ | Call | HTTP | Tier | Scope | Summary |
24
+ |---|---|---|---|---|
25
+ | [`createRole`](#op-createrole) | `POST /api/v1/roles` | write | `account:write` | Create Role |
26
+ | [`deleteRole`](#op-deleterole) | `DELETE /api/v1/roles/{role_id}` | destructive | `account:delete` | Delete Role |
27
+ | [`deleteServiceProviderAssignments`](#op-deleteserviceproviderassignments) | `DELETE /api/v1/roles/service-provider/assignments/{email}` | destructive | `account:delete` | Delete Service Provider Assignments |
28
+ | [`getDomainSettings`](#op-getdomainsettings) | `GET /api/v1/roles/domain-settings` | read | `account:read` | Get Domain Settings |
29
+ | [`getJoinRequestCount`](#op-getjoinrequestcount) | `GET /api/v1/roles/join-requests/count` | read | `account:read` | Get Join Request Count |
30
+ | [`getMyPermissions`](#op-getmypermissions) | `GET /api/v1/roles/me/permissions` | read | `account:read` | Get My Permissions |
31
+ | [`getRole`](#op-getrole) | `GET /api/v1/roles/{role_id}` | read | `account:read` | Get Role |
32
+ | [`getUserRole`](#op-getuserrole) | `GET /api/v1/roles/users/{user_id}` | read | `account:read` | Get User Role |
33
+ | [`listJoinRequests`](#op-listjoinrequests) | `GET /api/v1/roles/join-requests` | read | `account:read` | List Join Requests |
34
+ | [`listOrgUsers`](#op-listorgusers) | `GET /api/v1/roles/org-users` | read | `account:read` | List Org Users |
35
+ | [`listPendingInvites`](#op-listpendinginvites) | `GET /api/v1/roles/pending-invites` | read | `account:read` | List Pending Invites |
36
+ | [`listPermissions`](#op-listpermissions) | `GET /api/v1/roles/permissions` | read | `account:read` | List Permissions |
37
+ | [`listPermissionsGrouped`](#op-listpermissionsgrouped) | `GET /api/v1/roles/permissions/grouped` | read | `account:read` | List Permissions Grouped |
38
+ | [`listRoleOptions`](#op-listroleoptions) | `GET /api/v1/roles/options` | read | `account:read` | List Role Options |
39
+ | [`listRoles`](#op-listroles) | `GET /api/v1/roles` | read | `account:read` | List Roles |
40
+ | [`listServiceProviderAssignments`](#op-listserviceproviderassignments) | `GET /api/v1/roles/service-provider/assignments` | read | `account:read` | List Service Provider Assignments |
41
+ | [`listServiceProviderAvailableLists`](#op-listserviceprovideravailablelists) | `GET /api/v1/roles/service-provider/available-lists` | read | `account:read` | List Service Provider Available Lists |
42
+ | [`rejectJoinRequest`](#op-rejectjoinrequest) | `POST /api/v1/roles/join-requests/{request_id}/reject` | write | `account:write` | Reject Join Request |
43
+ | [`revokePendingInvite`](#op-revokependinginvite) | `DELETE /api/v1/roles/pending-invites/{email}` | destructive | `account:delete` | Revoke Pending Invite |
44
+ | [`updateRole`](#op-updaterole) | `PUT /api/v1/roles/{role_id}` | destructive | `account:delete` | Update Role |
45
+
46
+ ---
47
+
48
+ <a id="op-createrole"></a>
49
+
50
+ ### `g8.api.roles.createRole(input)`
51
+
52
+ **Create Role**
53
+
54
+ - HTTP: `POST /api/v1/roles`
55
+ - operationId: `create_role_roles_post` (also callable as `g8.api.call("create_role_roles_post", input)`)
56
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
57
+ - API-key scope: `account:write`
58
+
59
+ Define a new role. It grants nobody anything until it is assigned.
60
+
61
+ Two of the app's own guards run inside the handler and are not duplicated
62
+ here: `_assert_can_grant_permissions` refuses a permission the CALLER does
63
+ not hold, and `_require_teams_manage` refuses `manages_role_slugs` without
64
+ `teams:manage`. Both reach the caller as a 403 with the app's own message.
65
+
66
+ This is `write` rather than `destructive` on purpose: a brand-new role is
67
+ held by no one, so creating it changes nobody's access. Editing one does -
68
+ which is why `PUT /roles/{role_id}` is tiered differently.
69
+
70
+ **Input**
71
+
72
+ | Field | Type | Required | Description |
73
+ |---|---|---|---|
74
+ | `body` | `RoleCreateRequest` | yes | Request body; fields below. |
75
+
76
+ Body fields (`RoleCreateRequest`):
77
+
78
+ | Field | Type | Required | Description |
79
+ |---|---|---|---|
80
+ | `body.name` | `string` | yes | min length 1, max length 100 |
81
+ | `body.slug` | `string` | yes | min length 1, max length 50, pattern `^[a-z][a-z0-9_-]*$` |
82
+ | `body.description` | `string \| null` | no | |
83
+ | `body.manages_role_slugs` | `Array<string> \| null` | no | |
84
+ | `body.permissions` | `Array<string>` | no | |
85
+ | `body.rep_limits` | `RepLimitsSettings \| null` | no | |
86
+
87
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `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.roles.createRole({ body: { name: "Example", slug: "example" } });
95
+ ```
96
+
97
+ ---
98
+
99
+ <a id="op-deleterole"></a>
100
+
101
+ ### `g8.api.roles.deleteRole(input)`
102
+
103
+ **Delete Role**
104
+
105
+ - HTTP: `DELETE /api/v1/roles/{role_id}`
106
+ - operationId: `delete_role_roles__role_id__delete` (also callable as `g8.api.call("delete_role_roles__role_id__delete", input)`)
107
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
108
+ - API-key scope: `account:delete`
109
+
110
+ Remove a role definition.
111
+
112
+ The app refuses while anyone still holds it, so this cannot silently strip
113
+ a colleague's access - re-role them first.
114
+
115
+ **Input**
116
+
117
+ | Field | Type | Required | Description |
118
+ |---|---|---|---|
119
+ | `path.role_id` | `string` | yes | Role id (UUID). |
120
+
121
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
122
+
123
+ Other envelope fields: `pagination` (PaginationMeta).
124
+
125
+ **Example**
126
+
127
+ ```ts
128
+ // destructive: deletes or archives data; confirm with a human before calling.
129
+ const result = await g8.api.roles.deleteRole({ path: { role_id: "id" } });
130
+ ```
131
+
132
+ ---
133
+
134
+ <a id="op-deleteserviceproviderassignments"></a>
135
+
136
+ ### `g8.api.roles.deleteServiceProviderAssignments(input)`
137
+
138
+ **Delete Service Provider Assignments**
139
+
140
+ - HTTP: `DELETE /api/v1/roles/service-provider/assignments/{email}`
141
+ - operationId: `delete_service_provider_assignments_roles_service_provider_assignments__email__delete` (also callable as `g8.api.call("delete_service_provider_assignments_roles_service_provider_assignments__email__delete", input)`)
142
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
143
+ - API-key scope: `account:delete`
144
+
145
+ Revoke every list a service provider was given. Their access ends here.
146
+
147
+ Published although the PUT that grants assignments is not. This one only
148
+ deletes rows in `service_provider_list_assignments`; the PUT additionally
149
+ RE-ROLES the named person - see the PR body.
150
+
151
+ **Input**
152
+
153
+ | Field | Type | Required | Description |
154
+ |---|---|---|---|
155
+ | `path.email` | `string` | yes | The service provider's email address. |
156
+
157
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
158
+
159
+ Other envelope fields: `pagination` (PaginationMeta).
160
+
161
+ **Example**
162
+
163
+ ```ts
164
+ // destructive: deletes or archives data; confirm with a human before calling.
165
+ const result = await g8.api.roles.deleteServiceProviderAssignments({ path: { email: "jane@acme.com" } });
166
+ ```
167
+
168
+ ---
169
+
170
+ <a id="op-getdomainsettings"></a>
171
+
172
+ ### `g8.api.roles.getDomainSettings(input?)`
173
+
174
+ **Get Domain Settings**
175
+
176
+ - HTTP: `GET /api/v1/roles/domain-settings`
177
+ - operationId: `get_domain_settings_roles_domain_settings_get` (also callable as `g8.api.call("get_domain_settings_roles_domain_settings_get", input)`)
178
+ - Tier: `read`: reads data; safe to call and to retry
179
+ - API-key scope: `account:read`
180
+
181
+ Which email domains can reach this organisation, and how.
182
+
183
+ `domain_autojoin` is the consequential field: with it on, anybody with an
184
+ address at one of these domains joins automatically, at
185
+ `autojoin_default_role_id`. The WRITE half of this is not published - see
186
+ the module docstring.
187
+
188
+ **Input**: none.
189
+
190
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
191
+
192
+ Other envelope fields: `pagination` (PaginationMeta).
193
+
194
+ **Example**
195
+
196
+ ```ts
197
+ const result = await g8.api.roles.getDomainSettings();
198
+ ```
199
+
200
+ ---
201
+
202
+ <a id="op-getjoinrequestcount"></a>
203
+
204
+ ### `g8.api.roles.getJoinRequestCount(input?)`
205
+
206
+ **Get Join Request Count**
207
+
208
+ - HTTP: `GET /api/v1/roles/join-requests/count`
209
+ - operationId: `get_join_request_count_roles_join_requests_count_get` (also callable as `g8.api.call("get_join_request_count_roles_join_requests_count_get", input)`)
210
+ - Tier: `read`: reads data; safe to call and to retry
211
+ - API-key scope: `account:read`
212
+
213
+ How many people are waiting. The cheap poll behind a queue badge.
214
+
215
+ Declared BEFORE `/roles/{role_id}` so the literal wins - that route parses
216
+ a UUID, so a flip would answer 422 rather than 404, which is much harder
217
+ to recognise as a routing problem.
218
+
219
+ **Input**: none.
220
+
221
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
222
+
223
+ Other envelope fields: `pagination` (PaginationMeta).
224
+
225
+ **Example**
226
+
227
+ ```ts
228
+ const result = await g8.api.roles.getJoinRequestCount();
229
+ ```
230
+
231
+ ---
232
+
233
+ <a id="op-getmypermissions"></a>
234
+
235
+ ### `g8.api.roles.getMyPermissions(input?)`
236
+
237
+ **Get My Permissions**
238
+
239
+ - HTTP: `GET /api/v1/roles/me/permissions`
240
+ - operationId: `get_my_permissions_roles_me_permissions_get` (also callable as `g8.api.call("get_my_permissions_roles_me_permissions_get", input)`)
241
+ - Tier: `read`: reads data; safe to call and to retry
242
+ - API-key scope: `account:read`
243
+
244
+ What THIS KEY may do, as the app's own permission machinery sees it.
245
+
246
+ Worth calling before anything else on this surface: the non-escalation
247
+ guard on every write below bounds what you may grant by what this answer
248
+ contains. A machine key with no human behind it holds no role permissions
249
+ and will see an empty set - that is the documented fail-closed policy, not
250
+ a lookup failure.
251
+
252
+ **Input**: none.
253
+
254
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
255
+
256
+ Other envelope fields: `pagination` (PaginationMeta).
257
+
258
+ **Example**
259
+
260
+ ```ts
261
+ const result = await g8.api.roles.getMyPermissions();
262
+ ```
263
+
264
+ ---
265
+
266
+ <a id="op-getrole"></a>
267
+
268
+ ### `g8.api.roles.getRole(input)`
269
+
270
+ **Get Role**
271
+
272
+ - HTTP: `GET /api/v1/roles/{role_id}`
273
+ - operationId: `get_role_roles__role_id__get` (also callable as `g8.api.call("get_role_roles__role_id__get", input)`)
274
+ - Tier: `read`: reads data; safe to call and to retry
275
+ - API-key scope: `account:read`
276
+
277
+ One role, with the full permission list it grants.
278
+
279
+ **Input**
280
+
281
+ | Field | Type | Required | Description |
282
+ |---|---|---|---|
283
+ | `path.role_id` | `string` | yes | Role id (UUID). |
284
+
285
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
286
+
287
+ Other envelope fields: `pagination` (PaginationMeta).
288
+
289
+ **Example**
290
+
291
+ ```ts
292
+ const result = await g8.api.roles.getRole({ path: { role_id: "id" } });
293
+ ```
294
+
295
+ ---
296
+
297
+ <a id="op-getuserrole"></a>
298
+
299
+ ### `g8.api.roles.getUserRole(input)`
300
+
301
+ **Get User Role**
302
+
303
+ - HTTP: `GET /api/v1/roles/users/{user_id}`
304
+ - operationId: `get_user_role_roles_users__user_id__get` (also callable as `g8.api.call("get_user_role_roles_users__user_id__get", input)`)
305
+ - Tier: `read`: reads data; safe to call and to retry
306
+ - API-key scope: `account:read`
307
+
308
+ The role one person holds in this organisation.
309
+
310
+ 404 when they hold none - which is a real state, not an error: a member
311
+ can exist in the organisation with no role assigned yet.
312
+
313
+ The WRITE twin, `PUT /v1/roles/users/{user_id}`, is not published. It
314
+ maps a role slug of `owner` or `admin` onto the identity provider's own
315
+ Owner/Admin and syncs it, so it can make somebody an administrator of the
316
+ tenant.
317
+
318
+ **Input**
319
+
320
+ | Field | Type | Required | Description |
321
+ |---|---|---|---|
322
+ | `path.user_id` | `string` | yes | Identity-provider user id. |
323
+
324
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
325
+
326
+ Other envelope fields: `pagination` (PaginationMeta).
327
+
328
+ **Example**
329
+
330
+ ```ts
331
+ const result = await g8.api.roles.getUserRole({ path: { user_id: "id" } });
332
+ ```
333
+
334
+ ---
335
+
336
+ <a id="op-listjoinrequests"></a>
337
+
338
+ ### `g8.api.roles.listJoinRequests(input?)`
339
+
340
+ **List Join Requests**
341
+
342
+ - HTTP: `GET /api/v1/roles/join-requests`
343
+ - operationId: `list_join_requests_roles_join_requests_get` (also callable as `g8.api.call("list_join_requests_roles_join_requests_get", input)`)
344
+ - Tier: `read`: reads data; safe to call and to retry
345
+ - API-key scope: `account:read`
346
+
347
+ People waiting to be let into the organisation.
348
+
349
+ Read-only here. Approving or rejecting one admits a human being to the
350
+ tenant and can make them an administrator of it, so it stays in the
351
+ product - see the module docstring.
352
+
353
+ **Input**
354
+
355
+ | Field | Type | Required | Description |
356
+ |---|---|---|---|
357
+ | `query.status` | `string \| null` | no | Queue state to list: `pending`, `approved` or `rejected`. default `"pending"` |
358
+
359
+ **Returns** `ApiResponse_OrgListPayload_`: the envelope `{ data: OrgListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
360
+
361
+ Other envelope fields: `pagination` (PaginationMeta).
362
+
363
+ `OrgListPayload` fields:
364
+
365
+ | Field | Type | Required | Description |
366
+ |---|---|---|---|
367
+ | `items` | `Array<unknown>` | no | |
368
+
369
+ **Example**
370
+
371
+ ```ts
372
+ const result = await g8.api.roles.listJoinRequests();
373
+ ```
374
+
375
+ ---
376
+
377
+ <a id="op-listorgusers"></a>
378
+
379
+ ### `g8.api.roles.listOrgUsers(input?)`
380
+
381
+ **List Org Users**
382
+
383
+ - HTTP: `GET /api/v1/roles/org-users`
384
+ - operationId: `list_org_users_roles_org_users_get` (also callable as `g8.api.call("list_org_users_roles_org_users_get", input)`)
385
+ - Tier: `read`: reads data; safe to call and to retry
386
+ - API-key scope: `account:read`
387
+
388
+ Everyone in the organisation, with the role each of them holds.
389
+
390
+ The join between the identity provider's membership list and this org's
391
+ own role assignments - which is the only place both halves appear
392
+ together.
393
+
394
+ On the app's ungated sibling router, so no admin gate here either: the
395
+ directory is what every owner and assignee picker in the product is built
396
+ from, and `settings:read` OR `team:read` is the app's own bar for it.
397
+
398
+ **Input**: none.
399
+
400
+ **Returns** `ApiResponse_OrgListPayload_`: the envelope `{ data: OrgListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
401
+
402
+ Other envelope fields: `pagination` (PaginationMeta).
403
+
404
+ `OrgListPayload` fields:
405
+
406
+ | Field | Type | Required | Description |
407
+ |---|---|---|---|
408
+ | `items` | `Array<unknown>` | no | |
409
+
410
+ **Example**
411
+
412
+ ```ts
413
+ const result = await g8.api.roles.listOrgUsers();
414
+ ```
415
+
416
+ ---
417
+
418
+ <a id="op-listpendinginvites"></a>
419
+
420
+ ### `g8.api.roles.listPendingInvites(input?)`
421
+
422
+ **List Pending Invites**
423
+
424
+ - HTTP: `GET /api/v1/roles/pending-invites`
425
+ - operationId: `list_pending_invites_roles_pending_invites_get` (also callable as `g8.api.call("list_pending_invites_roles_pending_invites_get", input)`)
426
+ - Tier: `read`: reads data; safe to call and to retry
427
+ - API-key scope: `account:read`
428
+
429
+ Invitations sent but not yet accepted, and the role each one carries.
430
+
431
+ An invitation is a role assignment that has not landed yet: the role is
432
+ applied on the invitee's first login. That makes this list the honest
433
+ answer to "who is about to get access, and to what".
434
+
435
+ **Input**: none.
436
+
437
+ **Returns** `ApiResponse_OrgListPayload_`: the envelope `{ data: OrgListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
438
+
439
+ Other envelope fields: `pagination` (PaginationMeta).
440
+
441
+ `OrgListPayload` fields:
442
+
443
+ | Field | Type | Required | Description |
444
+ |---|---|---|---|
445
+ | `items` | `Array<unknown>` | no | |
446
+
447
+ **Example**
448
+
449
+ ```ts
450
+ const result = await g8.api.roles.listPendingInvites();
451
+ ```
452
+
453
+ ---
454
+
455
+ <a id="op-listpermissions"></a>
456
+
457
+ ### `g8.api.roles.listPermissions(input?)`
458
+
459
+ **List Permissions**
460
+
461
+ - HTTP: `GET /api/v1/roles/permissions`
462
+ - operationId: `list_permissions_roles_permissions_get` (also callable as `g8.api.call("list_permissions_roles_permissions_get", input)`)
463
+ - Tier: `read`: reads data; safe to call and to retry
464
+ - API-key scope: `account:read`
465
+
466
+ Every permission a role can be built from.
467
+
468
+ The source of the strings `POST /roles` and `PUT /roles/{role_id}` accept
469
+ in `permissions`. Read this first: a permission the org does not have is
470
+ rejected, and the app's non-escalation guard additionally refuses anything
471
+ the CALLER does not already hold.
472
+
473
+ **Input**: none.
474
+
475
+ **Returns** `ApiResponse_OrgListPayload_`: the envelope `{ data: OrgListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
476
+
477
+ Other envelope fields: `pagination` (PaginationMeta).
478
+
479
+ `OrgListPayload` fields:
480
+
481
+ | Field | Type | Required | Description |
482
+ |---|---|---|---|
483
+ | `items` | `Array<unknown>` | no | |
484
+
485
+ **Example**
486
+
487
+ ```ts
488
+ const result = await g8.api.roles.listPermissions();
489
+ ```
490
+
491
+ ---
492
+
493
+ <a id="op-listpermissionsgrouped"></a>
494
+
495
+ ### `g8.api.roles.listPermissionsGrouped(input?)`
496
+
497
+ **List Permissions Grouped**
498
+
499
+ - HTTP: `GET /api/v1/roles/permissions/grouped`
500
+ - operationId: `list_permissions_grouped_roles_permissions_grouped_get` (also callable as `g8.api.call("list_permissions_grouped_roles_permissions_grouped_get", input)`)
501
+ - Tier: `read`: reads data; safe to call and to retry
502
+ - API-key scope: `account:read`
503
+
504
+ The same catalogue, bucketed by the product area each permission gates.
505
+
506
+ The shape a permission picker is built from. Open-shaped: the buckets grow
507
+ as the product does, and a dropped one would read as "that area has no
508
+ permissions" rather than "we did not tell you".
509
+
510
+ **Input**: none.
511
+
512
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
513
+
514
+ Other envelope fields: `pagination` (PaginationMeta).
515
+
516
+ **Example**
517
+
518
+ ```ts
519
+ const result = await g8.api.roles.listPermissionsGrouped();
520
+ ```
521
+
522
+ ---
523
+
524
+ <a id="op-listroleoptions"></a>
525
+
526
+ ### `g8.api.roles.listRoleOptions(input?)`
527
+
528
+ **List Role Options**
529
+
530
+ - HTTP: `GET /api/v1/roles/options`
531
+ - operationId: `list_role_options_roles_options_get` (also callable as `g8.api.call("list_role_options_roles_options_get", input)`)
532
+ - Tier: `read`: reads data; safe to call and to retry
533
+ - API-key scope: `account:read`
534
+
535
+ Roles as a PICKER: id, name, slug. No permission lists.
536
+
537
+ Deliberately ungated, matching the app: choosing a role from a list is not
538
+ an administrative act, and gating it is what made the picker render empty
539
+ for every ordinary member.
540
+
541
+ **Input**: none.
542
+
543
+ **Returns** `ApiResponse_OrgListPayload_`: the envelope `{ data: OrgListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
544
+
545
+ Other envelope fields: `pagination` (PaginationMeta).
546
+
547
+ `OrgListPayload` fields:
548
+
549
+ | Field | Type | Required | Description |
550
+ |---|---|---|---|
551
+ | `items` | `Array<unknown>` | no | |
552
+
553
+ **Example**
554
+
555
+ ```ts
556
+ const result = await g8.api.roles.listRoleOptions();
557
+ ```
558
+
559
+ ---
560
+
561
+ <a id="op-listroles"></a>
562
+
563
+ ### `g8.api.roles.listRoles(input?)`
564
+
565
+ **List Roles**
566
+
567
+ - HTTP: `GET /api/v1/roles`
568
+ - operationId: `list_roles_roles_get` (also callable as `g8.api.call("list_roles_roles_get", input)`)
569
+ - Tier: `read`: reads data; safe to call and to retry
570
+ - API-key scope: `account:read`
571
+
572
+ Every role in the organisation, with its permissions and holder count.
573
+
574
+ **Input**: none.
575
+
576
+ **Returns** `ApiResponse_OrgListPayload_`: the envelope `{ data: OrgListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
577
+
578
+ Other envelope fields: `pagination` (PaginationMeta).
579
+
580
+ `OrgListPayload` fields:
581
+
582
+ | Field | Type | Required | Description |
583
+ |---|---|---|---|
584
+ | `items` | `Array<unknown>` | no | |
585
+
586
+ **Example**
587
+
588
+ ```ts
589
+ const result = await g8.api.roles.listRoles();
590
+ ```
591
+
592
+ ---
593
+
594
+ <a id="op-listserviceproviderassignments"></a>
595
+
596
+ ### `g8.api.roles.listServiceProviderAssignments(input?)`
597
+
598
+ **List Service Provider Assignments**
599
+
600
+ - HTTP: `GET /api/v1/roles/service-provider/assignments`
601
+ - operationId: `list_service_provider_assignments_roles_service_provider_assignments_get` (also callable as `g8.api.call("list_service_provider_assignments_roles_service_provider_assignments_get", input)`)
602
+ - Tier: `read`: reads data; safe to call and to retry
603
+ - API-key scope: `account:read`
604
+
605
+ Which lists each outside service provider can see.
606
+
607
+ A service provider is a non-employee working inside the tenant, and this
608
+ is the whole of what they are allowed to reach. Worth auditing.
609
+
610
+ **Input**: none.
611
+
612
+ **Returns** `ApiResponse_OrgListPayload_`: the envelope `{ data: OrgListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
613
+
614
+ Other envelope fields: `pagination` (PaginationMeta).
615
+
616
+ `OrgListPayload` fields:
617
+
618
+ | Field | Type | Required | Description |
619
+ |---|---|---|---|
620
+ | `items` | `Array<unknown>` | no | |
621
+
622
+ **Example**
623
+
624
+ ```ts
625
+ const result = await g8.api.roles.listServiceProviderAssignments();
626
+ ```
627
+
628
+ ---
629
+
630
+ <a id="op-listserviceprovideravailablelists"></a>
631
+
632
+ ### `g8.api.roles.listServiceProviderAvailableLists(input?)`
633
+
634
+ **List Service Provider Available Lists**
635
+
636
+ - HTTP: `GET /api/v1/roles/service-provider/available-lists`
637
+ - operationId: `list_service_provider_available_lists_roles_service_provider_available_lists_get` (also callable as `g8.api.call("list_service_provider_available_lists_roles_service_provider_available_lists_get", input)`)
638
+ - Tier: `read`: reads data; safe to call and to retry
639
+ - API-key scope: `account:read`
640
+
641
+ The lists that COULD be delegated, scoped to what the caller can see.
642
+
643
+ Not every list in the org: the app applies the caller's own list-read
644
+ scope, so a manager cannot delegate a list they cannot read themselves.
645
+
646
+ **Input**: none.
647
+
648
+ **Returns** `ApiResponse_OrgListPayload_`: the envelope `{ data: OrgListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
649
+
650
+ Other envelope fields: `pagination` (PaginationMeta).
651
+
652
+ `OrgListPayload` fields:
653
+
654
+ | Field | Type | Required | Description |
655
+ |---|---|---|---|
656
+ | `items` | `Array<unknown>` | no | |
657
+
658
+ **Example**
659
+
660
+ ```ts
661
+ const result = await g8.api.roles.listServiceProviderAvailableLists();
662
+ ```
663
+
664
+ ---
665
+
666
+ <a id="op-rejectjoinrequest"></a>
667
+
668
+ ### `g8.api.roles.rejectJoinRequest(input)`
669
+
670
+ **Reject Join Request**
671
+
672
+ - HTTP: `POST /api/v1/roles/join-requests/{request_id}/reject`
673
+ - operationId: `reject_join_request_roles_join_requests__request_id__reject_post` (also callable as `g8.api.call("reject_join_request_roles_join_requests__request_id__reject_post", input)`)
674
+ - Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
675
+ - API-key scope: `account:write`
676
+
677
+ Turn a pending join request down. Nobody gains access.
678
+
679
+ Published although its twin `approve` is not, for the same reason
680
+ `DELETE /roles/pending-invites/{email}` is: this direction only ever
681
+ REFUSES access, and the direction that admits a person - possibly at an
682
+ Owner or Admin role - is the one that needs a human.
683
+
684
+ 400 when the request is no longer pending; 404 when it is not this
685
+ organisation's.
686
+
687
+ **Input**
688
+
689
+ | Field | Type | Required | Description |
690
+ |---|---|---|---|
691
+ | `path.request_id` | `string` | yes | Join request id (UUID). |
692
+
693
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
694
+
695
+ Other envelope fields: `pagination` (PaginationMeta).
696
+
697
+ **Example**
698
+
699
+ ```ts
700
+ const result = await g8.api.roles.rejectJoinRequest({ path: { request_id: "id" } });
701
+ ```
702
+
703
+ ---
704
+
705
+ <a id="op-revokependinginvite"></a>
706
+
707
+ ### `g8.api.roles.revokePendingInvite(input)`
708
+
709
+ **Revoke Pending Invite**
710
+
711
+ - HTTP: `DELETE /api/v1/roles/pending-invites/{email}`
712
+ - operationId: `revoke_pending_invite_roles_pending_invites__email__delete` (also callable as `g8.api.call("revoke_pending_invite_roles_pending_invites__email__delete", input)`)
713
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
714
+ - API-key scope: `account:delete`
715
+
716
+ Withdraw an invitation before it is accepted.
717
+
718
+ Published although its counterpart `POST /invite` is not, and the
719
+ asymmetry is deliberate: this only ever REMOVES a pending grant. The
720
+ direction that hands someone access is the one that needs a human.
721
+
722
+ **Input**
723
+
724
+ | Field | Type | Required | Description |
725
+ |---|---|---|---|
726
+ | `path.email` | `string` | yes | Email address the invitation was sent to. |
727
+
728
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
729
+
730
+ Other envelope fields: `pagination` (PaginationMeta).
731
+
732
+ **Example**
733
+
734
+ ```ts
735
+ // destructive: deletes or archives data; confirm with a human before calling.
736
+ const result = await g8.api.roles.revokePendingInvite({ path: { email: "jane@acme.com" } });
737
+ ```
738
+
739
+ ---
740
+
741
+ <a id="op-updaterole"></a>
742
+
743
+ ### `g8.api.roles.updateRole(input)`
744
+
745
+ **Update Role**
746
+
747
+ - HTTP: `PUT /api/v1/roles/{role_id}`
748
+ - operationId: `update_role_roles__role_id__put` (also callable as `g8.api.call("update_role_roles__role_id__put", input)`)
749
+ - Tier: `destructive`: deletes or archives data; confirm with a human before calling
750
+ - API-key scope: `account:delete`
751
+
752
+ Redefine a role. THIS CHANGES WHAT EVERY HOLDER MAY DO, IMMEDIATELY.
753
+
754
+ `permissions` REPLACES the list rather than merging into it, so a value
755
+ left out is a permission taken away from everyone who holds the role. That
756
+ is why this operation is tiered `destructive` rather than `write`: it is a
757
+ privilege change, and "re-define what the sales team may do" must not ride
758
+ along in the same grant as "rename a team".
759
+
760
+ The app refuses to edit the permissions of its locked system roles
761
+ (`admin`, `service_provider`) - stripping `roles:manage` from `admin`
762
+ would lock the organisation out with no recovery path - and refuses to
763
+ grant anything the caller does not hold. Both reach you as a 403.
764
+
765
+ **Input**
766
+
767
+ | Field | Type | Required | Description |
768
+ |---|---|---|---|
769
+ | `path.role_id` | `string` | yes | Role id (UUID). |
770
+ | `body` | `RoleUpdateRequest` | yes | Request body; fields below. |
771
+
772
+ Body fields (`RoleUpdateRequest`):
773
+
774
+ | Field | Type | Required | Description |
775
+ |---|---|---|---|
776
+ | `body.description` | `string \| null` | no | |
777
+ | `body.manages_role_slugs` | `Array<string> \| null` | no | |
778
+ | `body.name` | `string \| null` | no | min length 1, max length 100 |
779
+ | `body.permissions` | `Array<string> \| null` | no | |
780
+ | `body.rep_limits` | `RepLimitsSettings \| null` | no | |
781
+
782
+ **Returns** `ApiResponse_OrgPayload_`: the envelope `{ data: OrgPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
783
+
784
+ Other envelope fields: `pagination` (PaginationMeta).
785
+
786
+ **Example**
787
+
788
+ ```ts
789
+ // destructive: deletes or archives data; confirm with a human before calling.
790
+ const result = await g8.api.roles.updateRole({ path: { role_id: "id" }, body: {} });
791
+ ```
792
+
793
+ ---
794
+
795
+ ## Referenced types
796
+
797
+ Named types that appear in the tables above. Full TypeScript definitions: `G8Contract.<Name>` (`import type { G8Contract } from "@graph8/sdk"`).
798
+
799
+ <a id="type-replimitssettings"></a>
800
+
801
+ ### `RepLimitsSettings`
802
+
803
+ Per-role reveal/ownership limits. Mirrors `roles.RepLimitsSettings`. The three `Literal`s are closed here rather than left as strings because they reach the app's own `Literal` inside `_apply_rep_limits`.
804
+
805
+ | Field | Type | Required | Description |
806
+ |---|---|---|---|
807
+ | `conflict_company_owned` | `"allow" \| "warn" \| "block"` | no | default `"allow"` |
808
+ | `conflict_contact_active` | `"allow" \| "warn" \| "block"` | no | default `"allow"` |
809
+ | `max_companies` | `integer \| null` | no | min 0 |
810
+ | `max_contacts` | `integer \| null` | no | min 0 |
811
+ | `reveal_monthly_credit_budget` | `integer \| null` | no | min 0 |
812
+ | `reveal_policy` | `"within_limits" \| "monthly_credit_budget" \| "no_limit"` | no | default `"no_limit"` |