Query Events
The general-purpose event reporting query. Pick a dimension to group by, the metrics to compute (users, sessions, events), and any filters, and it returns one aggregated row per group: a time series with groupBy: "date", a top-pages table with groupBy: "pathname", and so on. Dates are read in the project's configured timezone.
Authorization
Authorization In: header
Path Parameters
ID of the project to query.
Request Body
application/json
Dimension to aggregate by. One row comes back per distinct value. Use date or hour for a time series.
Optional second dimension, giving one row per groupBy × subGroupBy pair.
Metrics to compute for each row. At least one is required.
Start of the window as a YYYY-MM-DD date, inclusive. Interpreted in the project's configured timezone.
End of the window as a YYYY-MM-DD date, inclusive. Interpreted in the project's configured timezone.
Only include events from this country name.
Only include events from this device type, e.g. mobile.
Only include events from this browser, e.g. Chrome.
Only include events with this exact referrer URL.
Only include events from this referring domain.
Only include events with this action name, e.g. Page View.
Only include events tagged with this utm_source.
Only include events tagged with this utm_medium.
Only include events tagged with this utm_campaign.
Only include events tagged with this utm_term.
Only include events tagged with this utm_content.
Only include events attributed to this ad ID.
Only include events on this path, e.g. /pricing.
Only include events on this full URL.
Column to sort by: either groupBy or one of the requested metrics.
Sort direction. Ignored unless orderBy is set.
Number of rows to skip before collecting results.
Maximum number of rows to return.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://www.saasco.com/api/v2/projects/string/analytics/query-events" \ -H "Content-Type: application/json" \ -d '{ "groupBy": "projectId", "metrics": [ "users" ] }'{
"meta": [
{
"name": "string",
"type": "string"
}
],
"rows": 0,
"statistics": {
"bytes_read": 0,
"elapsed": 0,
"rows_read": 0
},
"data": [
{
"events": 0,
"groupBy": "string",
"sessions": 0,
"subGroupBy": "string",
"users": 0
}
],
"rows_before_limit_at_least": 0
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Delete User
Erases a user's stored identify properties for GDPR-style deletion requests. Scope is narrow and worth noting: it clears the identify record only. Tracked events stay, and the CRM contact is untouched (use Delete Contact for that). The delete runs as an asynchronous job, so the user can still surface in queries for a short window after this returns 200.
Latest Events
Returns the project's most recent events, newest first: the live activity feed. Each row carries the action, timestamp, page, referrer, and the visitor's device, browser, and country. Social-proof popup events are hidden unless you ask for them by `action`.