# Email Verification API Reference

> Restricted API reference — workspace-admin access only. These operations are not part of the general public API offer or headline endpoint count.

### What it does

Validate deliverability for a single address or a batch: syntax, domain and MX checks, mailbox verification, catch-all and disposable detection, with a clear status per address.

### Use cases

- Scrub a list before a send to protect domain reputation and keep bounce rates low.
- Verify emails at the point of form submission to stop typos and throwaway addresses.
- Re-verify a dormant database before restarting outreach on it.

### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `email` | string | Single email address to verify (for single verification) |
| `emails` | string[] | Array of email addresses to verify (max 10,000 for batch) |
| `callback_url` | string | Webhook URL to receive results when batch verification completes (optional) |
| `job_id` | string | Job ID for checking batch verification status |

### Response Schema

_Complete documented fields for this section, with nested notation preserved. Endpoint-specific envelopes, availability and additional fields are described under each endpoint below._

| Field | Notes |
|-------|-------|
| status (valid, invalid, catch-all, risky, unknown) | |
| email | |
| is_free_email | |
| is_role_based | |
| is_disposable | |
| mx_records[] | |
| smtp_result | |
| catch_all | |
| job_id (batch) | |
| progress_pct (batch) | |
| results[] (batch) | |

**Illustrative Example Response (synthetic, not a complete endpoint schema):**

```json
{
  "data": {
    "status": "string",
    "email": "user@example.com",
    "is_free_email": false,
    "is_role_based": false,
    "is_disposable": false,
    "mx_records[]": "string",
    "smtp_result": "string",
    "catch_all": "string",
    "job_id": "abc123",
    "progress_pct": "string",
    "results[]": "string"
  }
}
```

### POST /emails/verify/single — Verify Single Email

Synchronous single-email verification. Returns the result inline (no polling needed). Costs 1 credit. Checks: syntax, disposable domain, MX records, SMTP mailbox probe, catch-all detection, free/role-based flags. Typical response time: 2–8 seconds.

**Example Request Body:**

```json
{
  "email": "john@example.com"
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/emails/verify/single",
  "method": "POST",
  "body": {
    "email": "john@example.com"
  }
}'
```

### POST /emails/verify — Verify Emails (Batch)

Submit a batch of up to 10,000 emails for verification. Returns a job_id to poll for results. Each email costs 1 credit. Supports optional callback_url for webhook notification on completion. Verification checks: syntax, disposable domain, MX records, SMTP mailbox probe, catch-all detection, and free/role-based email flagging.

**Example Request Body:**

```json
{
  "emails": [
    "john@example.com",
    "jane@acme.co",
    "test@mailinator.com"
  ],
  "callback_url": "https://your-app.com/webhooks/email-verified"
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/emails/verify",
  "method": "POST",
  "body": {
    "emails": [
      "john@example.com",
      "jane@acme.co",
      "test@mailinator.com"
    ],
    "callback_url": "https://your-app.com/webhooks/email-verified"
  }
}'
```

### POST /emails/verify/status — Check Verification Status

Poll the status of a verification job. Returns progress percentage and completed results. Results include status (valid, invalid, catch-all, risky, unknown) and details (MX records, free email flag, role-based flag, SMTP result). Free — does not consume credits.

**Example Request Body:**

```json
{
  "job_id": "your-job-id-here"
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/emails/verify/status",
  "method": "POST",
  "body": {
    "job_id": "your-job-id-here"
  }
}'
```

