Overview
List all cron jobs with optional pagination and filtering by active status.
import { cuey } from "cuey";
const { data: crons, pagination } = await cuey.crons.list();
Parameters
Page number (0-indexed). Defaults to 0.
Number of items per page. Range: 1-1000. Defaults to 100.
Filter cron jobs by active status. true for active crons, false for inactive crons.
Response
Array of cron job objects.
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.
Retry configuration for failed webhooks.Show RetryConfig properties
Maximum number of retry attempts (1-10).
Backoff delay in milliseconds (100-5000).
Backoff strategy. Values: exponential, linear.
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.
Pagination information.Show Pagination properties
Current page number (0-indexed).
Number of items per page.
Total number of items across all pages.
{
"data": [
{
"id": "cron-uuid-here",
"cron_expression": "0 9 * * *",
"timezone": "America/New_York",
"webhook_url": "https://api.example.com/webhook",
"method": "POST",
"headers": null,
"payload": {
"report_type": "daily"
},
"retry_config": null,
"is_active": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"team_id": "team-uuid-here"
}
],
"pagination": {
"page": 0,
"limit": 100,
"total": 1
}
}
Errors
Requesting a page number that is out of range (e.g., page 100 when only 10 pages exist) will throw an InternalServerError.
UnauthorizedError: If API key is invalid or missing
InternalServerError: If the requested page is out of range
Examples
List Active Crons
import { cuey } from "cuey";
const { data: activeCrons } = await cuey.crons.list({
is_active: true,
});
console.log(`Found ${activeCrons.length} active cron jobs`);
List Inactive Crons
import { cuey } from "cuey";
const { data: inactiveCrons } = await cuey.crons.list({
is_active: false,
});
console.log(`Found ${inactiveCrons.length} inactive cron jobs`);