> For the complete documentation index, see [llms.txt](https://docs.ggwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ggwp.com/api-docs-privacy/user-data-retention.md).

# User Data Retention

\[ Base URL: `api.ggwp.com`]

`PUT` /privacy/v1/data-retention

## **Description**

API endpoint to define a user’s data retention policy in GGWP platform. The default retention period for all users is 6 months.

## **Parameters**

`body`: Dictionary containing the following fields:

* **user\_id**: unique identifier of the user whose retention policy will be updated.
* **retention\_period**: number of days for which the data corresponding to *user\_id* should be kept in GGWP platform.

Sample Call:

```bash
curl --request PUT 'https://api.ggwp.com/privacy/v1/data-retention' \
--header 'x-api-key: api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
  "user_id": "<id1>",
  "retention_period": 90	
}'
```

## **Output**

* 200 - successful operation

  ```json
  {
    "status": "success"
  }
  ```
* 400
  * Invalid input (eg: missing *user\_id* or *retention\_period*, or incorrect types)
* 403
  * Invalid or missing API key
* 500
  * Error response
