Event Logs
HappyView logs system events — lexicon changes, record operations, script errors, user actions, and more. See the Event Logs guide for details on event types and retention.
const TOKEN = "hv_..."; // your API keyconst headers = { Authorization: `Bearer ${TOKEN}` };const TOKEN = "hv_..."; // your API keyconst headers = { Authorization: `Bearer ${TOKEN}` };let token = "hv_..."; // your API keytoken := "hv_..." // your API key# All examples assume $TOKEN is an API key (hv_...)AUTH="Authorization: Bearer $TOKEN"List event logs
Section titled “List event logs”GET /admin/eventsinterface EventLog { id: string; event_type: string; severity: string; actor_did: string; subject: string; detail: Record<string, unknown>; created_at: string;}
interface EventLogResponse { events: EventLog[]; cursor: string | null;}
const response = await fetch( "http://127.0.0.1:3000/admin/events?severity=error&limit=10", { headers },);const data: EventLogResponse = await response.json();const response = await fetch( "http://127.0.0.1:3000/admin/events?severity=error&limit=10", { headers },);const data = await response.json();let client = reqwest::Client::new();let response = client .get("http://127.0.0.1:3000/admin/events") .query(&[("severity", "error"), ("limit", "10")]) .bearer_auth(token) .send() .await?;let data: serde_json::Value = response.json().await?;req, _ := http.NewRequest("GET", "http://127.0.0.1:3000/admin/events?severity=error&limit=10", nil)req.Header.Set("Authorization", "Bearer "+token)resp, err := http.DefaultClient.Do(req)curl "http://127.0.0.1:3000/admin/events?severity=error&limit=10" -H "$AUTH"| Param | Type | Required | Description |
|---|---|---|---|
event_type | string | no | Filter by exact event type (e.g. script.error) |
category | string | no | Filter by category prefix (e.g. lexicon matches all lexicon events) |
severity | string | no | Filter by severity: info, warn, or error |
subject | string | no | Filter by subject (lexicon ID, record URI, admin DID, etc.) |
cursor | string | no | Pagination cursor (ISO 8601 timestamp from previous response) |
limit | number | no | Results per page (default 50, max 100) |
Response: 200 OK
{ "events": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "event_type": "script.error", "severity": "error", "actor_did": "did:plc:abc123", "subject": "com.example.feed.like", "detail": { "error": "attempt to index nil value", "script_source": "function handle(input, ctx) ... end", "input": { "status": "hello" }, "caller_did": "did:plc:abc123", "method": "com.example.feed.like" }, "created_at": "2026-03-01T12:00:00Z" } ], "cursor": "2026-03-01T11:59:00Z"}Events are returned in reverse chronological order (newest first). Pass the cursor value from the response to fetch the next page.

