---
descriptions:
  set_retention:
    retention_period_in_days: >-
      The number of days Audit Log events will be retained. Valid values are
      `30` and `365`.
reference:
  curl:
    - key: set_retention
      id: set_retention
      url: /reference/audit-logs/set-retention
      title: '/organizations/:id/audit_logs_retention'
      type: PUT
      parameters:
        - key: id
          type: string
          description: (organization.id)
        - key: retention_period_in_days
          type: number
          description: (set_retention.retention_period_in_days)
      returns:
        - key: anonymous
          type: object
          unwrap: true
          properties:
            - key: retention_period_in_days
              type: number
              description: (get_retention.retention_period_in_days)
originalPath: .tmp-workos-clone/packages/docs/content/reference/audit-logs/retention/set.mdx
---

## Set Retention

Set the event retention period for the given Organization.

<CodeBlock referenceId="set_retention">
  <CodeBlockTab title="Request" file="set-retention-request" />
  <CodeBlockTab title="Response" file="set-retention-response" />
</CodeBlock>
