Create retention policy


Creates a retention policy.



Request Body

booleanin bodyoptional

Whether owner and co-owners of a file are notified when the policy nears expiration.

Value is one of true,false

booleanin bodyoptional

Whether the owner of a file will be allowed to extend the retention.

Value is one of true,false

A list of users notified when the retention policy duration is about to end.

stringin bodyoptional
"Policy to retain all reports for at least one month"

The additional text description of the retention policy.

stringin bodyrequired

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.

Value is one of permanently_delete,remove_retention

stringin bodyrequired
"Some Policy Name"

The name for the retention policy

stringin bodyrequired

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.

Value is one of finite,indefinite

string (int32) / number (int32) in body

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.

stringin bodyoptional

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.

Value is one of modifiable,non_modifiable


application/jsonRetention policy

Returns a new retention policy object.

application/jsonClient error

Returns a bad_request error with the retention_length was specified for a infinite retention policy, an incorrect disposition_action was set, or description exceeds maximum length of 500 characters.

application/jsonClient error

Returns an error if a retention policy with the given name already exists

application/jsonClient error

An unexpected client error.

Create retention policy
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

curl -i -X POST "" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "policy_name": "Some Policy Name",
       "policy_type": "finite",
       "retention_length": 365,
       "disposition_action": "permanently_delete"
TypeScript Gen
await client.retentionPolicies.createRetentionPolicy({
  policyName: getUuid(),
  policyType: 'finite' as CreateRetentionPolicyRequestBodyPolicyTypeField,
    'remove_retention' as CreateRetentionPolicyRequestBodyDispositionActionField,
  retentionLength: '1',
  description: description,
  canOwnerExtendRetention: false,
    'modifiable' as CreateRetentionPolicyRequestBodyRetentionTypeField,
} satisfies CreateRetentionPolicyRequestBody);
Python Gen
.NET Gen (Beta)
await client.RetentionPolicies.CreateRetentionPolicyAsync(requestBody: new CreateRetentionPolicyRequestBody(policyName: Utils.GetUUID(), policyType: CreateRetentionPolicyRequestBodyPolicyTypeField.Finite, dispositionAction: CreateRetentionPolicyRequestBodyDispositionActionField.RemoveRetention) { RetentionLength = "1", Description = description, CanOwnerExtendRetention = false, RetentionType = CreateRetentionPolicyRequestBodyRetentionTypeField.Modifiable });
policy_name = 'Test Indefinite Policy Name'
disposition_action = 'remove_retention'
indefinite_retention_policy = client.create_retention_policy(policy_name, disposition_action, float('inf'))
print(f'Indefinite Retention Policy ID is {} and the policy name is {indefinite_retention_policy.policy_name}')
var policyParams = new BoxRetentionPolicyRequest()
    PolicyName = "Important Documents!",
    PolicyType = "finite",
    RetentionLength = 365,
    DispositionAction = "remove_retention"
BoxRetentionPolicy policy = await client.RetentionPoliciesManager
BoxRetentionPolicy.createIndefinitePolicy(api, name);
	'Tax Documents',
).then(policy => {
	/* policy -> {
		type: 'retention_policy',
		id: '123456789',
		policy_name: 'Tax Documents',
		policy_type: 'indefinite',
		retention_length: 'indefinite',
		retention_type: 'modifiable',
		description: 'Policy to retain all reports',
		disposition_action: 'remove_retention',
		can_owner_extend_retention: false,
		status: 'active',
		are_owners_notified: true,
		custom_notification_recipients: []
		assignment_counts: { enterprise: 0, folder: 1, metadata_template: 0 },
		{ type: 'user',
			id: '11111',
			name: 'Example User',
			login: '' },
		created_at: '2015-05-01T11:12:54-07:00',
		modified_at: '2015-06-08T11:11:50-07:00' }
    name: "Test Indefinite Policy Name",
    type: .indefinite,
    dispositionAction: .removeRetention
) { result in
    guard case let .success(retentionPolicy) = result else {
        print("Error creating retention policy")
    print("Retention policy: \( was created")

Response Example

  "id": "12345",
  "type": "retention_policy",
  "are_owners_notified": false,
  "assignment_counts": {
    "enterprise": 1,
    "folder": 1,
    "metadata_template": 1
  "can_owner_extend_retention": false,
  "created_at": "2012-12-12T10:53:43-08:00",
  "created_by": {
    "id": "11446498",
    "type": "user",
    "login": "",
    "name": "Aaron Levie"
  "custom_notification_recipients": [
      "id": "11446498",
      "type": "user",
      "name": "Aaron Levie",
      "login": ""
  "description": "Policy to retain all reports for at least one month",
  "disposition_action": "permanently_delete",
  "modified_at": "2012-12-12T10:53:43-08:00",
  "policy_name": "Some Policy Name",
  "policy_type": "finite",
  "retention_length": "365",
  "retention_type": "non_modifiable",
  "status": "active"