Skip to main content

Overview

List all events with optional pagination and filtering by status or cron ID.
import { cuey } from "cuey";

const { data: events, pagination } = await cuey.events.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.
status
string
Filter events by status. Options: pending, processing, success, failed.
cron_id
string
Filter events by the cron job that created them. Use a valid cron UUID.

Response

data
Event[]
required
Array of event objects.
pagination
object
required
Pagination information.
{
  "data": [
    {
      "id": "event-uuid-here",
      "cron_id": null,
      "retry_of": null,
      "scheduled_at": "2024-12-31T23:59:59Z",
      "executed_at": null,
      "status": "pending",
      "webhook_url": "https://api.example.com/webhook",
      "method": "POST",
      "headers": null,
      "payload": {
        "message": "Hello, Cuey!"
      },
      "retry_config": null,
      "response_status": null,
      "response_headers": null,
      "response_body": null,
      "response_duration": null,
      "response_error": null,
      "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 Pending Events

import { cuey } from "cuey";

const { data: pendingEvents } = await cuey.events.list({
  status: "pending",
});

console.log(`Found ${pendingEvents.length} pending events`);

List Failed Events with Pagination

import { cuey } from "cuey";

const { data: failedEvents, pagination } = await cuey.events.list({
  status: "failed",
  page: 0,
  limit: 50,
});

console.log(`Found ${failedEvents.length} failed events (total: ${pagination.total})`);

List Events Created by a Cron

import { cuey } from "cuey";

const { data: cronEvents } = await cuey.events.list({
  cron_id: "cron-uuid-here",
});

console.log(`Found ${cronEvents.length} events for this cron`);