# Assign roles to a user in an organization **POST /api/organizations/{id}/users/{userId}/roles** Assign roles to a user in the specified organization with the provided data. ## Servers - Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.) ## Authentication methods - O auth2 ## Parameters #### Path parameters - **id** (string) The unique identifier of the organization. - **userId** (string) The unique identifier of the user. ## Body parameters Content-type: application/json - **organizationRoleIds** (array[string]) An array of organization role IDs to assign to the user. User existed roles assignment will be ignored. - **organizationRoleNames** (array[string]) An array of organization role names to assign to the user. User existed roles assignment will be ignored. ## Responses ### 201: Roles were assigned to the user successfully. ### 400: Bad Request ### 401: Unauthorized ### 403: Forbidden ### 422: The user is not a member of the organization; or at least one of the IDs provided is not valid. For example, the organization ID or organization role ID does not exist; or at least one of the role names provided is not valid. For example, the organization role name does not exist. [Powered by Bump.sh](https://bump.sh)