Update retention policy

put
https://api.box.com/2.0
/retention_policies/:retention_policy_id

Updates a retention policy.

Request

application/json

Path Parameters

stringin pathrequired
982312

The ID of the retention policy.

Request Body

stringin bodyoptional
permanently_delete

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.

Value is one of permanently_delete,remove_retention

stringin bodyoptional
Some Policy Name

The name for the retention policy

stringin bodyoptional
retired

Value is always retired

Response

application/jsonRetention policy

Returns the updated retention policy object.

application/jsonClient error

Returns a bad_request if an incorrect disposition_action was set.

application/jsonClient error

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

application/jsonClient error

An unexpected client error.

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

Request Example

cURL
curl -X PUT https://api.box.com/2.0/retention_policies/982312 \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
     -H 'Content-Type: application/json" '
     -d '{
       "disposition_action": "permanently_delete"
     }'
.NET
var updates = new BoxRetentionPolicyRequest()
{
    PolicyName = "New Policy Name"
};
BoxRetentionPolicy updatedPolicy = await client.RetentionPoliciesManager
    .UpdateRetentionPolicyAsync("11111", updates);
Java
BoxRetentionPolicy policy = new BoxRetentionPolicy(api, id);
BoxRetentionPolicy.Info policyInfo = policy.new Info();
policyInfo.addPendingChange("policy_name", "new policy name");
policy.updateInfo(policyInfo);
Python
policy_update = {'policy_name': 'New Policy Name',}
updated_retention_policy = client.retention_policy(policy_id='12345').update_info(policy_update)
print('Retention Policy ID is {0} and the new policy name is {1}'.format(updated_retention_policy.id, updated_retention_policy.policy_name))
Node
client.retentionPolicies.update('123456789', {status: 'retired'})
	.then(policy => {
		/* policy -> {
			type: 'retention_policy',
			id: '123456789',
			policy_name: 'Tax Documents',
			policy_type: 'indefinite',
			retention_length: 'indefinite',
			disposition_action: 'remove_retention',
			can_owner_extend_retention: false,
			status: 'retired',
			are_owners_notified: true,
			custom_notification_recipients: []
			assignment_counts: { enterprise: 0, folder: 1, metadata_template: 0 },
			created_by: 
			{ type: 'user',
				id: '11111',
				name: 'Example User',
				login: 'user@example.com' },
			created_at: '2015-05-01T11:12:54-07:00',
			modified_at: '2015-06-08T11:11:50-07:00' }
		*/
	});