<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Contact batch upsert endpoint in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1097433#M79666</link>
    <description>&lt;P&gt;I faced the same issue and after investigating a bit I found out that the hs_object_id is not set as unique id in property settings (although it is unique).&amp;nbsp;Funny enough!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lstepany_0-1737469586006.png" style="width: 868px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/136507iA9D0B2CB20714EF4/image-dimensions/868x102?v=v2" width="868" height="102" role="button" title="lstepany_0-1737469586006.png" alt="lstepany_0-1737469586006.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So besically it is not possible to use hs_object_id for butch upsert endpoint. A workaround would be to create a nea property and make it unique after what to create a workflow which will copy the original IDs to the newly created unique property. Then use that prop in the req body &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 14:30:29 GMT</pubDate>
    <dc:creator>lstepany</dc:creator>
    <dc:date>2025-01-21T14:30:29Z</dc:date>
    <item>
      <title>Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1008345#M74950</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I'm trying to use the upsert endpoint&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;to update existing contacts and create not existing ones, but cannot get it to work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm passing the following body (first input exist so should update, and the following two does not exist and should create them)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "inputs": [
        {
            "id": "35791753356",
            "properties": {
                "firstname": "Maria",
                "lastname": "Johnson"
            }
        },
        {
            "id": "doesnotexist",
            "properties": {
                "firstname": "John 1",
                "lastname": "Doe 1",
                "email": "test.test1@test.com"
            }
        },
        {
            "id": "doesnotexist2",
            "properties": {
                "firstname": "John 2",
                "lastname": "Doe 2",
                "email": "test.test2@test.com"
            }
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I get the following response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "status": "error",
    "message": "Updates in a single batch must specify its unique property.",
    "correlationId": "d6594c05-a699-4014-a51d-6693c172f179",
    "category": "VALIDATION_ERROR"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong? The &lt;A href="https://developers.hubspot.com/beta-docs/reference/api/crm/objects/contacts/v3" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; says that when providing a not existing id it will create the contact but it does not work&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 19:23:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1008345#M74950</guid>
      <dc:creator>LCM4</dc:creator>
      <dc:date>2024-07-11T19:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1008366#M74952</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/788193"&gt;@LCM4&lt;/a&gt;&amp;nbsp;- my reading of the descrption here suggests thst you need to provide the idProperty selection along with the id value. Using an email address as the idProperty that would look like:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;"inputs": [
    {
      "idProperty": "email",
      "id": "joe@company.com",
      "properties": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    }
]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there is a rather strange warning that "email upserts are not supported" - which maybe practically limits what you can use the&amp;nbsp; API for. Unless this format works of course:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;"inputs": [
    {
      "idProperty": "hs_object_id",
      "id": "", #null for new contact
      "properties": {
        "email": "joe@company.com",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    }
]&lt;/LI-CODE&gt;
&lt;P&gt;Best of luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 20:11:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1008366#M74952</guid>
      <dc:creator>SteveHTM</dc:creator>
      <dc:date>2024-07-11T20:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1008434#M74956</link>
      <description>&lt;P&gt;It would return this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "status": "error",
    "message": "Duplicate IDs found in batch input: []. IDs must be unique",
    "correlationId": "218c3962-47cc-4248-87ea-0064604ff943",
    "context": {
        "ids": [
            ""
        ]
    },
    "category": "VALIDATION_ERROR"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;But there is a rather strange warning that "email upserts are not supported" - which maybe practically limits what you can use the&amp;nbsp; API for.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Might be that since email is not supported here, or documentation is wrongly written on how pass the data correctly (seen that before). Tried the V1 API where a similar endpoint exist and works just right, but yeah, this one does not &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And a note hehe&lt;/P&gt;&lt;P&gt;I've tried deleting the id, idProperty, both at the same time, leave the id for the one that exist and none of those are working&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 22:23:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1008434#M74956</guid>
      <dc:creator>LCM4</dc:creator>
      <dc:date>2024-07-11T22:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1008441#M74957</link>
      <description>&lt;P&gt;And if you do try to use 'email' as the idProperty...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;HTTP 400

{
  "status": "error",
  "message": "Unable to perform update/upsert by non-unique 0-1 property email in portal ID XX3719",
  "correlationId": "fccd25a3-fb03-45ed-bf1d-982736c99cbe",
  "category": "VALIDATION_ERROR"
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Scatching my head for how this might work...&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 22:48:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1008441#M74957</guid>
      <dc:creator>SteveHTM</dc:creator>
      <dc:date>2024-07-11T22:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1017534#M75344</link>
      <description>&lt;P&gt;I have the same issue. Seems that the upsert endpoint is completely useless.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2024 20:32:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1017534#M75344</guid>
      <dc:creator>Tuscher</dc:creator>
      <dc:date>2024-07-27T20:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1032774#M76169</link>
      <description>&lt;P&gt;So should we consider documentation is wrong and we can't batch update/insert contacts?&lt;BR /&gt;I tried to get this working according to guidelines without any success, it returns error 400 if using `email` as `idProperty` value&lt;BR /&gt;Response is : `Unable to perform update/upsert by non-unique 0-1 property email in portal ID XXX`.&lt;/P&gt;&lt;P&gt;Batch read does work correctly with same params.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 13:21:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1032774#M76169</guid>
      <dc:creator>SAMsan</dc:creator>
      <dc:date>2024-08-27T13:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1032807#M76172</link>
      <description>&lt;P&gt;Yes - seems useless for most obvious practical purposes. Like many things its not clear how you can get this feedback to the product management team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 13:57:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1032807#M76172</guid>
      <dc:creator>SteveHTM</dc:creator>
      <dc:date>2024-08-27T13:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1033247#M76193</link>
      <description>&lt;P&gt;As an update, this endpoint totally works with custom objects although I can't get associations working, the batch update/insert is OK.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 09:24:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1033247#M76193</guid>
      <dc:creator>SAMsan</dc:creator>
      <dc:date>2024-08-28T09:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1076372#M78617</link>
      <description>&lt;P&gt;I have the same error. Did you find the solution?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 08:57:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1076372#M78617</guid>
      <dc:creator>VStruyf</dc:creator>
      <dc:date>2024-11-28T08:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1093126#M79425</link>
      <description>&lt;P&gt;Any work arounds or fixes been found?&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2025 23:46:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1093126#M79425</guid>
      <dc:creator>JMacias5</dc:creator>
      <dc:date>2025-01-12T23:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1093637#M79455</link>
      <description>&lt;P&gt;Haven't tested it recently, and I don't remember how i fixed this issue&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;But a workaround that maybe you try is&lt;BR /&gt;1. Check by id or email, etc if the contact exists&lt;/P&gt;&lt;P&gt;2. If it exists, use the update endpoint&lt;/P&gt;&lt;P&gt;3. If it does not exist, use the create endpoint&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this workaround will use 2 requests, but for me it is necessary&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 22:56:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1093637#M79455</guid>
      <dc:creator>LCM4</dc:creator>
      <dc:date>2025-01-13T22:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1093755#M79459</link>
      <description>&lt;P&gt;It worked for me when I specify email as the id though. Here's my request:&lt;/P&gt;
&lt;P&gt;POST&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "inputs": [
    {
        "properties": {
            "phone": "1234"
        },
        "id": "test1@gmail.com",
        "idProperty": "email"
    },
    {
        "properties": {
            "phone": "12345"
        },
        "id": "test2@gmail.com",
        "idProperty": "email"
    },
    {
        "properties": {
            "phone": "123456"
        },
        "id": "test3@gmail.com",
        "idProperty": "email"
    },
    {
        "properties": {
            "phone": "23455"
        },
        "id": "doesnotexistyet@gmail.com",
        "idProperty": "email"
    }
  ]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All updated if exists, and the one that didn't "&lt;A href="mailto:doesnotexistyet@gmail.com&amp;quot;" target="_blank"&gt;doesnotexistyet@gmail.com"&lt;/A&gt;&amp;nbsp;inserted without any issues.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 07:32:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1093755#M79459</guid>
      <dc:creator>dannio</dc:creator>
      <dc:date>2025-01-14T07:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Contact batch upsert endpoint</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1097433#M79666</link>
      <description>&lt;P&gt;I faced the same issue and after investigating a bit I found out that the hs_object_id is not set as unique id in property settings (although it is unique).&amp;nbsp;Funny enough!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lstepany_0-1737469586006.png" style="width: 868px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/136507iA9D0B2CB20714EF4/image-dimensions/868x102?v=v2" width="868" height="102" role="button" title="lstepany_0-1737469586006.png" alt="lstepany_0-1737469586006.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So besically it is not possible to use hs_object_id for butch upsert endpoint. A workaround would be to create a nea property and make it unique after what to create a workflow which will copy the original IDs to the newly created unique property. Then use that prop in the req body &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 14:30:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/m-p/1097433#M79666</guid>
      <dc:creator>lstepany</dc:creator>
      <dc:date>2025-01-21T14:30:29Z</dc:date>
    </item>
  </channel>
</rss>

