# Remove a user from a group (/docs/apis/management/users/RemoveUserFromGroup)

`DELETE /users/{user_id}/groups/{group_id}`

Removes the specified user from the group. After removal, the user will no longer receive any access, permissions, or roles previously granted through that group.

Base URL: `https://{tenant}.{region}.monocloud.com/api`, where `{tenant}`, `{region}` (one of us, eu, in) come from your tenant. Authentication: send your Management API key in the `X-API-KEY` header.

## Parameters

- `user_id` (path) (string, required) The unique identifier of the user.
- `group_id` (path) (string, required, uuid) The unique identifier of the group.

## Response body

`204`. The user was removed from the group successfully

## Errors

- `401` Unauthorized
- `403` Forbidden
- `404` Not Found
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
- `422` Unprocessable Entity
  - `KeyValidationProblemDetails`
    - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
    - `title` (string, required) A short, human-readable summary of the error.
    - `status` (integer, required, int32) The HTTP status code associated with this error response.
    - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
    - `detail` (string) A human-readable explanation specific to this occurrence of the error.
    - `instance` (string) A URI reference that identifies the specific occurrence of the error.
    - `errors` (Record<string, string[]>, required) A key-value map of validation errors, where each key represents a request field and the value contains one or more messages describing why the request could not be processed.
  - `IdentityValidationProblemDetails`
    - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
    - `title` (string, required) A short, human-readable summary of the error.
    - `status` (integer, required, int32) The HTTP status code associated with this error response.
    - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
    - `detail` (string) A human-readable explanation specific to this occurrence of the error.
    - `instance` (string) A URI reference that identifies the specific occurrence of the error.
    - `errors` (IdentityError[], required) List of identity validation errors describing why the request could not be processed.

## Example (MonoCloud .NET SDK)

```csharp
using MonoCloud.Management;
using MonoCloud.Management.Core.Base;

var apiClient = new MonoCloudManagementClient(new MonoCloudConfig("<your-domain>", "[[API-Key]]"));


var userId = "WUgDGqaqzqkRmsgd3PFAT";

var groupId = Guid.Parse("b4835fe2-5d39-4ff8-a1b6-1699b5899ff8");


var result = await apiClient.Users.RemoveUserFromGroupAsync(userId, groupId);
```

## Example (MonoCloud Javascript SDK)

```javascript
import { MonoCloudManagementClient } from '@monocloud/management';

const apiClient = MonoCloudManagementClient.init({ domain: '<your-domain>', apiKey: '[[API-Key]]' });

const userId = 'WUgDGqaqzqkRmsgd3PFAT';

const groupId = 'b4835fe2-5d39-4ff8-a1b6-1699b5899ff8';

const result = apiClient.users.removeUserFromGroup(userId, groupId);
```