Skip to main content
Updates the retention policy that controls how long audit logs are kept and what happens when they expire. Requires the tenant.audit.retention.manage permission.

Parameters

retention_days
integer
required
Number of days to retain audit logs. Must be between 30 and 3,650.
hard_delete
boolean
If true, permanently delete expired logs. If false, archive them (soft delete). Defaults to false.
export_allowed
boolean
Whether audit exports are permitted for this scope. Defaults to true.
environment_id
string
Optional. Apply this policy to a specific environment only. Environment-specific policies take precedence over the global policy.

Responses

{
  "retention_days": 730,
  "hard_delete": false,
  "export_allowed": true,
  "environment_id": null
}
curl -X PUT https://api.truthlocks.com/v1/audit/retention \
  -H "X-API-Key: tl_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "retention_days": 730,
    "hard_delete": false,
    "export_allowed": true
  }'