Multiple email ids are added to same contact at hubspot


#1

Hi Team,

We are facing an issue with Hubspot's contact APIs we are using. Few different contacts which we are trying to create at Hubspot are getting updated against same entity at Hubspot.

For example, three different contacts from our source with email ids – ‘angel.0114@yahoo.com’, ‘kellyannchapa@gmail.com’, ‘jenaaso@gmail.com’ are updated against same entity with vid – ‘50945314’ at Hubspot end using the create API. The API key used for the update is [redacted].

Below is the screenshot for the same -

As per the documentation for contacts API, email address is treated as primary key. In that case, once the email id is different, a new entity is supposed to be created at Hubspot but instead it is getting mapped to the same contact entity at hubspot.

Please check for the same and revert. Also please let us know if any further details are required.


#3

Welcome, @deepak.patro.

Do not include API keys in your responses. This is a public forum and anyone can access your account with that key. I’ve removed the key from your initial post. For your security, please immediately deactivate that API key and create a new one.

I cannot revert this behavior, but I am happy to investigate why a single contact record is being updated. Please share the endpoint URL you are using (do not include the API key) and the request bodies you are sending.

For example, providing a different email to this endpoint will create a new contact record, but using a vid in this endpoint will not.

I need to see the full picture of the information you are sending into HubSpot.


#4

Apologies for adding API key to the query. I felt it must be needed for your investigation. I will refrain from passing the same going forward.

Here is the API we used to create a contact. Request body is created internally through our scheduled job. Hence I could not get the actual request body. But here are the request bodies manually created as per the logic -

For first user - 'angel.0114@yahoo.com'

{
  "properties": [
    {
      "property": "address",
      "value": "404 N Luque St"
    },
    {
      "property": "cbcs_expiration_date",
      "value": null
    },
    {
      "property": "cbcs_pass_date",
      "value": null
    },
    {
      "property": "cbcs_recertification_date",
      "value": null
    },
    {
      "property": "ccma_expiration_date",
      "value": "03/16/2020"
    },
    {
      "property": "ccma_pass_date",
      "value": "03/16/2018"
    },
    {
      "property": "ccma_recertification_date",
      "value": null
    },
    {
      "property": "cehrs_expiration_date",
      "value": null
    },
    {
      "property": "cehrs_recertification_date",
      "value": null
    },
    {
      "property": "cet_expiration_date",
      "value": null
    },
    {
      "property": "cet_pass_date",
      "value": null
    },
    {
      "property": "cet_recertification_date",
      "value": null
    },
    {
      "property": "chers_pass_date",
      "value": null
    },
    {
      "property": "city",
      "value": "Sinton"
    },
    {
      "property": "cmaa_expiration_date",
      "value": null
    },
    {
      "property": "cmaa_pass_date",
      "value": null
    },
    {
      "property": "cmaa_recertification_date",
      "value": null
    },
    {
      "property": "cpct_a_expiration_date",
      "value": null
    },
    {
      "property": "cpct_a_pass_date",
      "value": null
    },
    {
      "property": "cpct_a_recertification_date",
      "value": null
    },
    {
      "property": "cpt_expiration_date",
      "value": null
    },
    {
      "property": "cpt_pass_date",
      "value": null
    },
    {
      "property": "cpt_recertification_date",
      "value": null
    },
	{
      "property": "email",
      "value": "angel.0114@yahoo.com"
    },
	{
      "property": "cert_holder_unique_id",
      "value": "9569406"
    },
    {
      "property": "excpt_expiration_date",
      "value": null
    },
    {
      "property": "excpt_pass_date",
      "value": null
    },
    {
      "property": "excpt_recertification_date",
      "value": null
    },
    {
      "property": "firstname",
      "value": "Angelica"
    },
    {
      "property": "lastname",
      "value": "Palomo"
    },
    {
      "property": "latest_certification_action_date",
      "value": "03/16/2018"
    },
    {
      "property": "old_nha_chi_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_chi_pass_date",
      "value": null
    },
    {
      "property": "old_nha_chi_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_expiration",
      "value": null
    },
    {
      "property": "old_nha_chuc_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_pass_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_corst_pass_date",
      "value": null
    },
    {
      "property": "old_nha_corst_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_recertification_date",
      "value": null
    },
    {
      "property": "phone",
      "value": "+1 361-437-9847"
    },
    {
      "property": "state",
      "value": "TX"
    },
    {
      "property": "zip",
      "value": "78387"
    },
    {
      "property": "next_cbcs_exam_date",
      "value": null
    },
    {
      "property": "next_ccma_exam_date",
      "value": null
    },
    {
      "property": "next_cehrs_exam_date",
      "value": null
    },
    {
      "property": "next_cet_exam_date",
      "value": null
    },
    {
      "property": "next_cmaa_exam_date",
      "value": null
    },
    {
      "property": "next_cpct_a_exam_date",
      "value": null
    },
    {
      "property": "next_cpt_exam_date",
      "value": null
    },
    {
      "property": "next_excpt_exam_date",
      "value": null
    },
    {
      "property": "cbcs_exam_attempts",
      "value": null
    },
    {
      "property": "ccma_exam_attempts",
      "value": "1"
    },
    {
      "property": "cehrs_exam_attempts",
      "value": null
    },
    {
      "property": "cet_exam_attempts",
      "value": null
    },
    {
      "property": "cmaa_exam_attempts",
      "value": null
    },
    {
      "property": "cpct_a_exam_attempts",
      "value": null
    },
    {
      "property": "cpt_exam_attempts",
      "value": null
    },
    {
      "property": "excpt_exam_attempts",
      "value": null
    },
    {
      "property": "number_of_active_certifications",
      "value": "1"
    },
    {
      "property": "number_of_certifications_eligible_for_reinstatement",
      "value": "0"
    },
    {
      "property": "number_of_lapsed_certifications",
      "value": "0"
    },
    {
      "property": "birthdate",
      "value": "1997-01-14"
    },
    {
      "property": "gender",
      "value": "F"
    },
    {
      "property": "chi_exam_attempts",
      "value": null
    },
    {
      "property": "chuc_exam_attempts",
      "value": null
    },
    {
      "property": "cmht_exam_attempts",
      "value": null
    },
    {
      "property": "cmla_exam_attempts",
      "value": null
    },
    {
      "property": "cmt_exam_attempts",
      "value": null
    },
    {
      "property": "corst_exam_attempts",
      "value": null
    },
    {
      "property": "cpe_exam_attempts",
      "value": null
    }
  ]
}

