Know the limits
Chunking into batches
Instead of sending one NPI per request, group NPIs into batches of100 and call the bulk endpoint. This reduces HTTP overhead and maximizes throughput.
Check credits before large jobs
Before you enqueue a large number of NPIs, verify you have enough credits:3 per NPI for personal) and refunded for those without an email. See GET /credits.
Queue and worker pattern
At high volume, enqueue batches on your side and consume them with a worker pool. This isolates Dmand AI’s limits from your application traffic and prevents data loss during traffic spikes. Recommended worker behavior:- Read a batch from your queue.
- Send the batch to Dmand AI with a unique
Idempotency-Keyfor safe retries. - On HTTP 202, store the returned
batch_idandrequest_idvalues, and mark the batch as submitted. - If the request is rejected for rate limiting, pause the worker briefly and re-queue the batch.
- On 5xx errors, retry with exponential backoff (for example, 1s, 2s, 4s, 8s) up to a maximum number of attempts.
Webhook mode for large jobs
For large background jobs, setwebhook.mode to batch so you receive a single webhook when the entire batch completes. This reduces webhook traffic and simplifies bookkeeping. Use real-time only when you need per-NPI UI updates, such as in an interactive workflow.
Live lookup latency
Dmand returns emails that were validated within the last30 days. If no stored email exists, Dmand runs a live enrichment lookup, which can take up to about 15 minutes before timing out. Design your UI to show a pending state while live lookups are in progress, and rely on webhooks or polling to update the record when the result is ready.
Credit planning
Credits are charged only for NPIs where an email is found. Holds for not-found or failed NPIs are refunded. Each found email costs1 credit for any, 1 for professional, and 3 for personal. See Credits or contact hello@dmand.ai for plan details.
- Fill batches close to
100NPIs when possible. - Put shared context (tenant, job ID) in
custom_data. Results come back per NPI, so you can split them bynpi. - Use webhooks rather than polling so you don’t spend quota checking status.
- Make your webhook handler idempotent by deduplicating on
request_id, because Dmand retries delivery when your endpoint returns a non-2xx response.