# group_eject

Ejects a resident from a group.


:::info
This API command applies only for **Standard bots**.

:::

```csharp
// See "LSL Helper Functions" page for this function
smartbotsAPI("group_eject", [
  "avatar", "417732f0-a100-4e2d-a9bf-e381cfd12c3a",
  "groupuuid", "0b65a122-8f77-64fe-5b2a-225d4c490d9c"
]);
```

```snippet http-api-variables-OmJyUigTgO
```

```snippet http-api-input-basic-parameters-5FcVlaJbq0 action="group_eject"
```

```snippet http-api-input-q5yvAagqsZ
avatar            | yes      | The UUID of the resident to eject
groupuuid         | yes      | The UUID of the group
ignore_membership | optional | Set to `1` to return success even if the resident is not in the group (see **Return value** below)
```

```snippet http-api-output-JAwUcmg7i7
```

# Return value

By default, the command returns success (`OK`) when the resident has been successfully ejected.  
If the resident is **not a member** of the group, an error message is returned:

```
Ejectee is not in the group
```

If you don’t need to verify membership, set `ignore_membership` to `1` — this forces the command to return `OK` even when the resident is not in the group.

# Custom roles

If your bot attempts to eject a member with a **custom role** (other than “Everyone”), additional abilities are required.  
For details, see [Inviting and ejecting from custom roles](/doc/4cb0e17a-9a3c-434f-b0bf-934091057184).