For second user - 'kellyannchapa@gmail.com'

{
  "properties": [
    {
      "property": "address",
      "value": "1207 E. Mesquite"
    },
    {
      "property": "cbcs_expiration_date",
      "value": "07/12/2020"
    },
    {
      "property": "cbcs_pass_date",
      "value": "07/12/2018"
    },
    {
      "property": "cbcs_recertification_date",
      "value": null
    },
    {
      "property": "ccma_expiration_date",
      "value": null
    },
    {
      "property": "ccma_pass_date",
      "value": null
    },
    {
      "property": "ccma_recertification_date",
      "value": null
    },
    {
      "property": "cehrs_expiration_date",
      "value": null
    },
    {
      "property": "cehrs_recertification_date",
      "value": null
    },
    {
      "property": "cet_expiration_date",
      "value": null
    },
    {
      "property": "cet_pass_date",
      "value": null
    },
    {
      "property": "cet_recertification_date",
      "value": null
    },
    {
      "property": "chers_pass_date",
      "value": null
    },
    {
      "property": "city",
      "value": "Kingsville"
    },
    {
      "property": "cmaa_expiration_date",
      "value": null
    },
    {
      "property": "cmaa_pass_date",
      "value": null
    },
    {
      "property": "cmaa_recertification_date",
      "value": null
    },
    {
      "property": "cpct_a_expiration_date",
      "value": null
    },
    {
      "property": "cpct_a_pass_date",
      "value": null
    },
    {
      "property": "cpct_a_recertification_date",
      "value": null
    },
    {
      "property": "cpt_expiration_date",
      "value": null
    },
    {
      "property": "cpt_pass_date",
      "value": null
    },
    {
      "property": "cpt_recertification_date",
      "value": null
    },
	{
      "property": "email",
      "value": "kellyannchapa@gmail.com"
    },
	{
      "property": "cert_holder_unique_id",
      "value": "9613651"
    },
    {
      "property": "excpt_expiration_date",
      "value": null
    },
    {
      "property": "excpt_pass_date",
      "value": null
    },
    {
      "property": "excpt_recertification_date",
      "value": null
    },
    {
      "property": "firstname",
      "value": "Kelly"
    },
    {
      "property": "lastname",
      "value": "Chapa"
    },
    {
      "property": "latest_certification_action_date",
      "value": "07/12/2018"
    },
    {
      "property": "old_nha_chi_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_chi_pass_date",
      "value": null
    },
    {
      "property": "old_nha_chi_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_expiration",
      "value": null
    },
    {
      "property": "old_nha_chuc_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_pass_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_corst_pass_date",
      "value": null
    },
    {
      "property": "old_nha_corst_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_recertification_date",
      "value": null
    },
    {
      "property": "phone",
      "value": "+1 361-455-9560"
    },
    {
      "property": "state",
      "value": "TX"
    },
    {
      "property": "zip",
      "value": "78363"
    },
    {
      "property": "next_cbcs_exam_date",
      "value": null
    },
    {
      "property": "next_ccma_exam_date",
      "value": null
    },
    {
      "property": "next_cehrs_exam_date",
      "value": null
    },
    {
      "property": "next_cet_exam_date",
      "value": null
    },
    {
      "property": "next_cmaa_exam_date",
      "value": null
    },
    {
      "property": "next_cpct_a_exam_date",
      "value": null
    },
    {
      "property": "next_cpt_exam_date",
      "value": null
    },
    {
      "property": "next_excpt_exam_date",
      "value": null
    },
    {
      "property": "cbcs_exam_attempts",
      "value": "1"
    },
    {
      "property": "ccma_exam_attempts",
      "value": null
    },
    {
      "property": "cehrs_exam_attempts",
      "value": null
    },
    {
      "property": "cet_exam_attempts",
      "value": null
    },
    {
      "property": "cmaa_exam_attempts",
      "value": null
    },
    {
      "property": "cpct_a_exam_attempts",
      "value": null
    },
    {
      "property": "cpt_exam_attempts",
      "value": null
    },
    {
      "property": "excpt_exam_attempts",
      "value": null
    },
    {
      "property": "number_of_active_certifications",
      "value": "1"
    },
    {
      "property": "number_of_certifications_eligible_for_reinstatement",
      "value": "0"
    },
    {
      "property": "number_of_lapsed_certifications",
      "value": "0"
    },
    {
      "property": "birthdate",
      "value": "1972-05-10"
    },
    {
      "property": "gender",
      "value": "F"
    },
    {
      "property": "chi_exam_attempts",
      "value": null
    },
    {
      "property": "chuc_exam_attempts",
      "value": null
    },
    {
      "property": "cmht_exam_attempts",
      "value": null
    },
    {
      "property": "cmla_exam_attempts",
      "value": null
    },
    {
      "property": "cmt_exam_attempts",
      "value": null
    },
    {
      "property": "corst_exam_attempts",
      "value": null
    },
    {
      "property": "cpe_exam_attempts",
      "value": null
    }
  ]
}

