custom_data.
1. Submit asynchronously
When a user requests enrichment, submit the NPI (or up to100 NPIs). The API responds with HTTP 202 immediately.
2. Store batch and request IDs
Both single and bulk submits return abatch_id and a requests array. Persist these so you can poll or reconcile later:
3. Handle webhooks
Withmode: "real-time", your endpoint receives one POST per NPI as it resolves, so you can update your UI progressively. With mode: "batch", you receive one webhook when the entire batch completes. Your handler should:
- Parse the JSON payload.
- Read
custom_datato find the tenant and user. - For each item in
data, update the record bynpiusing itsstatusand email fields. - Return a
2xxstatus quickly.
app.py
request_id. If your endpoint returns a non-2xx response, Dmand retries delivery with backoff. See Webhooks for the payload format.
4. Match results with custom_data
custom_data accepts any JSON object and comes back unchanged in every webhook and poll response. Use it for your tenant, user, or record IDs instead of matching on names.
5. Use Idempotency-Key for safe retries
If a submit request fails on the network, retry with the same Idempotency-Key header value so the retry does not create a duplicate submission. Use a UUID or a hash of the request body.
6. Check credits before large jobs
Before you enqueue a large number of NPIs, verify you have enough credits:not_found or failed NPIs. Re-requesting the same NPI within 30 days is free (replayed: true), so you don’t need to deduplicate recent lookups yourself. See GET /credits and Credits.
7. Keep polling as a fallback
If a webhook does not arrive, pollGET /api/v1/batch/{batch_id} or the poll_url of each request until no item is accepted or in-progress.
Next steps
- Size your traffic with Volume.
- Review Authentication to keep your key server-side.