Skip to main content

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
default:"0"
Page number (0-indexed). Defaults to 0.
limit
number
default:"100"
Number of items per page. Range: 1-1000. Defaults to 100.
is_active
boolean
Filter cron jobs by active status. true for active crons, false for inactive crons.

Response

data
Cron[]
required
Array of cron job objects.
pagination
object
required
Pagination information.
{
  "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`);