<?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 [Possible Bug] User Provisioning update primaryTeamId without providing roleId in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Possible-Bug-User-Provisioning-update-primaryTeamId-without/m-p/742963#M60408</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking to use the &lt;A href="https://developers.hubspot.com/docs/api/settings/user-provisioning" target="_blank" rel="noopener"&gt;User Provisioning API&lt;/A&gt; and have run into what appears to be a bug that causes the role of an account to be removed when not including the roleId param during an update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I make the following call, the user's primary team is updated but their role is removed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PUT /users/{userId}&lt;BR /&gt;{"primaryTeamId": "101"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I make the following call, the user's role is updated and their primary team unchanged.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PUT /users/{userId}&lt;/P&gt;&lt;P&gt;{"roleId": "100"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This behaviour with roleId isn't mentioned in the documentation and is inconsistent with the other parameters available for updating which is why I believe this is a bug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone else run into this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2023 02:18:15 GMT</pubDate>
    <dc:creator>MKnight</dc:creator>
    <dc:date>2023-01-18T02:18:15Z</dc:date>
    <item>
      <title>[Possible Bug] User Provisioning update primaryTeamId without providing roleId</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Possible-Bug-User-Provisioning-update-primaryTeamId-without/m-p/742963#M60408</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking to use the &lt;A href="https://developers.hubspot.com/docs/api/settings/user-provisioning" target="_blank" rel="noopener"&gt;User Provisioning API&lt;/A&gt; and have run into what appears to be a bug that causes the role of an account to be removed when not including the roleId param during an update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I make the following call, the user's primary team is updated but their role is removed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PUT /users/{userId}&lt;BR /&gt;{"primaryTeamId": "101"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I make the following call, the user's role is updated and their primary team unchanged.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PUT /users/{userId}&lt;/P&gt;&lt;P&gt;{"roleId": "100"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This behaviour with roleId isn't mentioned in the documentation and is inconsistent with the other parameters available for updating which is why I believe this is a bug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone else run into this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 02:18:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Possible-Bug-User-Provisioning-update-primaryTeamId-without/m-p/742963#M60408</guid>
      <dc:creator>MKnight</dc:creator>
      <dc:date>2023-01-18T02:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: [Possible Bug] User Provisioning update primaryTeamId without providing roleId</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Possible-Bug-User-Provisioning-update-primaryTeamId-without/m-p/743545#M60449</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/506156"&gt;@MKnight&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for reaching out. A few questions to help get the ball rolling:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You are&amp;nbsp;&lt;EM&gt;updating&lt;/EM&gt; existing users?&lt;/LI&gt;
&lt;LI&gt;You are using the example from the page here?&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/settings/user-provisioning" target="_blank" rel="noopener"&gt;Modifies a user&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Can you add your full request and response body here? I'd like to reproduce this exactly as you are doing it, if possible&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Thank you! — Jaycee&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 19:50:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Possible-Bug-User-Provisioning-update-primaryTeamId-without/m-p/743545#M60449</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-01-18T19:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: [Possible Bug] User Provisioning update primaryTeamId without providing roleId</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Possible-Bug-User-Provisioning-update-primaryTeamId-without/m-p/743721#M60481</link>
      <description>&lt;P&gt;Hi Jaycee,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've put together the test I've run to reproduce this issue. There appears to have been a change to the API since I last ran this. I'm no longer getting the secondaryTeamIds property and am instead getting a roleIds property. But this hasn't changed the outcome of my testing.&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;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl --request GET \
--url https://api.hubapi.com/settings/v3/users/49115683 \
--header 'authorization: Bearer pat-***'

response:
{
  "id": "49115683",
  "email": "***",
  "roleId": "525394",
  "roleIds": [
    "525394"
  ],
  "primaryTeamId": "14045993"
}

###

curl --request PUT \
--url https://api.hubapi.com/settings/v3/users/49115683 \
--header 'authorization: Bearer pat-***' \
--header 'Content-Type: application/json' \
--data '{"primaryTeamId": "14045992"}'

response:
{
  "id": "49115683",
  "email": "***",
  "roleIds": [],
  "primaryTeamId": "14045992"
}

###

curl --request GET \
--url https://api.hubapi.com/settings/v3/users/49115683 \
--header 'authorization: Bearer pat-***'

response:
{
  "id": "49115683",
  "email": "***",
  "roleIds": [],
  "primaryTeamId": "14045992"
}

###

curl --request PUT \
--url https://api.hubapi.com/settings/v3/users/49115683 \
--header 'authorization: Bearer pat-***' \
--header 'Content-Type: application/json' \
--data '{"roleId": "525394"}

response:
{
  "id": "49115683",
  "email": "***",
  "roleId": "525394",
  "roleIds": [
    "525394"
  ]
}

###

curl --request GET \
--url https://api.hubapi.com/settings/v3/users/49115683 \
--header 'authorization: Bearer pat-***'

response:
{
  "id": "49115683",
  "email": "***",
  "roleId": "525394",
  "roleIds": [
    "525394"
  ],
  "primaryTeamId": "14045992"
}&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;I can also see in the UI that the account is listed with "No Permission Set" after running the intial PUT and comes back after the last call&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 03:38:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Possible-Bug-User-Provisioning-update-primaryTeamId-without/m-p/743721#M60481</guid>
      <dc:creator>MKnight</dc:creator>
      <dc:date>2023-01-19T03:38:56Z</dc:date>
    </item>
  </channel>
</rss>

