# Ten thousand lookups, one request, one webhook.

> Send up to 10,000 lookups in one async Dizo batch, quote it with a dry run, get a signed webhook on completion and download results as JSONL or CSV.

A batch runs any Dizo lookup endpoint over up to 10,000 items at the same per-item price, with misses still free. Quote it, submit it, and collect the results file when it is done.

## Highlights
- **Up to 10,000 items.** One `POST /v1/batch` call carries up to 10,000 request bodies for a single endpoint.
- **Same price per item.** Each item costs what the underlying endpoint costs. Misses are still free.
- **Quote first.** Add `"dry_run": true` to see the maximum credits before anything runs.
- **Signed webhook.** Get `batch.completed` with a `Dizo-Signature` header, retried with backoff for 24 hours.
- **JSONL or CSV.** Pick `format` and download from `results_url`. Results stay available for 7 days.
- **Free status checks.** `GET /v1/batch/{id}` returns status, hits and credits used at no cost.

## Steps
1. **Prepare the items** — Build one request body per row for a single lookup endpoint, such as `/v1/email/find`.
2. **Quote the job** — Submit with `"dry_run": true` to get `quote.credits_max` for free.
3. **Register a webhook** — Point `POST /v1/webhooks` or the batch's `webhook_url` at an HTTPS endpoint.
4. **Submit with a ceiling** — Send the batch with `max_credits` and an `Idempotency-Key` header.
5. **Wait for completion** — Verify the signed `batch.completed` event, or poll `GET /v1/batch/{id}` gently.
6. **Download and merge** — Fetch `results_url` within 7 days and join results back to your rows.

