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

# Health Check

> GET /health - Check API server status and configuration

## Overview

Returns the current health status of the API server and validates that all required dependencies are properly configured. This endpoint is useful for monitoring, load balancer health checks, and troubleshooting.

<CodeGroup>
  ```bash curl theme={null}
  curl -X GET https://api.zcombinator.io/health
  ```

  ```javascript fetch theme={null}
  const response = await fetch('https://api.zcombinator.io/health');
  const health = await response.json();
  console.log(health);
  ```

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

  response = requests.get('https://api.zcombinator.io/health')
  health = response.json()
  print(health)
  ```
</CodeGroup>

## Response

<ResponseField name="status" type="string">
  Always returns "healthy" when the endpoint is reachable
</ResponseField>

<ResponseField name="timestamp" type="string">
  ISO 8601 timestamp of when the health check was performed
</ResponseField>

<ResponseField name="environment" type="object">
  Configuration status for required dependencies
</ResponseField>

<ResponseField name="environment.hasRPC" type="boolean">
  Whether RPC\_URL environment variable is configured
</ResponseField>

<ResponseField name="environment.hasConfig" type="boolean">
  Whether CONFIG\_ADDRESS environment variable is configured
</ResponseField>

<ResponseField name="environment.hasPinata" type="boolean">
  Whether PINATA\_JWT environment variable is configured
</ResponseField>

<ResponseField name="environment.hasStorage" type="boolean">
  Whether storage system is configured
</ResponseField>

### Success Response

```json theme={null}
{
  "status": "healthy",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "environment": {
    "hasRPC": true,
    "hasConfig": true,
    "hasPinata": true,
    "hasStorage": true
  }
}
```

### Degraded Response

If some optional dependencies are missing:

```json theme={null}
{
  "status": "healthy",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "environment": {
    "hasRPC": true,
    "hasConfig": false,
    "hasPinata": false,
    "hasStorage": true
  }
}
```

## HTTP Status Codes

<AccordionGroup>
  <Accordion title="200 - OK">
    The API server is running and responding normally. This doesn't guarantee all features will work if dependencies are missing.
  </Accordion>

  <Accordion title="500 - Server Error">
    The health endpoint itself failed, indicating a serious server issue.
  </Accordion>
</AccordionGroup>

## Environment Variables Checked

The health endpoint validates these environment variables:

<AccordionGroup>
  <Accordion title="hasRPC" icon="server">
    **RPC\_URL** - Required for all blockchain operations

    * ✅ Present: Token launch and claims will work
    * ❌ Missing: All endpoints will fail with configuration errors
  </Accordion>

  <Accordion title="hasConfig" icon="gear">
    **CONFIG\_ADDRESS** - Optional protocol configuration

    * ✅ Present: Advanced protocol features available
    * ❌ Missing: Basic functionality still works
  </Accordion>

  <Accordion title="hasPinata" icon="cloud">
    **PINATA\_JWT** - Required for metadata uploads

    * ✅ Present: Automatic IPFS metadata uploads work
    * ❌ Missing: Token launch may require external metadata URLs
  </Accordion>

  <Accordion title="hasStorage" icon="box">
    **Storage** - Required for token tracking and claims

    * ✅ Present: Claims system and token verification work
    * ❌ Missing: Claims endpoints will fail
  </Accordion>
</AccordionGroup>

## Rate Limiting

This endpoint is subject to the same rate limiting as other endpoints:

* **8 requests per IP** per 2-minute window
* Returns HTTP 429 when limit exceeded

## Use Cases

<AccordionGroup>
  <Accordion title="Load Balancer Health Checks" icon="scale-balanced">
    Configure your load balancer to periodically check this endpoint:

    ```yaml theme={null}
    health_check:
      path: /health
      interval: 30s
      timeout: 5s
      healthy_threshold: 2
      unhealthy_threshold: 3
    ```
  </Accordion>

  <Accordion title="Monitoring & Alerting" icon="bell">
    Monitor the environment flags to alert on configuration issues:

    ```javascript theme={null}
    const health = await fetch('/health').then(r => r.json());

    if (!health.environment.hasRPC) {
      alert('RPC configuration missing - API will not function');
    }

    if (!health.environment.hasStorage) {
      alert('Storage configuration missing - claims disabled');
    }
    ```
  </Accordion>

  <Accordion title="Client-side Integration" icon="code">
    Check API availability before making requests:

    ```javascript theme={null}
    async function isAPIHealthy() {
      try {
        const response = await fetch('/health');
        return response.ok && response.status === 200;
      } catch {
        return false;
      }
    }

    if (await isAPIHealthy()) {
      // Proceed with API calls
    } else {
      // Show maintenance message
    }
    ```
  </Accordion>
</AccordionGroup>

## Security Considerations

<Warning>
  **Important**: The health endpoint does not expose sensitive configuration values, only boolean flags indicating presence. Actual environment variable values are never returned.
</Warning>

## Troubleshooting

Common scenarios and their meanings:

<AccordionGroup>
  <Accordion title="All environment flags false">
    The server is running but completely unconfigured. No API functions will work.
  </Accordion>

  <Accordion title="hasRPC: false">
    Critical error - no blockchain connectivity. All token operations will fail.
  </Accordion>

  <Accordion title="hasStorage: false">
    Claims system disabled. Token launch may work but verification and claims won't.
  </Accordion>

  <Accordion title="hasPinata: false">
    Metadata uploads disabled. Manual IPFS URLs required for token launch.
  </Accordion>
</AccordionGroup>

## Related Endpoints

* [`/verify-token`](/api-reference/utility/verify-token) - Verify specific token existence
* [`/launch`](/api-reference/launch/create) - Requires healthy RPC and optionally Pinata
* [`/claims/:tokenAddress`](/api-reference/claims/eligibility) - Requires healthy DB and RPC
