{
  "schema_version": 2,
  "id": "commands/xgroup-setid",
  "title": "XGROUP SETID",
  "url": "https://redis.io/docs/latest/commands/xgroup-setid/",
  "summary": "Sets the last-delivered ID of a consumer group.",
  "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": "b650ce9392e239363e6c0bac34bd93662808675f330e4a2f512af7db03ffedc1",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Set the last delivered ID for a consumer group.\n\nNormally, a consumer group's last delivered ID is set when the group is created with [`XGROUP CREATE`](https://redis.io/docs/latest/commands/xgroup-create).\nThe `XGROUP SETID` command allows modifying the group's last delivered ID, without having to delete and recreate the group.\nFor instance if you want the consumers in a consumer group to re-process all the messages in a stream, you may want to set its next ID to 0:\n\n    XGROUP SETID mystream mygroup 0\n\nThe optional `entries_read` argument can be specified to enable consumer group lag tracking for an arbitrary ID.\nAn arbitrary ID is any ID that isn't the ID of the stream's first entry, its last entry or the zero (`0-0`) ID.\nThis can be useful you know exactly how many entries are between the arbitrary ID (excluding it) and the stream's last entry.\nIn such cases, the `entries_read` can be set to the stream's `entries_added` subtracted with the number of entries."
    },
    {
      "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 | $</code></summary>\n\nThe ID to set as the group's last-delivered ID. Use `$` for the last message currently in the stream, or `0` to reset to the start.\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>ENTRIESREAD entries-read</code></summary>\n\nSet the group's entries-read counter, used to compute its lag.\n\n</details>"
    },
    {
      "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[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`.\n\n**RESP3:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`."
    }
  ],
  "examples": []
}