## APIs used
| API | Endpoint | Credits | Charged | Reference |
|---|---|---|---|---|
| Batch | `POST /v1/batch` | Same as each item | Per item, same rules | [docs](https://dizo.ai/docs/batch.md) |
| Batch status | `GET /v1/batch/{id}` | Free | Never | [docs](https://dizo.ai/docs/batch-get.md) |
| Webhooks | `POST /v1/webhooks` | Free | Never | [docs](https://dizo.ai/docs/webhooks.md) |
| Email finder | `POST /v1/email/find` | 1 credit | Only if found | [docs](https://dizo.ai/docs/email-find.md) |
| Person enrich | `POST /v1/people/enrich` | 2 credits (+1 email, +10 phone) | If matched | [docs](https://dizo.ai/docs/people-enrich.md) |
| Data feedback | `POST /v1/feedback` | Free (refunds credits) | Never | [docs](https://dizo.ai/docs/feedback.md) |


## What you will accomplish

Enriching one record is a request. Enriching eight thousand is a job, and jobs need different handling: you want one price up front, no rate-limit juggling, a clean way to know when it is finished and a single file to load back into your CRM, warehouse or spreadsheet. Looping over single lookups works for a few dozen rows. Past that, the loop becomes the hardest part of the project.

Dizo's batch endpoint is built for that. One `POST /v1/batch` call takes up to 10,000 request bodies for one lookup endpoint, runs them asynchronously, and tells you when it is done with a signed webhook. Each item is billed exactly as if you had called the endpoint directly, and items that find nothing are still free. This guide takes you from a raw list of rows to a merged results file, with the quote, ceiling and error handling that make it safe to run unattended.

## Prerequisites

You need a Dizo key with access to the lookup endpoint you plan to batch, and an HTTPS endpoint that can receive webhooks if you want push notification instead of polling. You get a live key when you [sign up](/signup); a `dz_test_` key returns synthetic data and never spends credits, which is the right way to rehearse the whole flow first.

You also need your input rows in a consistent shape. Decide which endpoint you are calling and map each row to that endpoint's request body. For the email finder, that means `first_name`, `last_name` and `company_domain`, or a `profile_url`, or a `person_id`. For person enrich, it can be an `email`, a `phone`, a profile URL or a name with a company. A batch runs one endpoint, so if you need two different lookups, run two batches. Keep a stable row id of your own alongside each item so you can join results back later.

## Step 1: Prepare the items

Clean the input before you spend anything on it. Trim whitespace, lowercase domains, strip `www.` and drop rows with nothing usable in them. Deduplicate on the identifier you are sending, because two identical rows mean two identical lookups. If some of these records are current customers or people who have opted out, add them to your [suppression list](/docs/suppression) first. Suppressed records are dropped from every lookup before billing, and the list itself is free.

Then choose the most specific identifier each row has, because it changes the odds of a match. A Dizo `person_id` from an earlier search is exact. A public profile URL is close to it. A name with a company domain is strong, and a name with only a company name adds one more step of resolution. For large inputs, split the file into chunks of 10,000 or fewer. Each chunk becomes its own batch, which also makes partial reruns easy.

## Step 2: Quote the job

Send the batch once with `"dry_run": true`. A dry run returns a cost quote and spends 0 credits. The batch response includes a `quote` object with `credits_max`, the most the job could cost if every item matched. For 2,500 email finder items at 1 credit each, `credits_max` is 2,500.

The maximum is the right number to budget against, because it is the worst case. Your real spend will be lower by however many items miss. If the quote is higher than you expected, the usual causes are duplicate rows, the wrong endpoint, or `include` options that add extra charges, such as asking person enrich for a phone at 10 more credits per number found. Fix those before you submit the real job.

## Step 3: Register a webhook

You can pass `webhook_url` on the batch itself, or register an endpoint once with `POST /v1/webhooks` and subscribe it to `batch.completed`, along with any other events you care about, such as `billing.cap_warning`. Webhook registration is free.

Verify every delivery. Each one carries a `Dizo-Signature` header with two parts: `t`, a Unix timestamp, and `v1`, a signature that is an HMAC-SHA256 of the timestamp, a dot and the raw body, using your signing secret. Compute it yourself and compare before trusting the payload. The secret is shown once when you create the webhook, so store it in your secrets manager, and rotate it with `POST /v1/webhooks/{id}/rotate` if it ever leaks. Failed deliveries are retried with backoff for 24 hours, so make your handler idempotent: processing the same `batch.completed` twice should do no harm.

## Step 4: Submit with a ceiling

Now send the real job: `endpoint`, `items`, optional `webhook_url`, optional `format` of `jsonl` or `csv`, and `max_credits`. Set `max_credits` at or just above the quoted `credits_max`, so a mistake in the item list cannot cost more than you approved. Add an `Idempotency-Key` header derived from the chunk's contents. If the submit call times out and you send it again, retries within 24 hours are never charged twice, so you will not start a duplicate job.

The response comes back immediately with a batch `id`, `status: "queued"`, the item count and the quote. `credits_used` is 0 at this point. Store the id next to your chunk so you can find the results later. If you run several chunks, keep a small table of chunk name, batch id, quote and status; it turns a rerun after a failure into a lookup instead of a guess, and it gives whoever approves the spend a clear record of what ran and what it cost.

## Step 5: Wait for completion

If you registered a webhook, wait for `batch.completed`, verify its signature and then fetch the job. If you prefer to poll, `GET /v1/batch/{id}` is free and returns `status`, `hits`, `results_url` and `credits_used`. Poll gently, every minute or so, rather than in a tight loop; the batch runs at its own pace and polling faster does not speed it up.

The completed status tells you what you paid. In the reference example, a job with 2,500 email finder items finished with 2,310 hits and 2,310 credits used: the 190 misses cost nothing. That gap between `credits_max` and `credits_used` is the free-miss rule working at scale.

## Step 6: Download, merge and report

Download `results_url` and load it. JSONL is easier for code, one JSON object per line; CSV is easier for spreadsheets and CRM imports. Results stay available for 7 days, so copy them into your own storage promptly rather than treating the link as permanent. Join each result back to your row id and write the new fields into your system of record.

Then close the loop on quality. If an email from the batch bounces or a phone number turns out to be disconnected, report it with `POST /v1/feedback`. Confirmed reports within 30 days of purchase are refunded to your balance, usually within an hour, and the correction is applied for every customer.

## Variations and common mistakes

From code, the flow above is the whole thing. From an AI agent over MCP, the same job is the `dizo_batch` tool; Dizo's agent rules tell agents to use batch for anything over 50 lookups and to dry-run before any job that may exceed about 100 credits, so a well-prompted agent will quote first and ask before submitting. In a workflow tool such as [n8n](/integrations/n8n), the submit and the webhook receiver become two separate workflows joined by the batch id. If what you really have is a CSV and you want new columns rather than raw results, the [CSV list guide](/guides/build-lead-list-from-csv) may fit better.

- Mixing endpoints in one batch. A batch runs one endpoint; split the job.
- Skipping deduplication, then paying twice for the same person.
- Submitting without `max_credits` or an idempotency key.
- Trusting webhook payloads without checking `Dizo-Signature`.
- Leaving results on `results_url` past the 7-day window.

## What a batch costs

A batch has no surcharge. You pay the underlying endpoint's rate per item, under the same charging rule, and status checks are free. Credits cost $0.025 at the smallest purchase size and fall to $0.021, $0.017, $0.013 and $0.010 as single purchases grow. The examples below use hypothetical match rates; check the [pricing page](/pricing) for tiers.

- **10,000 email finder items, 8,200 found:** 8,200 credits, or $205 at $0.025 or $139.40 at $0.017.
- **10,000 person enrich items, 7,000 matched:** 14,000 credits, or $238 at $0.017.
- **The same enrich job with email included, 6,000 emails found:** 14,000 + 6,000 = 20,000 credits, or $340 at $0.017.
- **5,000 company enrich items, 4,500 matched:** 4,500 credits, or $112.50 at $0.025.

## FAQ

### How many items can one batch hold?
Up to 10,000 request bodies. For larger inputs, split the file into chunks and submit one batch per chunk, each with its own idempotency key and `max_credits`.

### Is a batch cheaper than individual calls?
No, and it is not more expensive either. Each item costs the same as calling the endpoint directly, under the same charging rule, so misses are still free. The benefit is operational: one request, no rate-limit juggling and one results file.

### Can one batch call more than one endpoint?
No. The `endpoint` field takes a single lookup path, such as `/v1/email/find`. If you need emails and company profiles, run two batches.

### How long are results available?
Batch results stay available for 7 days at `results_url`. Download them and store them in your own system as soon as the job completes.

### How do I know the webhook really came from Dizo?
Check the `Dizo-Signature` header. Compute an HMAC-SHA256 of the timestamp, a dot and the raw body with your signing secret and compare it with the `v1` value before trusting the payload.

### What happens if my balance runs out mid-job?
Set `max_credits` to the quoted maximum and check `GET /v1/billing` before submitting, so the job fits your balance and caps. If an account cap is reached, calls stop with a 402 and a human needs to decide what to do next.
