---
title: "Assign Subgroup To Activity"
method: POST
path: "/claims/{claim_id}/expenditures/subgroups/assign-activity"
tags: ["expenditures"]
---

# Assign Subgroup To Activity

`POST /claims/{claim_id}/expenditures/subgroups/assign-activity`

## 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/assign-activity`
- Auth: none declared

Set ``activity_id`` on every item in ``source`` to the requested
activity (or NULL to send the subgroup back to Ungrouped). Items whose
split actually changes are flagged ``manual_override=True`` (via the
apportionment writer); every matched item — including those already at
the target — is additionally stamped out of distribution links, WITHOUT
``manual_override`` when the stamp is the only change. ``updated_count``
therefore means "splits changed or stopped following a distribution".

Salaries are rejected on the same grounds as :func:`merge_subgroups` —
they're synthesised from ``aurd_employee_rates`` and apportioned via
:class:`AURDEmployeeCostApportionment`, not stored on the expenditure
items table.

## Path parameters

- `claim_id` integer, required

## Request body

- AssignSubgroupToActivityRequest: Assign every item in ``source`` to ``activity_id``. ``activity_id`` of ``None`` moves the subgroup back to the synthetic Ungrouped bucket on the categorised expenditures page.
  - `source` SubgroupRef, required: A single (category, subgroup_key) pair. ``subgroup_key`` is required — the salaries bucket uses synthesised keys per identity and isn't a valid merge target on either side.
    - `category` string, required
    - `subgroup_key` string, required
  - `activity_id` integer, nullable, 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)
