<?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: Batch Create associations in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Batch-Create-associations/m-p/802377#M64574</link>
    <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/300205"&gt;@EIbbetson&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for taking the time to flag this. I ran a quick test and got the same result.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;Request&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;curl --request POST \
  --url https://api.hubapi.com/crm/v3/objects/contacts/batch/create \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'content-type: application/json' \
  --data '{
  "inputs": [
    {
      "properties": {
        "company": "Jimmy Pesto'\''s Pizzeria",
        "email": "jimmyjr@jimmypestopizzeria.com",
        "firstname": "Jimmy Jr",
        "lastname": "Pesto",
        "phone": "(877) 929-0687",
        "website": "http://jimmypestopizzeria.com"
      },
      "associations": [
        {
          "to": {
            "id": "10202231595"
          },
          "types": [
            {
              "associationCategory": "HUBSPOT_DEFINED",
              "associationTypeId": 1
            }
          ]
        }
      ]
    }
  ]
}'&lt;/LI-CODE&gt;
&lt;P&gt;Response&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;HTTP 400

{
  "status": "error",
  "message": "Contact creates with Associations not supported.",
  "errorTokens": {
    "failedRequests": [
      "This failed createObjectRequest is of type contact and contains the following associations: [AssociationSpecAndObjectIds{associationSpec=AssociationSpec{associationCategory=HUBSPOT_DEFINED, associationTypeId=1}, objectIds=[10202231595]}]"
    ]
  },
  "correlationId": "3ec31fe7-17cd-4e49-ad93-6e150f2f8202"
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll take your example and mine, and get this to the team that owns the dev docs. I agree, this is confusing to offer an option that is explicitly called out as not possible in the accompanying &lt;A href="https://developers.hubspot.com/docs/api/crm/contacts#:~:text=a%20properties%20object.-,Please%20note,-%3A%20you%20cannot%20create" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Please note: you cannot create a contact and associate it with a record or activity in the same request. To associate your contact with other records or activities, create the contact, then update the contact or create an association via the associations API.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again! — Jaycee&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2023 17:20:41 GMT</pubDate>
    <dc:creator>Jaycee_Lewis</dc:creator>
    <dc:date>2023-06-02T17:20:41Z</dc:date>
    <item>
      <title>Batch Create associations</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Batch-Create-associations/m-p/801623#M64536</link>
      <description>&lt;P&gt;Using this documentation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/api/crm/contacts" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developers.hubspot.com/docs/api/crm/contacts&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this link under&amp;nbsp;&lt;SPAN&gt;/crm/v3/objects/contacts/batch/create&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Says I can add Associations to it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const BatchInputSimplePublicObjectInputForCreate = { inputs: [{"properties":{"company":"Biglytics","email":"bcooper@biglytics.net","firstname":"Bryan","lastname":"Cooper","phone":"(877) 929-0687","website":"biglytics.net"},"associations":[{"to":{"id":"6405179454"},"types":[{"associationCategory":"USER_DEFINED","associationTypeId":1}]}]}] };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I do this, I get an error:&lt;/P&gt;&lt;P&gt;Contact creates with Associations not supported&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I knew originally you had to do the Association separately but this is a direct copy/paste from the Documentation guide.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 08:51:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Batch-Create-associations/m-p/801623#M64536</guid>
      <dc:creator>EIbbetson</dc:creator>
      <dc:date>2023-06-01T08:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Create associations</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Batch-Create-associations/m-p/802377#M64574</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/300205"&gt;@EIbbetson&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for taking the time to flag this. I ran a quick test and got the same result.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;Request&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;curl --request POST \
  --url https://api.hubapi.com/crm/v3/objects/contacts/batch/create \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'content-type: application/json' \
  --data '{
  "inputs": [
    {
      "properties": {
        "company": "Jimmy Pesto'\''s Pizzeria",
        "email": "jimmyjr@jimmypestopizzeria.com",
        "firstname": "Jimmy Jr",
        "lastname": "Pesto",
        "phone": "(877) 929-0687",
        "website": "http://jimmypestopizzeria.com"
      },
      "associations": [
        {
          "to": {
            "id": "10202231595"
          },
          "types": [
            {
              "associationCategory": "HUBSPOT_DEFINED",
              "associationTypeId": 1
            }
          ]
        }
      ]
    }
  ]
}'&lt;/LI-CODE&gt;
&lt;P&gt;Response&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;HTTP 400

{
  "status": "error",
  "message": "Contact creates with Associations not supported.",
  "errorTokens": {
    "failedRequests": [
      "This failed createObjectRequest is of type contact and contains the following associations: [AssociationSpecAndObjectIds{associationSpec=AssociationSpec{associationCategory=HUBSPOT_DEFINED, associationTypeId=1}, objectIds=[10202231595]}]"
    ]
  },
  "correlationId": "3ec31fe7-17cd-4e49-ad93-6e150f2f8202"
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll take your example and mine, and get this to the team that owns the dev docs. I agree, this is confusing to offer an option that is explicitly called out as not possible in the accompanying &lt;A href="https://developers.hubspot.com/docs/api/crm/contacts#:~:text=a%20properties%20object.-,Please%20note,-%3A%20you%20cannot%20create" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Please note: you cannot create a contact and associate it with a record or activity in the same request. To associate your contact with other records or activities, create the contact, then update the contact or create an association via the associations API.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again! — Jaycee&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 17:20:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Batch-Create-associations/m-p/802377#M64574</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-06-02T17:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Create associations</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Batch-Create-associations/m-p/823568#M65861</link>
      <description>&lt;P&gt;Hello, I am also facing same issue. So, Is the end point defination is wrong? I still confused, do we create association to the new user creation. If not please remove it from the documentation&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/crm/v3/objects/contacts/batch/create&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 14:01:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Batch-Create-associations/m-p/823568#M65861</guid>
      <dc:creator>PRao5</dc:creator>
      <dc:date>2023-07-22T14:01:08Z</dc:date>
    </item>
  </channel>
</rss>

