> ## 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입니다. `ftn_` 접두사로 시작합니다.
</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/fortunes/ftn_xyz789abc123 \
    -H "X-API-Key: bs_live_xxx"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.sajuapi.dev/v1/fortunes/ftn_xyz789abc123',
    {
      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/fortunes/ftn_xyz789abc123',
      headers={'X-API-Key': 'bs_live_xxx'}
  )

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

***

## 응답 예시

```json theme={null}
{
  "id": "ftn_xyz789abc123",
  "deleted": true,
  "deleted_at": "2025-01-16T15:00:00Z"
}
```

***

## 응답 필드

| 필드           | 타입      | 설명                         |
| ------------ | ------- | -------------------------- |
| `id`         | string  | 삭제된 운세의 ID입니다.             |
| `deleted`    | boolean | 삭제 성공 여부입니다. 항상 `true`입니다. |
| `deleted_at` | string  | 삭제 시간입니다. ISO 8601 형식입니다.  |

***

## 감사 로그

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

```json theme={null}
{
  "action": "fortune.deleted",
  "resource_type": "fortune",
  "resource_id": "ftn_xyz789abc123",
  "actor_ip": "203.0.113.42",
  "actor_api_key": "bs_live_xxx...",
  "metadata": {
    "profile_id": "prf_abc123def456",
    "fortune_type": "daily",
    "fortune_date": "2025-01-16"
  },
  "created_at": "2025-01-16T15:00:00Z"
}
```

***

## 일괄 삭제

여러 운세를 한 번에 삭제해야 하는 경우, 프로필 삭제를 사용하면 관련된 모든 운세가 함께 삭제됩니다.

```bash theme={null}
# 프로필 삭제 시 모든 관련 운세도 함께 삭제됨
curl -X DELETE https://api.sajuapi.dev/v1/profiles/prf_abc123def456 \
  -H "X-API-Key: bs_live_xxx"
```

개별 운세만 삭제하려면 이 엔드포인트를 반복 호출하세요.
