List All Legal Hold Policies

Guides Legal Holds List All Legal Hold Policies
Edit this page

List All Legal Hold Policies

To list all Legal Hold Policies that have been created in an enterprise, call the GET /legal_hold_policies API endpoint.

cURL
curl -i -X GET "https://api.box.com/2.0/legal_hold_policies" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxCollectionMarkerBased<BoxLegalHoldPolicy> policies = await client.LegalHoldPoliciesManager
    .GetListLegalHoldPoliciesAsync();
Java
Iterable<BoxLegalHoldPolicy.Info> policies = BoxLegalHoldPolicy.getAll(api);
for (BoxLegalHoldPolicy.Info policyInfo : policies) {
    // Do something with the legal hold policy.
}
Python
policies = client.get_legal_hold_policies()
for policy in policies:
    print('Legal Hold Policy "{0}" has ID {1}'.format(policy.name, policy.id))
Node
client.legalHoldPolicies.getAll({policy_name: 'Important'})
	.then(policies => {
		/* policies -> {
			entries: 
			[ { type: 'legal_hold_policy',
				id: '11111',
				policy_name: 'Important Policy 1' },
				{ type: 'legal_hold_policy',
				id: '22222',
				policy_name: 'Important Policy 2' } ],
			limit: 100,
			order: [ { by: 'policy_name', direction: 'ASC' } ] }
		*/
	});
iOS
client.legalHolds.listForEnterprise(policyName: "policy1") { results in
    switch results {
    case let .success(iterator):
        for i in 1 ... 10 {
            iterator.next { result in
                switch result {
                case let .success(policy):
                    print("Legal hold policy \(policy.name)")
                case let .failure(error):
                    print(error)
                }
            }
        }
    case let .failure(error):
        print(error)
    }
}

Required Scopes

Before using any of the Legal Hold APIs, an application must have the right scopes enabled. See Required Scopes for more details.