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

# Upsert retention policy

> Requires organization retention permissions and the retention-policies entitlement.



## OpenAPI

````yaml /openapi.json put /v1/retention-policies/{resource}
openapi: 3.1.0
info:
  title: Leamout API
  version: 1.0.0
  description: >-
    Current public HTTP routes for the Leamout autonomous Voice Agent control
    plane. Configure your own SIP trunks and AI integrations.
servers:
  - url: https://api.leamout.com
    description: Leamout API
security: []
tags:
  - name: Voice Agents
  - name: AI Integrations
  - name: Agent Tools
  - name: Calls
  - name: SIP Trunks
  - name: Phone Numbers
  - name: Recordings
  - name: WebRTC
  - name: Webhooks
  - name: Commercial
  - name: Storage
  - name: Network policies
  - name: Retention policies
  - name: Audit events
paths:
  /v1/retention-policies/{resource}:
    put:
      tags:
        - Retention policies
      summary: Upsert retention policy
      description: >-
        Requires organization retention permissions and the retention-policies
        entitlement.
      operationId: put_v1_retention_policies_resource
      parameters:
        - name: resource
          in: path
          required: true
          schema:
            type: string
            enum:
              - recordings
              - conversations
              - audit_events
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RetentionPolicyUpsert'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessEnvelope'
        default:
          description: Error response envelope
      security:
        - organizationToken: []
components:
  schemas:
    RetentionPolicyUpsert:
      type: object
      properties:
        retention_days:
          type: integer
          minimum: 1
          maximum: 3650
        enabled:
          type: boolean
      required:
        - retention_days
        - enabled
    SuccessEnvelope:
      type: object
      properties:
        success:
          type: boolean
          const: true
        data: {}
      required:
        - success
        - data
  securitySchemes:
    organizationToken:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: Scoped organization API token (lm_org_...).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.