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

# Delete an org retention policy

> Requires org.retention_policy.delete at the scope in the URL.
The key must cover that scope. Scope headers do not select the target.
Retires this scope's current override and returns the inherited effective policy.
Preserves prior policy values and records the retiring actor, time, and cleared reason.
Repeated deletion is safe when no override exists.




## OpenAPI

````yaml https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/control_plane_openapi.yaml delete /v1/orgs/{org_id}/retention_policy
openapi: 3.1.0
info:
  title: HoneyHive Control Plane API
  description: >
    Manage HoneyHive control-plane resources: organizations with their roles,
    templates and

    members, workspaces with their templates and members, projects with their
    members and

    alerts, and read org usage.


    Authentication requires a fine-grained control-plane API key (values

    start with `hh_fgcp_`), sent as `Authorization: Bearer <api-key>`.

    Classic API keys used with the Data Plane API will not work here. Create

    a key in the HoneyHive app under an organization's or workspace's

    **Settings → API Keys**, or see

    [Authorization](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript#authorization)

    for details.
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.21.0
servers:
  - url: https://api.cp.us.honeyhive.ai
security: []
tags:
  - name: Alerts
    description: >
      Define and manage alerts. Alerts evaluate event metrics on a schedule and
      trigger notifications when configured thresholds are crossed.
  - name: Org Members
    description: >
      List an organization's members, invite people to it, set a member's roles,
      and remove people from it and from everything in it. Available on
      self-hosted deployments that do not enable an SSO group scheme.
  - name: Org Templates
    description: >
      Read and replace an organization's templates manifest, which defines the
      metrics and charts that new projects start with. Each workspace gets its
      own copy when it is created, so a new version reaches an existing
      workspace's projects only where that workspace's manifest merges with the
      organization's.
  - name: Orgs
    description: >
      Read an organization's display name and the email domains whose users join
      it automatically when they sign in, and update its display name.
  - name: Project Members
    description: >
      List a project's members, invite people to it, set a member's roles, and
      remove people from it. Available on self-hosted deployments that do not
      enable an SSO group scheme.
  - name: Projects
    description: >
      Create and manage projects within a workspace. A project is the container
      for the events, datasets, evaluations, and alerts logged against it.
  - name: Retention Policies
    description: >
      Read and replace scope retention windows, or remove an override to restore
      inheritance. A window sets how long data is kept. The retention expiry job
      of the data plane that hosts the data deletes what a window no longer
      keeps, where that job is enabled, and deleted data cannot be recovered.
      max_age_days expires a session with all of its events, by the start of the
      session. experiment_max_age_days expires an experiment run with its
      sessions, by the creation of the run. Two kinds of session are kept
      whatever the windows are: a session of an experiment run whose record was
      deleted, and a session that has no session event.
  - name: Roles
    description: >
      Read and replace an organization's roles manifest, which defines its roles
      and the permissions each one grants. Available on self-hosted deployments
      only.
  - name: Usage
    description: >
      Read an organization's usage: events and computed metrics per calendar
      month, and current user, workspace and project counts.
  - name: Virtual Dataplanes
    description: >
      Create and manage virtual data planes. A virtual data plane is a logical
      tenant boundary inside an organization, hosted on a physical cluster;
      several virtual data planes commonly share one cluster. Workspaces live
      inside a virtual data plane.
  - name: Workspace Members
    description: >
      List a workspace's members, invite people to it, set a member's roles, and
      remove people from it and from every project in it. Available on
      self-hosted deployments that do not enable an SSO group scheme.
  - name: Workspace Templates
    description: >
      Read and replace a workspace's templates manifest, which defines the
      metrics and charts that new projects in the workspace start with.
  - name: Workspaces
    description: >
      Read and manage workspaces. A workspace groups the projects belonging to
      one team or environment, and owns the API keys and AI provider secrets its
      projects share.
paths:
  /v1/orgs/{org_id}/retention_policy:
    delete:
      tags:
        - Retention Policies
      summary: Delete an org retention policy
      description: >
        Requires org.retention_policy.delete at the scope in the URL.

        The key must cover that scope. Scope headers do not select the target.

        Retires this scope's current override and returns the inherited
        effective policy.

        Preserves prior policy values and records the retiring actor, time, and
        cleared reason.

        Repeated deletion is safe when no override exists.
      operationId: deleteOrgRetentionPolicy
      parameters:
        - in: path
          name: org_id
          required: true
          description: The org whose retention policy is requested.
          schema:
            type: string
      responses:
        '200':
          description: The scope's explicit and effective retention policies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRetentionPolicyResponse'
        '400':
          description: An ancestor scope is archived.
        '404':
          description: The scope is missing, archived, or inaccessible to this caller.
      security:
        - ControlPlaneApiKey: []
components:
  schemas:
    GetRetentionPolicyResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/GetRetentionPolicyResponseData'
      required:
        - success
        - data
      additionalProperties: false
    GetRetentionPolicyResponseData:
      type: object
      properties:
        policy:
          type:
            - object
            - 'null'
          properties:
            scope_type:
              type: string
              enum:
                - org
                - workspace
                - project
            scope_id:
              type: string
              minLength: 1
            max_age_days:
              type:
                - integer
                - 'null'
              exclusiveMinimum: 0
              maximum: 36500
              description: >-
                Days to keep a session that belongs to no experiment run,
                counted from the start of the session. A session expires as a
                whole, with all of its events, also while it still receives
                events. A session of an experiment run whose record was deleted,
                and a session that has no session event, are kept whatever this
                value is. null keeps these sessions indefinitely.
            experiment_max_age_days:
              type:
                - integer
                - 'null'
              exclusiveMinimum: 0
              maximum: 36500
              description: >-
                Days to keep an experiment run, counted from the creation of the
                run. A run expires as a whole, with its sessions and their
                events. null keeps experiment runs indefinitely.
            created_by_actor_type:
              type: string
            created_by_actor_id:
              type: string
              minLength: 1
            created_at:
              type: string
              format: date-time
            effective_from:
              type: string
              format: date-time
          required:
            - scope_type
            - scope_id
            - max_age_days
            - experiment_max_age_days
            - created_by_actor_type
            - created_by_actor_id
            - created_at
            - effective_from
          additionalProperties: false
        effective_policy:
          type:
            - object
            - 'null'
          properties:
            scope_type:
              type: string
              enum:
                - org
                - workspace
                - project
            scope_id:
              type: string
              minLength: 1
            max_age_days:
              type:
                - integer
                - 'null'
              exclusiveMinimum: 0
              maximum: 36500
              description: >-
                Days to keep a session that belongs to no experiment run,
                counted from the start of the session. A session expires as a
                whole, with all of its events, also while it still receives
                events. A session of an experiment run whose record was deleted,
                and a session that has no session event, are kept whatever this
                value is. null keeps these sessions indefinitely.
            experiment_max_age_days:
              type:
                - integer
                - 'null'
              exclusiveMinimum: 0
              maximum: 36500
              description: >-
                Days to keep an experiment run, counted from the creation of the
                run. A run expires as a whole, with its sessions and their
                events. null keeps experiment runs indefinitely.
          required:
            - scope_type
            - scope_id
            - max_age_days
            - experiment_max_age_days
          additionalProperties: false
      required:
        - policy
        - effective_policy
      additionalProperties: false
  securitySchemes:
    ControlPlaneApiKey:
      type: http
      scheme: bearer
      description: >-
        A fine-grained control-plane API key (values begin with `hh_fgcp_`).
        Classic API keys used with the Data Plane API will not work here. Create
        one in the HoneyHive app under an organization's or workspace's
        **Settings → API Keys**.

````

## Related topics

- [Retention Policies](https://docs.honeyhive.ai/v2/cli-reference/ref/retention-policies.md)
- [Retention Policies Methods](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/index.md)
- [DeleteOrgRetentionPolicyResponse](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/DeleteOrgRetentionPolicyResponse.md)


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