Skip to main content

Overview

Get a single cron job by its unique identifier.
import { cuey } from "cuey";

const cron = await cuey.crons.get("cron-uuid-here");

Parameters

id
string
required
The UUID of the cron job to retrieve.

Response

cron
Cron
required
The cron job object.
{
  "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 exist
  • UnauthorizedError: 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`);