Skip to main content
PUT
/
v1
/
audit
/
retention
Update retention policy
curl --request PUT \
  --url https://api.truthlocks.com/v1/audit/retention \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "retention_days": 123,
  "hard_delete": true,
  "export_allowed": true,
  "environment_id": "<string>"
}
'
{
  "retention_days": 123,
  "hard_delete": true,
  "updated_at": "<string>"
}
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

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Body

application/json
retention_days
integer
required

Number of days to retain audit logs

hard_delete
boolean

Whether to permanently delete logs after retention period

export_allowed
boolean
environment_id
string

Response

Retention policy updated

retention_days
integer
hard_delete
boolean
updated_at
string