> 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/kr/api-8/user-data-retention.md).

# 사용자 데이터 보존

\[ 기본 URL: `api.ggwp.com`]

`PUT` /privacy/v1/data-retention

## **설명**

GGWP 플랫폼에서 사용자의 데이터 보존 정책을 정의하는 API 엔드포인트입니다. 모든 사용자의 기본 보존 기간은 6개월입니다.

## **매개변수**

`본문`: 다음 필드를 포함하는 사전(Dictionary):

* **user\_id**: 보존 정책이 업데이트될 사용자의 고유 식별자입니다.
* **retention\_period**: 해당 *user\_id* 에 해당하는 데이터가 GGWP 플랫폼에 보관되어야 하는 일수입니다.

샘플 호출:

```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	
}'
```

## **출력**

* 200 - 성공적인 작업

  ```json
  {
    "status": "success"
  }
  ```
* 400
  * 잘못된 입력 (예: 누락된 *user\_id* 또는 *retention\_period*, 또는 잘못된 유형)
* 403
  * 잘못되었거나 누락된 API 키
* 500
  * 오류 응답
