Overview
Get a single cron job by its unique identifier.Copy
import { cuey } from "cuey";
const cron = await cuey.crons.get("cron-uuid-here");
Parameters
The UUID of the cron job to retrieve.
Response
The cron job object.
Show Cron properties
Show Cron properties
Unique identifier for the cron job (UUID).
Cron expression defining the schedule (e.g.,
0 9 * * *).Timezone for the cron schedule (e.g.,
America/New_York). null for UTC.The webhook URL that will be called.
HTTP method used for the webhook request. Defaults to
POST.Custom headers to include in the webhook request.
null if not set.Payload to send with the webhook request.
null if not set.Whether the cron job is active.
null defaults to true.ISO 8601 timestamp when the cron job was created.
ISO 8601 timestamp when the cron job was last updated.
Team ID associated with the cron job.
Copy
{
"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
Copy
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
Copy
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`);