# Inconsistent email validation using Forms API

**URL:** <https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [October 5, 2018, 2:12pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742 "2018-10-05T14:12:07Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 5, 2018, 2:12pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/1 "2018-10-05T14:12:07Z")

</div>

This is directed mostly at HubSpot developers but if anyone has previous experience, any information would be helpful.

We are sending requests to the Forms API v3. Some of our tests are being rejected for “invalid email”. We are intentionally using emails containing date/time so we can differentiate them from others. However, they are valid by RFC standard. Here’s an example:

4264 15:06:46 INFO strEndpointURL: [https://api.hsforms.com/submissions/v3/integration/submit/[PORTALID]/[FORMID]](https://api.hsforms.com/submissions/v3/integration/submit/%5BPORTALID%5D/%5BFORMID%5D)  
4264 15:06:46 INFO strFormData: {“fields”:[{“name”:“firstname”,“value”:“Testy”},{“name”:“lastname”,“value”:“McTesterson”},{“name”:“email”,“value”:“test20181002\_1506@test.com”},{“name”:“company”,“value”:“Test Inc.”},{“name”:“page\_type”,“value”:“Contact Us”},{“name”:“message\_website”,“value”:“Disregard.”},{“name”:“industry\_dropdown”,“value”:“Aviation”}],“legalConsentOptions”:{“legitimateInterest”:{“value”:true,“subscriptionTypeId”:“342621”,“legalBasis”:“LEAD”,“text”:“Consent to communicate for subscription type ID 342621”}}}  
4264 15:06:48 ERROR Failed web request: {“status”:“error”,“message”:“The request is not valid”,“correlationId”:“36a102fe-418a-4f91-9e77-d58a6753d132”,“errors”:[{“message”:“Error in ‘fields.email’. Invalid email address”,“errorType”:“INVALID\_EMAIL”}],“requestId”:“44ea2422faf5f321dec0bd896601e8bd”}

Other emails we see in the system submitted through the same means contain numbers, underscores and the domain [test.com](http://test.com) with no issues. Can we say with conviction what the problem with this particular address is? Can we be assured we are not going to have problems with real-world users? Are there standards beyond RFC that you are checking?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 8, 2018, 1:56pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/2 "2018-10-08T13:56:11Z")

</div>

Hi [@celston1n](https://community.hubspot.com/u/celston1n),

I’ve run a few tests, but have yet to identify the issue with `test20181002_1506@test.com`. Here are some observations I have made, though:

- The `test20181002_1506@test.com` consistently passes the [Forms API v2](https://developers.hubspot.com/docs/methods/forms/submit_form) validation, yet consistently fails [v3](https://developers.hubspot.com/docs/methods/forms/submit_form_ajax).
- The similar address `test20181002_1507@test.com` consistently passes both.
- Other similar addresses, such as `test20181002_1508@test.com` and `test20181002_1509@test.com` also consistently pass v2, but fail v3.

Could you share similar addresses which have passed v3 validation? (Links to the contact records themselves would be even better.)

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 8, 2018, 7:49pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/3 "2018-10-08T19:49:39Z")

</div>

Thanks for the feedback, Isaac. I don’t have other email addresses to share that are failing. The ones in my examples were just ones I used to test the integration so I usually add date/time so I can tell which succeed and which fail. What I’m trying to determine is if there is a rhyme or reason as to why some fail and some succeed. If it’s a remote edge-case, I can relay that to my client and we can proceed with our integration. If there are things we can test on our own, we can build that into the application.

Do you know and can you point me to an independent method to test an email’s validity? I searched for one and could not find it so either it doesn’t exist or just hard to find. If there is, we could validate in advance and do a more graceful fail back to the user or notify an administrator.

Given the inconsistencies in your results, are we still sure that the API is only validating the email address by syntax and not some other means?

Also, we’re finding that the form submissions themselves are getting through but the point of failure is during the contact create step. I can share a screenshot through DM or other means as to not share leads’ personal information.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 9, 2018, 4:54pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/4 "2018-10-09T16:54:17Z")

</div>

[@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi), any more detail you can provide would be helpful.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 10, 2018, 2:07pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/5 "2018-10-10T14:07:20Z")

</div>

Hi [@celston1n](https://community.hubspot.com/u/celston1n),

Thanks for your patience as Tara and I work on this.

It seems the forms team added additional validation to the [v3 Forms API](https://developers.hubspot.com/docs/methods/forms/submit_form_ajax) beyond formatting that were not present in [v2](https://developers.hubspot.com/docs/methods/forms/submit_form). I’m seeking insight as to _exactly_ which checks are done _before_ the form submits and _before_ the contact record is created. Stay tuned for more details on this.

In the meantime, have you experimented with defining `"skipValidation": true` in your call? It’s one of the optional parameters outlined in the documentation.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 10, 2018, 2:47pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/6 "2018-10-10T14:47:13Z")

</div>

Hi again, [@celston1n](https://community.hubspot.com/u/celston1n),

I’ve confirmed that the v2 endpoint itself doesn’t use validation, but the CRM does validate before contacts are created.

The v3 endpoint, on the other hand, runs through the same checks as a regular HubSpot form if `"skipValidation": false` is included (as it is by default):

1. **Formatting check** : The text must look like an email address and the top level domain must appear in a public suffix list.
2. **Domain blocklist** : HubSpot maintains a list of throw-away email domains, like `lasersharks.com`.
3. **DNS Lookup** : The domain of the email address must have an MX record or an A record.
4. **HubSpot Data Check** : The email must not be globally blocked.
5. **HubSpot Delivery Check** : If HubSpot has ever delivered an email to the address, then the email is considered OK without continuing.

I’m unable to say _exactly_ which check(s) the test emails failed, but you could bypass the v3 endpoint’s validation by defining `"skipvalidation": true`. Certain emails might still be rejected before being created as contacts, however. To my knowledge, those checks are identical to the ones above.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 11, 2018, 2:20pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/7 "2018-10-11T14:20:33Z")

</div>

Thank you, [@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi). Am I right to assume that the “skipValidation” check would bypass all validations, not just the email one?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 12, 2018, 3:58pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/8 "2018-10-12T15:58:47Z")

</div>

Hi [@celston1n](https://community.hubspot.com/u/celston1n),

Yes. To my understanding, defining `"skipvalidation": true` will bypass _all_ six checks I listed at the form submission stage. In this way, it would be like the v2 Forms API which let all those emails through.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [November 2, 2018, 5:07am UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/9 "2018-11-02T05:07:53Z")

</div>

Hey [@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi) and [@celston1n](https://community.hubspot.com/u/celston1n), I have implemented the forms v3 and im running into the same error on certain emails, see below for a few examples of emails:

[kenkelly@yahoo.com](mailto:kenkelly@yahoo.com)  
[kellyken@yahoo.com](mailto:kellyken@yahoo.com)  
[roydiligay@yahoo.com](mailto:roydiligay@yahoo.com)

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [November 2, 2018, 3:19pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/10 "2018-11-02T15:19:58Z")

</div>

Hey [@swoopamir](https://community.hubspot.com/u/swoopamir),

Can you confirm you included `"skipvalidation": true`?

I successfully submitted those first two emails using the v3 endpoint using `"skipvalidation": false` and only ran into issues with the last. When I switched validation to `true`, however, the last email was accepted:

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/d/fd1d6895d7efd98255eed07a3bbf1fa2d42f7f2a.jpeg)

Screenshot 1.jpg767x473 54.7 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/f/fd1d6895d7efd98255eed07a3bbf1fa2d42f7f2a.jpeg](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/f/fd1d6895d7efd98255eed07a3bbf1fa2d42f7f2a.jpeg))

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/2/c2ccbb70f330da3954b9ec93dcb61d6fb88fa66e.jpeg)

Screenshot 2.jpg763x472 54.4 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/c/c2ccbb70f330da3954b9ec93dcb61d6fb88fa66e.jpeg](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/c/c2ccbb70f330da3954b9ec93dcb61d6fb88fa66e.jpeg))

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/5/f54e18b470cb8a03660d51ed805fdb8d5bc2e424.jpeg)

