<?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: Get &amp;quot;PERMISSIONS SET&amp;quot; or &amp;quot;ACCESS&amp;quot; from private app code in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1094283#M79500</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/872301"&gt;@GLopez13&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;It's possible to retrieve the "Permission Set(s)" assigned to individual HubSpot Users via API. The User property that stores this data is "hs_assigned_permission_sets". For example, when retrieving an individual HubSpot User:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --location 'https://api.hubapi.com/crm/v3/objects/users/:USER_ID?properties=hs_assigned_permission_sets' \
--header 'Authorization: Bearer pat-redacted'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;The "hs_assigned_permission_sets" property contains User Permission Set (or "Role") IDs. You can match up your HubSpot Portal's Permission Set IDs and Labels via the following call:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --location 'https://api.hubapi.com/settings/v3/users/roles' \
--header 'Authorization: Bearer pat-redcated'&lt;/LI-CODE&gt;
&lt;P&gt;I hope that proves helpful. Please let me know if you have any follow up questions.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2025 01:14:10 GMT</pubDate>
    <dc:creator>zach_threadint</dc:creator>
    <dc:date>2025-01-15T01:14:10Z</dc:date>
    <item>
      <title>Get "PERMISSIONS SET" or "ACCESS" from private app code</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1094135#M79487</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I am developping a private app using a React repo, so I am able to get the "Teams" from a user using the "CrmContext", doing something like:&lt;/P&gt;&lt;P&gt;ctx.user.teams&lt;BR /&gt;&lt;BR /&gt;My question is... Is it possible to get the "PERMISSIONS SET" or the "ACCESS" this user has? Guess the CrmContext does not have these options.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 18:26:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1094135#M79487</guid>
      <dc:creator>GLopez13</dc:creator>
      <dc:date>2025-01-14T18:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get "PERMISSIONS SET" or "ACCESS" from private app code</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1094283#M79500</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/872301"&gt;@GLopez13&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;It's possible to retrieve the "Permission Set(s)" assigned to individual HubSpot Users via API. The User property that stores this data is "hs_assigned_permission_sets". For example, when retrieving an individual HubSpot User:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --location 'https://api.hubapi.com/crm/v3/objects/users/:USER_ID?properties=hs_assigned_permission_sets' \
--header 'Authorization: Bearer pat-redacted'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;The "hs_assigned_permission_sets" property contains User Permission Set (or "Role") IDs. You can match up your HubSpot Portal's Permission Set IDs and Labels via the following call:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --location 'https://api.hubapi.com/settings/v3/users/roles' \
--header 'Authorization: Bearer pat-redcated'&lt;/LI-CODE&gt;
&lt;P&gt;I hope that proves helpful. Please let me know if you have any follow up questions.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 01:14:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1094283#M79500</guid>
      <dc:creator>zach_threadint</dc:creator>
      <dc:date>2025-01-15T01:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get "PERMISSIONS SET" or "ACCESS" from private app code</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1094707#M79521</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811"&gt;@zach_threadint&lt;/a&gt;&amp;nbsp; :),&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your response, that approach could help, just for curiosity, do you know if there is a way to do it using the SDK? I mean using some component of the "&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;@hubspot/ui-extensions"... currently using the SDK, so maybe could avoid the api requests&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you very much in advance!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Jan 2025 15:14:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1094707#M79521</guid>
      <dc:creator>GLopez13</dc:creator>
      <dc:date>2025-01-15T15:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get "PERMISSIONS SET" or "ACCESS" from private app code</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1095028#M79541</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/872301"&gt;@GLopez13&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;Here are the Node examples supplied in the relevant HubSpot Developer docs (1.&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/reference/api/settings/users/user-details" target="_blank" rel="noopener"&gt;User Details&lt;/A&gt;, 2.&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/reference/api/settings/users/user-provisioning" target="_blank" rel="noopener"&gt;User Provisioning&lt;/A&gt;&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;&lt;STRONG&gt;1. Read User&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Note that this example doesn't seem to use HubSpot's Node client library, but rather interacts with the HubSpot API via the "https" package.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.hubapi.com",
  "port": null,
  "path": "/crm/v3/objects/users/userId?archived=false",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR_ACCESS_TOKEN"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;2. Retrieve the roles on an account&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const hubspot = require('@hubspot/api-client');

const hubspotClient = new hubspot.Client({"accessToken":"YOUR_ACCESS_TOKEN"});

try {
  const apiResponse = await hubspotClient.settings.users.rolesApi.getAll();
  console.log(JSON.stringify(apiResponse, null, 2));
} catch (e) {
  e.message === 'HTTP request failed'
    ? console.error(JSON.stringify(e.response, null, 2))
    : console.error(e)
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;I haven't tested these examples -- I simply copied and pasted directly from HubSpot API docs. Sometimes the examples supplied by HubSpot don't work, so you might need to perform a little trial and error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that proves helpful. Please let me know if you have any questions.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2025 00:32:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1095028#M79541</guid>
      <dc:creator>zach_threadint</dc:creator>
      <dc:date>2025-01-16T00:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get "PERMISSIONS SET" or "ACCESS" from private app code</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1097129#M79656</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811"&gt;@zach_threadint&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;your approach helped me a lot! Just had to use&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;hubspotClient&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;settings&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;users&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;usersApi&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getById&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;userId&lt;/SPAN&gt;&lt;SPAN&gt;) api to get the "user role id (here the role id is the permission set id the user has and only one is possible),then get all the "roles" (permissions sets) using&amp;nbsp;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;hubspotClient&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;settings&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;users&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;rolesApi&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getAll&lt;/SPAN&gt;&lt;SPAN&gt;() api. Finally, check if the roleId the user has match with some role in the roles list (to gets its name).&lt;BR /&gt;&lt;BR /&gt;Thank you very much!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gabriel Lopez.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Jan 2025 22:20:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Get-quot-PERMISSIONS-SET-quot-or-quot-ACCESS-quot-from-private/m-p/1097129#M79656</guid>
      <dc:creator>GLopez13</dc:creator>
      <dc:date>2025-01-20T22:20:07Z</dc:date>
    </item>
  </channel>
</rss>

