---
title: "Rename Subgroup"
method: POST
path: "/claims/{claim_id}/expenditures/subgroups/rename"
tags: ["expenditures"]
---

# Rename Subgroup

`POST /claims/{claim_id}/expenditures/subgroups/rename`

## Request

- Base URL: `https://api.claimkit.co` (the document declares no server; this is the origin it was published from)
- URL: `https://api.claimkit.co/claims/{claim_id}/expenditures/subgroups/rename`
- Auth: none declared

Rename a subgroup by rewriting ``subgroup_key`` on every active item in
``(category, subgroup_key)`` to ``new_subgroup_key``. Each touched item is
flagged ``manual_override=True``, and any subgroup-scoped query threads on
the old key are carried over so their open-query badge follows the rename.

Rejected (400) for the salaries bucket — its keys are synthesised per
employee identity. Rejected (409) if the new name already exists in the
category, to avoid a rename silently becoming a merge.

## Path parameters

- `claim_id` integer, required

## Request body

- RenameSubgroupRequest: Relabel a subgroup in place: every active item in ``(category, subgroup_key)`` picks up ``new_subgroup_key``. Unlike :class:`MergeSubgroupRequest` this is a pure rename — it stays within one category and is rejected (409) if ``new_subgroup_key`` already names a subgroup in that category, so it never silently merges.
  - `category` string, required
  - `subgroup_key` string, required
  - `new_subgroup_key` string, required

## Response `200`

Successful Response

- BulkUpdateResponse
  - `updated_count` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/claimkit/apis/claimkit-api.md) - [All operations](https://skmtc.dev/claimkit/apis/claimkit-api/llms.txt) - [OpenAPI document](https://skmtc.dev/claimkit/apis/claimkit-api/revisions/94dc85ba5326?raw)
