MATIH Platform is in active MVP development. Documentation reflects current implementation status.
8. Platform Services
Config Audit Trail

Config Audit Trail

The Config Audit system provides a complete, immutable record of every configuration change. The ConfigAuditController at /api/v1/config/audit supports querying by tenant, config entry, feature flag, user, time range, and correlation ID. It also provides version comparison (diff) capabilities.


Get Tenant Audit History

Endpoint: GET /api/v1/config/audit

curl "http://localhost:8888/api/v1/config/audit?page=0&size=20" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000"

Get Config Entry History

Endpoint: GET /api/v1/config/audit/config/{configId}


Get Feature Flag History

Endpoint: GET /api/v1/config/audit/flags/{flagId}


Get Secret Audit History

Endpoint: GET /api/v1/config/audit/secrets


Get User History

See all changes made by a specific user.

Endpoint: GET /api/v1/config/audit/user/{userId}


Get History by Time Range

Endpoint: GET /api/v1/config/audit/range

curl "http://localhost:8888/api/v1/config/audit/range?start=2026-02-01T00:00:00Z&end=2026-02-12T23:59:59Z&page=0&size=50" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000"

Search by Key Pattern

Endpoint: GET /api/v1/config/audit/search

curl "http://localhost:8888/api/v1/config/audit/search?key=query.%25&page=0&size=20" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000"

Version Comparison (Diff)

Compare two versions of a configuration to see exactly what changed.

Endpoint: GET /api/v1/config/audit/versions/{targetId}/diff

curl "http://localhost:8888/api/v1/config/audit/versions/770e8400-e29b-41d4-a716-446655440000/diff?from=1&to=3" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000"

Response:

{
  "fromVersion": 1,
  "toVersion": 3,
  "fromValue": "60s",
  "toValue": "180s",
  "changes": [
    { "version": 2, "value": "120s", "changedBy": "dev@acme.com", "changedAt": "2026-02-10T09:00:00Z" },
    { "version": 3, "value": "180s", "changedBy": "admin@acme.com", "changedAt": "2026-02-12T14:00:00Z" }
  ]
}

Correlation Tracking

Get all audit entries related to a single operation (e.g., a bulk import or environment promotion).

Endpoint: GET /api/v1/config/audit/correlation/{correlationId}


Audit Statistics

Endpoint: GET /api/v1/config/audit/stats

curl "http://localhost:8888/api/v1/config/audit/stats?days=30" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000"