For third user - 'jenaaso@gmail.com'

{
  "properties": [
    {
      "property": "address",
      "value": "121 Opal Dr"
    },
    {
      "property": "cbcs_expiration_date",
      "value": null
    },
    {
      "property": "cbcs_pass_date",
      "value": null
    },
    {
      "property": "cbcs_recertification_date",
      "value": null
    },
    {
      "property": "ccma_expiration_date",
      "value": "08/10/2020"
    },
    {
      "property": "ccma_pass_date",
      "value": "08/10/2018"
    },
    {
      "property": "ccma_recertification_date",
      "value": null
    },
    {
      "property": "cehrs_expiration_date",
      "value": null
    },
    {
      "property": "cehrs_recertification_date",
      "value": null
    },
    {
      "property": "cet_expiration_date",
      "value": null
    },
    {
      "property": "cet_pass_date",
      "value": null
    },
    {
      "property": "cet_recertification_date",
      "value": null
    },
    {
      "property": "chers_pass_date",
      "value": null
    },
    {
      "property": "city",
      "value": "Corpus Christi"
    },
    {
      "property": "cmaa_expiration_date",
      "value": null
    },
    {
      "property": "cmaa_pass_date",
      "value": null
    },
    {
      "property": "cmaa_recertification_date",
      "value": null
    },
    {
      "property": "cpct_a_expiration_date",
      "value": null
    },
    {
      "property": "cpct_a_pass_date",
      "value": null
    },
    {
      "property": "cpct_a_recertification_date",
      "value": null
    },
    {
      "property": "cpt_expiration_date",
      "value": null
    },
    {
      "property": "cpt_pass_date",
      "value": null
    },
    {
      "property": "cpt_recertification_date",
      "value": null
    },
	{
      "property": "email",
      "value": "jenaaso@gmail.com"
    },
	{
      "property": "cert_holder_unique_id",
      "value": "9626484"
    },
    {
      "property": "excpt_expiration_date",
      "value": null
    },
    {
      "property": "excpt_pass_date",
      "value": null
    },
    {
      "property": "excpt_recertification_date",
      "value": null
    },
    {
      "property": "firstname",
      "value": "Adrian"
    },
    {
      "property": "lastname",
      "value": "Mott"
    },
    {
      "property": "latest_certification_action_date",
      "value": null
    },
    {
      "property": "old_nha_chi_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_chi_pass_date",
      "value": null
    },
    {
      "property": "old_nha_chi_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_expiration",
      "value": null
    },
    {
      "property": "old_nha_chuc_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_pass_date",
      "value": null
    },
    {
      "property": "old_nha_chuc_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmht_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmla_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cmt_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_corst_pass_date",
      "value": null
    },
    {
      "property": "old_nha_corst_recertification_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_expiration_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_pass_date",
      "value": null
    },
    {
      "property": "old_nha_cpe_recertification_date",
      "value": null
    },
    {
      "property": "phone",
      "value": "555-122-2323"
    },
    {
      "property": "state",
      "value": "MA"
    },
    {
      "property": "zip",
      "value": "02139"
    },
    {
      "property": "next_cbcs_exam_date",
      "value": null
    },
    {
      "property": "next_ccma_exam_date",
      "value": null
    },
    {
      "property": "next_cehrs_exam_date",
      "value": null
    },
    {
      "property": "next_cet_exam_date",
      "value": null
    },
    {
      "property": "next_cmaa_exam_date",
      "value": null
    },
    {
      "property": "next_cpct_a_exam_date",
      "value": null
    },
    {
      "property": "next_cpt_exam_date",
      "value": null
    },
    {
      "property": "next_excpt_exam_date",
      "value": null
    },
    {
      "property": "cbcs_exam_attempts",
      "value": null
    },
    {
      "property": "ccma_exam_attempts",
      "value": null
    },
    {
      "property": "cehrs_exam_attempts",
      "value": null
    },
    {
      "property": "cet_exam_attempts",
      "value": null
    },
    {
      "property": "cmaa_exam_attempts",
      "value": null
    },
    {
      "property": "cpct_a_exam_attempts",
      "value": null
    },
    {
      "property": "cpt_exam_attempts",
      "value": null
    },
    {
      "property": "excpt_exam_attempts",
      "value": null
    },
    {
      "property": "number_of_active_certifications",
      "value": null
    },
    {
      "property": "number_of_certifications_eligible_for_reinstatement",
      "value": null
    },
    {
      "property": "number_of_lapsed_certifications",
      "value": null
    },
    {
      "property": "birthdate",
      "value": null
    },
    {
      "property": "gender",
      "value": null
    },
    {
      "property": "chi_exam_attempts",
      "value": null
    },
    {
      "property": "chuc_exam_attempts",
      "value": null
    },
    {
      "property": "cmht_exam_attempts",
      "value": null
    },
    {
      "property": "cmla_exam_attempts",
      "value": null
    },
    {
      "property": "cmt_exam_attempts",
      "value": null
    },
    {
      "property": "corst_exam_attempts",
      "value": null
    },
    {
      "property": "cpe_exam_attempts",
      "value": null
    }
  ]
}

Please let me know if there are any further details required.


#5

Hi, @deepak.patro.

Thank you for that information.

This contact record shows updates from this batch endpoint, not the Create a new contact endpoint.

This is evident through the change source "Bulk edit" in the email property's history:

Per the batch endpoint documentation, either a vid or email address must be included with each set of property data. Please note that these fields should be outside the properties array:

Your examples show the email property inside the properties array. Since you are not receiving errors but you are seeing the same contact record updated multiple times, the same vid must be included in multiple calls.

Through my testing, I've confirmed that this is the only scenario that would update a single record with multiple email addresses. Other combinations either fail and throw errors or create multiple contacts.

I recommend taking the following steps:

  1. Checking whether you are caching or including the vid 50945314 in these batch calls outside of the properties array.
  2. Include the email address outside the properties array instead of inside. See the example below:
 {
    "email": "contact.1234@example.com",
    "properties": [
      {
        "property": "firstname",
        "value": "Example"
      },
      {
        "property": "lastname",
        "value": "Contact"
      }
    ]
  }
]