Skip to main content
When you embed Dmand AI in a product with many users, enrichment requests can spike. This page shows how to batch NPIs, stay within the default limits, and queue work so your integration stays reliable at scale.

Know the limits

Chunking into batches

Instead of sending one NPI per request, group NPIs into batches of 100 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:
Response:
Make sure your balance covers the batch: credits are held at submit for every NPI (up to 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:
  1. Read a batch from your queue.
  2. Send the batch to Dmand AI with a unique Idempotency-Key for safe retries.
  3. On HTTP 202, store the returned batch_id and request_id values, and mark the batch as submitted.
  4. If the request is rejected for rate limiting, pause the worker briefly and re-queue the batch.
  5. 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, set webhook.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 last 30 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 costs 1 credit for any, 1 for professional, and 3 for personal. See Credits or contact hello@dmand.ai for plan details.
  • Fill batches close to 100 NPIs when possible.
  • Put shared context (tenant, job ID) in custom_data. Results come back per NPI, so you can split them by npi.
  • 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.