Skip to content

Events API ​

Custom events the site sends (Events module).

All paths are relative to https://your-site.com/api/v1. Send Authorization: Bearer <token> and Accept: application/json; see authentication and errors.

MethodPathWhat it does
GET/sites/{site}/eventsCustom events of a site
GET/sites/{site}/events/{name}One event's latest occurrences

GET /sites/{site}/events ​

Custom events of a site

Every event name the site sent with __sr.push(['event', name, props]) in the period, the most frequent first (at most 200), with sessions and a daily trend. Plan feature events.enabled. Sessions of one event can be listed with the session filter set=event:<name>.

Parameters ​

NameInTypeRequiredDescription
sitepathintegeryes
daysqueryintegerOne of: 1, 7, 14, 30, 90. Default 7.

Responses ​

  • 200 — OK
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 404 — Missing, or another account's.
  • 422 — Validation failed.
Response fields
FieldTypeRequiredDescription
dataobject[]
data[].namestring
data[].countinteger
data[].sessionsinteger
data[].last_at_msinteger
data[].trendinteger[]
metaobject
meta.periodobject
meta.period.fromstring (date)
meta.period.tostring (date)
meta.period.daysinteger
bash
curl -X GET "https://your-site.com/api/v1/sites/{site}/events" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

GET /sites/{site}/events/{name} ​

One event's latest occurrences

Parameters ​

NameInTypeRequiredDescription
sitepathintegeryes
namepathstringyesAt most 64 characters.
daysqueryintegerOne of: 1, 7, 14, 30, 90. Default 7.

Responses ​

  • 200 — Newest first, at most 100.
  • 404 — Missing, or another account's.
Response fields
FieldTypeRequiredDescription
dataobject[]
data[].sessionstring (uuid)
data[].urlstring, nullable
data[].at_msinteger
data[].propsobject
bash
curl -X GET "https://your-site.com/api/v1/sites/{site}/events/{name}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

Replora: see what your visitors see.