Groups
(permissions.groups)
Overview
Available Operations
- checkGroupPermission - Check if a group has a specific permission on a resource
- listGroupPermissions - List all permissions for a group
- grantGroupPermission - Grant a permission to a group
- revokeGroupPermission - Revoke a permission from a group
- addGroupMember - Add a member to a group
- removeGroupMember - Remove a member from a group
- checkGroupMember - Check if a user is a member of a group
- listGroupMembers - List all members of a group
checkGroupPermission
Verifies whether the specified group has the requested permission level (owner, writer, or reader) on a given resource. This checks group-level permissions, not individual member permissions. Due to the hierarchical permission model, owner permissions include writer and reader access, and writer permissions include reader access. Returns true if the group has the permission (either directly or through inheritance), false otherwise.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.permissions.groups.checkGroupPermission({
group: "admins",
permission: "reader",
resource: "budget-2024",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { permissionsGroupsCheckGroupPermission } from "@meetkai/mka1/funcs/permissionsGroupsCheckGroupPermission.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await permissionsGroupsCheckGroupPermission(sdk, {
group: "admins",
permission: "reader",
resource: "budget-2024",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("permissionsGroupsCheckGroupPermission failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
usePermissionsGroupsCheckGroupPermission,
usePermissionsGroupsCheckGroupPermissionSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchPermissionsGroupsCheckGroupPermission,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidatePermissionsGroupsCheckGroupPermission,
invalidateAllPermissionsGroupsCheckGroupPermission,
} from "@meetkai/mka1/react-query/permissionsGroupsCheckGroupPermission.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CheckGroupPermissionRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.CheckGroupPermissionResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listGroupPermissions
Retrieves a comprehensive list of all resources the specified group has access to, organized by permission level (owner, writer, reader). This is useful for auditing group permissions or implementing group-based access control UI. Each permission level returns an array of resource IDs that the group can access. Members of the group inherit these permissions.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.permissions.groups.listGroupPermissions({
group: "admins",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { permissionsGroupsListGroupPermissions } from "@meetkai/mka1/funcs/permissionsGroupsListGroupPermissions.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await permissionsGroupsListGroupPermissions(sdk, {
group: "admins",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("permissionsGroupsListGroupPermissions failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
usePermissionsGroupsListGroupPermissions,
usePermissionsGroupsListGroupPermissionsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchPermissionsGroupsListGroupPermissions,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidatePermissionsGroupsListGroupPermissions,
invalidateAllPermissionsGroupsListGroupPermissions,
} from "@meetkai/mka1/react-query/permissionsGroupsListGroupPermissions.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListGroupPermissionsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListGroupPermissionsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
grantGroupPermission
Grants the specified permission level (owner, writer, or reader) on a resource to a group. All members of the group will inherit this permission. Note that due to the hierarchical model, granting owner permission automatically includes writer and reader access, and granting writer includes reader access. If the permission already exists, this operation will fail with a validation error.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.permissions.groups.grantGroupPermission({
group: "admins",
permission: "reader",
resource: "budget-2024",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { permissionsGroupsGrantGroupPermission } from "@meetkai/mka1/funcs/permissionsGroupsGrantGroupPermission.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await permissionsGroupsGrantGroupPermission(sdk, {
group: "admins",
permission: "reader",
resource: "budget-2024",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("permissionsGroupsGrantGroupPermission failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
usePermissionsGroupsGrantGroupPermissionMutation
} from "@meetkai/mka1/react-query/permissionsGroupsGrantGroupPermission.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GrantGroupPermissionRequestBody | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GrantGroupPermissionResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
revokeGroupPermission
Removes the specified permission level from a group on a resource. This removes the permission for all group members. Due to the hierarchical model, if a group has owner permission and you revoke reader, members will still have reader access through the owner permission. To fully remove group access, revoke the highest permission level the group has.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.permissions.groups.revokeGroupPermission({
group: "admins",
permission: "reader",
resource: "budget-2024",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { permissionsGroupsRevokeGroupPermission } from "@meetkai/mka1/funcs/permissionsGroupsRevokeGroupPermission.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await permissionsGroupsRevokeGroupPermission(sdk, {
group: "admins",
permission: "reader",
resource: "budget-2024",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("permissionsGroupsRevokeGroupPermission failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
usePermissionsGroupsRevokeGroupPermissionMutation
} from "@meetkai/mka1/react-query/permissionsGroupsRevokeGroupPermission.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.RevokeGroupPermissionRequestBody | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.RevokeGroupPermissionResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
addGroupMember
Adds the specified user as a member of the given group. Once added, the user will inherit all permissions that have been granted to the group. This is useful for managing access control at scale, as you can grant permissions to groups rather than individual users. If the user is already a member, this operation will fail with a validation error.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.permissions.groups.addGroupMember({
group: "<value>",
user: "Chanel22",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { permissionsGroupsAddGroupMember } from "@meetkai/mka1/funcs/permissionsGroupsAddGroupMember.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await permissionsGroupsAddGroupMember(sdk, {
group: "<value>",
user: "Chanel22",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("permissionsGroupsAddGroupMember failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
usePermissionsGroupsAddGroupMemberMutation
} from "@meetkai/mka1/react-query/permissionsGroupsAddGroupMember.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.AddGroupMemberRequestBody | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.AddGroupMemberResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
removeGroupMember
Removes the specified user from the given group. Once removed, the user will no longer inherit any permissions from the group, though they may still have direct permissions on resources. This operation is idempotent - removing a user who is not a member will succeed without error.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.permissions.groups.removeGroupMember({
group: "<value>",
user: "George75",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { permissionsGroupsRemoveGroupMember } from "@meetkai/mka1/funcs/permissionsGroupsRemoveGroupMember.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await permissionsGroupsRemoveGroupMember(sdk, {
group: "<value>",
user: "George75",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("permissionsGroupsRemoveGroupMember failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
usePermissionsGroupsRemoveGroupMemberMutation
} from "@meetkai/mka1/react-query/permissionsGroupsRemoveGroupMember.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.RemoveGroupMemberRequestBody | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.RemoveGroupMemberResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
checkGroupMember
Verifies whether the specified user is a member of the given group. Returns true if the user is a member, false otherwise. This is useful for implementing group-based UI features or validating group membership before performing operations.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.permissions.groups.checkGroupMember({
group: "<value>",
user: "Unique_Cruickshank",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { permissionsGroupsCheckGroupMember } from "@meetkai/mka1/funcs/permissionsGroupsCheckGroupMember.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await permissionsGroupsCheckGroupMember(sdk, {
group: "<value>",
user: "Unique_Cruickshank",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("permissionsGroupsCheckGroupMember failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
usePermissionsGroupsCheckGroupMember,
usePermissionsGroupsCheckGroupMemberSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchPermissionsGroupsCheckGroupMember,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidatePermissionsGroupsCheckGroupMember,
invalidateAllPermissionsGroupsCheckGroupMember,
} from "@meetkai/mka1/react-query/permissionsGroupsCheckGroupMember.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CheckGroupMemberRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.CheckGroupMemberResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listGroupMembers
Retrieves a complete list of all user IDs that are members of the specified group. This is useful for auditing group membership, displaying group members in UI, or understanding who has inherited permissions from the group. Returns an empty array if the group has no members.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.permissions.groups.listGroupMembers({
group: "admins",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { permissionsGroupsListGroupMembers } from "@meetkai/mka1/funcs/permissionsGroupsListGroupMembers.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await permissionsGroupsListGroupMembers(sdk, {
group: "admins",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("permissionsGroupsListGroupMembers failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
usePermissionsGroupsListGroupMembers,
usePermissionsGroupsListGroupMembersSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchPermissionsGroupsListGroupMembers,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidatePermissionsGroupsListGroupMembers,
invalidateAllPermissionsGroupsListGroupMembers,
} from "@meetkai/mka1/react-query/permissionsGroupsListGroupMembers.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListGroupMembersRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListGroupMembersResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |