Box Developer Documentation
Latest version

List all legal hold policies

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

This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

Retrieves a list of legal hold policies that belong to an enterprise.

Request

bearer [ACCESS_TOKEN]
application/json

Query Parameters

string arrayin queryoptional
id,type,name

A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.

Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.

integer (int64)in queryoptional
1000
1000

The maximum number of items to return per page.

stringin queryoptional
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination.

This requires usemarker to be set to true.

stringin queryoptional
Sales Policy

Limits results to policies for which the names start with this search term. This is a case-insensitive prefix.

Response

application/jsonLegal hold policies

Returns a list of legal hold policies.

application/jsonClient error

An unexpected client error.

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

Request Example

Learn more about Box SDK versionig strategy.


cURL
curl -i -X GET "https://api.box.com/2.0/legal_hold_policies" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.legalHoldPolicies.getLegalHoldPolicies();
Python v10
client.legal_hold_policies.get_legal_hold_policies()
.NET v10
await client.LegalHoldPolicies.GetLegalHoldPoliciesAsync();
Swift v10
try await client.legalHoldPolicies.getLegalHoldPolicies()
Java v10
client.getLegalHoldPolicies().getLegalHoldPolicies()
Java v4
Iterable<BoxLegalHoldPolicy.Info> policies = BoxLegalHoldPolicy.getAll(api);
for (BoxLegalHoldPolicy.Info policyInfo : policies) {
    // Do something with the legal hold policy.
}
Python v3
policies = client.get_legal_hold_policies()
for policy in policies:
    print(f'Legal Hold Policy "{policy.name}" has ID {policy.id}')
.NET v5
BoxCollectionMarkerBased<BoxLegalHoldPolicy> policies = await client.LegalHoldPoliciesManager
    .GetListLegalHoldPoliciesAsync();
Node v3
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' } ] }
		*/
	});

Response Example

{
  "entries": [
    {
      "id": "11446498",
      "type": "legal_hold_policy",
      "assignment_counts": {
        "file": 3,
        "file_version": 4,
        "folder": 2,
        "user": 1
      },
      "created_at": "2012-12-12T10:53:43-08:00",
      "created_by": {
        "id": "11446498",
        "type": "user",
        "login": "ceo@example.com",
        "name": "Aaron Levie"
      },
      "deleted_at": "2012-12-12T10:53:43-08:00",
      "description": "Postman created policy",
      "filter_ended_at": "2012-12-12T10:53:43-08:00",
      "filter_started_at": "2012-12-12T10:53:43-08:00",
      "modified_at": "2012-12-12T10:53:43-08:00",
      "policy_name": "Policy 4",
      "release_notes": "Example",
      "status": "active"
    }
  ],
  "limit": 1000,
  "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
  "prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih"
}