# XGROUP DESTROY

> Delete a consumer group from a stream, with its consumers and pending entries.

URL: https://docs.hotkv.com/commands/xgroup-destroy/

```
XGROUP DESTROY key group
```

- Group: Stream
- Complexity: O(N), N being the group's pending entries
- HotKV Cloud: all plans
- On-Premise: no license needed

`XGROUP DESTROY` removes the consumer group `group` from the stream at `key`,
together with its consumers and its pending entries list. The stream's
entries are not touched. Clients blocked in
[XREADGROUP](https://docs.hotkv.com/commands/xreadgroup/index.md) on that group get a `NOGROUP` error.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Group removed | Integer `1` | Integer `1` |
| No such group | Integer `0` | Integer `0` |

Error replies:

- `ERR The XGROUP subcommand requires the key to exist. ...` when the stream does not exist.
- `WRONGTYPE` if the key holds another type.

## Examples

```
127.0.0.1:6379> XGROUP CREATE orders billing $ MKSTREAM
OK
127.0.0.1:6379> XGROUP DESTROY orders billing
(integer) 1
127.0.0.1:6379> XGROUP DESTROY orders billing
(integer) 0
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[XGROUP CREATE](https://docs.hotkv.com/commands/xgroup-create/index.md), [XGROUP](https://docs.hotkv.com/commands/xgroup/index.md), [XINFO GROUPS](https://docs.hotkv.com/commands/xinfo-groups/index.md)