---
title: "Set Subgroup Distribution Link"
method: POST
path: "/claims/{claim_id}/expenditures/subgroups/distribution-link"
tags: ["expenditures"]
---

# Set Subgroup Distribution Link

`POST /claims/{claim_id}/expenditures/subgroups/distribution-link`

## 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/distribution-link`
- Auth: none declared

Link a whole subgroup to an employee distribution (NULL-scope members
follow it, including items imported later), rescope it, or unlink it.
Keys are stored verbatim — sentinels included — matching how
assign_subgroup_to_activity addresses subgroups. Unlink zeroes the R&D of
the members that were following the link, matching the per-item opt-out;
``updated_count`` is that many rows.

## Path parameters

- `claim_id` integer, required

## Request body

- SetSubgroupDistributionLinkRequest
  - `source` SubgroupDistributionSource, required
    - `category` string, required
    - `subgroup_key` string, required
  - `scope` 'all' | 'engineering', 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)
