Box API - Create Folder and enable "Auto-Delete on selected date"

SOLVED
Go to solution
Occasional Contributor

Box API - Create Folder and enable "Auto-Delete on selected date"

I'm looking at the API for "Create Folder" and I don't see any mention of the "Auto-Delete" inside the JSON payload. I see where to configure 'Sharing' and 'Email upload'... Is this actually an option? Can I configure a folder and then set it to auto delete 90 days after creation all via the API?

7 REPLIES
Box Employee

Re: Box API - Create Folder and enable "Auto-Delete on selected date"

Hey @BentheBuilder,

 

You can achieve that by either calling the delete folder endpoint or by using the Box Retention Policy endpoint to determine a duration that a folder cannot be deleted. At the end of this period(90 days in this case) you can choose to: permanently delete or remove the retention policy from the folder.

 

Let me know if this is helpful or if you have any other questions, thank you! 

Occasional Contributor

Re: Box API - Create Folder and enable "Auto-Delete on selected date"

The idea is to not have to need to make an additional API call (90 days later) to delete the folder. There is a setting in box at both the folder and file level that allows you to set it to delete (move to trash) on a specified date. I'm trying to figure out if I can configure that setting via the API (Create Folder or Update Folder) or some other API call to manage the settings on the folder. 

Box Employee

Re: Box API - Create Folder and enable "Auto-Delete on selected date"

@BentheBuilder Unfortunately, that setting is not currently supported via the Update Folder API endpoint.

Occasional Contributor

Re: Box API - Create Folder and enable "Auto-Delete on selected date"

Is there any option for automating this function via the API or SDK? 

Box Employee

Re: Box API - Create Folder and enable "Auto-Delete on selected date"

@BentheBuilder As @cary mentioned, Box offers Governance features like Retention Policies, which can be used to ensure a file is not deleted for some amount of time and then delete it at the end of that period.  However, aside from that, there is not a simple feature in the API or SDK to perform this functionality automatically.

Occasional Contributor

Re: Box API - Create Folder and enable "Auto-Delete on selected date"

"Governance features" - Does this require additional cost/features for Box? And are those Governance features available via SDK/API? 

Highlighted
Box Employee

Re: Box API - Create Folder and enable "Auto-Delete on selected date"

Yes, Governance is generally sold as an add-on feature to enterprise accounts.  The Retention Policies feature I mentioned is available in our API and is supported in our SDKs.