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

# Create Domain Monitor

> Create a new domain expiration monitor to prevent accidental domain loss

## Request Body

<ParamField body="domain" type="string" required>
  Domain to monitor (e.g., "example.com"). Do not include subdomains or protocol.
</ParamField>

<ParamField body="alert_days" type="number" default="60">
  Number of days before expiration to trigger alerts. Recommended: 60 for critical domains, 30 for others.
</ParamField>

<ParamField body="service_id" type="string">
  Optional service ID to link this monitor to
</ParamField>

<ParamField body="notification_channels" type="array">
  Array of notification channel IDs to alert on domain expiration warnings
</ParamField>

## Response

Returns the created domain monitor object with initial WHOIS lookup results.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://kodostatus.com/api/v1/domain-monitors" \
    -H "X-API-Key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "domain": "example.com",
      "alert_days": 60
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://kodostatus.com/api/v1/domain-monitors', {
    method: 'POST',
    headers: {
      'X-API-Key': 'your_api_key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      domain: 'example.com',
      alert_days: 60
    })
  });
  const domain_monitor = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "dom_abc123",
    "domain": "example.com",
    "alert_days": 60,
    "enabled": true,
    "last_checked_at": "2024-01-15T10:30:00Z",
    "registration": {
      "registrar": "Cloudflare, Inc.",
      "created_date": "2020-01-15T00:00:00Z",
      "expiry_date": "2025-01-15T00:00:00Z",
      "days_until_expiry": 365,
      "nameservers": ["ns1.cloudflare.com", "ns2.cloudflare.com"]
    },
    "created_at": "2024-01-15T10:30:00Z"
  }
  ```
</ResponseExample>

<Note>
  Domain WHOIS lookups are performed daily. Some registrars may redact WHOIS information for privacy-protected domains.
</Note>
