Retention settings control how long Audit Log events are stored before being permanently deleted. You can configure the retention period on a per-organization basis.
Get the configured event retention period for the given Organization.
curl "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/audit_logs_retention" \ --header "Authorization: Bearer sk_example_123456789"
{ "retention_period_in_days": 30 }
| curl "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/audit_logs_retention" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| { | |
| "retention_period_in_days": 30 | |
| } |
GET/organizations /:id /audit_logs_retentionParameters Returns Set the event retention period for the given Organization.
curl --request PUT \ --url "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/audit_logs_retention" \ --header "Authorization: Bearer sk_example_123456789" \ --header "Content-Type: application/json" \ -d @- <<'BODY' { "retention_period_in_days": 30 } BODY
{ "retention_period_in_days": 30 }
| curl --request PUT \ | |
| --url "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/audit_logs_retention" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "retention_period_in_days": 30 | |
| } | |
| BODY |
| { | |
| "retention_period_in_days": 30 | |
| } |
PUT/organizations /:id /audit_logs_retentionParameters Returns