# Email to company domain in bulk

> Send up to 1,000 email addresses and get the company domain for each, without scoring.

`POST https://mmkuffhlzytnmgraagbp.supabase.co/functions/v1/api-email-domain-bulk`

The list version of [Email to company domain](/email-domain), with the same rules and prices.

## Request

```bash
curl -X POST "https://mmkuffhlzytnmgraagbp.supabase.co/functions/v1/api-email-domain-bulk" \
  -H "Authorization: Bearer $PLATINUX_API_KEY" -H "Content-Type: application/json" \
  -d '{"emails": ["priya@mail.stripe.com", "jane.doe@gmail.com", "x@mailinator.com", "not-an-email"]}'
```

| Body field | Type | Required | Notes |
|---|---|---|---|
| `emails` | array of strings | Yes | 1 to 1,000. Duplicates are merged (case doesn't matter) |

Work emails, temporary emails and generic emails looked up in the last 30 days are answered at once. New generic emails are looked up in the background.

## Everything answered at once: `200`

```json
{ "status": "complete", "total": 3, "found": 2, "not_found": 0, "temporary": 1, "credits_charged": 0,
  "rejected": [ { "email": "not-an-email", "reason": "invalid_email" } ],
  "results": [
    { "email": "priya@mail.stripe.com", "type": "work", "status": "found", "domain": "stripe.com", "credits_charged": 0 },
    { "email": "jane.doe@gmail.com", "type": "personal", "status": "found", "domain": "acme.com", "cached": true, "credits_charged": 0 },
    { "email": "x@mailinator.com", "type": "temporary", "status": "temporary_email", "domain": null, "credits_charged": 0,
      "message": "This is a temporary (disposable) email address, so there is no company domain." } ] }
```

## New generic emails to look up: `202`

```json
{ "status": "processing", "batch_id": "481c589e-…", "total": 3, "pending": 2, "rejected": [], "check_after_seconds": 15 }
```

Then check every `check_after_seconds` until `status` is `complete`. Each check also moves the lookups along.

```bash
curl "https://mmkuffhlzytnmgraagbp.supabase.co/functions/v1/api-email-domain-bulk?batch_id=481c589e-…&page=1" -H "Authorization: Bearer $PLATINUX_API_KEY"
```

```json
{ "status": "complete", "batch_id": "481c589e-…", "total": 3, "finished": 3, "processing": 0, "found": 2, "not_found": 1, "credits_charged": 10,
  "results": [
    { "email": "jane.doe@gmail.com", "type": "personal", "status": "found", "domain": "acme.com", "cached": false, "credits_charged": 10 },
    { "email": "someone@gmail.com", "type": "personal", "status": "not_found", "domain": null, "cached": false, "credits_charged": 0 },
    { "email": "lee@asana.com", "type": "work", "status": "found", "domain": "asana.com", "credits_charged": 0 } ],
  "page": 1, "pages": 1 }
```

`202` while running, `200` when complete. 100 results per page.

## Result fields

| Field | Values |
|---|---|
| `type` | `work` · `personal` (a generic email such as Gmail or Outlook) · `temporary` |
| `status` | `processing` · `found` · `not_found` · `temporary_email` · `failed` (a data source kept failing; free) · `insufficient_credits` |
| `domain` | The company's main domain, or `null` |
| `cached` | Generic emails only: `true` when the answer came from a lookup in the last 30 days |
| `credits_charged` | 10 for a new generic email that was found, otherwise 0 |

## Credits

**10 per generic email newly found.** Work, temporary, not-found and recently looked-up emails are free. Credits for every new generic email are checked up front; if the balance is short, nothing starts (`402`).

## Errors

| HTTP | `error` | When |
|---|---|---|
| 400 | `invalid_input` | `emails` missing or empty, or none valid (`reason: none_valid`) |
| 400 | `too_many_emails` | More than 1,000 emails |
| 401 | `unauthorized` | Missing, wrong or revoked key |
| 402 | `insufficient_credits` | Balance below the most the lookup can cost |
| 404 | `batch_not_found` | Wrong `batch_id`, or another account's batch |
