Events API
The Events API allows you to create, query, and export audit events.
Base URL
Bash
1https://api.logvault.app/v1
Authentication
All requests require an API key in the Authorization header:
Bash
1Authorization: Bearer lv_live_your_api_key
Create Event
Log a new audit event.
Request
Bash
1POST /v1/events23{4 "action": "user.login",5 "actor_id": "user_123",6 "actor_type": "user",7 "target_id": "session_456",8 "target_type": "session",9 "metadata": {10 "ip_address": "82.10.22.1",11 "user_agent": "Mozilla/5.0..."12 }13}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Action identifier (e.g., "user.login") |
actor_id | string | Yes | ID of who performed the action |
actor_type | string | No | Type of actor (default: "user") |
target_id | string | No | ID of the affected resource |
target_type | string | No | Type of the affected resource |
metadata | object | No | Additional context (max 10KB) |
Response
JSON
1{2 "id": "evt_8f92a3b4c5d6e7f8",3 "action": "user.login",4 "actor_id": "user_123",5 "timestamp": "2025-11-28T12:00:00Z",6 "signature": "sha256:a1b2c3d4..."7}
List Events
Query events with filters and pagination.
Request
Bash
1GET /v1/events?action=user.login&limit=50&offset=0
Query Parameters
| Parameter | Type | Description |
|---|---|---|
action | string | Filter by action type |
actor_id | string | Filter by actor ID |
target_id | string | Filter by target ID |
start_date | ISO 8601 | Filter events after this date |
end_date | ISO 8601 | Filter events before this date |
limit | integer | Max results (default: 50, max: 1000) |
offset | integer | Pagination offset |
Response
JSON
1{2 "data": [3 {4 "id": "evt_8f92a3b4c5d6e7f8",5 "action": "user.login",6 "actor_id": "user_123",7 "timestamp": "2025-11-28T12:00:00Z"8 }9 ],10 "pagination": {11 "total": 1234,12 "limit": 50,13 "offset": 0,14 "has_more": true15 }16}
Get Event
Retrieve a single event by ID.
Bash
1GET /v1/events/evt_8f92a3b4c5d6e7f8
Export Events
Export events in CSV or JSON format.
Bash
1GET /v1/events/export?format=csv&start_date=2025-01-01
Export Parameters
| Parameter | Options | Description |
|---|---|---|
format | csv, json | Export format (default: json) |
start_date | ISO 8601 | Required for exports |
end_date | ISO 8601 | Optional end date |
Rate Limits
API rate limits depend on your plan:
| Plan | Requests/minute |
|---|---|
| Free | 60 |
| Starter | 300 |
| Growth | 1,000 |
| Enterprise | Custom |