# B2B data you can wire up in an afternoon.

> A REST API for people, company, email and phone data with an OpenAPI 3.1 spec, stable error codes, Idempotency-Key retries and test keys that never spend credits.

One base URL, JSON in and out, an OpenAPI 3.1 spec, errors that tell you how to fix them, and retries that are never charged twice. Build against test keys now, go live when you sign up.

## Highlights
- **OpenAPI 3.1 spec.** Generate a typed client from `https://dizo.ai/openapi.json`. Every docs page also has a Markdown twin.
- **Safe retries.** Send an `Idempotency-Key` header on every POST. Retries within 24 hours are **never charged twice**.
- **Errors with a fix.** Branch on `error.code`, read the plain-English `error.fix`, and retry only when `error.retryable` is true.
- **Test keys.** `dz_test_` keys return synthetic data and never spend credits, so CI can hit the real API shape.
- **Cost in every response.** Read `x-dizo-credits-used` and `x-dizo-credits-remaining` headers, or quote any call first with `"dry_run": true`.
- **Async at scale.** Batch up to 10,000 lookups per job with a signed `batch.completed` webhook and JSONL or CSV results.

## Steps
1. **Build on a test key** — Point your client at `https://api.dizo.ai/v1` with a `dz_test_` key and wire up the response shapes.
2. **Read your key's limits** — Call `GET /v1/me` at start-up for scopes, allowed endpoints, remaining budget and rate limits.
3. **Harden the calls** — Add `Idempotency-Key`, `max_credits` and error handling that branches on `error.code`.
4. **Go live with caps** — Swap in a scoped `dz_live_` key with daily and monthly caps when you are ready.

