---
title: "Assign roles to organization user members"
method: POST
path: "/api/organizations/{id}/users/roles"
tags: ["Organizations"]
---

# Assign roles to organization user members

`POST /api/organizations/{id}/users/roles`

Assign roles to user members of the specified organization.

## Path parameters

- `id` string, required

## Request body

- object
  - `userIds` string[], required — An array of user IDs to assign roles.
  - `organizationRoleIds` string[], required — An array of organization role IDs to assign. User existed roles assignment will be ignored.

## Response `201`

Roles were assigned to organization users successfully.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `422` — At least one of the IDs provided is not valid. For example, the organization ID, user ID, or organization role ID does not exist; the user is not a member of the organization; or the role type is not assignable to the user.

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/versions/a163dc77d842/schema)
