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