Analytics.Projects
Overview
Create, list, rename, and archive analytics projects.
Available Operations
- create - Create an analytics project
- list - List accessible analytics projects
- get - Get an analytics project
- update - Rename an active analytics project
- archive - Archive an analytics project
create
Create a project in the caller's organization. Without team_id the project belongs to the authenticated team. Organization owners and admins can create a project for any team in their organization, including teams they are not a member of, or pass team_id: null for an organization-level project. Service accounts can only create projects for their own team; any other team_id returns 403. team_id is trimmed. Ownership cannot be changed after creation.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.analytics.projects.create({
name: "<value>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { analyticsProjectsCreate } from "@meetkai/mka1/funcs/analyticsProjectsCreate.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 analyticsProjectsCreate(sdk, {
name: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("analyticsProjectsCreate 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.
useAnalyticsProjectsCreateMutation
} from "@meetkai/mka1/react-query/analyticsProjectsCreate.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | components.AnalyticsProjectCreate | ✔️ | 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<components.AnalyticsProject>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.AnalyticsError | 400, 401, 403, 404, 409, 413, 415, 429 | application/json |
| errors.AnalyticsError | 500, 503 | application/json |
| errors.APIError | 4XX, 5XX | */* |
list
Organization owners and admins see every project in their organization: all teams' projects and organization-level projects, regardless of their active team. This also applies to an owner's or admin's API keys and exchanged JWTs, whichever team the key was issued for; use a service account for a team-confined credential. Service accounts see only their own team's projects. team_id and ownership narrow that set and never widen it, so filtering by a team the caller cannot access returns an empty list. ownership=organization combined with team_id returns 400. Unknown or repeated query parameters also return 400.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.analytics.projects.list({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { analyticsProjectsList } from "@meetkai/mka1/funcs/analyticsProjectsList.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 analyticsProjectsList(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("analyticsProjectsList 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.
useAnalyticsProjectsList,
useAnalyticsProjectsListSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchAnalyticsProjectsList,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAnalyticsProjectsList,
invalidateAllAnalyticsProjectsList,
} from "@meetkai/mka1/react-query/analyticsProjectsList.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.AnalyticsProjectsListRequest | ✔️ | 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<components.AnalyticsProjectList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.AnalyticsError | 400, 401, 403, 404, 409, 413, 415, 429 | application/json |
| errors.AnalyticsError | 500, 503 | application/json |
| errors.APIError | 4XX, 5XX | */* |
get
Get an analytics project
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.analytics.projects.get({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { analyticsProjectsGet } from "@meetkai/mka1/funcs/analyticsProjectsGet.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 analyticsProjectsGet(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("analyticsProjectsGet 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.
useAnalyticsProjectsGet,
useAnalyticsProjectsGetSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchAnalyticsProjectsGet,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAnalyticsProjectsGet,
invalidateAllAnalyticsProjectsGet,
} from "@meetkai/mka1/react-query/analyticsProjectsGet.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.AnalyticsProjectsGetRequest | ✔️ | 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<components.AnalyticsProject>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.AnalyticsError | 400, 401, 403, 404, 409, 413, 415, 429 | application/json |
| errors.AnalyticsError | 500, 503 | application/json |
| errors.APIError | 4XX, 5XX | */* |
update
Rename an active project. Project ownership cannot be changed.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.analytics.projects.update({
id: "<id>",
analyticsProjectUpdate: {
name: "<value>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { analyticsProjectsUpdate } from "@meetkai/mka1/funcs/analyticsProjectsUpdate.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 analyticsProjectsUpdate(sdk, {
id: "<id>",
analyticsProjectUpdate: {
name: "<value>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("analyticsProjectsUpdate 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.
useAnalyticsProjectsUpdateMutation
} from "@meetkai/mka1/react-query/analyticsProjectsUpdate.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.AnalyticsProjectsUpdateRequest | ✔️ | 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<components.AnalyticsProject>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.AnalyticsError | 400, 401, 403, 404, 409, 413, 415, 429 | application/json |
| errors.AnalyticsError | 500, 503 | application/json |
| errors.APIError | 4XX, 5XX | */* |
archive
Stop new captures and queries for this project. Previously accepted events continue processing. Archiving does not delete stored events.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.analytics.projects.archive({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { analyticsProjectsArchive } from "@meetkai/mka1/funcs/analyticsProjectsArchive.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 analyticsProjectsArchive(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("analyticsProjectsArchive 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.
useAnalyticsProjectsArchiveMutation
} from "@meetkai/mka1/react-query/analyticsProjectsArchive.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.AnalyticsProjectsArchiveRequest | ✔️ | 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<components.AnalyticsProject>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.AnalyticsError | 400, 401, 403, 404, 409, 413, 415, 429 | application/json |
| errors.AnalyticsError | 500, 503 | application/json |
| errors.APIError | 4XX, 5XX | */* |