import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.tasks.update({
id: "<id>",
aiTaskRequest: {},
});
console.log(result);
}
run();{
"id": "<string>",
"object": "<string>",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"trigger_type": "immediate",
"cron_expression": "<string>",
"interval_seconds": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"delivery_method": "notification",
"approval_mode": "autonomous",
"model_id": "<string>",
"active": true,
"expires_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"total_runs_count": 123,
"consecutive_failure_count": 123,
"total_credits_consumed": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Updates an existing AI task.
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.tasks.update({
id: "<id>",
aiTaskRequest: {},
});
console.log(result);
}
run();{
"id": "<string>",
"object": "<string>",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"trigger_type": "immediate",
"cron_expression": "<string>",
"interval_seconds": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"delivery_method": "notification",
"approval_mode": "autonomous",
"model_id": "<string>",
"active": true,
"expires_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"total_runs_count": 123,
"consecutive_failure_count": 123,
"total_credits_consumed": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}API key in the format: Bearer {api_token}
The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")
immediate, cron, interval, once, event notification, email, telegram, discord, slack, none autonomous, supervised, read_only Task updated
immediate, cron, interval, once, event notification, email, telegram, discord, slack, none autonomous, supervised, read_only Was this page helpful?