# Ten thousand lookups, one request, one webhook.

> Send up to 10,000 lookups to any Dizo endpoint in one async job. Get a quote up front, a webhook when it finishes and results as JSONL or CSV. Misses stay free.

`POST /v1/batch` runs any lookup endpoint over up to 10,000 items asynchronously. You pay the same per-item price as single calls, misses are still free, and results arrive as a file.

## Highlights
- **Up to 10,000 items.** Pass an `endpoint` such as `/v1/email/find` and an `items` array of request bodies.
- **Same price, same rules.** Each item costs what the underlying endpoint costs, and **misses are still free**.
- **Quote in the response.** The job returns `quote.credits_max` when queued. Add `dry_run` for a quote that spends nothing.
- **Webhook or poll.** Get `batch.completed` at your `webhook_url`, or poll `GET /v1/batch/{id}` for free.
- **JSONL or CSV.** Choose the result `format`. The file is linked from `results_url` and kept for 7 days.
- **Hard ceiling.** `max_credits` caps the whole job, so a bad input file cannot run up the bill.

## Steps
1. **Prepare items** — Build one request body per row, using the same fields as the single-call endpoint.
2. **Quote the job** — Send the batch with `"dry_run": true` to see the maximum credits.
3. **Submit with a ceiling** — Post again with `max_credits`, a `webhook_url`, a `format` and an `Idempotency-Key`.
4. **Collect results** — On `batch.completed`, download the file from `results_url` within 7 days.

