# XACK

> Acknowledge stream entries, removing them from a consumer group's pending list.

URL: https://docs.hotkv.com/commands/xack/

```
XACK key group id [id ...]
```

- Group: Stream
- Complexity: O(1) per ID
- HotKV Cloud: all plans
- On-Premise: no license needed

`XACK` marks entries as processed for the consumer group `group`: they are
removed from the group's pending entries list, whichever consumer held them.
It returns how many of the IDs were pending and are now acknowledged.

Acknowledging does not delete the entries from the stream. Use
[XDEL](https://docs.hotkv.com/commands/xdel/index.md) or [XTRIM](https://docs.hotkv.com/commands/xtrim/index.md) for that.

When the stream and the group exist, all IDs are checked before any is
acknowledged.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Integer: the number of entries acknowledged | Integer |

The reply is `0` when the key or the group does not exist, or when none of
the IDs was pending.

Error replies: `ERR Invalid stream ID specified as stream command argument`,
and `WRONGTYPE` if the key holds another type.

## Examples

```
127.0.0.1:6379> XADD tasks 1700000000000-0 job email
"1700000000000-0"
127.0.0.1:6379> XGROUP CREATE tasks workers 0
OK
127.0.0.1:6379> XREADGROUP GROUP workers alice STREAMS tasks >
1) 1) "tasks"
   2) 1) 1) "1700000000000-0"
         2) 1) "job"
            2) "email"
127.0.0.1:6379> XACK tasks workers 1700000000000-0
(integer) 1
127.0.0.1:6379> XACK tasks workers 1700000000000-0
(integer) 0
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[XREADGROUP](https://docs.hotkv.com/commands/xreadgroup/index.md), [XPENDING](https://docs.hotkv.com/commands/xpending/index.md), [XCLAIM](https://docs.hotkv.com/commands/xclaim/index.md)