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/events
2
3{
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

FieldTypeRequiredDescription
actionstringYesAction identifier (e.g., "user.login")
actor_idstringYesID of who performed the action
actor_typestringNoType of actor (default: "user")
target_idstringNoID of the affected resource
target_typestringNoType of the affected resource
metadataobjectNoAdditional 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

ParameterTypeDescription
actionstringFilter by action type
actor_idstringFilter by actor ID
target_idstringFilter by target ID
start_dateISO 8601Filter events after this date
end_dateISO 8601Filter events before this date
limitintegerMax results (default: 50, max: 1000)
offsetintegerPagination 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": true
15 }
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

ParameterOptionsDescription
formatcsv, jsonExport format (default: json)
start_dateISO 8601Required for exports
end_dateISO 8601Optional end date

Rate Limits

API rate limits depend on your plan:

PlanRequests/minute
Free60
Starter300
Growth1,000
EnterpriseCustom