<?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: Assign a Customer Group to User via Rest in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537700#M22646</link>
    <description>&lt;P&gt;thanks again&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp;! it works.. I see you're a Qlik employee.. Not sure if this is your area although on the documentation (&lt;A href="https://qlik.dev/apis/rest/users/#patch-api-v1-users-userId" target="_blank"&gt;https://qlik.dev/apis/rest/users/#patch-api-v1-users-userId&lt;/A&gt;)&amp;nbsp; the data seems to be written in a different format: Is this out of date?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="richard_pearce6_0-1764608789695.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/185361i1544643D9BD760DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="richard_pearce6_0-1764608789695.png" alt="richard_pearce6_0-1764608789695.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Dec 2025 17:08:35 GMT</pubDate>
    <dc:creator>richard_pearce6</dc:creator>
    <dc:date>2025-12-01T17:08:35Z</dc:date>
    <item>
      <title>Assign a Customer Group to User via Rest</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537652#M22644</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I've been trying in vain to get this to work. It seems to be an invalid Patch request so maybe its something to do with my data structure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a custom group I wish to assign to a user or remove it... I'm using an API gen key against my user (who created the custom group)&lt;/P&gt;&lt;P&gt;code to add is&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print('The group is NOT assigned to the user so add it')
        data = {"op":"add","path":"/assignedGroups","value":{"name":"Qlik Sense API"}}
        response = requests.patch(f'{tenant_url}{api_version}users/{user["id"]}', headers=headers, data=data)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code to remove is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;print('The group is assigned to the user so remove it')
        data = {"op":"remove-value","path":"/assignedGroups","value":{"id":"690b6a286b0920b29e3eeb03"}}
        response = requests.patch(f'{tenant_url}{api_version}users/{user["id"]}', headers=headers, data=data)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get a 400 Bad Request error:&amp;nbsp;{"traceId":"3f466c9de279b0e31caab10f0524ab14","errors":[{"code":"IDENTITIES-00017","detail":"invalid request body","status":400,"title":"Bad Request"}]}&lt;/P&gt;&lt;P&gt;I've tried changing the data to be a string, list, string within a list, etc but no luck&lt;/P&gt;&lt;P&gt;Anyone solved this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 17:10:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537652#M22644</guid>
      <dc:creator>richard_pearce6</dc:creator>
      <dc:date>2025-12-01T17:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a Customer Group to User via Rest</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537695#M22645</link>
      <description>&lt;P&gt;Let's create a dummy user:&lt;/P&gt;
&lt;PRE&gt;POST /api/v1/users&lt;/PRE&gt;
&lt;PRE&gt;{
  "name": "User Group Adjustment",
  "email": "user.group@corp.example",
  "subject": "1234asdasa6781231239"
}
&lt;/PRE&gt;
&lt;P&gt;From here, we can add a user to a _custom_ group:&lt;/P&gt;
&lt;PRE&gt;PATCH /api/v1/users/692dba4bccd2c3757641e9df&lt;/PRE&gt;
&lt;PRE&gt;[
    {
        "op": "add",
        "path": "/assignedGroups/-",
        "value": "684adfb0adbd8a0c6443bde4"
    }
]
&lt;/PRE&gt;
&lt;P&gt;As a side note, we can use names as well if we're using custom groups:&lt;/P&gt;
&lt;PRE&gt;PATCH /api/v1/users/692dba4bccd2c3757641e9df&lt;/PRE&gt;
&lt;PRE&gt;[
    {
        "op": "replace",
        "path": "/assignedGroups",
        "value": [
            {
                    "name": "Example2",
                    "providerType": "custom"
                }
        ]
    }
]
&lt;/PRE&gt;
&lt;P&gt;We can remove a _custom_ group assignment:&lt;/P&gt;
&lt;PRE&gt;PATCH /api/v1/users/692dba4bccd2c3757641e9df&lt;/PRE&gt;
&lt;PRE&gt;[
    {
        "op": "remove-value",
        "path": "/assignedGroups",
        "value": "684af6cf1c69d94a9e90ef90"
    }
]
&lt;/PRE&gt;
&lt;P&gt;I reference _custom_ groups very intentionally, if a user is assigned an _idp_ group then you will need to take a different approach. Rather than using the add operator to append, you will need to build the array of _existing_ groups and use the replace operator. Like so:&lt;/P&gt;
&lt;PRE&gt;PATCH /api/v1/users/Rq6ftmNArJRHHyaWnFaCx5U7p8adVdUU&lt;/PRE&gt;
&lt;PRE&gt;[
  {
    "op": "replace",
    "path": "/assignedGroups",
    "value": [
      {
        "id": "60b0fce6e585231c5e8aa755"
      },
      {
        "id": "60c7c5d74ed18c7b7f6ee173"
      },
      {
        "id": "684adfb0adbd8a0c6443bde4"
      }
    ]
  }
]
&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Dec 2025 16:13:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537695#M22645</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2025-12-01T16:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a Customer Group to User via Rest</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537700#M22646</link>
      <description>&lt;P&gt;thanks again&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp;! it works.. I see you're a Qlik employee.. Not sure if this is your area although on the documentation (&lt;A href="https://qlik.dev/apis/rest/users/#patch-api-v1-users-userId" target="_blank"&gt;https://qlik.dev/apis/rest/users/#patch-api-v1-users-userId&lt;/A&gt;)&amp;nbsp; the data seems to be written in a different format: Is this out of date?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="richard_pearce6_0-1764608789695.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/185361i1544643D9BD760DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="richard_pearce6_0-1764608789695.png" alt="richard_pearce6_0-1764608789695.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 17:08:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537700#M22646</guid>
      <dc:creator>richard_pearce6</dc:creator>
      <dc:date>2025-12-01T17:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a Customer Group to User via Rest</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537701#M22647</link>
      <description>&lt;P&gt;I do not have a say on the docs but can forward to someone who does!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 17:10:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537701#M22647</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2025-12-01T17:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a Customer Group to User via Rest</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537703#M22648</link>
      <description>&lt;P&gt;Thanks very much... I think it may help someone having a similar issue.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 17:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Assign-a-Customer-Group-to-User-via-Rest/m-p/2537703#M22648</guid>
      <dc:creator>richard_pearce6</dc:creator>
      <dc:date>2025-12-01T17:14:35Z</dc:date>
    </item>
  </channel>
</rss>

