Events
Query Events
Retrieve and filter ingested usage events
GET
Query Events
Retrieve raw events that have been ingested into FlexPrice. Use this for debugging ingestion, building usage dashboards, or exporting event data for analysis.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/flexprice/flexprice/llms.txt
Use this file to discover all available pages before exploring further.
Use Cases
- Debug event ingestion and verify data
- Build customer usage dashboards
- Export events for external analytics
- Audit event history for support tickets
- Verify property values and timestamps
Query Parameters
Filter events by your customer identifier. Returns events for a specific customer.
Filter by event type (e.g.,
api_request, storage_usage).Retrieve a specific event by its idempotency key.
ISO 8601 timestamp for the start of the time range. Defaults to 7 days ago if not provided.Example:
2024-03-13T00:00:00ZISO 8601 timestamp for the end of the time range. Defaults to current time if not provided.Example:
2024-03-20T23:59:59ZFilter by event source (e.g.,
api, mobile_app, webhook).Filter events by properties. Format:
key1:value1,value2;key2:value3Examples:status:200,201- Events where status is 200 or 201region:us-east-1;tier:premium- Events from us-east-1 AND premium tier
Number of events to return per page. Default: 50, max: 50.
Number of events to skip for pagination. Default: 0.
Field to sort by. Allowed values:
timestamp, event_name. Default: timestamp.Case-sensitive.Sort order. Allowed values:
asc, desc. Default: desc.Case-sensitive.If
true, includes the total count of matching events in the response. Default: false.Note: Counting can be slow for large datasets.For cursor-based pagination. Use the
iter_first_key from the previous response to get the next page.For cursor-based pagination. Use the
iter_last_key from the previous response.Response
Array of event objects matching the query filters.
Unique event identifier.
Type of event (e.g.,
api_request).Customer identifier from your system.
FlexPrice’s internal customer ID.
ISO 8601 timestamp when the event occurred.
Key-value pairs with event metadata.
Event source identifier.
Environment where the event was ingested (e.g., production, staging).
Whether there are more events to fetch. Use for pagination.
Cursor for the first event in the current page. Use for cursor-based pagination.
Cursor for the last event in the current page. Use for cursor-based pagination.
Total number of events matching the query. Only present if
count_total=true.Current offset for offset-based pagination.
Examples
Pagination
FlexPrice supports two pagination methods:Offset-Based Pagination
Simple but less efficient for large datasets:Cursor-Based Pagination
More efficient for large datasets:Property Filters
Filter events by properties using theproperty_filters parameter:
Response Example
Response Codes
Successfully retrieved events.
Invalid query parameters. Check:
start_timeandend_timeformatsortfield is valid (timestamp or event_name)orderis valid (asc or desc)property_filtersformat
Missing or invalid API key.
Internal server error.
Best Practices
-
Use time ranges: Always specify
start_timeandend_timefor predictable results and better performance. -
Cursor pagination for large datasets: Use
iter_first_keyanditer_last_keyinstead of offset for better performance when fetching many pages. - Avoid count_total in production: Counting all matching events can be slow. Only use when necessary.
-
Filter early: Apply filters like
event_nameandexternal_customer_idto reduce the result set size. - Cache results: If displaying events in a dashboard, consider caching the response to avoid repeated API calls.
Related
- Ingest Event - Send a single event
- Batch Ingest Events - Send multiple events
- Usage Analytics - Aggregate and analyze event data
Query Events