{
  "schema_version": 2,
  "id": "commands/xack",
  "title": "XACK",
  "url": "https://redis.io/docs/latest/commands/xack/",
  "summary": "Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.",
  "since": "5.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T16:45:25+01:00",
  "page_type": "content",
  "content_hash": "a5607287c3ab32e19ce4cc5d33f05d5ce2f787ca24b9171a84473df7fb023713",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The `XACK` command removes one or multiple messages from the\n*Pending Entries List* (PEL) of a stream consumer group. A message is pending,\nand as such stored inside the PEL, when it was delivered to some consumer,\nnormally as a side effect of calling [`XREADGROUP`](https://redis.io/docs/latest/commands/xreadgroup), or when a consumer took\nownership of a message calling [`XCLAIM`](https://redis.io/docs/latest/commands/xclaim). The pending message was delivered to\nsome consumer but the server is yet not sure it was processed at least once.\nSo new calls to [`XREADGROUP`](https://redis.io/docs/latest/commands/xreadgroup) to grab the messages history for a consumer\n(for instance using an ID of 0), will return such message.\nSimilarly the pending message will be listed by the [`XPENDING`](https://redis.io/docs/latest/commands/xpending) command,\nthat inspects the PEL.\n\nOnce a consumer *successfully* processes a message, it should call `XACK`\nso that such message does not get processed again, and as a side effect,\nthe PEL entry about this message is also purged, releasing memory from the\nRedis server."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe stream key.\n\n</details>\n\n<details open><summary><code>group</code></summary>\n\nThe consumer group name.\n\n</details>\n\n<details open><summary><code>id [id ...]</code></summary>\n\nOne or more message IDs to acknowledge.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): The command returns the number of messages successfully acknowledged. Certain message IDs may no longer be part of the PEL (for example because they have already been acknowledged), and XACK will not count them as successfully acknowledged.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): The command returns the number of messages successfully acknowledged. Certain message IDs may no longer be part of the PEL (for example because they have already been acknowledged), and XACK will not count them as successfully acknowledged."
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "redis> XACK mystream mygroup 1526569495631-0\n(integer) 1",
      "section_id": "examples"
    }
  ]
}