## APIs used
| API | Endpoint | Credits | Charged | Reference |
|---|---|---|---|---|
| Key info | `GET /v1/me` | Free | Never | [docs](https://dizo.ai/docs/me.md) |
| Email finder | `POST /v1/email/find` | 1 credit | Only if found | [docs](https://dizo.ai/docs/email-find.md) |
| Company enrich | `POST /v1/companies/enrich` | 1 credit | If matched | [docs](https://dizo.ai/docs/company-enrich.md) |
| Batch | `POST /v1/batch` | Same as each item | Per item, same rules | [docs](https://dizo.ai/docs/batch.md) |
| Webhooks | `POST /v1/webhooks` | Free | Never | [docs](https://dizo.ai/docs/webhooks.md) |
| API keys | `POST /v1/keys` | Free | Never | [docs](https://dizo.ai/docs/keys.md) |


## What developers actually get asked to build

Most data work lands on a developer as a ticket that sounds small. Enrich new signups with company size. Fill the job title on inbound forms. Find work emails for the event list before the campaign goes out. Pipe contact data into the warehouse every night. None of these are hard in principle. They get hard because the data vendor was chosen for a sales team, so the API is an afterthought: inconsistent response shapes, vague errors, no way to know what a call costs until the invoice arrives.

The slow parts are rarely the happy path. They are retries that double-charge, timeouts you cannot safely repeat, a 500 that might mean the record is missing or the service is down, and a rate limit you discover in production. This page covers how Dizo handles each of those, and which endpoints to reach for on the jobs that usually land on your desk.

## The shape of the API

Everything lives under one base URL, `https://api.dizo.ai/v1`, and authenticates with `Authorization: Bearer dz_live_...`. Requests and responses are JSON. The full contract is published as an OpenAPI 3.1 document at `https://dizo.ai/openapi.json`, so you can generate a typed client instead of hand-writing request models. Every docs page also has a Markdown twin if you append `.md`, which is useful when you want to paste a reference into a code assistant. The complete list of 29 endpoints is on the [API index](/apis).

Billable endpoints share a small set of conventions. Each accepts `dry_run` and `max_credits` in the body. Each response carries `credits_used`, and the `x-dizo-credits-used` and `x-dizo-credits-remaining` headers tell you the cost and the balance after the call. Lookups that find nothing cost nothing: the email finder returns `404 not_found` and charges zero, and searches charge only for results returned. Free endpoints include count, batch status, webhooks, suppression, key info, billing reads and pricing.

## Five workflows, endpoint by endpoint

These are the requests you will most often wire up. Costs are in credits, and a credit costs between $0.025 and $0.010 depending on purchase size.

For anything above roughly 50 lookups, send the items to `POST /v1/batch` instead of looping. A batch takes up to 10,000 request bodies for one lookup endpoint, runs asynchronously and charges the same per-item price as the underlying call, with misses still free. Poll `GET /v1/batch/{id}`, which is free, or wait for the `batch.completed` webhook. Results stay available for seven days, so copy them into your own storage.

- **Signup enrichment:** `POST /v1/people/by-email` with the signup address (2 credits, only if found), then `GET /v1/companies/{domain}` for the employer (1 credit, only if found).
- **Form fill:** `POST /v1/companies/enrich` with the email domain to backfill headcount, industry and revenue band (1 credit if matched).
- **Contact lookup in an internal tool:** `POST /v1/email/find` with name and `company_domain` (1 credit, only if found), plus `POST /v1/phone/find` when a rep needs a cell; it returns up to three numbers, each with a type and a `dnc` flag (10 credits, only if found).
- **Bounce recovery:** `POST /v1/people/enrich` with a bounced address to find where the person works now (2 credits if matched). Dizo has no list-verification endpoint.
- **Nightly warehouse sync:** `POST /v1/batch` against person or company enrich, with a webhook on completion.

## Idempotency and retries

Network calls fail in the worst possible place: after the server did the work and before your client saw the response. If that call costs money, a naive retry pays twice. Dizo solves this with the `Idempotency-Key` header. Send a unique value on every POST, and any retry with the same key within 24 hours returns the original result and is never charged again. Use something deterministic per logical operation, such as a hash of the signup id and the endpoint, rather than a random value generated inside the retry loop.

Pair that with a retry policy that respects the API rather than guessing. Failed responses include `error.retryable` and, where relevant, `error.retry_after` in seconds. Retry only when `retryable` is true, wait the stated time, and cap your attempts. Everything else is a bug in your request, a budget limit or a missing record, and repeating it will not help. Our [idempotency keys](/features/idempotency-keys) page walks through key design in more detail.

## Errors you can branch on

Every error returns a stable `error.code` and a plain-English `error.fix`. Write your handling against the code, never against the message text, and log the fix so whoever is on call knows what to change. Two codes you will meet early: `404 not_found` from lookups that found nothing, which is normal and free, and `402 monthly_cap_reached` when the account hits its monthly spend ceiling. The first belongs in your happy path. The second should stop the job and alert a human, not trigger a retry storm.

Log the `x-dizo-request-id` header on every response. If an email bounces or a number is disconnected, send that request id to `POST /v1/feedback` with an issue such as `bounced` or `disconnected`. Confirmed reports made within 30 days of purchase are refunded to your balance, usually within an hour. The [error codes](/features/error-codes) page lists the codes and how to handle each one in a client.

## Rate limits, keys and environments

Call `GET /v1/me` when your service starts. It is free and returns the key's scopes, endpoint allow-list, `max_credits_per_request`, remaining daily and monthly credits and its rate limits, including requests per second and concurrency. Size your worker pool from those numbers instead of hard-coding them. The free count endpoint has its own limit of five requests per second per key, which matters if you use it for live previews in a UI.

Treat keys like any other production secret. Create one key per service with `POST /v1/keys`, give it only the `data:read` scope and an allow-list of the paths it calls, and set daily and monthly caps. The secret is returned once, so put it straight into your secret manager. Use `dz_test_` keys in development and CI: they return synthetic data in the real response shapes and never spend credits, so your integration tests exercise the same parsing code as production.

## Webhooks and async jobs

Batches, lists, monitors and job-change signals are asynchronous. Register an endpoint once with `POST /v1/webhooks` and choose events such as `batch.completed`, `list.completed`, `monitor.new_results`, `signal.job_change` and the billing alerts. Each delivery carries a `Dizo-Signature` header in the form `t=UNIX_TIME,v1=HMAC`, where the HMAC is SHA-256 over the timestamp, a dot and the raw body, keyed with your signing secret.

Verify the signature against the raw request body before parsing JSON, reject stale timestamps, and return a 2xx quickly. Deliveries are retried with backoff for 24 hours, so your handler must be idempotent: store the event and process it from a queue rather than doing the work inline. The signing secret is shown once and can be rotated with `POST /v1/webhooks/{id}/rotate`. See [webhooks](/docs/webhooks) for the full event list.

## What it costs to run in production

Suppose your product gets 3,000 signups a month and you enrich each one. Assume, hypothetically, that 70% of addresses match a person and 80% of domains match a company. Email to profile costs 2,100 × 2 = 4,200 credits. Domain to company costs 2,400 × 1 = 2,400 credits. That is 6,600 credits a month, or $165 at the $0.025 pay-as-you-go rate.

Buying in larger blocks lowers the rate. A single $500 purchase is priced at $0.021 and buys about 23,800 credits, which covers this workload for roughly three and a half months. Credits are valid for 12 months. Add a quarterly pass that re-identifies 1,000 bounced contacts with person enrich, and at a hypothetical 60% match rate that is 1,200 credits more. Use `dry_run` on any new job to get the exact figure before it runs, and check the [pricing](/pricing) page or `GET /v1/pricing`, which needs no auth, for current tiers.

## Guardrails worth setting on day one

Put three ceilings in place before your first live call. Send `max_credits` on every billable request, so a bug in a loop cannot spend more than one request's worth. Give each service key a daily and monthly credit cap. Set an account-wide `monthly_cap_usd` with `PUT /v1/billing/limits` and alert emails at 50%, 80% and 100%. Auto-refill, if you turn it on, never pushes the month past that cap.

Then load your suppression list. Domains, emails and person ids sent to `POST /v1/suppression` are dropped from every search and lookup before billing, which keeps internal test accounts and existing customers out of results. If your service has no reason to touch money, leave billing write scopes off its key, and consider locking billing so no key can change it. [Sign up](/signup) for live keys and build against test keys in the meantime.

## FAQ

### Is there an official SDK?
The facts we publish are the REST API and its OpenAPI 3.1 spec at https://dizo.ai/openapi.json. Most teams generate a typed client from that spec with their usual OpenAPI tooling, or call the endpoints directly with any HTTP library.

### What happens if my retry fires after the first request succeeded?
If both requests carry the same Idempotency-Key and the retry arrives within 24 hours, you get the original result and are not charged again. Without the header, the retry is treated as a new request and billed if it finds data.

### Do I pay for lookups that return nothing?
No. Lookups that return no email, phone or person are free, and searches charge only for the results returned. Person and company enrich charge only if matched, and counts are always free.

### How do I test without spending credits?
Use a key that starts with dz_test_. Test keys return synthetic data in the same response shapes as live keys and never spend credits. The playground shows the same sandbox data in the browser.

### How should my code handle a 402?
A 402 with monthly_cap_reached means the account hit its monthly spend ceiling. Stop the job, record where it stopped, and alert a person. Retrying will not succeed until the cap is raised or the month rolls over.

### Can I call Dizo from a code assistant while I build?
Yes. Connect an MCP client such as Claude Code or Cursor to https://mcp.dizo.ai/mcp and it can call every API as a tool, which is handy for exploring response shapes. MCP connections default to data:read and a 500-credit per-call limit.
