API Post into an existing source in Hubspot


There appears to be an existing source called Affiliate (see below).
"hidden": true,
"label": "Affiliate",
"value": "Affiliate",
"readOnly": null,
"description": null,
"displayOrder": -1,
"doubleData": null

How do we post via API into this source? Two attempts have both failed using "lead source" and the c_source fields. See posting strings below. No record of either contact is showing up.



Hi @tbailey,

To confirm, are you attempting to create new contacts with the Forms API and set the leadsource property value?

If so, please share the following:

  • Your Hub ID.
  • The error code and response you received from the failed Forms API submission.


Hi Isaac,

I am not the developer but I have copied him on this response as well. Here is the API key as well as the post response we received when posting into the leadsource field. Let us know what other information you need.

[Removed by moderator]


This is the return:

{"vid":61143951,"canonical-vid":61143951,"merged-vids":[],"portal-id":2611654,"is-contact":true,"profile-token":"AO_T-mOaAcgGaCfcrd5tDya6buQ6_7uofFzQlZTfTbMkiKgH0TiVB_z23IuE-34GnuBHaLXfrYNDEGn7zue5jFqzAtwmNAHzpRfBDuZqT6hR48oQsl9hAwZEsLuz2uf0UBNl8vA-cxD6","profile-url":"https://app.hubspot.com/contacts/2611654/lists/public/contact/_AO_T-mOaAcgGaCfcrd5tDya6buQ6_7uofFzQlZTfTbMkiKgH0TiVB_z23IuE-34GnuBHaLXfrYNDEGn7zue5jFqzAtwmNAHzpRfBDuZqT6hR48oQsl9hAwZEsLuz2uf0UBNl8vA-cxD6/ ","properties":{"zip":{"value":"15239","versions":[{"value":"15239","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]},"firstname":{"value":"Georgeanna","versions":[{"value":"Georgeanna","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]},"address":{"value":"3 Homestead Lane Gardens","versions":[{"value":"3 Homestead Lane Gardens","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]},"phone":{"value":"5618258185","versions":[{"value":"5618258185","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]},"city":{"value":"Slocomb","versions":[{"value":"Slocomb","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]},"leadsource":{"value":"Affiliate","versions":[{"value":"Affiliate","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]},"state":{"value":"NH","versions":[{"value":"NH","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]},"email":{"value":"etiam@exactamedia.com","versions":[{"value":"etiam@exactamedia.com","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]},"lastname":{"value":"Henseler","versions":[{"value":"Henseler","source-type":"API","source-id":null,"source-label":null,"timestamp":1539106578515,"selected":false}]}},"form-submissions":[],"list-memberships":[],"identity-profiles":[{"vid":61143951,"is-deleted":false,"is-contact":false,"pointer-vid":0,"previous-vid":0,"linked-vids":[],"saved-at-timestamp":0,"deleted-changed-timestamp":0,"identities":[{"type":"EMAIL","value":"etiam@exactamedia.com","timestamp":1539106578528,"is-primary":true,"source":"UNSPECIFIED"},{"type":"LEAD_GUID","value":"45e50b0e-27c0-4e39-9769-c669822aa2a2","timestamp":1539106578837,"source":"UNSPECIFIED"}]}],"merge-audits":[]}


Hi @tbailey,

This contact was created via the Contacts API rather than the Forms API, but the Lead source property was properly set to "Affiliate" on 10/9/2018 at 1:36 PM EDT.

What is your goal? Do you wish to change the "Affiliate" value to something else?


We want to post via the Contacts API as we will be posting from an external system rather than a form directly in Hubspot. What do we need to do differently to get that to work? When I looked for this lead in their database, it did not show up.




Hi Isaac,

Any updates on what we need to do to fix the post? We are in a rush to get this resolved for the client. I can have our developer call the support line if that is easier too.




Hi @tbailey,

I am still unsure of what needs to be "fixed." As we have covered, the Contacts API call successfully created this contact in HubSpot with the "Affliliate" Lead source value.

The Contacts API is not an automatic two-way sync, so I cannot speak to why a specific record does not exist in your database. You can pull contacts from HubSpot to populate an external database with this endpoint, but that is separate from the method which created the contact above.



The Contacts API did not successfully create the new contact. I can not see it in the Mt. Sierra log-in with the other contacts. Are you showing a record of that lead? We don't need a two way sync. I just need to get a lead posting successfully via the Contacts API and be able to view it in Hubspot.



The Contacts API only goes into HubSpot, where it created the contact here.


That contact link keeps taking me to the home log-in screen and I am getting an error message that I can't access the portal right now?



Are you a user in portal 2611654 (Hartford Gold Group)? I don't see your name in here. I got the portal ID from the code you shared earlier:



Maybe that is the issue. I am a user for Mt. Sierra College.

  1. Is that the portal we should be using?

  1. It got cut off in the previous response.


I do see you as a user in portal 4517614, but then how did you get the API key for portal 2611654? The contact "Georgeanna Henseler" was successfully created via the Contacts API in that portal.


Our client sent us the API key for Mt. Sierra. Is that incorrect? How do we get the correct version?


You can get the API key for portal 4517614 (Mt Sierra College) on this page (Settings > Integrations > Browse all integrations > Your integrations > API key > Show key).

The API key you were sent and used for the Contacts API belongs to portal 2611654 (Hartford Gold Group).


Hi Isaac,

We are posting from a proprietary third party system not listed in your integrations. Does that matter? Do we need a custom API key as a result?



Hey Tammy,

Yep, because you're using a custom, non-listed integration, you must use the API key I linked to in order to authenticate your requests. You were using the API key of a different portal entirely.


I just copied that one and it matches what we had before.

[Removed by moderator]