Contact Enrichment API Error Codes and Troubleshooting: Complete Reference Guide for Production API Integrations
This guide is the definitive error code reference for teams building with the Dievio Contact Enrichment API. It maps every HTTP status and application-level error to a root cause and a concrete fix, includes retry and rate-limit handling patterns, and outlines a systematic troubleshooting workflow for production environments. Use this reference to build reliable enrichment pipelines and minimize debugging time.

html
Contact Enrichment API Error Codes and Troubleshooting: Complete Reference Guide for Production API Integrations
If you are running a production B2B data pipeline, you already know the drill. The lead list is built, the CRM sync is scheduled, and the enrichment calls are firing. Then, without warning, your webhook logs light up with a wall of red. A 400 here, a 429 there, and suddenly your carefully constructed outbound machine is grinding to a halt. The worst part? Most of these failures are avoidable if you understand exactly what the API is trying to tell you.
This guide is the definitive error code reference for teams building with the Dievio Contact Enrichment API. We are not going to waste time on generic "check your internet connection" advice. Instead, we are mapping every HTTP status code and application-level error to a root cause and a concrete fix. By the time you finish this, you will be able to read a raw API response, diagnose the issue in under a minute, and implement the right retry or validation logic to keep your enrichment pipeline running clean. This is the operational knowledge that separates a demo script from a production-grade integration.
Why Error Codes Matter in Enrichment Pipelines
Enrichment pipelines fail silently more often than they fail loudly. A single malformed email address in a batch of 10,000 can trigger a 422 that rolls back an entire job if you are not handling partial responses correctly. A rate-limit response that is ignored can get your API key temporarily throttled, turning a minor spike into a full pipeline outage. Understanding the difference between a transient network blip and a permanent data validation error is the difference between a self-healing system and a pager-duty nightmare.
We have structured this reference to be practical. We start with the HTTP status codes you will see at the transport layer, then drill into the application-level error codes embedded in the response body. From there, we cover the specific categories of failures—input validation, authentication, rate limiting, and data gaps—and finish with a systematic debugging workflow you can apply to any integration, regardless of whether you are using our SDKs or raw REST calls.
HTTP Status Code Quick Reference
Before you dig into the JSON body of an error response, the HTTP status code tells you which side of the fence the problem is on. This is the first triage step. Here is the complete mapping for the Contact Enrichment API:
| HTTP Status | Meaning | Who Fixes It | Typical Cause |
|---|---|---|---|
| 200 OK | Request succeeded. Enrichment data is in the response body. | N/A | Successful lookup. Check the confidence and data_status fields for data quality. |
| 400 Bad Request | The request is malformed. The syntax is wrong or required parameters are missing. | Client | Missing email or domain parameter, malformed JSON payload, or invalid query string. |
| 401 Unauthorized | Authentication failed. The API key is missing, invalid, or expired. | Client | Missing Authorization header, malformed API key, or revoked credentials. |
| 403 Forbidden | Authentication succeeded, but the account lacks permission for this resource or plan tier. | Client / Account Admin | Trying to access a field not included in your plan, or the API key lacks the enrichment scope. |
| 404 Not Found | The requested resource does not exist. This is often the contact identifier or the API endpoint itself. | Client | Invalid email format that passes basic validation, or a typo in the API endpoint URL. |
| 422 Unprocessable Entity | The request is syntactically valid, but semantically incorrect. The server understands it but cannot process it. | Client | Invalid email format (e.g., john@), unsupported enrichment field name, or a contact identifier that fails domain-level validation. |
| 429 Too Many Requests | Rate limit exceeded. You have sent more requests in a given time window than the plan allows. | Client | Bursting requests without respecting the X-RateLimit-Limit headers or ignoring the Retry-After header. |
| 500 Internal Server Error | The server encountered an unexpected condition. This is not your fault. | Server | Unexpected upstream data provider failure or a bug in the enrichment enrichment engine. |
| 503 Service Unavailable | The server is temporarily unable to handle the request, often due to maintenance or overload. | Server | Planned maintenance windows or a downstream data provider being offline. |
This table is your first line of defense. If you see a 4xx code, the fix is on your side. If you see a 5xx code, the ball is in our court, and you should implement a retry with exponential backoff rather than changing your payload.
Application-Level Error Codes: Full Reference
The HTTP status code gives you the category, but the application-level error code in the response body tells you exactly what to fix. Every error response from the Contact Enrichment API follows a consistent JSON structure:
<code>{
"error": {
"code": "INVALID_EMAIL_FORMAT",
"message": "The email address 'john@' is not a valid format.",
"field": "email",
"documentation_url": "https://dievio.com/api/contact-enrichment-api#errors"
}
}
</code>Here is the full reference of application error codes, grouped by category. These are the codes your error-handling logic should be matching against, not the HTTP status code alone.
Input Validation Errors
| Error Code | Description | Root Cause | Resolution |
|---|---|---|---|
MISSING_REQUIRED_FIELD |
A required parameter is absent from the request body. | You did not provide email or domain. The API requires at least one identifier. |
Check your payload construction. Ensure you are sending a JSON body with the email or domain field populated. |
INVALID_EMAIL_FORMAT |
The email address fails RFC 5322 basic syntax validation. | Email contains spaces, missing the @ symbol, or has an invalid TLD (e.g., john@example). |
Run a regex validation client-side before calling the API. Strip whitespace and ensure the domain has a valid TLD. |
INVALID_DOMAIN_FORMAT |
The domain name is malformed. | Domain contains invalid characters, protocol (https://), or a path (/about). |
Normalize the domain. Remove protocol, www. prefix, and any path segments before sending. |
UNSUPPORTED_FIELD |
You requested an enrichment field that does not exist in the API schema. | Typo in the fields array, or you are requesting a field that requires a higher plan tier. |
Review the Contact Enrichment API Field Mapping guide to verify field names and availability. |
ARRAY_LIMIT_EXCEEDED |
The request body contains more than the maximum allowed number of identifiers in a single call. | You are trying to batch-enrich more than 100 contacts in a single request. | Split your batch into smaller chunks. For large-scale operations, use the pagination and batching patterns described in the B2B Leads API Pagination guide. |
Data Not Found Errors
| Error Code | Description | Root Cause | Resolution |
|---|---|---|---|
CONTACT_NOT_FOUND |
The email address or LinkedIn URL does not match any record in our database. | The contact is not in our index, or the email is a generic role address (e.g., info@) that we do not enrich. |
This is a valid business outcome, not an error. Do not retry. Move to the next record. If you are seeing this frequently, your source list may contain outdated data. |
COMPANY_NOT_FOUND |
The domain name does not match any company in our firmographic database. | The domain is a free email provider (e.g., gmail.com) or a small business with no matching firmographic record. |
Decide if you want to enrich with only the contact-level data. If not, skip the record. Consider using the preview leads feature to estimate coverage before spending credits. |
ENRICHMENT_UNAVAILABLE |
The identifier is valid, but we cannot provide enrichment data for it at this time. | This is a data gap in our provider network. It is not a permanent failure. | Do not retry immediately. If this is a high-value account, you can re-queue the record for a later date. Our data freshness team continuously updates the index. |
Billing and Quota Errors
| Error Code | Description | Root Cause | Resolution |
|---|---|---|---|
QUOTA_EXHAUSTED |
Your plan's monthly or daily credit limit has been reached. | You have consumed all the enrichment credits allocated to your plan. | Check your pricing plan for the current limits. Either upgrade your plan or wait for the next billing cycle to reset. |
CREDIT_LIMIT_EXCEEDED |
You have exceeded the per-request or per-second credit spend limit. | You are making too many concurrent requests, or a single batch request is too large. | Implement client-side rate limiting. Use the X-RateLimit-Remaining header to monitor your usage in real time. |
PLAN_FIELD_RESTRICTION |
You are requesting a field that is not included in your current plan tier. | Your plan includes basic firmographics but not intent data or advanced technographics. | Review the field-level access on your plan. You may need to upgrade to access premium fields. |
Permissions and Scope Errors
| Error Code | Description | Root Cause | Resolution |
|---|---|---|---|
ORG_SCOPE_VIOLATION |
The API key is scoped to a specific organization, and the request is trying to access data outside that scope. | You are using a restricted API key (e.g., a key created for a sub-account or a specific team) and attempting to enrich a contact that does not belong to that team. | Verify the API key's organization scope in the dashboard. If you need cross-org access, generate a new key with broader permissions. |
INVALID_API_KEY |
The API key provided in the Authorization header is not recognized. |
The key is mistyped, has been revoked, or was deleted. | Regenerate the API key from the dashboard and update your environment variables. Ensure you are using the Bearer prefix. |
Input Validation Errors: Contact Identifiers and Payload Structure
Input validation errors are the most common class of errors we see in production, and they are also the most preventable. The API is strict about the format of the identifiers you send, and for good reason—garbage in, garbage out. If you send a malformed email address, you are not going to get a reliable enrichment result, and you are going to burn a credit on a request that was doomed from the start.
Let us look at a typical 422 response for a bad email format:
<code>{
"error": {
"code": "INVALID_EMAIL_FORMAT",
"message": "The email address 'john.doe@' is not a valid format.",
"field": "email",
"documentation_url": "https://dievio.com/api/contact-enrichment-api#errors"
}
}
</code>Notice the field attribute. This tells you exactly which part of the payload failed. When you are building your integration, you should use this to provide actionable feedback to your internal users or to trigger a data-cleaning job in your CRM.
For Salesforce integrations specifically, field-level validation errors can cascade downstream. Per the Salesforce Lead Management implementation guide, records with malformed data in required fields will fail validation at the CRM layer even after successful API enrichment. Build a validation step between your enrichment call and your CRM write to catch these mismatches early.
Here is a checklist to prevent validation errors before they hit the API:
- Normalize emails: Lowercase the entire address, strip any leading/trailing whitespace, and remove any display name (e.g., "John Doe <john@doe.com>" should become
john@doe.com). - Validate the TLD: A simple regex like
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$will catch 99% of malformed addresses. - Strip protocols from domains: If you are enriching by company domain, remove
https://,http://, andwww.before sending. The API expects a bare domain likeacme.com. - Check the field names: If you are requesting specific fields, ensure they are spelled correctly. A single typo in the
fieldsarray will trigger anUNSUPPORTED_FIELDerror.
By implementing a lightweight validation layer in your code before the API call, you can eliminate the majority of 400 and 422 errors, which in turn preserves your rate limit and your credits for valid lookups.
Authentication, Quota, and Plan-Level Errors
Authentication errors are straightforward to diagnose but can be frustrating to debug if you are not familiar with the header structure. The Contact Enrichment API uses Bearer token authentication. Every request must include an Authorization header in the following format:
<code>Authorization: Bearer YOUR_API_KEY_HERE </code>
If you are getting a 401 INVALID_API_KEY error, check the following:
- Is the key correct? Copy-paste it directly from the Dievio dashboard. It is easy to accidentally truncate a key when moving it between environment files.
- Is there a space after
Bearer? The header format is strict.BearerYOUR_API_KEYwill not work. - Has the key been rotated? If you recently rotated keys for security purposes, update your environment variables. Old keys are immediately invalidated.
On the quota side, the QUOTA_EXHAUSTED error is a signal to review your consumption patterns. If you are hitting this regularly, you are either over-provisioning your pipeline or you need a higher-tier plan. We recommend monitoring the X-RateLimit-Remaining header on every response. When it drops below 10% of your limit, trigger a notification to your ops team so they can prepare for a potential throttle.
For RevOps teams building automated enrichment workflows, HubSpot's sales prospecting documentation offers a useful mental model for thinking about data hygiene at scale. Even if you are not using HubSpot directly, the principle applies: catching bad data before it enters your CRM saves hours of cleanup later.
For agencies managing multiple client accounts, it is critical to understand that quota is tracked per API key. If you are using a single key for all clients, a spike in one client's enrichment volume can starve the others. Consider using separate keys per client or per campaign to isolate usage. This pattern is covered in our Lead Generation API for Agencies guide.
Rate Limiting and Retry Logic: 429 Handling Patterns
The 429 Too Many Requests response is not an error—it is a control mechanism. The API uses rate limiting to protect the infrastructure and ensure fair usage across all tenants. When you hit a 429, the response will include headers that tell you exactly how to proceed:
<code>X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1620000000 Retry-After: 30 </code>
The Retry-After header is the most important one. It tells you how many seconds to wait before making your next request. Ignoring it will result in your key being temporarily blocked, which is far worse than a simple 429.
Here is a robust retry pattern using exponential backoff with jitter. This is the industry standard for interacting with rate-limited APIs:
<code>import time
import random
def make_request_with_retry(api_call, max_retries=5):
for attempt in range(max_retries):
response = api_call()
if response.status_code != 429:
return response
# Exponential backoff with jitter
wait_time = (2 ** attempt) + random.uniform(0, 1)
time.sleep(wait_time)
raise Exception("Max retries exceeded for rate-limited request")
</code>For batch enrichment, we strongly recommend a staggered approach rather than firing all requests in parallel. A good rule of thumb is to keep the concurrency at 5-10 requests per second and monitor the X-RateLimit-Remaining header. If you see it dropping linearly, slow down. If you are using our SDKs, they handle this automatically, but if you are building a custom integration, respect the headers.
For large-scale list enrichment, consider using the bulk endpoints with the pagination patterns outlined in the B2B Leads API Pagination guide. This reduces the number of HTTP round-trips and minimizes the risk of hitting rate limits.
Empty and Partial Responses: When Data Is Missing or Inconclusive
Not every successful request returns a full record. Sometimes the API returns a 200 OK with a data_status field that indicates partial or missing data. This is not an error—it is a reflection of the underlying data landscape. Understanding the difference between a hard failure and a soft data gap is essential for building a resilient pipeline.
Here is what a partial response looks like:
<code>{
"data": {
"email": "john.doe@acme.com",
"first_name": "John",
"last_name": "Doe",
"company_name": "Acme Corp",
"company_industry": null,
"confidence": 0.87
},
"data_status": "PARTIAL",
"warnings": [
{
"code": "FIELD_NOT_FOUND",
"message": "Company industry not found for this record."
}
]
}
</code>In this case, the API successfully resolved the contact and company, but the company_industry field is null. The confidence score of 0.87 indicates that the email is likely valid but not guaranteed. When you push this into your CRM, you need to decide how to handle null fields. Do you leave them blank, or do you trigger a separate data append process?
For RevOps teams, we recommend treating confidence scores as a routing mechanism. Records with a confidence score above 0.95 can be auto-assigned to outbound reps. Records between 0.80 and 0.95 should go to a human for verification before being added to a sequence. Records below 0.80 should be quarantined for further research. This prevents your sales team from wasting time on unverified data.
If you are seeing a high volume of ENRICHMENT_UNAVAILABLE responses, it may be a sign that your source data is stale or that you are targeting a niche segment with low coverage. Before you blame the API, check the quality of your input list. A quick sanity check is to run a sample of your list through the preview leads tool to estimate coverage before committing credits.
Systematic Troubleshooting Workflow: 5 Steps for Production Debugging
When something goes wrong in production, you need a repeatable process to isolate the issue quickly. Here is the five-step workflow we use internally and recommend to our API customers:
- Check the HTTP status code. This tells you the category of the problem. 4xx means it is on your side. 5xx means it is on ours. Do not proceed until you know which side of the fence you are on.
- Inspect the response body for the application error code. The
codefield is your primary diagnostic. Match it against the reference table above to get a precise description of the issue. - Verify the API key and organization scope. If you are getting 401 or 403 errors, double-check that the key is active and has the correct permissions. Look for any IP allowlisting that might be blocking requests from your server.
- Validate the input payload against the field mapping spec. Use the field mapping guide to ensure you are sending the correct parameter names and types. A quick diff between your payload and the API documentation can reveal typos.
- Check quota and rate-limit headers. Look at
X-RateLimit-RemainingandRetry-Afterto determine if you are being throttled. If you are close to your limit, wait or reduce concurrency.
This workflow is linear, but you can jump between steps if you have a strong suspicion about the root cause. For example, if you are seeing a CONTACT_NOT_FOUND error, you can skip step 3 and go straight to validating the input format.
CRM and RevOps Integration Error Patterns
Once you have the enriched data, the next failure point is often the CRM integration. Pushing data into Salesforce, HubSpot, or a custom database introduces a new set of potential errors that have nothing to do with the enrichment API itself.
Here are the most common CRM-related errors we see:
- Field type mismatches: You are trying to write a string value into a numeric field (e.g.,
phonefield expects an integer). This is a classic data mapping error. Always check the target schema before pushing data. - Required field violations: The CRM has a required field (e.g.,
Last Namein Salesforce) that is not populated in your enrichment payload. If the API returnslast_nameas null, you need a fallback strategy. - Duplicate detection: You are creating duplicate records because your deduplication logic is not matching on the right keys. Use the email address as the primary key, not the company name.
- Webhook delivery failures: If you are using webhooks to push enriched data into your CRM, a failed delivery can cause silent data loss. Implement a dead-letter queue with retry logic to catch these.
For Salesforce specifically, we recommend reviewing the Salesforce Lead Management implementation guide to understand the required fields and validation rules. For HubSpot, their sales prospecting documentation offers insights into how to structure your data for better engagement. The key is to map your enrichment fields to the CRM fields before you start the sync, not after.
If you are building a white-label workflow for clients, you need to abstract these errors away from the end user. Our white-label lead search workflow guide covers how to handle error mapping and user-facing messaging in a multi-tenant environment.
Credit Efficiency: Avoiding Costly Error-Driven Requests
Every API call you make consumes a credit, whether it succeeds or fails. A 404 for a contact that does not exist is just as expensive as a 200 for a fully enriched record. This means error handling is not just a reliability concern—it is a cost concern. Here is a checklist to maximize your credit efficiency:
- Pre-validate emails before calling the API. Use a simple regex to catch obvious formatting issues. This alone can reduce your error rate by 10-15%.
- Use the preview endpoints to estimate coverage. Before you commit to a large batch, run a sample through the preview leads tool to see how many records will return data. This helps you avoid wasting credits on low-coverage segments.
- Batch smartly. Do not send a batch of 100 records if you only need 10. The API has a maximum batch size, but that does not mean you should always hit it. Smaller batches are easier to debug and recover from.
- Handle 404s gracefully. When you get a
CONTACT_NOT_FOUND, do not retry the same identifier. Mark it as "do not enrich" in your database and move on. Repeatedly retrying a bad record is the fastest way to burn through your quota. - Monitor your credit usage in real time. Use the
X-RateLimit-Remainingheader to track your consumption. Set up alerts when you hit 80% of your monthly limit so you have time to adjust your strategy.
For agencies managing multiple client accounts, credit efficiency is even more critical. A single client with a poorly formatted list can drain your entire monthly quota. Our Lead Generation API for Agencies guide provides additional strategies for credit management across client portfolios.
Quick Reference Card
Here is the condensed version of this guide. Bookmark this section, print it out, or paste it into your internal documentation. These are the top 10 error codes you are most likely to encounter, with a one-line resolution for each:
INVALID_EMAIL_FORMAT(422): Fix the email syntax before retrying.MISSING_REQUIRED_FIELD(400): Add the missingemailordomainparameter.UNSUPPORTED_FIELD(422): Check the field name against the API schema.INVALID_API_KEY(401): Regenerate the key and update your headers.ORG_SCOPE_VIOLATION(403): Use a key with the correct organization scope.QUOTA_EXHAUSTED(403): Upgrade your plan or wait for the reset.CONTACT_NOT_FOUND(200): Not an error—skip the record and move on.ENRICHMENT_UNAVAILABLE(200): Data gap—re-queue for a later date.429 Too Many Requests: Slow down and respect theRetry-Afterheader.500/503: Server-side issue—retry with exponential backoff.
This reference should be your first stop when something goes wrong. But do not just wait for errors to happen. Proactively monitor your integration, set up alerts for unusual error rates, and keep your team trained on the difference between a transient blip and a systemic issue.
Building a Resilient Enrichment Pipeline
Error handling is not the most glamorous part of building a B2B data pipeline, but it is the difference between a tool that works and a tool that is a constant source of fire drills. By understanding the error codes, implementing proper retry logic, and validating your inputs, you can turn a fragile integration into a robust, self-healing system.
We have covered a lot of ground in this guide, from the HTTP status codes to the application-level error codes, and from rate-limit handling to CRM integration pitfalls. The key takeaway is this: the Contact Enrichment API is designed to be transparent about what is happening under the hood. The error codes are not there to frustrate you—they are there to give you the information you need to fix problems quickly and move on.
If you are ready to put this knowledge into practice, head over to the Contact Enrichment API documentation to review the full endpoint reference and start building. And if you are looking to scale your outbound efforts, explore our lead search and preview leads tools to build higher-quality lists from the start. The fewer errors you encounter, the more time you spend on what matters—closing deals.
For white-label workflows that handle errors gracefully for end clients, see our guide on How to Build a White-Label Lead Search Workflow.
Build Your First Outbound List to validate the segment before you commit to full outreach.
Build Your First Outbound List to validate the segment before you commit to full outreach.


