Skip to content

Groups

(permissions.groups)

Overview

Available Operations

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

typescript
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:

typescript
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.

tsx
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

ParameterTypeRequiredDescription
requestoperations.CheckGroupPermissionRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.CheckGroupPermissionResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 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

typescript
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:

typescript
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.

tsx
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

ParameterTypeRequiredDescription
requestoperations.ListGroupPermissionsRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ListGroupPermissionsResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 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

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  usePermissionsGroupsGrantGroupPermissionMutation
} from "@meetkai/mka1/react-query/permissionsGroupsGrantGroupPermission.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.GrantGroupPermissionRequestBody✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GrantGroupPermissionResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 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

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  usePermissionsGroupsRevokeGroupPermissionMutation
} from "@meetkai/mka1/react-query/permissionsGroupsRevokeGroupPermission.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.RevokeGroupPermissionRequestBody✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.RevokeGroupPermissionResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 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

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  usePermissionsGroupsAddGroupMemberMutation
} from "@meetkai/mka1/react-query/permissionsGroupsAddGroupMember.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.AddGroupMemberRequestBody✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.AddGroupMemberResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 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

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  usePermissionsGroupsRemoveGroupMemberMutation
} from "@meetkai/mka1/react-query/permissionsGroupsRemoveGroupMember.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.RemoveGroupMemberRequestBody✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.RemoveGroupMemberResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 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

typescript
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:

typescript
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.

tsx
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

ParameterTypeRequiredDescription
requestoperations.CheckGroupMemberRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.CheckGroupMemberResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 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

typescript
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:

typescript
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.

tsx
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

ParameterTypeRequiredDescription
requestoperations.ListGroupMembersRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ListGroupMembersResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*