API Reference
The LogVault API is built on REST principles. We enforce HTTPS in production and use standard HTTP response codes.
Base URL
1https://api.logvault.eu/v1
Authentication
Pass your API key in the x-api-key header or as Authorization: Bearer. Get your API key from the Dashboard → Settings → API Keys.
1curl https://api.logvault.eu/v1/events \2 -H "Content-Type: application/json" \3 -H "x-api-key: lv_live_YOUR_API_KEY" \4 -d '{5 "action": "user.login",6 "user_id": "u_123",7 "resource": "dashboard"8 }'
Rate Limiting
API requests are rate-limited per organization. Standard tiers:
Rate limit headers are included in all responses: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Error Handling
All errors follow RFC 7807 format:
1{2 "type": "about:blank",3 "title": "Validation Error",4 "status": 422,5 "detail": "One or more fields failed validation",6 "instance": "/v1/events",7 "request_id": "550e8400-e29b-41d4-a716-446655440000",8 "errors": [9 {10 "field": "body.user_id",11 "message": "field required",12 "code": "value_error.missing"13 }14 ]15}
Common status codes: 400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 422 (Validation Error), 429 (Rate Limited), 500 (Server Error).
Health Endpoints
Use these endpoints to monitor API availability and dependency status.
/healthBasic liveness check. Returns 200 if the API is running. No authentication required.
1{2 "status": "healthy",3 "service": "logvault-api",4 "version": "3490905",5 "environment": "production",6 "uptime_seconds": 3600,7 "timestamp": "2025-11-30T12:00:00Z"8}
/health/readyReadiness probe. Returns 200 only if the database is healthy. Returns 503 if not ready.
/health/deepDeep health check with dependency status (Supabase, Redis).
1{2 "status": "healthy",3 "service": "logvault-api",4 "checks": {5 "supabase": { "status": "healthy", "latency_ms": 12.5 },6 "redis": { "status": "healthy", "latency_ms": 2.1 }7 }8}
Events
/v1/eventsIngest a new audit event. Events are cryptographically signed, hash-chained, and immutable.
1{2 "action": "user.created",3 "user_id": "u_123",4 "resource": "team_A",5 "metadata": {6 "ip": "1.2.3.4",7 "user_agent": "Mozilla/5.0..."8 }9}
1{2 "id": "550e8400-e29b-41d4-a716-446655440000",3 "action": "user.created",4 "user_id": "u_123",5 "resource": "team_A",6 "timestamp": "2025-11-30T10:30:00Z",7 "signature": "hmac_sha256_abc123...",8 "chain_hash": "sha256_def456...",9 "prev_hash": "sha256_ghi789..."10}
/v1/eventsRetrieve a paginated list of events. Supports filtering by user_id, action, resource, and date range.
1?page=12&page_size=503&user_id=u_1234&action=user.login5&start_date=2025-01-016&end_date=2025-01-31
1{2 "events": [...],3 "total": 150,4 "page": 1,5 "page_size": 50,6 "has_next": true7}
/v1/events/searchHybrid search using full-text + semantic search. Supports natural language queries.
1GET /v1/events/search?q=failed+login+attempts&page=1&page_size=50
/v1/events/exportExport events as CSV. Supports filtering by date range, user_id, and action.
1GET /v1/events/export?start_date=2025-01-01&end_date=2025-01-31
Returns: Content-Type: text/csv
/v1/events/{event_id}/verifyVerify the cryptographic signature of an event.
1{2 "event_id": "550e8400-e29b-41d4-a716-446655440000",3 "valid": true,4 "signature": "hmac_sha256_abc123...",5 "expected_signature": "hmac_sha256_abc123...",6 "tampered": false,7 "verified_at": "2025-11-30T10:30:00Z"8}
/v1/events/{event_id}/proofGet cryptographic proof for an event including chain context.
1{2 "event": { ... },3 "proof": {4 "signature": "hmac_sha256_abc123...",5 "chain_hash": "sha256_def456...",6 "prev_hash": "sha256_ghi789...",7 "chain_position": 428 },9 "previous_event": { ... },10 "next_event": { ... },11 "verification_instructions": "..."12}
Chain Integrity
Verify the cryptographic hash chain that links all audit events.
/v1/chain/verifyVerify the entire audit log chain integrity.
1?start_date=2025-01-012&end_date=2025-01-313&limit=1000
1{2 "is_valid": true,3 "events_checked": 1523,4 "first_event_id": "...",5 "last_event_id": "...",6 "verified_at": "2025-11-30T10:30:00Z"7}
/v1/chain/statsGet statistics about the hash chain.
1{2 "total_events": 1523,3 "chained_events": 1520,4 "legacy_events": 3,5 "chain_coverage_percent": 99.8,6 "first_chained_event": { ... },7 "last_chained_event": { ... }8}
API Keys
/v1/keys/rotateRotate an API key with optional grace period for zero-downtime rotation.
1{2 "key_id": "key_abc123",3 "grace_hours": 244}
1{2 "new_key_id": "key_def456",3 "new_api_key": "lv_live_...",4 "old_key_expires_at": "2025-12-01T10:30:00Z",5 "message": "Save your new API key now!"6}
Organizations
/v1/organizationsCreate a new organization. Returns an API key for immediate use.
1{2 "name": "Acme Corp",3 "email": "admin@acme.com",4 "tier": "starter"5}
1{2 "success": true,3 "organization": {4 "org_id": "550e8400-...",5 "name": "Acme Corp",6 "tier": "starter",7 "monthly_limit": 100000,8 "retention_days": 3659 },10 "api_key": "lv_live_...",11 "message": "⚠️ Save your API key now!"12}
Full OpenAPI Specification
For a complete, interactive specification of all endpoints, visit our Swagger UI.
Open Swagger UI↗