---
title: "API: getUserGroups"
slug: "api-getusergroups"
tags: ["home groups", "permissions"]
updated: 2022-09-20T15:50:20Z
published: 2022-09-20T15:50:20Z
canonical: "support.smarteru.com/api-getusergroups"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.smarteru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API: getUserGroups

- Starting June 1, 2022, SmarterU will require all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
- If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
- Tags are required unless specified.

## **Description**

The getUserGroups method retrieves a [user's groups](/v1/docs/user-group-permissions).

## **Who Has Access**

The following users have access to the getUserGroups method:

- Users with the [Group Managers](/v1/docs/group-permission-group-manager-gm), [Manage Group Users](/v1/docs/group-permission-manage-group-users-mgu), or [Manage Users](/v1/docs/group-permission-manage-users-mu) group permission.
- [Supervisors](/v1/docs/user-profile-information#supervisors), if the [account's **Supervisor Access** setting's](/v1/docs/account-settings#supervisor-access)*View Supervisees* or *Edit Supervisees* option is checked.
- [Administrators and owners](/v1/docs/user-profile-information#access-level).

## **API Call XML Package**

```markup
<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>getUserGroups</Method>

   <Parameters>
      <User>
         <ID><![CDATA[]]></ID>
            -OR-
         <Email><![CDATA[]]></Email>
            -OR-
         <EmployeeID><![CDATA[]]></EmployeeID>
      </User>
   </Parameters>

</SmarterU>
```

## **User Tag Group**

The User tag group is a container for the user filter.

```markup
<User>
   <ID><![CDATA[]]></ID>
      -OR-
   <Email><![CDATA[]]></Email>
      -OR-
   <EmployeeID><![CDATA[]]></EmployeeID>
</User>
```

The User tag contains one of the following.

### ID

The user's system-generated identifier. This tag is mutually exclusive with the [Email](/v1/docs/api-getusergroups#email) and [EmployeeID](/v1/docs/api-getusergroups#employeeid) tags. This is the ID returned by the [getUser](/v1/docs/api-getuser) method.

### Email

The [user's email address](/v1/docs/user-login-information#primary-email-required-if-employee-id-not-specified). This tag is mutually exclusive with the [ID](/v1/docs/api-getusergroups#id) and [EmployeeID](/v1/docs/api-getusergroups#employeeid) tags. This is the Email returned by the [getUser](/v1/docs/api-getuser) and [listUsers](/v1/docs/api-listusers) methods.

### EmployeeID

The [user's employee ID](/v1/docs/user-login-information#employee-id-required-if-primary-email-not-specified). This tag is mutually exclusive with the [ID](/v1/docs/api-getusergroups#id) and [Email](/v1/docs/api-getusergroups#email) tags. This is the EmployeeID returned by the [getUser](/v1/docs/api-getuser) and [listUsers](/v1/docs/api-listusers) method.

## API Response XML Package

The [API response XML package](/v1/docs/api-response-xml-package) will always include a Result, Info, and [Errors](/v1/docs/api-getusergroups#error-codes) tag.

```markup
<UserGroups>
   <Group>
      <Name><![CDATA[]]></Name>
      <Identifier><![CDATA[]]></Identifier>
      <IsHomeGroup><![CDATA[]]></IsHomeGroup>

      <Permissions>
         <Permission><![CDATA[]]></Permission>
      </Permissions>
   </Group>
</UserGroups>
```

The UserGroups tag is a container for the [groups](/v1/docs/groups) returned by the getUserGroups method. Each group is contained in a Group tag and may contain the following.

### Name

The [group's name](/v1/docs/group-group-information#name).

### Identifier

The user-specified [group identifier](/v1/docs/group-group-information#group-id).

### IsHomeGroup

Indicates whether the group is the user's [home group](/v1/docs/home-groups):

- *0* - The group is not the user's home group.
- *1* - The group is the user's home group.

### **Permissions**

A container for the [user's group permissions](/v1/docs/user-group-permissions). Each permission is contained in a Permission tag.

### Example API Response XML Package

Below is an example of an API response XML package.

```markup
<SmarterU>
   <Result>Success</Result>
   <Info>
      <UserGroups>
         <Group>
            <Name><![CDATA[Distribution]]></Name>
            <Identifier/>
            <IsHomeGroup>No</IsHomeGroup>

            <Permissions>
               <Permission><![CDATA[MANAGE_GROUP_USERS]]></Permission>
               <Permission><![CDATA[MANAGE_USERS]]></Permission>
               <Permission><![CDATA[VIEW_LEARNER_RESULTS]]></Permission>
            </Permissions>
         </Group>

         <Group>
            <Name><![CDATA[Human Resources]]></Name>
            <Identifier/>
            <IsHomeGroup>Yes</IsHomeGroup>

            <Permissions>
               <Permission><![CDATA[MANAGE_GROUP]]></Permission>
            </Permissions>
         </Group>

         <Group>
            <Name><![CDATA[Manufacturing]]></Name>
            <Identifier/>
            <IsHomeGroup>No</IsHomeGroup>

            <Permissions>
               <Permission><![CDATA[MANAGE_GROUP_USERS]]></Permission>
               <Permission><![CDATA[MANAGE_USERS]]></Permission>
               <Permission><![CDATA[VIEW_LEARNER_RESULTS]]></Permission>
            </Permissions>
         </Group>

         <Group>
            <Name><![CDATA[Retail]]></Name>
            <Identifier><![CDATA[G-3039]]></Identifier>
            <IsHomeGroup>No</IsHomeGroup>

            <Permissions>
               <Permission><![CDATA[MANAGE_GROUP_USERS]]></Permission>
               <Permission><![CDATA[MANAGE_USERS]]></Permission>
               <Permission><![CDATA[VIEW_LEARNER_RESULTS]]></Permission>
            </Permissions>
         </Group>
      </UserGroups>
   </Info>

   <Errors>
   </Errors>
</SmarterU>
```

## **Error Codes**

| Error Code | Message |
| --- | --- |
| GUG:01 | The email address provided is not valid. |
| GUG:02 | The employee ID provided is not valid. |
| GUG:03 | The user ID provided is not valid. |

## Related

- [API: createUser](/api-createuser.md)
- [API: getUser](/api-getuser.md)
- [API: getUserSubscriptions](/api-getusersubscriptions.md)
- [API: getUserWithRoleDetail](/api-getuserwithroledetail.md)
- [API: listUsers](/api-listusers.md)
- [API: updateUser](/api-updateuser.md)
- [Home Groups](/home-groups.md)
- [User: Group Permissions](/user-group-permissions.md)
