---
title: "Assign or update user group model role"
method: POST
path: "/v1/user-groups/{userGroupId}/model-roles"
tags: ["User group model roles"]
---

# Assign or update user group model role

`POST /v1/user-groups/{userGroupId}/model-roles`

Assign or update a model role for a user group. If the user group already has a role for the specified model, this endpoint will update it to the new role. All members of the user group will inherit this role.

Model roles control what actions user group members can perform on models and connections. To manage user groups, see the [User group APIs](/api/user-groups).

## Path parameters

- `userGroupId` string, required

## Request body

- object
  - `connectionId` string, uuid — The ID of the connection that the model belongs to: - **Required** if `modelId` is not provided - **Optional** if `modelId` is provided, as it will be inferred from the model
  - `modelId` string, uuid — The ID of the model to assign the role for: - **Optional** when assigning `CONNECTION_ADMIN` or [custom roles](/administration/users/custom-roles) with `CONNECTION_ADMIN` as the base role - **Required** for other role types
  - `roleName` string, required — The role to assign. Available roles include: - `VIEWER` - Can view the model - `QUERIER` - Can view and query the model - `QUERY_TOPICS` - Can query specific topics. Equivalent to **Restricted Querier.** - `MODELER` - Can edit and model the data - `CONNECTION_ADMIN` - Full administrative access to the connection - `NO_ACCESS` - No access to the model - [Custom roles](/administration/users/custom-roles) defined for your organization

## Response `200`

Model role assigned or updated successfully.

- object
  - `userGroupId` string — The ID of the user group.
  - `connectionId` string, uuid — The ID of the connection.
  - `modelId` string, uuid — The ID of the model.
  - `roleName` string — The assigned role name.

## Other responses

- `400` — Bad Request. Possible error messages include: - `Invalid JSON` - `Invalid model ID` - `Invalid connection ID` - `Method not allowed`
- `404` — Not Found. Possible error messages include: - `User group not found in organization` - `Model does not exist` - `Connection does not exist`
- `422` — Unprocessable Entity. Possible error messages include: - `Invalid role` - `Model does not belong to connection` - `Only shared and shared_extension models can be assigned model roles`
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)

---

[API](https://skmtc.net/omni/apis/omni-api.md) · [All operations](https://skmtc.net/omni/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omni/omni-api/revisions/6b02f7349d0e/schema)