## 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) |
| Email finder | `POST /v1/email/find` | 1 credit | Only if found | [docs](https://dizo.ai/docs/email-find.md) |
| Webhooks | `POST /v1/webhooks` | Free | Never | [docs](https://dizo.ai/docs/webhooks.md) |


## What a batch job is

Most Dizo endpoints take one input and return one answer. That works well for a rep looking up a single contact or an agent handling a single request. It works badly for a spreadsheet of 8,000 rows, a nightly CRM sync or a warehouse table that needs a company profile on every record. Looping over single calls means managing rate limits, retries, partial failures and a long-running process that has to stay alive until the end.

A batch job moves that work to Dizo. You send one request to `POST /v1/batch` naming the endpoint to run and an array of up to 10,000 request bodies. Dizo queues the job, works through it asynchronously, and tells you when it is done. You collect one results file instead of thousands of responses.

Dizo's agent rules make the threshold explicit: use batch for more than 50 lookups. Below that, single calls are simpler. Above it, batch is cheaper to operate and easier to reason about.

## The request

A batch request has two required fields and four optional ones. The shape is deliberately close to the single-call endpoints, so moving from a loop to a batch is mostly a matter of wrapping the bodies you already build.

- **endpoint:** any lookup endpoint path, for example `/v1/email/find`, `/v1/phone/find`, `/v1/people/enrich` or `/v1/companies/enrich`.
- **items:** up to 10,000 request bodies, each exactly what you would send to that endpoint on its own.
- **webhook_url:** notified with `batch.completed` when the job finishes.
- **format:** `jsonl` or `csv` for the results file.
- **dry_run:** return a cost quote and spend nothing.
- **max_credits:** a hard ceiling on what the whole job may spend.

## The job lifecycle

When you submit a job, the response comes back immediately with an `id` such as `bat_3Jx8`, a `status` of `queued`, the number of `items`, a `quote` with `credits_max` and `credits_used: 0`. The quote is the most the job could cost if every item were a hit. For an email finder batch of 2,500 people, `credits_max` is 2,500.

While the job runs, `GET /v1/batch/{id}` returns its status, the hit count so far and, once complete, a `results_url` and the final `credits_used`. Polling is free, so a workflow tool without a public webhook endpoint can simply check every few minutes. If you supplied a `webhook_url` or registered one for the `batch.completed` event, Dizo posts to it when the job finishes, signed with the `Dizo-Signature` header like every other [webhook](/features/webhooks).

Results stay available for seven days. Download the file and load it into your own storage promptly; do not treat `results_url` as a permanent archive.

## Pricing: the same rules as single calls

Batch adds no surcharge and offers no special discount. Each item is billed exactly as if you had called the endpoint directly, and every charging rule carries over. Email finder items cost 1 credit only if found. Phone finder items cost 10 credits only if found. Person enrich items cost 2 credits if matched. Company enrich items cost 1 credit if matched.

Here is a worked example. A team has 25,000 contacts that need work emails. That is more than one batch holds, so they split it into three jobs: 10,000, 10,000 and 5,000. The combined quote is 25,000 credits, the maximum if every lookup hits. Suppose 70 percent are found. The real bill is 17,500 credits: $437.50 at the pay-as-you-go rate, $297.50 at the Growth rate of $0.017 and $227.50 at the Scale rate of $0.013. The 7,500 misses cost nothing.

Because the price per credit is set by the size of each purchase, a team planning a large backfill can check which tier a single top-up would land in before running it. The [pricing page](/pricing) lists the tiers.

## Guardrails for large jobs

Large jobs are where spending mistakes are most expensive, so batch supports every control Dizo has. Start with `"dry_run": true` on the exact request you intend to send. The quote tells you the ceiling without spending anything. Then submit the real job with `max_credits` set at or just above the quote, so a malformed file or an accidental duplicate cannot cost more than you planned.

Send an `Idempotency-Key` header on the submit call. If your network drops and your code retries, a retry with the same key within 24 hours is never charged twice. That matters more for a 10,000-item job than for any single call. See [idempotency keys](/features/idempotency-keys) for how to generate and reuse them.

Finally, rely on account and key limits as backstops. A key used for nightly batch syncs can carry its own daily and monthly credit caps, and the account monthly cap stops everything with a `402 monthly_cap_reached` if it is ever reached.

## Batch from agents

Over MCP, `dizo_batch` lets an agent submit a job directly. This is the right tool when a user hands an agent a file and says "find emails for all of these" or "clean this list". Submitting a batch rather than looping keeps the agent's context small: it sends one call, receives a job id, and checks back later.

A well-behaved agent quotes first, tells the user the maximum cost and the likely cost at a realistic hit rate, and waits for approval before submitting. It should then report the final hit count and `credits_used` when the job completes. MCP connections default to a 500-credit per-call limit, so a large batch from an agent will need that limit raised deliberately in the console. That is a feature: big jobs should require a human decision.

## Splitting and scheduling large files

A file bigger than 10,000 rows needs more than one job. Split it into chunks of up to 10,000, submit each chunk as its own batch with its own `Idempotency-Key`, and store every job id next to the chunk it came from. If one chunk fails validation or hits a cap, you only rerun that chunk rather than the whole file.

Deduplicate before you split. Two rows for the same person in a finder batch are two lookups, and if both are found, both are charged, so a duplicate costs real credits. A quick pass on email address, or on name plus domain, is usually enough.

For recurring work, such as a nightly enrichment of new CRM records, submit only the rows added or changed since the last run. A small daily batch is cheaper and faster to review than a monthly backfill of everything, and it keeps each job's quote easy to sanity-check before it is approved. Run the first few jobs with a test key, which returns synthetic data and spends nothing, to confirm your file format and join logic before any live credits are involved.

## Working with results

Pick the format for where the data is going. [JSONL](/glossary/jsonl), one JSON object per line, preserves nested fields such as phone arrays and company objects and streams well into warehouses and scripts. CSV is easier to open in a spreadsheet or import into a CRM, at the cost of flattening nested data.

Keep your own mapping from each submitted item to its source row, such as a CRM record id alongside the name and domain you sent, so you can join results back reliably. Check the joined output on a sample before writing it over existing fields. Treat misses as useful information: a row with no email found is a row you did not pay for and a candidate for a different approach, such as a phone lookup or a profile URL.

If any result turns out to be wrong, report it through `POST /v1/feedback`. Confirmed reports within 30 days of purchase are refunded automatically.

## When you do not need batch

Under about 50 lookups, single calls are simpler and return answers immediately, which matters for interactive use such as an agent answering a question in chat. Batch also does not replace search: to find new people or companies, use search or a list job, and use batch to enrich records you already have.

If you want to build a new list from a description or a CSV, with email, phone and company columns added and suppression applied, the [list builder](/features/list-builder) handles that end to end. Batch is the lower-level tool for running one endpoint over many inputs exactly as you specify them.

## FAQ

### How many lookups can one batch job hold?
Up to 10,000 items per job. For larger files, split them into several jobs and track each job id separately.

### Does batch cost more or less than single calls?
Neither. Each item costs the same as the underlying endpoint and follows the same rules, so email finder misses are still free and phone finder hits are still 10 credits each.

### How do I know when a batch is finished?
Pass a `webhook_url` to receive `batch.completed`, or poll `GET /v1/batch/{id}`, which is free. Both give you the `results_url` and final `credits_used`.

### How long are batch results kept?
Seven days. Download the JSONL or CSV file and store it yourself within that window.

### Which endpoints can I run in a batch?
Any lookup endpoint, such as email finder, phone finder, person enrich and company enrich. Set the path in the `endpoint` field.

### What stops a batch from overspending?
Quote it with `dry_run`, cap it with `max_credits`, and send an `Idempotency-Key` so retries are not charged twice. Per-key and account caps act as further backstops.
