<?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 Wrong ID returned when creating a company via API (maybe?) in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1234625#M86169</link>
    <description>&lt;P&gt;I'm trying to hunt down a strange company sync issue connected to an API integration. Here's the sequence of events:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- A first company is created via some process other than our app's integration (via Hubspot web UI, user tracking, or something else)&lt;/P&gt;&lt;P&gt;- At signup time, our integration creates a second company record for the user, and supplies some app specific custom attributes. (Aside, I am aware that our app would benefit from an attempt to prevent duplication at this stage by performing a company lookup.)&lt;/P&gt;&lt;P&gt;- However, the integration records in our database have the &lt;EM&gt;Hubspot ID from first company&lt;/EM&gt;, but also have the &lt;EM&gt;creation timestamp of the second company.&amp;nbsp;&lt;/EM&gt;My best guess at how this happens is that the Hubspot company create API response contains a different ID from the company that was actually created.&lt;/P&gt;&lt;P&gt;-&amp;nbsp;As we store the Hubspot company ID for the first company, it continues to be updated by future sync events via our integration. The second company's integration attributes in the cases I've observed are out of date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible that the Hubspot Companies API endpoint is attempting to do some deduplication, or is having confusion between the two records involved in this case? In all of the cases where I've seen this happen, the company names for the first and second companies are identical. From what I can tell, the companies have not been merged, but even if they were merged later I don't see how it could explain what's happening at creation time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 16 Dec 2025 19:02:10 GMT</pubDate>
    <dc:creator>PatrickKing</dc:creator>
    <dc:date>2025-12-16T19:02:10Z</dc:date>
    <item>
      <title>Wrong ID returned when creating a company via API (maybe?)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1234625#M86169</link>
      <description>&lt;P&gt;I'm trying to hunt down a strange company sync issue connected to an API integration. Here's the sequence of events:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- A first company is created via some process other than our app's integration (via Hubspot web UI, user tracking, or something else)&lt;/P&gt;&lt;P&gt;- At signup time, our integration creates a second company record for the user, and supplies some app specific custom attributes. (Aside, I am aware that our app would benefit from an attempt to prevent duplication at this stage by performing a company lookup.)&lt;/P&gt;&lt;P&gt;- However, the integration records in our database have the &lt;EM&gt;Hubspot ID from first company&lt;/EM&gt;, but also have the &lt;EM&gt;creation timestamp of the second company.&amp;nbsp;&lt;/EM&gt;My best guess at how this happens is that the Hubspot company create API response contains a different ID from the company that was actually created.&lt;/P&gt;&lt;P&gt;-&amp;nbsp;As we store the Hubspot company ID for the first company, it continues to be updated by future sync events via our integration. The second company's integration attributes in the cases I've observed are out of date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible that the Hubspot Companies API endpoint is attempting to do some deduplication, or is having confusion between the two records involved in this case? In all of the cases where I've seen this happen, the company names for the first and second companies are identical. From what I can tell, the companies have not been merged, but even if they were merged later I don't see how it could explain what's happening at creation time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2025 19:02:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1234625#M86169</guid>
      <dc:creator>PatrickKing</dc:creator>
      <dc:date>2025-12-16T19:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong ID returned when creating a company via API (maybe?)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1234729#M86175</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1023727"&gt;@PatrickKing&lt;/a&gt;&amp;nbsp;&amp;nbsp;, that’s a weird one to debug, but your hypothesis (“the create response ID doesn’t match what was created”) is almost never what’s happening. HubSpot’s create endpoint should return the ID of the record it actually created when it returns a 201.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The more common pattern is: you think you created a second company, but HubSpot rejected the create as a duplicate, and your integration stored the existing company ID while your own “created_at” reflects when you attempted the create.&amp;nbsp;&lt;/P&gt;
