A legal hold policy blocks permanent deletion of content during ongoing litigation. Admins can create legal hold policies and then later assign them to specific folders, files, or users.
- Get Legal Hold Policy
- Get Enterprise Legal Hold Policies
- Create Legal Hold Policy
- Update Legal Hold Policy
- Delete Legal Hold Policy
- Get Legal Hold Policy Assignment
- Get Legal Hold Policy Assignments
- Assign Legal Hold Policy
- Delete Legal Hold Policy Assignment
- Get File Version Legal Hold
- Get File Version Legal Holds
To retrieve information about a specific legal hold policy, call
LegalHoldPoliciesManager.GetLegalHoldPolicyAsync(string legalHoldId)
with the ID of the legal hold policy.
BoxLegalHoldPolicy policy = await client.LegalHoldPoliciesManager.GetLegalHoldPolicyAsync("11111");
To retrieve all of the legal hold policies for the given enterprise, call
LegalHoldPoliciesManager.GetListLegalHoldPoliciesAsync(string policyName = null, string fields = null, int limit = 100, string marker = null, bool autoPaginate = false)
.
BoxCollectionMarkerBased<BoxLegalHoldPolicy> policies = await client.LegalHoldPoliciesManager
.GetListLegalHoldPoliciesAsync();
To create a new legal hold policy, call
LegalHoldPoliciesManager.CreateLegalHoldPolicyAsync(BoxLegalHoldPolicyRequest createRequest)
.
var policyParams = new BoxLegalHoldPolicyRequest()
{
PolicyName = "IRS Audit"
};
BoxLegalHoldPolicy policy = await client.LegalHoldPoliciesManager
.CreateLegalHoldPolicyAsync(policyParams);
To update or modify an existing legal hold policy, call
LegalHoldPoliciesManager.UpdateLegalHoldPolicyAsync(string legalHoldPolicyId, BoxLegalHoldPolicyRequest updateRequest)
with the ID of the policy to update and the fields to update.
var updates = new BoxLegalHoldPolicyRequest()
{
Description = "Hold for documents related to the IRS audit"
};
BoxLegalHoldPolicy updatedPolicy = await client.LegalHoldPoliciesManager
.UpdateLegalHoldPolicyAsync("11111", updates);
To delete a legal hold policy, call
LegalHoldPoliciesManager.DeleteLegalHoldPolicyAsync(string legalHoldPolicyId)
.
Note that this is an asynchronous process - the policy will not be fully deleted
yet when the response comes back.
await client.LegalHoldPoliciesManager.DeleteLegalHoldPolicyAsync("11111");
To retrieve information about a legal hold policy assignment, call
LegalHoldPoliciesManager.GetAssignmentAsync(string assignmentId)
with the ID of the assignment object.
BoxLegalHoldPolicyAssignment assignment = await client.LegalHoldPoliciesManager
.GetAssignmentAsync(assignmentId: "22222");
To get a list of all legal hold policy assignments associated with a specified legal hold policy, call
LegalHoldPoliciesManager.GetAssignmentsAsync(string legalHoldPolicyId, string fields = null, string assignToType = null, string assignToId = null, int limit = 100, string marker = null, bool autoPaginate = false)
with the ID of the policy.
BoxCollectionMarkerBased<BoxLegalHoldPolicyAssignment> assignments = await client.LegalHoldPoliciesManager
.GetAssignmentsAsync(legalHoldPolicyId: "11111");
To assign a legal hold policy, call
LegalHoldPoliciesManager.CreateAssignmentAsync(BoxLegalHoldPolicyAssignmentRequest createRequest)
.
var requestParams = new BoxLegalHoldPolicyAssignmentRequest()
{
PolicyId = "11111",
AssignTo = new BoxRequestEntity()
{
Type = "folder",
Id = "12345"
}
};
BoxLegalHoldPolicyAssignment assignment = await client.LegalHoldPoliciesManager
.CreateAssignmentAsync(requestParams);
To delete a legal hold assignment and remove a legal hold policy from an item, call the
LegalHoldPoliciesManager.DeleteAssignmentAsync(string assignmentId)
method. Note that this is an asynchronous process - the assignment will not be fully deleted
yet when the response comes back.
await client.LegalHoldPoliciesManager.DeleteAssignmentAsync("22222");
A file version legal hold is a record for a held file version. To get information
for a specific file version legal hold record, call
LegalHoldPoliciesManager.GetFileVersionLegalHoldAsync(string fileVersionLegalHoldId)
with the ID of the file version legal hold record.
BoxFileVersionLegalHold hold = await client.LegalHoldPoliciesManager
.GetFileVersionLegalHoldAsync("55555");
To retrieve a list of all file version legal holds for a given policy, call
LegalHoldPoliciesManager.GetFileVersionLegalHoldsAsync(string policyId, IEnumerable<string> fields = null, int limit = 100, string marker = null, bool autoPaginate = false)
with the ID of the legal hold policy.
BoxCollectionMarkerBased<BoxFileVersionLegalHold> holds = await client.LegalHoldPoliciesManager
.GetFileVersionLegalHoldsAsync(policyId: "11111");