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

# Quickstart Guide

> Start validating emails with Sanitize-Email API in under 5 minutes

## Get Your API Key

Before you can start validating emails, you'll need to get your API key from the Sanitize-Email dashboard.

<Steps>
  <Step title="Visit the Dashboard">
    Go to
    [https://app.sanitizeemail.com/api-key](https://app.sanitizeemail.com/api-key)
    to access your API key.
  </Step>

  <Step title="Copy Your API Key">
    Copy the API key from your dashboard - you'll need this for authentication.
  </Step>

  <Step title="Choose Your Plan">
    Select from subscription plans or use pay-as-you-go credits based on your
    needs.
  </Step>
</Steps>

## Make Your First Request

Once you have your API key, you can start validating emails immediately. Here's how to validate a single email address:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://base.sanitizeemail.com/v1/api/email-validation/ \
    -H "Content-Type: application/json" \
    -H "X-API-KEY: YOUR_API_KEY" \
    -d '{
      "emails": ["user@example.com"],
      "options": {
        "validate_smtp": true
      },
      "file_tag": "quickstart-test"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://base.sanitizeemail.com/v1/api/email-validation/",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "X-API-KEY": "YOUR_API_KEY",
      },
      body: JSON.stringify({
        emails: ["user@example.com"],
        options: {
          validate_smtp: true,
        },
        file_tag: "quickstart-test",
      }),
    },
  );

  const data = await response.json();
  console.log(data);
  ```

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

  url = "https://base.sanitizeemail.com/v1/api/email-validation/"
  headers = {
      "Content-Type": "application/json",
      "X-API-KEY": "YOUR_API_KEY"
  }
  data = {
      "emails": ["user@example.com"],
      "options": {
          "validate_smtp": True
      },
      "file_tag": "quickstart-test"
  }

  response = requests.post(url, headers=headers, json=data)
  result = response.json()
  print(result)
  ```
</CodeGroup>

## Understanding the Response

The API will return detailed validation results for each email:

```json theme={null}
{
  "results": [
    {
      "email": "user@example.com",
      "status": "valid",
      "normalized_email": "user@example.com",
      "is_disposable": false,
      "is_role_account": false,
      "reason": {
        "format": {
          "status": "pass",
          "reason": "Valid email format"
        },
        "dns": {
          "status": "pass",
          "reason": "Domain exists"
        },
        "mx": {
          "status": "pass",
          "reason": "MX records found"
        },
        "smtp": {
          "status": "pass",
          "reason": "SMTP server responds"
        }
      },
      "mx_records": ["mx1.example.com", "mx2.example.com"]
    }
  ],
  "stats": {
    "total": 1,
    "valid": 1,
    "invalid": 0,
    "disposable": 0,
    "role_accounts": 0
  },
  "credits_used": 1,
  "remaining_processing": 0,
  "batch_size": 1
}
```

## Bulk Email Validation

You can validate multiple emails in a single request for efficient bulk processing:

```json theme={null}
{
  "emails": ["user1@example.com", "user2@domain.com", "test@company.org"],
  "options": {
    "validate_smtp": true
  },
  "file_tag": "bulk-validation"
}
```

## Validation Options

<AccordionGroup>
  <Accordion title="SMTP Validation">
    Set `validate_smtp: true` to perform real-time SMTP checks. This provides
    the most accurate validation but takes longer.
  </Accordion>

  <Accordion title="File Tags">
    Use `file_tag` to organize and identify your validation batches for easier
    tracking.
  </Accordion>

  <Accordion title="Rate Limits">
    The API has rate limits to ensure optimal performance. Check the response
    headers for rate limit information.
  </Accordion>
</AccordionGroup>

## Error Handling

Always check for errors in your API responses:

* **400**: Bad request - Invalid payload format
* **401**: Unauthorized - Missing or invalid API key
* **403**: Forbidden - API key is inactive
* **429**: Rate limit exceeded

<Warning>
  Keep your API key secure and never expose it in client-side code. Store it as
  an environment variable or in a secure configuration file.
</Warning>

## Next Steps

<CardGroup cols={2}>
  <Card title="Explore API Reference" icon="book" href="/api-reference/introduction">
    Dive deeper into our complete API documentation
  </Card>

  <Card title="Email Validation Endpoint" icon="envelope-circle-check" href="/api-reference/endpoint/validate_emails">
    Learn about all validation parameters and response fields
  </Card>
</CardGroup>

## Need Help?

<CardGroup cols={2}>
  <Card title="Contact Support" icon="envelope">
    **Email**: [support@sanitizeemail.com](mailto:support@sanitizeemail.com)
  </Card>

  <Card title="Visit Our Website" icon="globe">
    **URL**: [sanitizeemail.com](https://sanitizeemail.com)
  </Card>
</CardGroup>
