> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sajuapi.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 프로필 삭제

<Info>
  **v1 Enterprise API (Coming Soon)**

  이 엔드포인트는 Enterprise 버전에서 제공될 예정입니다.
  현재는 [v0 API](/api-reference/v0/overview)를 사용하세요.
</Info>

프로필을 삭제합니다. 삭제된 프로필과 연관된 모든 운세 데이터도 함께 삭제됩니다.

<Warning>
  이 작업은 되돌릴 수 없습니다. 삭제된 데이터는 복구할 수 없으며, 모든 삭제 작업은 감사 로그에 기록됩니다.
</Warning>

***

## Path 파라미터

<ParamField path="id" type="string" required>
  삭제할 프로필의 ID입니다. `prf_` 접두사로 시작합니다.
</ParamField>

***

## Response

### 성공

프로필 삭제에 성공하면 삭제된 프로필 정보와 삭제 확인이 반환됩니다.

### 실패

| 상태 코드 | 에러 타입                  | 설명             |
| ----- | ---------------------- | -------------- |
| 401   | `authentication_error` | API 키가 유효하지 않음 |
| 404   | `not_found`            | 프로필을 찾을 수 없음   |
| 429   | `rate_limited`         | 요청 한도 초과       |

***

## 요청 예시

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://api.sajuapi.dev/v1/profiles/prf_abc123def456 \
    -H "X-API-Key: bs_live_xxx"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.sajuapi.dev/v1/profiles/prf_abc123def456',
    {
      method: 'DELETE',
      headers: {
        'X-API-Key': 'bs_live_xxx'
      }
    }
  );

  const result = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.delete(
      'https://api.sajuapi.dev/v1/profiles/prf_abc123def456',
      headers={'X-API-Key': 'bs_live_xxx'}
  )

  result = response.json()
  ```
</CodeGroup>

***

## 응답 예시

```json theme={null}
{
  "id": "prf_abc123def456",
  "deleted": true,
  "deleted_at": "2025-01-16T15:00:00Z",
  "related_data_deleted": {
    "fortunes": 45,
    "cached_calculations": 12
  }
}
```

***

## 응답 필드

| 필드                                         | 타입      | 설명                         |
| ------------------------------------------ | ------- | -------------------------- |
| `id`                                       | string  | 삭제된 프로필의 ID입니다.            |
| `deleted`                                  | boolean | 삭제 성공 여부입니다. 항상 `true`입니다. |
| `deleted_at`                               | string  | 삭제 시간입니다. ISO 8601 형식입니다.  |
| `related_data_deleted`                     | object  | 함께 삭제된 연관 데이터 정보입니다.       |
| `related_data_deleted.fortunes`            | integer | 삭제된 운세 데이터 수입니다.           |
| `related_data_deleted.cached_calculations` | integer | 삭제된 캐시된 계산 결과 수입니다.        |

***

## 감사 로그

모든 삭제 작업은 감사 로그에 자동으로 기록됩니다.

```json theme={null}
{
  "action": "profile.deleted",
  "resource_type": "profile",
  "resource_id": "prf_abc123def456",
  "actor_ip": "203.0.113.42",
  "actor_api_key": "bs_live_xxx...",
  "metadata": {
    "fortunes_deleted": 45,
    "cached_calculations_deleted": 12
  },
  "created_at": "2025-01-16T15:00:00Z"
}
```

감사 로그는 [리포트 API](/api-reference/reports/audit)를 통해 조회할 수 있습니다.
