---
updatedAt: 2026-04-22T15:31:09.000Z
agentTools:
  projectIndex: https://360learning.readme.io/llms.txt
---

# Migrate deleteUserFromGroup

This guide outlines the changes introduced in the [Remove a user's role](https://360learning.readme.io/reference/v2groupsremoveuserrolefromgroupcontroller_removeuserrolefromgroup) v2 endpoint (previously known as `deleteUserFromGroup` in v1).

<Callout icon="💡" theme="default">

  ### Key changes

  * **No more input body:** The v2 endpoint does not use an input body anymore, as every input parameters are passed along in the endpoint path.
  * **Identifier type:** The v2 endpoint requires user's unique IDs. It no longer accepts an email address as a direct identifier. Migrating requires extra steps if you previously used email. For more information, see the **How to identify users in v2** section below.

</Callout>

## Documentation links

Here are the links to the API reference for:

* [API v1](https://api.360learning.com/#6232d764-eefd-4a68-b205-a1946259f9e2)
* [API v2](https://360learning.readme.io/reference/v2groupsremoveuserrolefromgroupcontroller_removeuserrolefromgroup)

## Endpoint mapping

Here's the direct correlation between the v1 and v2 endpoint URLs:

* API v1: `/api/v1/groups/:group_id/users/:email`
* API v2: '/api/v2/groups/`{groupId}`/`{role}`/`{userId}`'

## Behavior changes

### Private subgroups deletion

The v2 endpoint does not remove the user from the target group private subgroups. You will have to iterate on private subgroups and call this very same endpoint each time to do so.

### How to identify users in v2

A key update in v2 is the standardized method for identifying users. For improved security and consistency, you must now use the user's unique internal ID when referencing a user.

* If you already have the internal ID, you can use it directly.
* If you only have the user's email address, you'll need to fetch their internal ID first.

To get the user ID based on their email address:

1. **Retrieve and cache all users:**\
   Call [List all users](https://360learning.readme.io/reference/v2usersgetuserscontroller_getusers) to retrieve the full list of users in your organization. To ensure your application is performant, this data should be stored in a local database or cache that is updated periodically.
2. **Find the user and get their ID:**\
   Find the user object where the `mail` field matches the email you are searching for.\
   Copy the value of their `_id`. This is the internal ID.

<br />

## Input changes

This section details the specific alterations to the input requirements between API versions.

### API v1 input example

```Text Shell
curl --location -g --request DELETE 'https://{{host}}/api/v1/groups/58eb608a1a92bb4fb56b31a/users/learner@yourcompany.com' \
--data-urlencode 'company={{company}}' \
--data-urlencode 'apiKey={{apiKey}}'
```

### API v2 input example

```Text Shell
curl --request DELETE \
     --url https://app.360learning.com/api/v2/groups/507f1f77bcf86cd799439011/learner/507f1f77bcf86cd799439011 \
     --header '360-api-version: v2.0' \
     --header 'accept: application/json'
```

### Main input differences

<Table align={["left","left","left"]}>

  <thead>
    <tr>
      <th>Change type</th>
      <th>API v1</th>
      <th>API v2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <span class="param-modified">Modified</span><br/> Parameter
      </td>
      <td>
        `user_email` (Path parameter, Required): Could be the email or the ID of the user. This parameter email was part of the URL path.
      </td>
      <td>
        `userId` (Required): user's internal ID. An email is no longer accepted here.
        See **Behavior changes** (section above) for how to get the ID from an email.
      </td>
    </tr>
    <tr>
      <td>
        <span class="param-removed">Removed</span><br/>Body parameter
      </td>
      <td>
        `deleteFromPrivateSubgroups` (Body parameter, Required): Indicate whether to also remove the user from the target group's private subgroups
      </td>
      <td>
        Not replaced
      </td>
    </tr>
    <tr>
      <td>
        <span class="param-removed">Removed</span><br/>Body parameter
      </td>
      <td>
        `group_id` (Body parameter, Required): Unique identifier of the group to remove the user from.
      </td>
      <td>
        `groupId` (Path parameter, Required): Unique identifier of the group to remove the user from.
      </td>
    </tr>
  </tbody>
  
</Table>

## Output changes

This section details the specific alterations to the successful output returned between API versions.

### API v1 output example

```Text JSON
// 204 No content
```

### API v2 output example

```Text JSON
// 204 No content
```

### Main output differences

No change in output as both versions return a `204 No content` with no response body.