> ## 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>

서비스의 기본 상태를 확인합니다. 로드 밸런서의 헬스 체크나 간단한 연결 확인에 사용합니다.

<Note>
  이 엔드포인트는 인증 없이 호출할 수 있습니다. 상세한 서비스 상태는 `/v1/status` 엔드포인트를 사용하세요.
</Note>

***

## Response

### 성공

서비스가 정상이면 `200 OK`와 함께 상태 정보가 반환됩니다.

### 실패

| 상태 코드 | 에러 타입                 | 설명            |
| ----- | --------------------- | ------------- |
| 503   | `service_unavailable` | 서비스를 사용할 수 없음 |

***

## 요청 예시

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://api.sajuapi.dev/v1/health
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.sajuapi.dev/v1/health'
  );

  const health = await response.json();

  if (health.status === 'healthy') {
    console.log('서비스 정상');
  }
  ```

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

  response = requests.get(
      'https://api.sajuapi.dev/v1/health'
  )

  health = response.json()
  print(f"Status: {health['status']}")
  ```
</CodeGroup>

***

## 응답 예시

### 정상

```json theme={null}
{
  "status": "healthy",
  "timestamp": "2025-01-16T09:00:00Z"
}
```

### 비정상

```json theme={null}
{
  "status": "unhealthy",
  "timestamp": "2025-01-16T09:00:00Z"
}
```

***

## Health 객체

| 필드          | 타입     | 설명                                      |
| ----------- | ------ | --------------------------------------- |
| `status`    | string | 서비스 상태입니다. `healthy` 또는 `unhealthy`입니다. |
| `timestamp` | string | 응답 생성 시간입니다.                            |

***

## 활용 사례

### Kubernetes Liveness Probe

```yaml theme={null}
livenessProbe:
  httpGet:
    path: /v1/health
    port: 3000
  initialDelaySeconds: 10
  periodSeconds: 30
  timeoutSeconds: 5
  failureThreshold: 3
```

### AWS ALB Health Check

```
Health check path: /v1/health
Healthy threshold: 2
Unhealthy threshold: 3
Timeout: 5 seconds
Interval: 30 seconds
Success codes: 200
```

<Note>
  헬스 체크 엔드포인트는 가볍게 유지되어 빠른 응답 시간을 보장합니다. 데이터베이스 연결 상태 등 상세 정보가 필요하면 `/v1/status`를 사용하세요.
</Note>
