Overview
Get a single event by its unique identifier.import { cuey } from "cuey";
const event = await cuey.events.get("event-uuid-here");
Parameters
Response
The event object.
Show Event properties
Show Event properties
{
"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);
}