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