# API Post into an existing source in Hubspot

**URL:** <https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [October 10, 2018, 7:45pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008 "2018-10-10T19:45:51Z")\
**Posts on this page:** 20\
**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 10, 2018, 7:45pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/1 "2018-10-10T19:45:51Z")

</div>

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.

firstname=Georgeanna&lastname=Henseler&email=etiam%[40exactamedia.com](http://40exactamedia.com)&phone=5618258185&address=3+Homestead+Lane+Gardens&city=Slocomb&state=NH&zip=15239&leadsource=Affiliate

---

<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 11, 2018, 3:49pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/2 "2018-10-11T15:49:47Z")

</div>

Hi [@tbailey](https://community.hubspot.com/u/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.

---

<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, 4:15pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/3 "2018-10-11T16:15:01Z")

</div>

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]

firstname=Georgeanna&lastname=Henseler&email=etiam%[40exactamedia.com](http://40exactamedia.com)&phone=5618258185&address=3+Homestead+Lane+Gardens&city=Slocomb&state=NH&zip=15239&leadsource=Affiliate

**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/](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](mailto:value%22:%22etiam@exactamedia.com)”,“versions”:[{“[value":"etiam@exactamedia.com](mailto:value%22:%22etiam@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](mailto:type%22:%22EMAIL%22,%22value%22:%22etiam@exactamedia.com)”,“timestamp”:1539106578528,“is-primary”:true,“source”:“UNSPECIFIED”},{“type”:“LEAD\_GUID”,“value”:“45e50b0e-27c0-4e39-9769-c669822aa2a2”,“timestamp”:1539106578837,“source”:“UNSPECIFIED”}]}],“merge-audits”:[]}

---

<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 11, 2018, 4:34pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/4 "2018-10-11T16:34:17Z")

</div>

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

[This contact](https://app.hubspot.com/contacts/2611654/contact/61143951/?interaction=note) was created via the [Contacts API](https://developers.hubspot.com/docs/methods/contacts/contacts-overview) rather than the [Forms API](https://developers.hubspot.com/docs/methods/forms/forms_overview), but [the Lead source property](https://app.hubspot.com/contacts/2611654/contact/61143951/properties?search=leadsource) 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?

---

<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, 4:46pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/5 "2018-10-11T16:46:33Z")

</div>

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.

Thanks,

Tammy

---

<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, 8:05pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/6 "2018-10-11T20:05:02Z")

</div>

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.

Thanks,

Tammy

---

<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 11, 2018, 8:10pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/7 "2018-10-11T20:10:05Z")

</div>

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

I am still unsure of what needs to be “fixed.” As we have covered, the Contacts API call successfully created [this contact](https://app.hubspot.com/contacts/2611654/contact/61143951/?interaction=note) 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](https://developers.hubspot.com/docs/methods/contacts/get_contact_by_email-0), but that is separate from the method which created the contact 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, 8:16pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/8 "2018-10-11T20:16:14Z")

</div>

Issac,

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.

---

<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 11, 2018, 8:18pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/9 "2018-10-11T20:18:14Z")

</div>

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

The Contacts API only goes _into_ HubSpot, where it created the contact [here](https://app.hubspot.com/contacts/2611654/contact/61143951/?interaction=note).

---

<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, 8:22pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/10 "2018-10-11T20:22:53Z")

</div>

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?

---

<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 11, 2018, 8:26pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/11 "2018-10-11T20:26:52Z")

</div>

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

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:

`{"vid":61143951,"canonical-vid":61143951,"merged-vids":[],"portal-id":2611654`

---

<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, 8:27pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/12 "2018-10-11T20:27:37Z")

</div>

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

---

<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, 8:28pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/13 "2018-10-11T20:28:14Z")

</div>

1. Is that the portal we should be using?

---

<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, 8:29pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/14 "2018-10-11T20:29:17Z")

</div>

1. It got cut off in the previous response.

---

<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 11, 2018, 8:32pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/15 "2018-10-11T20:32:38Z")

</div>

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.

---

<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, 8:34pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/16 "2018-10-11T20:34:07Z")

</div>

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

---

<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 11, 2018, 8:39pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/17 "2018-10-11T20:39:48Z")

</div>

You can get the API key for portal **4517614** (Mt Sierra College) on [this page](https://app.hubspot.com/integrations-beta/4517614/your-integrations/api-key) ( **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).

---

<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, 8:45pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/18 "2018-10-11T20:45:58Z")

</div>

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?

Thanks,  
Tammy

---

<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 11, 2018, 8:54pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/19 "2018-10-11T20:54:12Z")

</div>

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.

---

<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, 9:06pm UTC](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008/20 "2018-10-11T21:06:37Z")

</div>

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

[Removed by moderator]

[Next page](https://community.hubspot.com/t/api-post-into-an-existing-source-in-hubspot/12008.md?page=2)
