List retention policies

get
https://api.box.com/2.0
/retention_policies/

Retrieves all of the retention policies for an enterprise.

Request

Bearer [ACCESS_TOKEN]
application/json

Query Parameters

stringin queryoptional
21312321

Filters results by the ID of the user who created policy.

stringin queryoptional
Sales Policy

Filters results by a case sensitive prefix of the name of retention policies.

stringin queryoptional
finite

Filters results by the type of retention policy.

Value is one of finite,indefinite

Response

application/jsonRetention policies

Returns a list retention policies in the enterprise.

application/jsonClient error

Returns a bad_request if a non existent policy_type was specified.

application/jsonClient error

Returns a not_found error if the user specified in created_by_user_id does not exist.

application/jsonClient error

An unexpected client error.

get
List retention policies
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X GET "https://api.box.com/2.0/retention_policies" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxCollectionMarkerBased<BoxRetentionPolicy> policies = await client.RetentionPoliciesManager
    .GetRetentionPoliciesAsync();
Java
Iterable<BoxRetentionPolicy.Info> policies = BoxRetentionPolicy.getAll(api);
for (BoxRetentionPolicy.Info policyInfo : policies) {
	// Do something with the retention policy.
}
Python
retention_policies = client.get_retention_policies()
for policy in retention_policies:
    print('The policy ID is {0} and the name is {1}'.format(policy.id, policy.policy_name))
Node
client.retentionPolicies.getAll({ policy_name: 'Tax' })
	.then(policies => {
		/* policies -> {
			entries: 
			[ { type: 'retention_policy',
				id: '123456789',
				name: 'Tax Documents' } ],
			limit: 100,
			next_marker: 'someMarkerString' }
		*/
	});

Response Example

{
  "entries": [
    {
      "id": 12345,
      "type": "file_version",
      "policy_name": "Some Policy Name",
      "retention_length": 365,
      "disposition_action": "permanently_delete",
      "policy_type": "finite",
      "status": "active",
      "created_by": {
        "id": 11446498,
        "type": "user",
        "name": "Aaron Levie",
        "login": "ceo@example.com"
      },
      "created_at": "2012-12-12T10:53:43-08:00",
      "modified_at": "2012-12-12T10:53:43-08:00"
    }
  ],
  "total_count": 156
}