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

# Email Validation

> Validate email addresses, run bulk validation jobs, and inspect credits with the MailGlyph Python SDK.

Use a **secret key** client for Email Validation.

```python theme={null}
from mailglyph import MailGlyph

client = MailGlyph("sk_your_secret_key")
```

## Validate one address

```python theme={null}
result = client.verification.validate("user@example.com")

print(result.valid)
print(result.validation_method)
print(result.smtp_status)
print(result.credits_consumed)
print(result.reasons)
```

`client.emails.verify(email)` is also available as a convenience method for single-address validation.

## Handle typo suggestions

```python theme={null}
result = client.verification.validate("user@gmial.com")

if result.is_typo and result.suggested_email:
    print("Did you mean:", result.suggested_email)
```

## Create a bulk validation job

```python theme={null}
job = client.verification.create_bulk(
    "emails.csv",
    content_type="text/csv",
)

print(job.id)
print(job.status)
print(job.reserved_credits)
```

## List and poll jobs

```python theme={null}
jobs = client.verification.list_bulk(limit=20, status="COMPLETED")
job = client.verification.get_bulk(job.id)

print(jobs.next_cursor)
print(job.status, job.ready_for_download)
```

If a job pauses because more credits are required, continue it after adding credits:

```python theme={null}
if job.status == "ACTION_REQUIRED":
    job = client.verification.continue_bulk(job.id)
```

## Download results

```python theme={null}
if job.ready_for_download:
    csv_bytes = client.verification.download_bulk(
        job.id,
        filter="valid",
        format="csv",
    )
    print(len(csv_bytes))
```

Download filters are `all`, `valid`, `invalid`, `unknown`, and `catchall`. Filtered downloads are CSV only. XLS is available only when `filter` is `all`.

## Delete a job

```python theme={null}
deleted = client.verification.delete_bulk(job.id)

print(deleted.refunded_credits)
```

Jobs can be deleted only when they are not actively uploading or processing.

## Check credits

```python theme={null}
credits = client.verification.credits()
ledger = client.verification.credit_ledger(limit=25)

print(credits.balance, credits.low_credits)
print(len(ledger.items), ledger.next_cursor)
```

## Async usage

`AsyncMailGlyph` exposes the same Email Validation methods:

```python theme={null}
from mailglyph import AsyncMailGlyph


async def run() -> None:
    async with AsyncMailGlyph("sk_your_secret_key") as client:
        result = await client.verification.validate("user@example.com")
        print(result.valid)
```

See full endpoint details in the [Email Validation API reference](https://docs.mailglyph.com/api-reference/verifications/verifyEmail.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.