Audit Events
Releasy stores security-relevant audit data locally in the primary database. The current implementation focuses on API key authentication events and is intended for self-hosted operators to inspect when debugging access issues.
Storage Schema
Audit events are stored in the audit_events table:
id(TEXT, PK)customer_id(TEXT, nullable)actor(TEXT)event(TEXT)payload(TEXT, nullable, JSON string)created_at(INTEGER, unix timestamp seconds)
Event Catalog
Releasy currently emits a single event family for API key authentication.
api_key.auth
actor:api_keyevent:api_key.authpayload(JSON):outcome:acceptorrejectreason:okmissing_headernot_foundrevokedexpiredinvalid_scopestime_unavailable
api_key_id: nullable string (when known)
Example payload:
{
"outcome": "reject",
"reason": "expired",
"api_key_id": "key_01h..."
}Notes:
customer_idis populated when the key is resolved; otherwise it isNULL.- Events are best-effort. If system time is unavailable, the event is skipped and a warning is logged.
- Payloads must not include secrets. Use IDs and short reason codes only.
Retention
Releasy does not enforce retention or automatic cleanup. Operators control data lifecycle using database tooling (manual SQL, scheduled jobs, or retention policies). Recommended practice:
- Keep audit events for a minimum operational window (for example 90 days).
- Purge or archive older rows based on your compliance requirements.
See docs/audit-retention.md for SQL templates.
Read API
GET /v1/admin/audit-events
Query parameters (optional):
customer_id: filter events for a specific customeractor: filter by actor (for exampleapi_key)event: filter by event name (for exampleapi_key.auth)created_from: minimumcreated_at(unix seconds, inclusive)created_to: maximumcreated_at(unix seconds, inclusive)limit/offset: pagination (seedocs/api-conventions.md)
Response body:
{
"events": [
{
"id": "evt_...",
"customer_id": "cust_...",
"actor": "api_key",
"event": "api_key.auth",
"payload": {
"outcome": "accept",
"reason": "ok",
"api_key_id": "key_..."
},
"created_at": 1700000000
}
],
"limit": 50,
"offset": 0
}Access Model
Audit events are available only to the admin/operator authorization flow:
platform_admin: read accessplatform_support: read accessrelease_publisher: no access- customer-level credentials: no access
Customer API keys are not permitted to read audit events. If a customer-facing read API is introduced later, it will be gated behind a dedicated scope (for example audit:read).