> ## 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.

# Retention Policies Methods

> HoneyHive TypeScript Control Plane SDK Retention Policies namespace reference

#### deleteOrg

> **deleteOrg**(`request`: [`DeleteOrgRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/DeleteOrgRetentionPolicyRequest)): `Promise`\<[`DeleteOrgRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/DeleteOrgRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

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.

#### deleteProject

> **deleteProject**(`request`: [`DeleteProjectRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/DeleteProjectRetentionPolicyRequest)): `Promise`\<[`DeleteProjectRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/DeleteProjectRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

Delete a project retention policy

Requires project.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.

#### deleteWorkspace

> **deleteWorkspace**(`request`: [`DeleteWorkspaceRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/DeleteWorkspaceRetentionPolicyRequest)): `Promise`\<[`DeleteWorkspaceRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/DeleteWorkspaceRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

Delete a workspace retention policy

Requires workspace.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.

#### getOrg

> **getOrg**(`request`: [`GetOrgRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/GetOrgRetentionPolicyRequest)): `Promise`\<[`GetOrgRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/GetOrgRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

Get an org retention policy

Requires org.retention\_policy.get at the scope in the URL.
The key must cover that scope. Scope headers do not select the target.
Returns the explicit policy, if present, and the effective policy with its source scope.
The nearest current policy supplies both windows. Fields are not merged across scopes.
When no scope in the lineage has a current policy, effective\_policy is null and data is
retained indefinitely.

#### getProject

> **getProject**(`request`: [`GetProjectRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/GetProjectRetentionPolicyRequest)): `Promise`\<[`GetProjectRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/GetProjectRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

Get a project retention policy

Requires project.retention\_policy.get at the scope in the URL.
The key must cover that scope. Scope headers do not select the target.
Returns the explicit policy, if present, and the effective policy with its source scope.
The nearest current policy supplies both windows. Fields are not merged across scopes.
When no scope in the lineage has a current policy, effective\_policy is null and data is
retained indefinitely.

#### getWorkspace

> **getWorkspace**(`request`: [`GetWorkspaceRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/GetWorkspaceRetentionPolicyRequest)): `Promise`\<[`GetWorkspaceRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/GetWorkspaceRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

Get a workspace retention policy

Requires workspace.retention\_policy.get at the scope in the URL.
The key must cover that scope. Scope headers do not select the target.
Returns the explicit policy, if present, and the effective policy with its source scope.
The nearest current policy supplies both windows. Fields are not merged across scopes.
When no scope in the lineage has a current policy, effective\_policy is null and data is
retained indefinitely.

#### replaceOrg

> **replaceOrg**(`request`: [`ReplaceOrgRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/ReplaceOrgRetentionPolicyRequest)): `Promise`\<[`ReplaceOrgRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/ReplaceOrgRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

Replace an org retention policy

Requires org.retention\_policy.put at the scope in the URL.
The key must cover that scope. Scope headers do not select the target.
Replaces both windows. Both fields are required. Null retains data indefinitely.
A shorter window makes older data expire. Runs of the retention expiry job delete it, and a
large amount of expired data can take more than one run. Deleted data cannot be recovered.
An explicit policy overrides inherited windows, including when both values are null.
Creates a new policy version and preserves the previous version for audit.

#### replaceProject

> **replaceProject**(`request`: [`ReplaceProjectRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/ReplaceProjectRetentionPolicyRequest)): `Promise`\<[`ReplaceProjectRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/ReplaceProjectRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

Replace a project retention policy

Requires project.retention\_policy.put at the scope in the URL.
The key must cover that scope. Scope headers do not select the target.
Replaces both windows. Both fields are required. Null retains data indefinitely.
A shorter window makes older data expire. Runs of the retention expiry job delete it, and a
large amount of expired data can take more than one run. Deleted data cannot be recovered.
An explicit policy overrides inherited windows, including when both values are null.
Creates a new policy version and preserves the previous version for audit.

#### replaceWorkspace

> **replaceWorkspace**(`request`: [`ReplaceWorkspaceRetentionPolicyRequest`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/ReplaceWorkspaceRetentionPolicyRequest)): `Promise`\<[`ReplaceWorkspaceRetentionPolicyResponse`](https://docs.honeyhive.ai/v2/control-plane-sdk-reference/typescript/ref/retention-policies/ReplaceWorkspaceRetentionPolicyResponse)>

**Accepted keys:** [Control plane fine-grained API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

Replace a workspace retention policy

Requires workspace.retention\_policy.put at the scope in the URL.
The key must cover that scope. Scope headers do not select the target.
Replaces both windows. Both fields are required. Null retains data indefinitely.
A shorter window makes older data expire. Runs of the retention expiry job delete it, and a
large amount of expired data can take more than one run. Deleted data cannot be recovered.
An explicit policy overrides inherited windows, including when both values are null.
Creates a new policy version and preserves the previous version for audit.


## Related topics

- [Retention Policies](https://docs.honeyhive.ai/v2/cli-reference/ref/retention-policies.md)
- [Get a workspace retention policy](https://docs.honeyhive.ai/v2/control-plane-api-reference-autogen/retention-policies/get-a-workspace-retention-policy.md)
- [Get a project retention policy](https://docs.honeyhive.ai/v2/control-plane-api-reference-autogen/retention-policies/get-a-project-retention-policy.md)


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