Overview
Get a single cron job by its unique identifier.import { cuey } from "cuey";
const cron = await cuey.crons.get("cron-uuid-here");
Parameters
Response
The cron job object.
Show Cron properties
Show Cron properties
{
"id": "cron-uuid-here",
"cron_expression": "0 9 * * *",
"timezone": "America/New_York",
"webhook_url": "https://api.example.com/webhook",
"method": "POST",
"headers": {
"Authorization": "Bearer token"
},
"payload": {
"report_type": "daily"
},
"retry_config": {
"maxRetries": 3,
"backoffMs": 1000,
"backoffType": "exponential"
},
"is_active": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"team_id": "team-uuid-here"
}
Errors
NotFoundError: If the cron job doesn’t existUnauthorizedError: If API key is invalid or missing
Examples
Check Cron Status
import { cuey } from "cuey";
const cron = await cuey.crons.get("cron-uuid-here");
console.log("Cron expression:", cron.cron_expression);
console.log("Timezone:", cron.timezone);
console.log("Is active:", cron.is_active);
List Events Created by Cron
import { cuey } from "cuey";
const cron = await cuey.crons.get("cron-uuid-here");
const { data: events } = await cuey.events.list({
cron_id: cron.id,
});
console.log(`Found ${events.length} events for this cron`);