---
title: "Create retention policy"
method: POST
path: "/retention_policies"
tags: ["Retention policies"]
---

# Create retention policy

`POST /retention_policies`

Creates a retention policy.

## Request body

- object
  - `policy_name` string, required — The name for the retention policy.
  - `description` string — The additional text description of the retention policy.
  - `policy_type` 'finite' | 'indefinite', required — The type of the retention policy. A retention policy type can either be `finite`, where a specific amount of time to retain the content is known upfront, or `indefinite`, where the amount of time to retain the content is still unknown.
  - `disposition_action` 'permanently_delete' | 'remove_retention', required — The disposition action of the retention policy. `permanently_delete` deletes the content retained by the policy permanently. `remove_retention` lifts retention policy from the content, allowing it to be deleted by users once the retention policy has expired.
  - `retention_length` union — The length of the retention policy. This value specifies the duration in days that the retention policy will be active for after being assigned to content. If the policy has a `policy_type` of `indefinite`, the `retention_length` will also be `indefinite`.
    - string, int32, nullable
    - number
  - `retention_type` 'modifiable' | 'non_modifiable' — Specifies the retention type: * `modifiable`: You can modify the retention policy. For example, you can add or remove folders, shorten or lengthen the policy duration, or delete the assignment. Use this type if your retention policy is not related to any regulatory purposes. * `non_modifiable`: You can modify the retention policy only in a limited way: add a folder, lengthen the duration, retire the policy, change the disposition action or notification settings. You cannot perform other actions, such as deleting the assignment or shortening the policy duration. Use this type to ensure compliance with regulatory retention policies.
  - `can_owner_extend_retention` boolean — Whether the owner of a file will be allowed to extend the retention.
  - `max_extension_length` union — The maximum extension length of the retention date. This value specifies the duration in days for which the retention date of the file under policy can be extended. It can be specified only for the 'finite' policy type where the disposition action is 'permanently delete', otherwise the server will return status 400. If this value is 'none', it won't be possible to extend the retention.
    - 'none'
    - string, int32
    - integer
  - `are_owners_notified` boolean — Whether owner and co-owners of a file are notified when the policy nears expiration.
  - `custom_notification_recipients` UserMini[] — A list of users notified when the retention policy duration is about to end.
    - `id` string, required — The unique identifier for this user.
    - `type` 'user', required — The value will always be `user`.
    - `name` string — The display name of this user.
    - `login` string, email — The primary email address of this user.

## Response `201`

Returns a new retention policy object.

- RetentionPolicy — A base representation of a retention policy.
  - `id` string, required — The unique identifier that represents a retention policy.
  - `type` 'retention_policy', required — The value will always be `retention_policy`.
  - `policy_name` string — The name given to the retention policy.
  - `retention_length` string, int32 — The length of the retention policy. This value specifies the duration in days that the retention policy will be active for after being assigned to content. If the policy has a `policy_type` of `indefinite`, the `retention_length` will also be `indefinite`.
  - `disposition_action` 'permanently_delete' | 'remove_retention' — The disposition action of the retention policy. This action can be `permanently_delete`, which will cause the content retained by the policy to be permanently deleted, or `remove_retention`, which will lift the retention policy from the content, allowing it to be deleted by users, once the retention policy has expired.
  - `max_extension_length` union — The maximum extension length of the retention date. This value specifies the duration in days for which the retention date of the file under policy can be extended. If the policy type is other than 'finite' or the disposition action is other than 'permanently delete', or the maximum extension length is undefined, this field will be set to 'none'.
    - 'none'
    - string, int32
  - `description` string — The additional text description of the retention policy.
  - `policy_type` 'finite' | 'indefinite' — The type of the retention policy. A retention policy type can either be `finite`, where a specific amount of time to retain the content is known upfront, or `indefinite`, where the amount of time to retain the content is still unknown.
  - `retention_type` 'modifiable' | 'non_modifiable' — Specifies the retention type: * `modifiable`: You can modify the retention policy. For example, you can add or remove folders, shorten or lengthen the policy duration, or delete the assignment. Use this type if your retention policy is not related to any regulatory purposes. * `non-modifiable`: You can modify the retention policy only in a limited way: add a folder, lengthen the duration, retire the policy, change the disposition action or notification settings. You cannot perform other actions, such as deleting the assignment or shortening the policy duration. Use this type to ensure compliance with regulatory retention policies.
  - `status` 'active' | 'retired' — The status of the retention policy. The status of a policy will be `active`, unless explicitly retired by an administrator, in which case the status will be `retired`. Once a policy has been retired, it cannot become active again.
  - `created_by` object — A mini user object representing the user that created the retention policy.
    - `id` string, required — The unique identifier for this user.
    - `type` 'user', required — The value will always be `user`.
    - `name` string — The display name of this user.
    - `login` string, email — The primary email address of this user.
  - `created_at` string, date-time — When the retention policy object was created.
  - `modified_at` string, date-time — When the retention policy object was last modified.
  - `can_owner_extend_retention` boolean — Determines if the owner of items under the policy can extend the retention when the original retention duration is about to end.
  - `are_owners_notified` boolean — Determines if owners and co-owners of items under the policy are notified when the retention duration is about to end.
  - `custom_notification_recipients` UserMini[] — A list of users notified when the retention policy duration is about to end.
    - `id` string, required — The unique identifier for this user.
    - `type` 'user', required — The value will always be `user`.
    - `name` string — The display name of this user.
    - `login` string, email — The primary email address of this user.
  - `assignment_counts` object — Counts the retention policy assignments for each item type.
    - `enterprise` integer — The number of enterprise assignments this policy has. The maximum value is 1.
    - `folder` integer — The number of folder assignments this policy has.
    - `metadata_template` integer — The number of metadata template assignments this policy has.

## Other responses

- `400` — Returns a `bad_request` error when the `retention_length` was specified for an `indefinite` retention policy, an incorrect `disposition_action` was set, `max_extension_length` is not allowed for the given policy type or disposition action, or description exceeds maximum length of 500 characters.
- `409` — Returns an error if a retention policy with the given name already exists.
- `default` — An unexpected client error.

---

[API](https://skmtc.net/box/apis/platform-api.md) · [All operations](https://skmtc.net/box/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/box/platform-api/revisions/ba8f087e1a4d/schema)
