> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifuse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set the workspace audit log retention

> Owners only. retention_days absent means the deployment default; 0 keeps every entry forever; otherwise 30 to 3650. Works in every licence state.




## OpenAPI

````yaml /openapi.json post /api/workspaces.setAuditLogSettings
openapi: 3.0.3
info:
  title: Notifuse API
  description: API for Notifuse - a transactional email and newsletter management platform
  version: 1.0.0
  contact:
    name: Notifuse Support
    url: https://www.notifuse.com/support
    email: hello@notifuse.com
  license:
    name: BUSL-1.1
    url: https://github.com/Notifuse/notifuse/blob/main/LICENSE
servers:
  - url: https://{notifuseDomain}
    description: Customer-specific Notifuse API server
    variables:
      notifuseDomain:
        description: Your unique Notifuse domain
        default: demo.notifuse.com
security: []
paths:
  /api/workspaces.setAuditLogSettings:
    post:
      tags:
        - Audit logs
      summary: Set the workspace audit log retention
      description: >
        Owners only. retention_days absent means the deployment default; 0 keeps
        every entry forever; otherwise 30 to 3650. Works in every licence state.
      operationId: setAuditLogSettings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workspace_id
                - settings
              properties:
                workspace_id:
                  type: string
                settings:
                  $ref: '#/components/schemas/AuditLogSettings'
      responses:
        '200':
          description: Saved
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
        '400':
          description: Invalid retention
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not an owner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    AuditLogSettings:
      type: object
      description: >-
        The workspace's retention. retention_days absent means the deployment
        default (365 days unless a root user changed it); 0 keeps every entry
        forever.
      properties:
        retention_days:
          type: integer
          minimum: 0
          maximum: 3650
          description: 0, or a value between 30 and 3650.
          example: 365
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API token for authentication

````