&lt;P data-start="778" data-end="1462"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="778" data-end="1462"&gt;HubSpot’s company deduplication is primarily based on domain name, not company name. If you send the domain property and that domain already exists, you’ll typically get a 409 Conflict with an “Existing ID” rather than a new company being created (&lt;A class="" href="https://knowledge.hubspot.com/records/deduplication-of-records" target="_blank" rel="noopener" data-start="1036" data-end="1098"&gt;https://knowledge.hubspot.com/records/deduplication-of-records).&lt;/A&gt;&lt;/P&gt;
&lt;P data-start="778" data-end="1462"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="778" data-end="1462"&gt;So if “company #1” was created earlier (UI, tracking, import) with the same domain, and your signup flow posts “company #2” with that domain, you can end up with exactly the mismatch you described unless your code explicitly handles 409 and switches into “update existing company” mode (&lt;A class="" href="https://developers.hubspot.com/docs/api-reference/crm-companies-v3/guide" target="_blank" rel="noopener" data-start="1388" data-end="1460"&gt;https://developers.hubspot.com/docs/api-reference/crm-companies-v3/guide).&lt;/A&gt;&lt;/P&gt;
&lt;P data-start="1464" data-end="1951"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="1464" data-end="1951"&gt;One quick clarifying question: in the calls where you observe this, are you setting the domain property on create, and what HTTP status are you logging back (201 vs 409)? If you’re not already, I’d log the full response body + status code and also the exact request payload. Then adjust the flow to: search by domain (or your own unique custom property if you have one) before create, and on 409 parse the existing ID and update that record instead of assuming a new one was created.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2025 22:24:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1234729#M86175</guid>
      <dc:creator>RubenBurdin</dc:creator>
      <dc:date>2025-12-16T22:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong ID returned when creating a company via API (maybe?)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1234744#M86176</link>
      <description>&lt;P&gt;Hi Ruben, thanks for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can say that we are not providing the domain name, at the time that the integration was built we were not collecting a domain from our users.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, I can also confirm that two records exist in Hubspot for the example cases I've seen. If there's a deduplication routine, it isn't suppressing the creation of the extra companies. The second/more recent records have custom attributes from our integration, and the record source shows as coming from our integration, but I can't find corresponding DB entries with those newer Hubspot company IDs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, this happens rarely enough that I don't have any logs available. Checking our client code over, only 200 and 201 are considered successful, and the local record with the Hubspot company ID would only be created in that case. We have no special handling for a 409 response, we would just consider the attempt to make a company to have failed. Our app has "create or update" behaviour on sync, if it doesn't see a local DB record for a Hubspot company, it will try again to make one the next time a business logic event implies a sync.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I realize it would be very unusual for Hubspot's create company endpoint to be responding with an ID other than what it created, but I've been racking my brain for any other way this situation could come about. From what I can see in the docs, deduplication for company creation doesn't occur absent a domain name.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2025 23:06:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1234744#M86176</guid>
      <dc:creator>PatrickKing</dc:creator>
      <dc:date>2025-12-16T23:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong ID returned when creating a company via API (maybe?)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1253846#M86946</link>
      <description>&lt;P&gt;Please stop marking the other message as the accepted solution, we never got to the bottom of what's going on here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a bug report, your API has a bug, and this should proably be escalated to a developer&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 15:18:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1253846#M86946</guid>
      <dc:creator>PatrickKing</dc:creator>
      <dc:date>2026-02-25T15:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong ID returned when creating a company via API (maybe?)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1253922#M86948</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1023727"&gt;@PatrickKing&lt;/a&gt;&lt;/SPAN&gt;, and thank you for continuing to post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to share this Knowledge Base article that offers help context and explanation for your issue:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://knowledge.hubspot.com/records/deduplication-of-records" target="_blank"&gt;https://knowledge.hubspot.com/records/deduplication-of-records&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These developer resources also provide important context for a possible workaround:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/api-reference/crm-companies-v3/guide" target="_blank"&gt;https://developers.hubspot.com/docs/api-reference/crm-companies-v3/guide&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/Duplicated-companies-records-with-API/td-p/223097" target="_blank"&gt;https://community.hubspot.com/t5/APIs-Integrations/Duplicated-companies-records-with-API/td-p/223097&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’d also like to tag a few community experts who may have seen similar edge cases. Hey there &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt; &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/321717"&gt;@MichaelMa&lt;/a&gt;&lt;/SPAN&gt; &amp;nbsp;and &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/53048"&gt;@evaldas&lt;/a&gt;&lt;/SPAN&gt; , any additional insights here?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 19:03:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1253922#M86948</guid>
      <dc:creator>Victor_Becerra</dc:creator>
      <dc:date>2026-02-25T19:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong ID returned when creating a company via API (maybe?)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1253942#M86949</link>
      <description>&lt;P&gt;A couple of notes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The docs suggest that the company creation API does not perform any deduplication. In my case, the second/more recent record is created via API.&lt;/LI&gt;&lt;LI&gt;The app in question doesn't collect or submit domain names through the integration, which is the only listed mechanism for deduplication.&lt;/LI&gt;&lt;LI&gt;There are, in any case, two company records in the hubspot database in each of the error cases. If the company creation API were performing a duplicate check before creation and it found an existing company, I would expect there to be just one record, right?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Just a reminder, the issue is not that a duplicate company record was created. The issue is that the create endpoint creates a second company record, but responds with the content of the first company record.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 19:52:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Wrong-ID-returned-when-creating-a-company-via-API-maybe/m-p/1253942#M86949</guid>
      <dc:creator>PatrickKing</dc:creator>
      <dc:date>2026-02-25T19:52:06Z</dc:date>
    </item>
  </channel>
</rss>

