---
title: "Replaces a schedule group's complete membership."
method: PUT
path: "/api/v1/schedule-groups/{id}/members"
tags: ["ScheduleGroups"]
---

# Replaces a schedule group's complete membership.

`PUT /api/v1/schedule-groups/{id}/members`

## Request

- Base URL: `https://app.flexonthejob.com`
- URL: `https://app.flexonthejob.com/api/v1/schedule-groups/{id}/members`
- Auth: HTTP bearer

Requires `ManageJobs` and an `Idempotency-Key` header. Same as saving the member
picker on the Schedule Groups page: listed users become (or stay) members, everyone else is
removed, and `isLead` is set exactly for `leadIds`. All or nothing: an id that is
not an active user of this organization, or a lead missing from `userIds`, changes
nothing. Jobs already assigned are not changed. For single changes use
`PUT` / `DELETE .../members/{userId}`.
Example: `{ "userIds": ["3f2a…", "9b1c…"], "leadIds": ["3f2a…"] }`.

## Path parameters

- `id` integer, required

## Request body

- ScheduleGroupMembersApiRequest: Body of `PUT /api/v1/schedule-groups/{id}/members`: the group's complete membership. Example: `{ "userIds": ["3f2a…", "9b1c…"], "leadIds": ["3f2a…"] }`.
  - `userIds` string[], required: User ids (string GUIDs, from `GET /api/v1/users`) of every member, each an active user of this organization; `[]` removes everyone. At most 500.
  - `leadIds` string[], nullable: The crew leads / foremen among `userIds` (each must also be in `userIds`); omitted or `[]` = no leads.

## Response `200`

The group with its members after the change.

- ScheduleGroupDto: A scheduling group (division, crew or team) of the calling organization, as returned by `GET /api/v1/schedule-groups`. Groups form a tree via `parentGroupId`; a user may belong to several groups. Requires the `scheduling` module.
  - `id` integer: Numeric id of the group. Stable within this organization.
  - `syncId` string, uuid: Globally unique sync id (GUID). Use it as the `after` pagination cursor.
  - `name` string: Group name, e.g. `"Install Crew A"`.
  - `description` string, nullable: Optional description shown on the dispatch board.
  - `colorHex` string, nullable: Hex colour used for calendar / board rendering, e.g. `"#2e7d32"`; null when unset.
  - `parentGroupId` integer, nullable: Id of the parent group (e.g. the division a crew belongs to); null for top-level groups.
  - `parentGroupName` string, nullable: Name of the parent group; null for top-level groups.
  - `displayOrder` integer: Sort position among siblings (ascending). Pages are returned in id order, so sort by this client-side when rendering a board.
  - `members` ScheduleGroupMemberDto[]: Members of this group, leads first. Only active users are listed.
    - `userId` string: User id (string GUID) — matches `id` from `GET /api/v1/users` and job assignee ids.
    - `displayName` string: User's display name, e.g. `"Sam Carter"`.
    - `isLead` boolean: True for the crew lead / foreman of this group.
  - `createdAt` string, date-time: UTC creation timestamp.
  - `updatedAt` string, date-time, nullable: UTC timestamp of the last edit; null when never edited.

## Other responses

- `400`: Malformed body, more than 500 ids, or missing `Idempotency-Key`.
- `401`: Unauthorized
- `403`: The `scheduling` module is not active for this organization.
- `404`: No such group in this organization.
- `409`: The key's creator is unknown on this server.
- `422`: An unknown or inactive user id (`userIds`), or a lead not listed in `userIds` (`leadIds`).
- `429`: Too Many Requests

---

[API](https://skmtc.dev/flexonthejob/apis/flex-api.md) · [All operations](https://skmtc.dev/flexonthejob/apis/flex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flexonthejob/apis/flex-api/revisions/19c8f4d27acf?raw)