Screenshot 3.jpg765x617 79.5 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/f/f54e18b470cb8a03660d51ed805fdb8d5bc2e424.jpeg](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/f/f54e18b470cb8a03660d51ed805fdb8d5bc2e424.jpeg))

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/e/8ea5dda43c647c01dc5af11ddffa0b644d4df6e0.jpeg)

Screenshot 4.jpg763x477 57.8 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/8/8ea5dda43c647c01dc5af11ddffa0b644d4df6e0.jpeg](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/8/8ea5dda43c647c01dc5af11ddffa0b644d4df6e0.jpeg))

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [November 2, 2018, 7:58pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/11 "2018-11-02T19:58:10Z")

</div>

Skipvalidation worked when i changed it to false, thanks [@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi) any idea of what the downside will be having on false or for how long?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [November 2, 2018, 9:09pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/12 "2018-11-02T21:09:44Z")

</div>

Hey [@swoopamir](https://community.hubspot.com/u/swoopamir),

If you’re using `"skipvalidation": false`, then validation is _on_, so there shouldn’t be any downside.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [November 2, 2018, 11:07pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/13 "2018-11-02T23:07:07Z")

</div>

[@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi) youre right, sorry i meant if i have skipvalidation on True

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [November 5, 2018, 7:02pm UTC](https://community.hubspot.com/t/inconsistent-email-validation-using-forms-api/11742/14 "2018-11-05T19:02:13Z")

</div>

Hey [@swoopamir](https://community.hubspot.com/u/swoopamir),

With validation disabled, none of the checks I mentioned above will be processed:

1. **Formatting check** : The text must look like an email address and the top level domain must appear in a public suffix list.
2. **Domain blocklist** : HubSpot maintains a list of throw-away email domains, like `lasersharks.com` .
3. **DNS Lookup** : The domain of the email address must have an MX record or an A record.
4. **HubSpot Data Check** : The email must not be globally blocked.
5. **HubSpot Delivery Check** : If HubSpot has ever delivered an email to the address, then the email is considered OK without continuing.

While I can’t say with certainty, you _may_ see more submissions with improperly formatted email values (e.g. `asdf1234`), but the good thing is these submissions won’t create new contact records.

The form won’t check whether the address belongs to a valid domain, so you may also see “fake” submissions coming through (e.g. `testhippo@yugioh.com`).

On the other hand, all freemail addresses like `gmail.com` and `yahoo.com` will come through without the inconsistent filtering you cited earlier, so I’d recommend monitoring your submissions closely before fully committing one way or another.
