Skip to content

Auth.ServiceAccounts

Overview

Available Operations

create

Mint a non-human principal scoped to this org (org owner/admin only).

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.auth.serviceAccounts.create({
    orgId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { authServiceAccountsCreate } from "@meetkai/mka1/funcs/authServiceAccountsCreate.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 authServiceAccountsCreate(sdk, {
    orgId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("authServiceAccountsCreate 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.
  useAuthServiceAccountsCreateMutation
} from "@meetkai/mka1/react-query/authServiceAccountsCreate.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.CreateServiceAccountRequest✔️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.CreateServiceAccountResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.CreateServiceAccountResponseBody400application/json
errors.CreateServiceAccountAuthServiceAccountsResponseBody401application/json
errors.CreateServiceAccountAuthServiceAccountsResponseResponseBody403application/json
errors.CreateServiceAccountAuthServiceAccountsResponse404ResponseBody404application/json
errors.CreateServiceAccountAuthServiceAccountsResponse409ResponseBody409application/json
errors.CreateServiceAccountAuthServiceAccountsResponse429ResponseBody429application/json
errors.APIError4XX, 5XX*/*

list

List service accounts

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.auth.serviceAccounts.list({
    orgId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { authServiceAccountsList } from "@meetkai/mka1/funcs/authServiceAccountsList.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 authServiceAccountsList(sdk, {
    orgId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("authServiceAccountsList 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.
  useAuthServiceAccountsList,
  useAuthServiceAccountsListSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchAuthServiceAccountsList,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateAuthServiceAccountsList,
  invalidateAllAuthServiceAccountsList,
} from "@meetkai/mka1/react-query/authServiceAccountsList.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ListServiceAccountsRequest✔️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.ListServiceAccountsResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.ListServiceAccountsResponseBody400application/json
errors.ListServiceAccountsAuthServiceAccountsResponseBody401application/json
errors.ListServiceAccountsAuthServiceAccountsResponseResponseBody403application/json
errors.ListServiceAccountsAuthServiceAccountsResponse404ResponseBody404application/json
errors.ListServiceAccountsAuthServiceAccountsResponse409ResponseBody409application/json
errors.ListServiceAccountsAuthServiceAccountsResponse429ResponseBody429application/json
errors.APIError4XX, 5XX*/*

get

Get a service account

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.auth.serviceAccounts.get({
    orgId: "<id>",
    saId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { authServiceAccountsGet } from "@meetkai/mka1/funcs/authServiceAccountsGet.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 authServiceAccountsGet(sdk, {
    orgId: "<id>",
    saId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("authServiceAccountsGet 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.
  useAuthServiceAccountsGet,
  useAuthServiceAccountsGetSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchAuthServiceAccountsGet,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateAuthServiceAccountsGet,
  invalidateAllAuthServiceAccountsGet,
} from "@meetkai/mka1/react-query/authServiceAccountsGet.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.GetServiceAccountRequest✔️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.GetServiceAccountResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.GetServiceAccountResponseBody400application/json
errors.GetServiceAccountAuthServiceAccountsResponseBody401application/json
errors.GetServiceAccountAuthServiceAccountsResponseResponseBody403application/json
errors.GetServiceAccountAuthServiceAccountsResponse404ResponseBody404application/json
errors.GetServiceAccountAuthServiceAccountsResponse409ResponseBody409application/json
errors.GetServiceAccountAuthServiceAccountsResponse429ResponseBody429application/json
errors.APIError4XX, 5XX*/*

delete

Delete a service account

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.auth.serviceAccounts.delete({
    orgId: "<id>",
    saId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { authServiceAccountsDelete } from "@meetkai/mka1/funcs/authServiceAccountsDelete.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 authServiceAccountsDelete(sdk, {
    orgId: "<id>",
    saId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("authServiceAccountsDelete 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.
  useAuthServiceAccountsDeleteMutation
} from "@meetkai/mka1/react-query/authServiceAccountsDelete.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.DeleteServiceAccountRequest✔️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.DeleteServiceAccountResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.DeleteServiceAccountResponseBody400application/json
errors.DeleteServiceAccountAuthServiceAccountsResponseBody401application/json
errors.DeleteServiceAccountAuthServiceAccountsResponseResponseBody403application/json
errors.DeleteServiceAccountAuthServiceAccountsResponse404ResponseBody404application/json
errors.DeleteServiceAccountAuthServiceAccountsResponse409ResponseBody409application/json
errors.DeleteServiceAccountAuthServiceAccountsResponse429ResponseBody429application/json
errors.APIError4XX, 5XX*/*

listApiKeys

List a service account's API keys

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.auth.serviceAccounts.listApiKeys({
    orgId: "<id>",
    saId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { authServiceAccountsListApiKeys } from "@meetkai/mka1/funcs/authServiceAccountsListApiKeys.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 authServiceAccountsListApiKeys(sdk, {
    orgId: "<id>",
    saId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("authServiceAccountsListApiKeys 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.
  useAuthServiceAccountsListApiKeys,
  useAuthServiceAccountsListApiKeysSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchAuthServiceAccountsListApiKeys,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateAuthServiceAccountsListApiKeys,
  invalidateAllAuthServiceAccountsListApiKeys,
} from "@meetkai/mka1/react-query/authServiceAccountsListApiKeys.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ListServiceAccountApiKeysRequest✔️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.ListServiceAccountApiKeysResponseBody[]>

Errors

Error TypeStatus CodeContent Type
errors.ListServiceAccountApiKeysResponseBody400application/json
errors.ListServiceAccountApiKeysAuthServiceAccountsResponseBody401application/json
errors.ListServiceAccountApiKeysAuthServiceAccountsResponseResponseBody403application/json
errors.ListServiceAccountApiKeysAuthServiceAccountsResponse404ResponseBody404application/json
errors.ListServiceAccountApiKeysAuthServiceAccountsResponse409ResponseBody409application/json
errors.ListServiceAccountApiKeysAuthServiceAccountsResponse429ResponseBody429application/json
errors.APIError4XX, 5XX*/*

updateApiKey

Update a service-account API key

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.auth.serviceAccounts.updateApiKey({
    orgId: "<id>",
    saId: "<id>",
    keyId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { authServiceAccountsUpdateApiKey } from "@meetkai/mka1/funcs/authServiceAccountsUpdateApiKey.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 authServiceAccountsUpdateApiKey(sdk, {
    orgId: "<id>",
    saId: "<id>",
    keyId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("authServiceAccountsUpdateApiKey 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.
  useAuthServiceAccountsUpdateApiKeyMutation
} from "@meetkai/mka1/react-query/authServiceAccountsUpdateApiKey.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.UpdateServiceAccountApiKeyRequest✔️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.UpdateServiceAccountApiKeyResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.UpdateServiceAccountApiKeyResponseBody400application/json
errors.UpdateServiceAccountApiKeyAuthServiceAccountsResponseBody401application/json
errors.UpdateServiceAccountApiKeyAuthServiceAccountsResponseResponseBody403application/json
errors.UpdateServiceAccountApiKeyAuthServiceAccountsResponse404ResponseBody404application/json
errors.UpdateServiceAccountApiKeyAuthServiceAccountsResponse409ResponseBody409application/json
errors.UpdateServiceAccountApiKeyAuthServiceAccountsResponse429ResponseBody429application/json
errors.APIError4XX, 5XX*/*

deleteApiKey

Delete a service-account API key

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.auth.serviceAccounts.deleteApiKey({
    orgId: "<id>",
    saId: "<id>",
    keyId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { authServiceAccountsDeleteApiKey } from "@meetkai/mka1/funcs/authServiceAccountsDeleteApiKey.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 authServiceAccountsDeleteApiKey(sdk, {
    orgId: "<id>",
    saId: "<id>",
    keyId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("authServiceAccountsDeleteApiKey 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.
  useAuthServiceAccountsDeleteApiKeyMutation
} from "@meetkai/mka1/react-query/authServiceAccountsDeleteApiKey.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.DeleteServiceAccountApiKeyRequest✔️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.DeleteServiceAccountApiKeyResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.DeleteServiceAccountApiKeyResponseBody400application/json
errors.DeleteServiceAccountApiKeyAuthServiceAccountsResponseBody401application/json
errors.DeleteServiceAccountApiKeyAuthServiceAccountsResponseResponseBody403application/json
errors.DeleteServiceAccountApiKeyAuthServiceAccountsResponse404ResponseBody404application/json
errors.DeleteServiceAccountApiKeyAuthServiceAccountsResponse409ResponseBody409application/json
errors.DeleteServiceAccountApiKeyAuthServiceAccountsResponse429ResponseBody429application/json
errors.APIError4XX, 5XX*/*

regenerateApiKey

Rotate a service-account API key's secret

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.auth.serviceAccounts.regenerateApiKey({
    orgId: "<id>",
    saId: "<id>",
    keyId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { authServiceAccountsRegenerateApiKey } from "@meetkai/mka1/funcs/authServiceAccountsRegenerateApiKey.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 authServiceAccountsRegenerateApiKey(sdk, {
    orgId: "<id>",
    saId: "<id>",
    keyId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("authServiceAccountsRegenerateApiKey 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.
  useAuthServiceAccountsRegenerateApiKeyMutation
} from "@meetkai/mka1/react-query/authServiceAccountsRegenerateApiKey.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.RegenerateServiceAccountApiKeyRequest✔️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.RegenerateServiceAccountApiKeyResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.RegenerateServiceAccountApiKeyResponseBody400application/json
errors.RegenerateServiceAccountApiKeyAuthServiceAccountsResponseBody401application/json
errors.RegenerateServiceAccountApiKeyAuthServiceAccountsResponseResponseBody403application/json
errors.RegenerateServiceAccountApiKeyAuthServiceAccountsResponse404ResponseBody404application/json
errors.RegenerateServiceAccountApiKeyAuthServiceAccountsResponse409ResponseBody409application/json
errors.RegenerateServiceAccountApiKeyAuthServiceAccountsResponse429ResponseBody429application/json
errors.APIError4XX, 5XX*/*