---
title: "Update Group Membership"
method: POST
path: "/v1/farm/{farm_id}/groups/{group_id}/membership"
tags: ["groups"]
---

# Update Group Membership

`POST /v1/farm/{farm_id}/groups/{group_id}/membership`

## Request

- Base URL: `https://api.ranch.bot`
- URL: `https://api.ranch.bot/v1/farm/{farm_id}/groups/{group_id}/membership`
- Auth: HTTP bearer

Current groups HTTP operation. External credential scopes: write:groups. Minimum farm role: EDITOR. Explicitly add and remove group members. Pass the membership_fingerprint from a fresh group read; a stale fingerprint is a 409 conflict. add_animal_ids and remove_animal_ids must not overlap, every target must be on this farm, and additions must be active. Already-present additions and already-absent removals are no-ops. Removal unlinks membership only; it changes no animal status, record, count observation or saved birth link, and cannot be undone.

## Path parameters

- `farm_id` string, uuid, required
- `group_id` string, uuid, required

## Request body

- object
  - `add_animal_ids` string[]: Active same-farm animal UUIDs to add.
  - `remove_animal_ids` string[]: Same-farm animal UUIDs to unlink.
  - `membership_fingerprint` string, required: From a fresh group read; a mismatch is a 409 conflict.

## Response `200`

Success

- object
  - `group_id` string, uuid, required
  - `added_animal_ids` string[], required
  - `removed_animal_ids` string[], required
  - `member_animal_ids` string[], required
  - `membership_fingerprint` string, required
  - `member_count` integer, required

## Other responses

- `400`: Request validation failed.
- `401`: Missing/invalid authentication or insufficient farm role.
- `403`: Missing required scope or credential type is disallowed.
- `404`: Resource or active farm membership not found.
- `409`: The reviewed membership changed before this request was applied; reread the group.
- `429`: Rate limit exceeded. Retry after the indicated delay.
- `500`: Unexpected server failure.

---

[API](https://skmtc.dev/ranch/apis/ranch-bot-http-api.md) · [All operations](https://skmtc.dev/ranch/apis/ranch-bot-http-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ranch/apis/ranch-bot-http-api/revisions/24109d33fa02?raw)
