# Task Retention & Scheduled Deletion Forms can come with compliance requirements on data retention. For example, employers may be required to retain Federal Form W-4 for at least four years after filing. Other legislations may also require certain forms to be deleted x years after collection. Onboarded helps employers meet these compliance requirements via task retention and scheduled deletion settings. ## Task Retention Task retention setting prevents a task from being deleted until its retention window has past. Customers can set retention via Dashboard or API. To set retention in the Onboarded Dashboard, go to the task edit view and set the time when deletion is allowed (shown below). image.png Alternatively, retention can be set via the Create-Task and Update-Task endpoint using the `deletion_allowed_at` parameter. See below for how this property can be set in the request payload when calling the Create-Task endpoint. ``` curl -i -X POST \ 'https://api.onboarded.com/api/v1/tasks' \ -d '{ "deletion_allowed_at": "2019-08-24T14:15:22Z" }' ``` ## Scheduled Task Deletion Scheduled task deletion allows task data collected from employees to be deleted at a specific time in the future. Customers can set scheduled deletion via Dashboard or API. To set scheduled deletion in the Onboarded Dashboard, go to the task edit view and set the time when a task should be deleted (shown below). image.png Alternatively, scheduled deletion can be set via the Create-Task and Update-Task endpoint using the `deletion_scheduled_at` parameter. See below for how this property can be set in the request payload when calling the Create-Task endpoint. ``` curl -i -X POST \ 'https://api.onboarded.com/api/v1/tasks' \ -d '{ "deletion_scheduled_at": "2019-08-24T14:15:22Z" }' ``` ## View Existing Settings Customers can view existing retention and scheduled deletion settings for a task in the task details view (shown below). Alternatively, these settings can be read from the API response of the List-Tasks and Get-Task endpoints under `deletion_allowed_at` and `deletion_scheduled_at`.