box-node-sdk

RetentionPoliciesManager

List retention policies

Retrieves all of the retention policies for an enterprise.

This operation is performed by calling function getRetentionPolicies.

See the endpoint docs at API Reference.

await client.retentionPolicies.getRetentionPolicies();

Arguments

Returns

This function returns a value of type RetentionPolicies.

Returns a list retention policies in the enterprise.

Create retention policy

Creates a retention policy.

This operation is performed by calling function createRetentionPolicy.

See the endpoint docs at API Reference.

await client.retentionPolicies.createRetentionPolicy({
  policyName: retentionPolicyName,
  policyType: 'finite' as CreateRetentionPolicyRequestBodyPolicyTypeField,
  areOwnersNotified: true,
  canOwnerExtendRetention: true,
  description: retentionDescription,
  dispositionAction:
    'remove_retention' as CreateRetentionPolicyRequestBodyDispositionActionField,
  retentionLength: '1',
  retentionType:
    'modifiable' as CreateRetentionPolicyRequestBodyRetentionTypeField,
} satisfies CreateRetentionPolicyRequestBody);

Arguments

Returns

This function returns a value of type RetentionPolicy.

Returns a new retention policy object.

Get retention policy

Retrieves a retention policy.

This operation is performed by calling function getRetentionPolicyById.

See the endpoint docs at API Reference.

await client.retentionPolicies.getRetentionPolicyById(retentionPolicy.id);

Arguments

Returns

This function returns a value of type RetentionPolicy.

Returns the retention policy object.

Update retention policy

Updates a retention policy.

This operation is performed by calling function updateRetentionPolicyById.

See the endpoint docs at API Reference.

await client.retentionPolicies.updateRetentionPolicyById(retentionPolicy.id, {
  requestBody: {
    policyName: updatedRetentionPolicyName,
  } satisfies UpdateRetentionPolicyByIdRequestBody,
} satisfies UpdateRetentionPolicyByIdOptionalsInput);

Arguments

Returns

This function returns a value of type RetentionPolicy.

Returns the updated retention policy object.

Delete retention policy

Permanently deletes a retention policy.

This operation is performed by calling function deleteRetentionPolicyById.

See the endpoint docs at API Reference.

await client.retentionPolicies.deleteRetentionPolicyById(retentionPolicy.id);

Arguments

Returns

This function returns a value of type undefined.

Returns an empty response when the policy has been deleted.