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 (0-indexed). Defaults to 0.
Number of items per page. Range: 1-1000. Defaults to 100.
Filter events by status. Options: pending, processing, success, failed.
Filter events by the cron job that created them. Use a valid cron UUID.
Response
Array of event objects.
Unique identifier for the event (UUID).
Parent cron ID if this event was created by a cron job. null if created manually.
Original event ID if this is a retry attempt. null for original events.
ISO 8601 timestamp when the event is scheduled to execute.
ISO 8601 timestamp when the event was executed. null if not yet executed.
Current status of the event. Values: pending, processing, success, failed.
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.
HTTP status code from the webhook response. null if not yet executed.
Response headers from the webhook. null if not yet executed.
Response body from the webhook (truncated to 1KB). null if not yet executed.
Duration of the webhook request in milliseconds. null if not yet executed.
Error message if the webhook execution failed. null if successful or not yet executed.
ISO 8601 timestamp when the event was created.
ISO 8601 timestamp when the event was last updated.
Team ID associated with the event.
Pagination information.Show Pagination properties
Current page number (0-indexed).
Number of items per page.
Total number of items across all pages.
{
"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`);
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`);