---
title: "Update Group User"
method: POST
path: "/entityGroup/{entityGroupId}/user/{foreignId}"
tags: ["entity-group > user"]
---

# Update Group User

`POST /entityGroup/{entityGroupId}/user/{foreignId}`

## Request

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

Update entity user for all entities in the group.

## Path parameters

- `entityGroupId` string, required
- `foreignId` string, required

## Request body

- EntityGroupTypesEntityGroupUserRequest
  - `foreignId` string, required: The ID used to identify this user in your system. This is a required field and needs to be unique for all users in the group.
  - `email` string
  - `name` string
  - `roles` string[]: List of roles to assign to the user. A role can be any string. For example: "payer", "approver", "viewer" If not provided, the user will have no roles. Per entity roles will override these global roles.
  - `entities` EntityGroupTypesEntityGroupUserEntityRequest[]: List of roles per entity. Useful for assigning roles to specific entities.
    - `roles` string[], required: List of roles. A role can be any string. For example: "payer", "approver", "viewer"
    - `entityId` string, required

## Response `200`

Response with status 200

- EntityGroupTypesEntityGroupUserResponse
  - `foreignId` string, required: The ID used to identify this user in your system.
  - `email` string
  - `name` string
  - `entities` EntityGroupTypesEntityGroupUserEntityResponse[], required: List of roles per entity.
    - `roles` string[], required: List of roles. A role can be any string. For example: "payer", "approver", "viewer"
    - `entityId` string, required
    - `id` string, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## 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)
