---
title: "Sync Group Users"
method: POST
path: "/entityGroup/{entityGroupId}/sync-users"
tags: ["entity-group > user"]
---

# Sync Group Users

`POST /entityGroup/{entityGroupId}/sync-users`

## Request

- Base URL: `https://api.mercoa.com`
- URL: `https://api.mercoa.com/entityGroup/{entityGroupId}/sync-users`
- Auth: HTTP bearer

Sync entity group users. This will add users to entities that do not have them and remove users from entities that have them.

## Path parameters

- `entityGroupId` string, required

## Request body

- EntityGroupTypesEntityGroupUserSyncRequest
  - `copyUsersFrom` string
  - `filterRoles` string[]: List of roles to filter users by. If not provided, all users will be copied. If provided, only users with the provided roles will be copied.
  - `addUsers` boolean: If true, users will be added to entities if they are not found in the copyUsersFrom entity. Default is true.
  - `removeUsers` boolean: If true, users will be removed from entities if they are not found in the copyUsersFrom entity. Default is false.

## Response `200`

Successful response

## Other responses

- `400`: Error response with status 400
- `401`: Error response with status 401
- `403`: Error response with status 403
- `404`: Error response with status 404
- `409`: Error response with status 409
- `500`: Error response with status 500
- `501`: Error response with status 501

---

[API](https://skmtc.dev/mercoa/apis/mercoa-2.md) - [All operations](https://skmtc.dev/mercoa/apis/mercoa-2/llms.txt) - [OpenAPI document](https://skmtc.dev/mercoa/apis/mercoa-2/revisions/00a8e403ae18?raw)
