AgentSchedules
Overview
Create and manage scheduled or recurring saved agent runs.
Available Operations
- listAgentSchedules - List schedules for an agent
- createAgentSchedule - Create an agent schedule
- getAgentSchedule - Retrieve an agent schedule
- updateAgentSchedule - Update an agent schedule
- deleteAgentSchedule - Delete an agent schedule
- pauseAgentSchedule - Pause an agent schedule
- resumeAgentSchedule - Resume an agent schedule
listAgentSchedules
List schedules for an agent
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentSchedules.listAgentSchedules({
agentId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentSchedulesListAgentSchedules } from "@meetkai/mka1/funcs/agentSchedulesListAgentSchedules.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 agentSchedulesListAgentSchedules(sdk, {
agentId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentSchedulesListAgentSchedules 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.
useAgentSchedulesListAgentSchedules,
useAgentSchedulesListAgentSchedulesSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchAgentSchedulesListAgentSchedules,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAgentSchedulesListAgentSchedules,
invalidateAllAgentSchedulesListAgentSchedules,
} from "@meetkai/mka1/react-query/agentSchedulesListAgentSchedules.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListAgentSchedulesRequest | ✔️ | 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.AgentScheduleList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 401, 404 | application/json |
| errors.APIError | 4XX, 5XX | */* |
createAgentSchedule
Creates a Temporal-backed one-time, interval, or cron schedule that starts normal saved agent runs.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentSchedules.createAgentSchedule({
agentId: "<id>",
createAgentScheduleRequest: {
schedule: {
type: "interval",
intervalSeconds: 581769,
timezone: "UTC",
},
input: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentSchedulesCreateAgentSchedule } from "@meetkai/mka1/funcs/agentSchedulesCreateAgentSchedule.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 agentSchedulesCreateAgentSchedule(sdk, {
agentId: "<id>",
createAgentScheduleRequest: {
schedule: {
type: "interval",
intervalSeconds: 581769,
timezone: "UTC",
},
input: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentSchedulesCreateAgentSchedule 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.
useAgentSchedulesCreateAgentScheduleMutation
} from "@meetkai/mka1/react-query/agentSchedulesCreateAgentSchedule.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CreateAgentScheduleRequest | ✔️ | 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.AgentSchedule>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 400, 401, 404 | application/json |
| errors.ErrorEnvelope | 502 | application/json |
| errors.APIError | 4XX, 5XX | */* |
getAgentSchedule
Retrieve an agent schedule
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentSchedules.getAgentSchedule({
agentId: "<id>",
scheduleId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentSchedulesGetAgentSchedule } from "@meetkai/mka1/funcs/agentSchedulesGetAgentSchedule.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 agentSchedulesGetAgentSchedule(sdk, {
agentId: "<id>",
scheduleId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentSchedulesGetAgentSchedule 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.
useAgentSchedulesGetAgentSchedule,
useAgentSchedulesGetAgentScheduleSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchAgentSchedulesGetAgentSchedule,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAgentSchedulesGetAgentSchedule,
invalidateAllAgentSchedulesGetAgentSchedule,
} from "@meetkai/mka1/react-query/agentSchedulesGetAgentSchedule.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetAgentScheduleRequest | ✔️ | 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.AgentSchedule>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 401, 404 | application/json |
| errors.APIError | 4XX, 5XX | */* |
updateAgentSchedule
Update an agent schedule
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentSchedules.updateAgentSchedule({
agentId: "<id>",
scheduleId: "<id>",
updateAgentScheduleRequest: {},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentSchedulesUpdateAgentSchedule } from "@meetkai/mka1/funcs/agentSchedulesUpdateAgentSchedule.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 agentSchedulesUpdateAgentSchedule(sdk, {
agentId: "<id>",
scheduleId: "<id>",
updateAgentScheduleRequest: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentSchedulesUpdateAgentSchedule 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.
useAgentSchedulesUpdateAgentScheduleMutation
} from "@meetkai/mka1/react-query/agentSchedulesUpdateAgentSchedule.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.UpdateAgentScheduleRequest | ✔️ | 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.AgentSchedule>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 400, 401, 404 | application/json |
| errors.ErrorEnvelope | 502 | application/json |
| errors.APIError | 4XX, 5XX | */* |
deleteAgentSchedule
Delete an agent schedule
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentSchedules.deleteAgentSchedule({
agentId: "<id>",
scheduleId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentSchedulesDeleteAgentSchedule } from "@meetkai/mka1/funcs/agentSchedulesDeleteAgentSchedule.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 agentSchedulesDeleteAgentSchedule(sdk, {
agentId: "<id>",
scheduleId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentSchedulesDeleteAgentSchedule 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.
useAgentSchedulesDeleteAgentScheduleMutation
} from "@meetkai/mka1/react-query/agentSchedulesDeleteAgentSchedule.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteAgentScheduleRequest | ✔️ | 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.DeleteAgentScheduleResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 401, 404 | application/json |
| errors.APIError | 4XX, 5XX | */* |
pauseAgentSchedule
Pause an agent schedule
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentSchedules.pauseAgentSchedule({
agentId: "<id>",
scheduleId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentSchedulesPauseAgentSchedule } from "@meetkai/mka1/funcs/agentSchedulesPauseAgentSchedule.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 agentSchedulesPauseAgentSchedule(sdk, {
agentId: "<id>",
scheduleId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentSchedulesPauseAgentSchedule 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.
useAgentSchedulesPauseAgentScheduleMutation
} from "@meetkai/mka1/react-query/agentSchedulesPauseAgentSchedule.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.PauseAgentScheduleRequest | ✔️ | 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.AgentSchedule>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 401, 404, 409 | application/json |
| errors.APIError | 4XX, 5XX | */* |
resumeAgentSchedule
Resume an agent schedule
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentSchedules.resumeAgentSchedule({
agentId: "<id>",
scheduleId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentSchedulesResumeAgentSchedule } from "@meetkai/mka1/funcs/agentSchedulesResumeAgentSchedule.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 agentSchedulesResumeAgentSchedule(sdk, {
agentId: "<id>",
scheduleId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentSchedulesResumeAgentSchedule 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.
useAgentSchedulesResumeAgentScheduleMutation
} from "@meetkai/mka1/react-query/agentSchedulesResumeAgentSchedule.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ResumeAgentScheduleRequest | ✔️ | 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.AgentSchedule>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 401, 404, 409 | application/json |
| errors.APIError | 4XX, 5XX | */* |