<?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: Is it possible to associate a record with a custom object on POST creation? in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/848597#M67378</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/630480"&gt;@HKamminga&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/630699"&gt;@SKwon&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on &lt;A href="https://developers.hubspot.com/docs/api/crm/crm-custom-objects" target="_blank" rel="noopener"&gt;HubSpot's Custom Object API documentation&lt;/A&gt; and my own personal testing, this is possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is an example request where the operation is &lt;EM&gt;batch create custom object records while defining associations&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;POST&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://api.hubapi.com" target="_blank" rel="noopener"&gt;https://api.hubapi.com&lt;/A&gt;&lt;SPAN&gt;/crm/v3/objects/&lt;STRONG&gt;:OBJECT_TYPE&lt;/STRONG&gt;/batch/create&lt;/SPAN&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Where&amp;nbsp;&lt;STRONG&gt;:OBJECT_TYPE&amp;nbsp;&lt;/STRONG&gt;is replaced by your custom object "name"&lt;FONT color="#999999"&gt; (in my experience, this is case-sensitive for custom objects)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#333333"&gt;&lt;STRONG&gt;Headers&lt;/STRONG&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#333333"&gt;Content-Type:&amp;nbsp;application/json&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#333333"&gt;Authorization: Bearer &lt;EM&gt;{{your_access_token}}&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#333333"&gt;&lt;STRONG&gt;Request Body (JSON)&lt;/STRONG&gt;:&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
    "inputs": [
        {
            "properties": {
                "example_property_1": "Test 1",
                "example_property_2": "Example 1"
            },
            "associations": [
                {
                    "to": {
                        "id": "123"
                    },
                    "types": [
                        {
                            "associationCategory": "USER_DEFINED",
                            "associationTypeId": 1
                        }
                    ]
                },
                {
                    "to": {
                        "id": "321"
                    },
                    "types": [
                        {
                            "associationCategory": "USER_DEFINED",
                            "associationTypeId": 2
                        }
                    ]
                }
            ]
        },
        {
            "properties": {
                "example_property_1": "Test 2",
                "example_property_2": "Example 2"
            },
            "associations": [
                {
                    "to": {
                        "id": "456"
                    },
                    "types": [
                        {
                            "associationCategory": "USER_DEFINED",
                            "associationTypeId": 1
                        }
                    ]
                },
                {
                    "to": {
                        "id": "654"
                    },
                    "types": [
                        {
                            "associationCategory": "USER_DEFINED",
                            "associationTypeId": 2
                        }
                    ]
                }
            ]
        }
    ]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the above request, were are creating 2 custom object records, "Test 1" and "Test 2". We are also associating these new test records to records (IDs "123", "321" and "456", "654") of 2 other object-types, where the association category is "USER_DEFINED" (association type ID "1" and "2"). To find the&amp;nbsp;&lt;STRONG&gt;associationTypeId&lt;/STRONG&gt;(s) relevant to your case, you'll need to retrieve the relevant custom object schema via API and then go through the "associations" array&amp;nbsp;&lt;FONT color="#999999"&gt;(e.g. GET&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://api.hubapi.com/crm-object-schemas/v3/schemas/:OBJECT_TYPE" target="_blank" rel="noopener"&gt;https://api.hubapi.com/crm-object-schemas/v3/schemas/:OBJECT_TYPE&lt;/A&gt;)&lt;FONT color="#333333"&gt;. More information can be found by navigating to the &lt;A href="https://developers.hubspot.com/docs/api/crm/crm-custom-objects" target="_blank" rel="noopener"&gt;previously mentioned documentation's&lt;/A&gt; "Object schema" tab, then scrolling down to &lt;EM&gt;"Get an existing schema"&lt;/EM&gt;.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this proves useful. Please let me know if you have any follow-up questions.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2024 06:38:19 GMT</pubDate>
    <dc:creator>zach_threadint</dc:creator>
    <dc:date>2024-03-05T06:38:19Z</dc:date>
    <item>
      <title>Is it possible to associate a record with a custom object on POST creation?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/848291#M67349</link>
      <description>&lt;P&gt;Hi, this is basically a follow-up question because you good people on Hubspot are open to ideas from the community.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are having a situation where we would like to post a custom object and associate this with an existing record.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The post I'm following up from is this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/Associate-Contact-Record-with-Custom-Object-on-POST-Create/m-p/713009" target="_blank" rel="noopener"&gt;https://community.hubspot.com/t5/APIs-Integrations/Associate-Contact-Record-with-Custom-Object-on-POST-Create/m-p/713009&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was from November last year, so I am hoping you might have implemented something of this nature in the meanwhile? Otherwise we'd be doubling our requests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To quote from the post I referenced to:&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;I see documentation on how to do this with the API as a seperate step- but I wasn't sure if I could create the Custom Object&amp;nbsp;&lt;STRONG&gt;AND&lt;/STRONG&gt;&amp;nbsp;create the association with one API call?&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please advise, since we have a slew of data to synchronise and are aware of rate limits...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hakun&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 14:39:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/848291#M67349</guid>
      <dc:creator>HKamminga</dc:creator>
      <dc:date>2023-09-12T14:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to associate a record with a custom object on POST creation?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/848471#M67358</link>
      <description>&lt;P&gt;Need a follow up to this too.&lt;BR /&gt;&lt;BR /&gt;I'm trying to batch create custom objects and associate them to a deal that has already been created.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 19:34:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/848471#M67358</guid>
      <dc:creator>SKwon</dc:creator>
      <dc:date>2023-09-12T19:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to associate a record with a custom object on POST creation?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/848597#M67378</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/630480"&gt;@HKamminga&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/630699"&gt;@SKwon&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on &lt;A href="https://developers.hubspot.com/docs/api/crm/crm-custom-objects" target="_blank" rel="noopener"&gt;HubSpot's Custom Object API documentation&lt;/A&gt; and my own personal testing, this is possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is an example request where the operation is &lt;EM&gt;batch create custom object records while defining associations&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;POST&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://api.hubapi.com" target="_blank" rel="noopener"&gt;https://api.hubapi.com&lt;/A&gt;&lt;SPAN&gt;/crm/v3/objects/&lt;STRONG&gt;:OBJECT_TYPE&lt;/STRONG&gt;/batch/create&lt;/SPAN&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Where&amp;nbsp;&lt;STRONG&gt;:OBJECT_TYPE&amp;nbsp;&lt;/STRONG&gt;is replaced by your custom object "name"&lt;FONT color="#999999"&gt; (in my experience, this is case-sensitive for custom objects)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#333333"&gt;&lt;STRONG&gt;Headers&lt;/STRONG&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#333333"&gt;Content-Type:&amp;nbsp;application/json&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#333333"&gt;Authorization: Bearer &lt;EM&gt;{{your_access_token}}&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#333333"&gt;&lt;STRONG&gt;Request Body (JSON)&lt;/STRONG&gt;:&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
    "inputs": [
        {
            "properties": {
                "example_property_1": "Test 1",
                "example_property_2": "Example 1"
            },
            "associations": [
                {
                    "to": {
                        "id": "123"
                    },
                    "types": [
                        {
                            "associationCategory": "USER_DEFINED",
                            "associationTypeId": 1
                        }
                    ]
                },
                {
                    "to": {
                        "id": "321"
                    },
                    "types": [
                        {
                            "associationCategory": "USER_DEFINED",
                            "associationTypeId": 2
                        }
                    ]
                }
            ]
        },
        {
            "properties": {
                "example_property_1": "Test 2",
                "example_property_2": "Example 2"
            },
            "associations": [
                {
                    "to": {
                        "id": "456"
                    },
                    "types": [
                        {
                            "associationCategory": "USER_DEFINED",
                            "associationTypeId": 1
                        }
                    ]
                },
                {
                    "to": {
                        "id": "654"
                    },
                    "types": [
                        {
                            "associationCategory": "USER_DEFINED",
                            "associationTypeId": 2
                        }
                    ]
                }
            ]
        }
    ]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the above request, were are creating 2 custom object records, "Test 1" and "Test 2". We are also associating these new test records to records (IDs "123", "321" and "456", "654") of 2 other object-types, where the association category is "USER_DEFINED" (association type ID "1" and "2"). To find the&amp;nbsp;&lt;STRONG&gt;associationTypeId&lt;/STRONG&gt;(s) relevant to your case, you'll need to retrieve the relevant custom object schema via API and then go through the "associations" array&amp;nbsp;&lt;FONT color="#999999"&gt;(e.g. GET&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://api.hubapi.com/crm-object-schemas/v3/schemas/:OBJECT_TYPE" target="_blank" rel="noopener"&gt;https://api.hubapi.com/crm-object-schemas/v3/schemas/:OBJECT_TYPE&lt;/A&gt;)&lt;FONT color="#333333"&gt;. More information can be found by navigating to the &lt;A href="https://developers.hubspot.com/docs/api/crm/crm-custom-objects" target="_blank" rel="noopener"&gt;previously mentioned documentation's&lt;/A&gt; "Object schema" tab, then scrolling down to &lt;EM&gt;"Get an existing schema"&lt;/EM&gt;.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this proves useful. Please let me know if you have any follow-up questions.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 06:38:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/848597#M67378</guid>
      <dc:creator>zach_threadint</dc:creator>
      <dc:date>2024-03-05T06:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to associate a record with a custom object on POST creation?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/856976#M67819</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/630480"&gt;@HKamminga&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm a little late to the party but have you heard of&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://ecosystem.hubspot.com/marketplace/apps/productivity/workflow-automation/associations-app-272901" target="_blank" rel="noopener nofollow noreferrer"&gt;Associ8&lt;/A&gt;&lt;SPAN&gt;? It lets you automatically create associations between objects based on parameters you set. There's some documentation showing how it works&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://hapily.com/blog/associ8-technical-deep-dive" target="_blank" rel="noopener nofollow noreferrer"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if you have any questions! I'd be happy to talk with you about it in more detail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-David Staat&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 20:15:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Is-it-possible-to-associate-a-record-with-a-custom-object-on/m-p/856976#M67819</guid>
      <dc:creator>DStaat</dc:creator>
      <dc:date>2023-09-28T20:15:39Z</dc:date>
    </item>
  </channel>
</rss>

