Overview
Get a single event by its unique identifier.import { cuey } from "cuey";
const event = await cuey.events.get("event-uuid-here");
Parameters
string
required
The UUID of the event to retrieve.
Response
Event
required
The event object.
Show Event properties
Show Event properties
string
required
Unique identifier for the event (UUID).
string | null
Parent cron ID if this event was created by a cron job.
null if created manually.string | null
Original event ID if this is a retry attempt.
null for original events.string
required
ISO 8601 timestamp when the event is scheduled to execute.
string | null
ISO 8601 timestamp when the event was executed.
null if not yet executed.EventStatus
required
Current status of the event. Values:
pending, processing, success, failed.string
required
The webhook URL that will be called.
HttpMethod
required
HTTP method used for the webhook request. Defaults to
POST.object | null
Custom headers to include in the webhook request.
null if not set.object | null
Payload to send with the webhook request.
null if not set.object | null
number | null
HTTP status code from the webhook response.
null if not yet executed.object | null
Response headers from the webhook.
null if not yet executed.string | null
Response body from the webhook (truncated to 1KB).
null if not yet executed.number | null
Duration of the webhook request in milliseconds.
null if not yet executed.string | null
Error message if the webhook execution failed.
null if successful or not yet executed.string | null
ISO 8601 timestamp when the event was created.
string | null
ISO 8601 timestamp when the event was last updated.
string | null
Team ID associated with the event.
{
"id": "event-uuid-here",
"cron_id": null,
"retry_of": null,
"scheduled_at": "2024-12-31T23:59:59Z",
"executed_at": "2024-12-31T23:59:59Z",
"status": "success",
"webhook_url": "https://api.example.com/webhook",
"method": "POST",
"headers": {
"Authorization": "Bearer token"
},
"payload": {
"message": "Hello, Cuey!"
},
"retry_config": {
"maxRetries": 3,
"backoffMs": 1000,
"backoffType": "exponential"
},
"response_status": 200,
"response_headers": {
"content-type": "application/json"
},
"response_body": "{\"success\": true}",
"response_duration": 150,
"response_error": null,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-12-31T23:59:59Z",
"team_id": "team-uuid-here"
}
Errors
NotFoundError: If the event doesn’t existUnauthorizedError: If API key is invalid or missing
Examples
Check Event Status
import { cuey } from "cuey";
const event = await cuey.events.get("event-uuid-here");
console.log("Status:", event.status);
console.log("Scheduled at:", event.scheduled_at);
console.log("Executed at:", event.executed_at);
Monitor Event Execution Results
import { cuey } from "cuey";
const event = await cuey.events.get("event-uuid-here");
if (event.status === "success") {
console.log("Event executed successfully");
console.log("Response status:", event.response_status);
console.log("Duration:", event.response_duration, "ms");
} else if (event.status === "failed") {
console.log("Event failed:", event.response_error);
}