@graph8/sdk 0.251.0 → 0.260.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/cli.js +216 -0
- package/dist/index.d.mts +104 -7
- package/dist/index.d.ts +104 -7
- package/dist/index.js +44 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -3
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +102 -7
- package/dist/react.d.ts +102 -7
- package/dist/react.js +62 -11
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +53 -12
- package/dist/react.mjs.map +1 -1
- package/dist/types/README.md +7 -0
- package/dist/types/agency.d.ts +20 -0
- package/dist/types/agentSetup.d.ts +57 -0
- package/dist/types/api.d.ts +127 -0
- package/dist/types/appClient.d.ts +99 -0
- package/dist/types/appPlatform.d.ts +269 -0
- package/dist/types/appTokens.d.ts +125 -0
- package/dist/types/apps.d.ts +130 -0
- package/dist/types/audiences.d.ts +88 -0
- package/dist/types/calendar.d.ts +55 -0
- package/dist/types/campaigns.d.ts +61 -0
- package/dist/types/chat.d.ts +35 -0
- package/dist/types/cli.d.ts +14 -0
- package/dist/types/companies.d.ts +123 -0
- package/dist/types/contacts.d.ts +200 -0
- package/dist/types/copilot.d.ts +31 -0
- package/dist/types/core.d.ts +1052 -0
- package/dist/types/deals.d.ts +215 -0
- package/dist/types/enrich.d.ts +51 -0
- package/dist/types/fields.d.ts +84 -0
- package/dist/types/forms.d.ts +16 -0
- package/dist/types/http.d.ts +141 -0
- package/dist/types/inbox.d.ts +123 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/intent.d.ts +196 -0
- package/dist/types/lists.d.ts +44 -0
- package/dist/types/mailboxes.d.ts +240 -0
- package/dist/types/marketplace.d.ts +62 -0
- package/dist/types/meetings.d.ts +70 -0
- package/dist/types/newsletter.d.ts +212 -0
- package/dist/types/notes.d.ts +57 -0
- package/dist/types/objects.d.ts +281 -0
- package/dist/types/pipelines.d.ts +135 -0
- package/dist/types/quotes.d.ts +143 -0
- package/dist/types/react.d.ts +978 -0
- package/dist/types/search.d.ts +99 -0
- package/dist/types/sequences.d.ts +255 -0
- package/dist/types/signals.d.ts +28 -0
- package/dist/types/skills.d.ts +176 -0
- package/dist/types/snippet.d.ts +24 -0
- package/dist/types/studio.d.ts +161 -0
- package/dist/types/tasks.d.ts +101 -0
- package/dist/types/types.d.ts +45 -0
- package/dist/types/utils.d.ts +21 -0
- package/dist/types/version.d.ts +10 -0
- package/dist/types/visitors.d.ts +29 -0
- package/dist/types/voice.d.ts +304 -0
- package/dist/types/webhooks.d.ts +71 -0
- package/dist/types/workflows.d.ts +229 -0
- package/docs/agents.md +748 -0
- package/docs/api/README.md +165 -0
- package/docs/api/accounts.d.ts +396 -0
- package/docs/api/accounts.md +644 -0
- package/docs/api/adCampaigns.d.ts +707 -0
- package/docs/api/adCampaigns.md +1091 -0
- package/docs/api/adCreatives.d.ts +996 -0
- package/docs/api/adCreatives.md +1708 -0
- package/docs/api/agency.d.ts +556 -0
- package/docs/api/agency.md +845 -0
- package/docs/api/agent.d.ts +330 -0
- package/docs/api/agent.md +514 -0
- package/docs/api/agents.d.ts +1622 -0
- package/docs/api/agents.md +2860 -0
- package/docs/api/aiInbox.d.ts +1984 -0
- package/docs/api/aiInbox.md +3490 -0
- package/docs/api/analytics.d.ts +1273 -0
- package/docs/api/analytics.md +2095 -0
- package/docs/api/apiKeys.d.ts +252 -0
- package/docs/api/apiKeys.md +318 -0
- package/docs/api/appDeployments.d.ts +236 -0
- package/docs/api/appDeployments.md +471 -0
- package/docs/api/appDomains.d.ts +171 -0
- package/docs/api/appDomains.md +281 -0
- package/docs/api/appLogs.d.ts +120 -0
- package/docs/api/appLogs.md +159 -0
- package/docs/api/appObjects.d.ts +415 -0
- package/docs/api/appObjects.md +568 -0
- package/docs/api/appPages.d.ts +557 -0
- package/docs/api/appPages.md +796 -0
- package/docs/api/appPlatformTokens.d.ts +123 -0
- package/docs/api/appPlatformTokens.md +172 -0
- package/docs/api/appointments.d.ts +2361 -0
- package/docs/api/appointments.md +3917 -0
- package/docs/api/apps.d.ts +822 -0
- package/docs/api/apps.md +1342 -0
- package/docs/api/assertUpsert.d.ts +286 -0
- package/docs/api/assertUpsert.md +370 -0
- package/docs/api/audienceSyncs.d.ts +259 -0
- package/docs/api/audienceSyncs.md +395 -0
- package/docs/api/brandKit.d.ts +686 -0
- package/docs/api/brandKit.md +1133 -0
- package/docs/api/bugReports.d.ts +181 -0
- package/docs/api/bugReports.md +268 -0
- package/docs/api/by-path.md +3260 -0
- package/docs/api/calendarInvites.d.ts +117 -0
- package/docs/api/calendarInvites.md +148 -0
- package/docs/api/campaignWorkflows.d.ts +152 -0
- package/docs/api/campaignWorkflows.md +200 -0
- package/docs/api/campaigns.d.ts +721 -0
- package/docs/api/campaigns.md +1236 -0
- package/docs/api/channels.d.ts +171 -0
- package/docs/api/channels.md +235 -0
- package/docs/api/cliCampaigns.d.ts +205 -0
- package/docs/api/cliCampaigns.md +256 -0
- package/docs/api/cliPipelines.d.ts +324 -0
- package/docs/api/cliPipelines.md +562 -0
- package/docs/api/clickHouse.d.ts +115 -0
- package/docs/api/clickHouse.md +138 -0
- package/docs/api/companies.d.ts +1636 -0
- package/docs/api/companies.md +2211 -0
- package/docs/api/companyIntelligence.d.ts +299 -0
- package/docs/api/companyIntelligence.md +488 -0
- package/docs/api/contacts.d.ts +2173 -0
- package/docs/api/contacts.md +3143 -0
- package/docs/api/content.d.ts +968 -0
- package/docs/api/content.md +1667 -0
- package/docs/api/contentGridSkills.d.ts +177 -0
- package/docs/api/contentGridSkills.md +271 -0
- package/docs/api/copilot.d.ts +1017 -0
- package/docs/api/copilot.md +1765 -0
- package/docs/api/crmSyncs.d.ts +215 -0
- package/docs/api/crmSyncs.md +301 -0
- package/docs/api/customerSuccess.d.ts +491 -0
- package/docs/api/customerSuccess.md +776 -0
- package/docs/api/deals.d.ts +1696 -0
- package/docs/api/deals.md +2432 -0
- package/docs/api/deliverability.d.ts +418 -0
- package/docs/api/deliverability.md +677 -0
- package/docs/api/desk.d.ts +1765 -0
- package/docs/api/desk.md +3007 -0
- package/docs/api/dialer.d.ts +1185 -0
- package/docs/api/dialer.md +2166 -0
- package/docs/api/dialerAnalytics.d.ts +187 -0
- package/docs/api/dialerAnalytics.md +257 -0
- package/docs/api/documents.d.ts +895 -0
- package/docs/api/documents.md +1440 -0
- package/docs/api/duplicates.d.ts +195 -0
- package/docs/api/duplicates.md +315 -0
- package/docs/api/eSign.d.ts +38 -0
- package/docs/api/eSign.md +54 -0
- package/docs/api/eSignature.d.ts +242 -0
- package/docs/api/eSignature.md +341 -0
- package/docs/api/enrichment.d.ts +3207 -0
- package/docs/api/enrichment.md +5225 -0
- package/docs/api/events.d.ts +115 -0
- package/docs/api/events.md +105 -0
- package/docs/api/fields.d.ts +482 -0
- package/docs/api/fields.md +566 -0
- package/docs/api/forms.d.ts +1012 -0
- package/docs/api/forms.md +1542 -0
- package/docs/api/gtmCampaigns.d.ts +662 -0
- package/docs/api/gtmCampaigns.md +1044 -0
- package/docs/api/gtmContext.d.ts +1187 -0
- package/docs/api/gtmContext.md +2112 -0
- package/docs/api/gtmDeliverability.d.ts +60 -0
- package/docs/api/gtmDeliverability.md +63 -0
- package/docs/api/gtmKnowledgeBase.d.ts +76 -0
- package/docs/api/gtmKnowledgeBase.md +91 -0
- package/docs/api/gtmLaunchHelpers.d.ts +123 -0
- package/docs/api/gtmLaunchHelpers.md +148 -0
- package/docs/api/gtmLibrary.d.ts +448 -0
- package/docs/api/gtmLibrary.md +780 -0
- package/docs/api/health.d.ts +39 -0
- package/docs/api/health.md +58 -0
- package/docs/api/imageLibrary.d.ts +341 -0
- package/docs/api/imageLibrary.md +569 -0
- package/docs/api/imports.d.ts +157 -0
- package/docs/api/imports.md +174 -0
- package/docs/api/inbox.d.ts +709 -0
- package/docs/api/inbox.md +1067 -0
- package/docs/api/install.d.ts +213 -0
- package/docs/api/install.md +317 -0
- package/docs/api/installedApps.d.ts +131 -0
- package/docs/api/installedApps.md +241 -0
- package/docs/api/integrationStatus.d.ts +142 -0
- package/docs/api/integrationStatus.md +205 -0
- package/docs/api/integrations.d.ts +2327 -0
- package/docs/api/integrations.md +3791 -0
- package/docs/api/intent.d.ts +482 -0
- package/docs/api/intent.md +858 -0
- package/docs/api/knowledge.d.ts +501 -0
- package/docs/api/knowledge.md +843 -0
- package/docs/api/knowledgeBase.d.ts +84 -0
- package/docs/api/knowledgeBase.md +96 -0
- package/docs/api/landingPages.d.ts +1411 -0
- package/docs/api/landingPages.md +2488 -0
- package/docs/api/leads.d.ts +133 -0
- package/docs/api/leads.md +180 -0
- package/docs/api/library.d.ts +217 -0
- package/docs/api/library.md +338 -0
- package/docs/api/linkedIn.d.ts +227 -0
- package/docs/api/linkedIn.md +289 -0
- package/docs/api/linkedInOutreach.d.ts +727 -0
- package/docs/api/linkedInOutreach.md +990 -0
- package/docs/api/lists.d.ts +1106 -0
- package/docs/api/lists.md +1609 -0
- package/docs/api/logs.d.ts +71 -0
- package/docs/api/logs.md +70 -0
- package/docs/api/mailboxes.d.ts +1050 -0
- package/docs/api/mailboxes.md +1690 -0
- package/docs/api/marketingIntelligence.d.ts +256 -0
- package/docs/api/marketingIntelligence.md +454 -0
- package/docs/api/marketplace.d.ts +3173 -0
- package/docs/api/marketplace.md +5953 -0
- package/docs/api/mcp.d.ts +69 -0
- package/docs/api/mcp.md +69 -0
- package/docs/api/me.d.ts +54 -0
- package/docs/api/me.md +56 -0
- package/docs/api/meetings.d.ts +539 -0
- package/docs/api/meetings.md +747 -0
- package/docs/api/newsletter.d.ts +1613 -0
- package/docs/api/newsletter.md +2746 -0
- package/docs/api/notes.d.ts +517 -0
- package/docs/api/notes.md +888 -0
- package/docs/api/notifications.d.ts +94 -0
- package/docs/api/notifications.md +105 -0
- package/docs/api/objects.d.ts +621 -0
- package/docs/api/objects.md +1098 -0
- package/docs/api/openSearch.d.ts +234 -0
- package/docs/api/openSearch.md +297 -0
- package/docs/api/ops.d.ts +299 -0
- package/docs/api/ops.md +339 -0
- package/docs/api/orgGovernance.d.ts +393 -0
- package/docs/api/orgGovernance.md +623 -0
- package/docs/api/orgVideos.d.ts +184 -0
- package/docs/api/orgVideos.md +252 -0
- package/docs/api/organizationSettings.d.ts +626 -0
- package/docs/api/organizationSettings.md +911 -0
- package/docs/api/phoneNumbers.d.ts +484 -0
- package/docs/api/phoneNumbers.md +777 -0
- package/docs/api/profile.d.ts +329 -0
- package/docs/api/profile.md +540 -0
- package/docs/api/programmaticPages.d.ts +400 -0
- package/docs/api/programmaticPages.md +626 -0
- package/docs/api/providerDomains.d.ts +866 -0
- package/docs/api/providerDomains.md +1446 -0
- package/docs/api/providerUsage.d.ts +129 -0
- package/docs/api/providerUsage.md +186 -0
- package/docs/api/public.d.ts +69 -0
- package/docs/api/public.md +78 -0
- package/docs/api/publicCopilot.d.ts +67 -0
- package/docs/api/publicCopilot.md +80 -0
- package/docs/api/publicSignals.d.ts +66 -0
- package/docs/api/publicSignals.md +71 -0
- package/docs/api/publicVisitors.d.ts +97 -0
- package/docs/api/publicVisitors.md +118 -0
- package/docs/api/quotes.d.ts +1564 -0
- package/docs/api/quotes.md +2553 -0
- package/docs/api/radar.d.ts +808 -0
- package/docs/api/radar.md +1431 -0
- package/docs/api/radarReports.d.ts +208 -0
- package/docs/api/radarReports.md +306 -0
- package/docs/api/recordRoles.d.ts +143 -0
- package/docs/api/recordRoles.md +175 -0
- package/docs/api/repos.d.ts +146 -0
- package/docs/api/repos.md +211 -0
- package/docs/api/research.d.ts +295 -0
- package/docs/api/research.md +534 -0
- package/docs/api/revenue.d.ts +402 -0
- package/docs/api/revenue.md +608 -0
- package/docs/api/revenueAnalytics.d.ts +147 -0
- package/docs/api/revenueAnalytics.md +212 -0
- package/docs/api/revenueLifecycle.d.ts +207 -0
- package/docs/api/revenueLifecycle.md +274 -0
- package/docs/api/revenueRecords.d.ts +372 -0
- package/docs/api/revenueRecords.md +563 -0
- package/docs/api/roles.d.ts +431 -0
- package/docs/api/roles.md +812 -0
- package/docs/api/salesCoach.d.ts +877 -0
- package/docs/api/salesCoach.md +1540 -0
- package/docs/api/sandbox.d.ts +210 -0
- package/docs/api/sandbox.md +380 -0
- package/docs/api/scans.d.ts +104 -0
- package/docs/api/scans.md +136 -0
- package/docs/api/scheduleBuy.d.ts +293 -0
- package/docs/api/scheduleBuy.md +431 -0
- package/docs/api/scraping.d.ts +266 -0
- package/docs/api/scraping.md +383 -0
- package/docs/api/sdrAnalytics.d.ts +138 -0
- package/docs/api/sdrAnalytics.md +246 -0
- package/docs/api/search.d.ts +598 -0
- package/docs/api/search.md +866 -0
- package/docs/api/seo.d.ts +447 -0
- package/docs/api/seo.md +660 -0
- package/docs/api/sequenceLifecycle.d.ts +439 -0
- package/docs/api/sequenceLifecycle.md +513 -0
- package/docs/api/sequences.d.ts +1936 -0
- package/docs/api/sequences.md +3232 -0
- package/docs/api/settings.d.ts +448 -0
- package/docs/api/settings.md +731 -0
- package/docs/api/signals.d.ts +1441 -0
- package/docs/api/signals.md +2526 -0
- package/docs/api/signatures.d.ts +719 -0
- package/docs/api/signatures.md +1247 -0
- package/docs/api/skills.d.ts +230 -0
- package/docs/api/skills.md +466 -0
- package/docs/api/snippet.d.ts +85 -0
- package/docs/api/snippet.md +106 -0
- package/docs/api/socialPublishing.d.ts +824 -0
- package/docs/api/socialPublishing.md +1245 -0
- package/docs/api/studioDocuments.d.ts +244 -0
- package/docs/api/studioDocuments.md +348 -0
- package/docs/api/support.d.ts +90 -0
- package/docs/api/support.md +76 -0
- package/docs/api/suppressions.d.ts +241 -0
- package/docs/api/suppressions.md +343 -0
- package/docs/api/surveys.d.ts +847 -0
- package/docs/api/surveys.md +1223 -0
- package/docs/api/tasks.d.ts +813 -0
- package/docs/api/tasks.md +1344 -0
- package/docs/api/teamMembers.d.ts +668 -0
- package/docs/api/teamMembers.md +1040 -0
- package/docs/api/teams.d.ts +784 -0
- package/docs/api/teams.md +1395 -0
- package/docs/api/usage.d.ts +277 -0
- package/docs/api/usage.md +389 -0
- package/docs/api/visitors.d.ts +690 -0
- package/docs/api/visitors.md +1075 -0
- package/docs/api/voice.d.ts +4661 -0
- package/docs/api/voice.md +7905 -0
- package/docs/api/webAnalytics.d.ts +964 -0
- package/docs/api/webAnalytics.md +1452 -0
- package/docs/api/webChat.d.ts +1704 -0
- package/docs/api/webChat.md +2048 -0
- package/docs/api/webhooks.d.ts +251 -0
- package/docs/api/webhooks.md +386 -0
- package/docs/api/websiteEditor.d.ts +324 -0
- package/docs/api/websiteEditor.md +517 -0
- package/docs/api/work.d.ts +2298 -0
- package/docs/api/work.md +3096 -0
- package/docs/api/workbench.d.ts +2962 -0
- package/docs/api/workbench.md +4884 -0
- package/docs/api/workflows.d.ts +1218 -0
- package/docs/api/workflows.md +2302 -0
- package/docs/sdk-clients.md +4339 -0
- 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"` |
|