Overview
Event endpoints allow you to retrieve events from your categories with filtering and pagination.These endpoints use Hono.js server procedures and require authentication via session cookies (not Bearer tokens). They are primarily used by the PingPilot web dashboard.
Get Events by Category
Retrieve events for a specific category with time-based filtering and pagination.Query Parameters
Category name to retrieve events from.Validation:
- Must contain only letters, numbers, or hyphens
- Must match an existing category
Page number for pagination (1-indexed).Example:
1, 2, 3Number of events per page.Constraints:
- Maximum:
50 - Minimum:
1
10, 25, 50Time range to filter events.Options:
today- Events from today (since midnight)week- Events from this week (since Sunday)month- Events from this month (since 1st of month)
Request Example
Response
Array of event objects.
Unique event identifier.
Event category name.
Formatted event message sent in notifications.
Custom fields attached to the event.
Delivery status:
"DELIVERED" or "FAILED".ISO timestamp when event was created.
User ID who owns this event.
Category ID this event belongs to.
Total number of events matching the query (for pagination).
Number of unique field keys used across all events in the time range.
Whether the operation succeeded.
Success Response
Error Response
Status Code:404 Not Found
Event Object Structure
Event Fields
Time Range Behavior
Today
Returns events from midnight (00:00:00) of the current day in your timezone.Week
Returns events from the start of the current week (Sunday at 00:00:00).Month
Returns events from the 1st of the current month at 00:00:00.Pagination
Events are returned in descending order by creation time (newest first).Calculation
Example: Fetching All Events
Unique Field Count
TheuniqueFieldCount field indicates how many distinct field keys have been used across all events in the selected time range.
Example:
If you have 3 events:
severity, user_id, error_code, timestamp
Result: uniqueFieldCount: 4
Filtering Events
By Delivery Status
To find failed events, filter the results client-side:By Field Value
To find events with specific field values:By Date Range (Custom)
For custom date ranges, fetch all events and filter:Best Practices
- Use appropriate time ranges to limit result size
- Implement pagination for large datasets (use max limit of 50)
- Cache results when possible to reduce API calls
- Monitor delivery status to identify notification failures
- Index field keys client-side for fast filtering
- Handle empty results gracefully (new categories may have no events)