Skip to content

Record an authentication audit event (FM-494)

POST
/api/v1/me/auth-event
curl --request POST \
--url http://localhost:3000/api/v1/me/auth-event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "event": "auth.login.success", "success": true, "provider": "example", "errorCode": "example", "errorDescription": "example", "metadata": {} }'

Emits a tamper-evident audit-log entry for an auth-flow event observed by the BFF (login, refresh, logout, federated, session termination). The signing uses the same AUDIT_HMAC_SECRET as the rest of the audit pipeline.

Media type application/json
object
event
required

Canonical auth-audit event name (FM-494).

string
Allowed values: auth.login.success auth.login.failed auth.refresh.success auth.refresh.failed auth.logout auth.session_terminated_by_admin auth.federated_login.success auth.federated_login.failed
success
required

Whether the underlying auth operation succeeded.

boolean
provider

OAuth/OIDC provider name when relevant (e.g. “keycloak”, “entra”).

string
errorCode

Short error code for failed events (e.g. “expired_token”).

string
errorDescription

Human-readable error description for failed events.

string
metadata

Free-form metadata (small JSON object). MUST NOT contain access tokens.

object

Audit event recorded

Invalid payload

Unauthorized