Appearance
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.
| Method | Path | What it does |
|---|---|---|
| GET | /sites/{site}/events | Custom 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
site | path | integer | yes | |
days | query | integer | One 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
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | ||
data[].name | string | ||
data[].count | integer | ||
data[].sessions | integer | ||
data[].last_at_ms | integer | ||
data[].trend | integer[] | ||
meta | object | ||
meta.period | object | ||
meta.period.from | string (date) | ||
meta.period.to | string (date) | ||
meta.period.days | integer |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
site | path | integer | yes | |
name | path | string | yes | At most 64 characters. |
days | query | integer | One of: 1, 7, 14, 30, 90. Default 7. |
Responses
- 200 — Newest first, at most 100.
- 404 — Missing, or another account's.
Response fields
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | ||
data[].session | string (uuid) | ||
data[].url | string, nullable | ||
data[].at_ms | integer | ||
data[].props | object |
bash
curl -X GET "https://your-site.com/api/v1/sites/{site}/events/{name}" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json"