> For the complete documentation index, see [llms.txt](https://docs.groobee.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groobee.ai/developer-guide/api-guide/personalization-api/personalization-delete.md).

# 개인화 데이터 삭제

## **1. 개요**

* 수집된 개인화 데이터(오프사이트 캠페인 발송 대상 회원의 개인화 데이터)를 그루비에서 삭제하는 API입니다.
* `memberId` 혹은 `전화번호` 기준으로 매칭되는 데이터를 삭제합니다.

***

## **2. 기본 정보**

<table><thead><tr><th width="291.35546875">항목</th><th>내용</th></tr></thead><tbody><tr><td>Method</td><td><code>DELETE</code></td></tr><tr><td>URL</td><td><code>https://api.groobee.io/personalizations</code></td></tr><tr><td>인증</td><td><a href="https://docs.groobee.ai/~/changes/799/new-admin/settings/site"><strong>[설정 > 사이트]</strong></a>에서 발급받은 API Key (Header)</td></tr></tbody></table>

## **3. 요청 (Request)**

### **요청 헤더(Header)**

| 이름             | 필수 | 설명                 |
| -------------- | -- | ------------------ |
| `x-api-key`    | O  | API 인증 키           |
| `Content-Type` | O  | `application/json` |

### **요청 본문(Body)**

| 필드             | 타입             | 필수 | 설명                               |
| -------------- | -------------- | -- | -------------------------------- |
| `memberIds`    | Array\<String> | △  | 삭제 대상 회원 ID 목록                   |
| `phoneNumbers` | Array\<String> | △  | 삭제 대상 전화번호 목록 (하이픈 포함/미포함 모두 허용) |

{% hint style="warning" %}

* `memberIds`, `phoneNumbers` **둘 중 하나 이상**은 반드시 포함되어야 합니다.
* 두 조건은 **OR**로 동작합니다. (`memberIds`에 포함되거나 **또는** `phoneNumbers`에 포함되면 삭제)
* `memberIds`와 `phoneNumbers`의 **합산 개수**는 한 번에 최대 **1,000건**까지 요청할 수 있습니다.
  {% endhint %}

***

## **4. 예제 (Example)**

### 요청(Request)

```json
{
    "memberIds": [
        "groobee1",
        "groobee2"
    ],
    "phoneNumbers": [
        "010-0000-2222",
        "01033334444"
    ]
}
```

* **`memberId`만으로 삭제**

```json
{
    "memberIds": [
        "groobee1",
        "groobee2"
    ]
}
```

* **`전화번호`만으로 삭제**

```json
{
    "phoneNumbers": [
        "010-0000-2222",
        "010-3333-4444"
    ]
}
```

***

## **5. 응답 (Response)**

* 성공 시 `processValue`에 **삭제된 데이터 건수**가 반환됩니다.

### **성공 시**

```json
{
    "httpStatus": {
        "code": "200",
        "reasonPhrase": "OK"
    },
    "processCode": "0",
    "processValue": 2
}
```

### **실패 시**

```json
{
    "httpStatus": {
        "code": "400",
        "reasonPhrase": "Bad Request"
    },
    "processCode": "-1004",
    "processValue": {
        "message": "데이터 초과"
    }
}
```

{% hint style="info" %}

* HTTP Status는 항상 `200`이며, 실제 성공 여부는 `processCode`로 판단합니다.
* `processValue`는 성공 시 삭제된 문서 수(정수)입니다.
  {% endhint %}

## **6. 결과 코드 (Result Codes)**

<table><thead><tr><th width="156.78125">코드 값</th><th width="193.1640625">상태</th><th>설명</th></tr></thead><tbody><tr><td>0</td><td>성공</td><td>정상 처리</td></tr><tr><td>-1000</td><td>실패</td><td>요청 시 Header에 x-api-key 미존재</td></tr><tr><td>-1001</td><td>실패</td><td>고객사 미존재</td></tr><tr><td>-1002</td><td>실패</td><td>고객사 미승인 상태 (승인 필요)</td></tr><tr><td>-1003</td><td>실패</td><td>고객사 계약기간 만료</td></tr><tr><td>-1004</td><td>실패</td><td>데이터 초과 (합산 1,000건 초과)</td></tr><tr><td>-1006</td><td>실패</td><td>회원 ID가 올바르지 않습니다.</td></tr><tr><td>-1007</td><td>실패</td><td>회원 전화번호가 올바르지 않습니다.</td></tr><tr><td>-4001</td><td>실패</td><td>요청 본문에 내용이 없습니다 (삭제 조건 미포함)</td></tr><tr><td>-9997</td><td>실패</td><td>데이터가 올바르지 않습니다.</td></tr><tr><td>-9998</td><td>실패</td><td>http 관련 에러</td></tr><tr><td>-9999</td><td>실패</td><td>요청 API 서버 에러</td></tr></tbody></table>

***

## **7. 주의사항**

* **삭제 조건:** `memberIds`, `phoneNumbers` 중 최소 하나 이상은 반드시 포함해야 합니다. 두 값이 모두 비어 있으면 `-4001` 오류가 발생하며, 전체 데이터가 삭제되지 않도록 방지합니다.
* **OR 조건 동작:** `memberIds`와 `phoneNumbers`를 함께 전송하면, 둘 중 **하나라도 일치**하는 데이터가 모두 삭제됩니다. (교집합이 아닌 합집합)
* **전화번호 처리:** 전화번호는 수집 시와 동일하게 하이픈(`-`)을 제거한 뒤 처리됩니다. 하이픈 포함(`010-0000-2222`), 미포함(`01000002222`) 모두 동일하게 동작합니다.
* **존재하지 않는 대상:** 삭제 대상이 존재하지 않아도 오류가 아니며, 실제로 삭제된 건수가 `processValue`로 반환됩니다. (예: 일치 데이터가 없으면 `0`)
* **복구 불가:** 삭제된 데이터는 복구할 수 없습니다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.groobee.ai/developer-guide/api-guide/personalization-api/personalization-delete.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
