Update roles for a user in an organization

PUT /api/organizations/{id}/users/{userId}/roles

Update roles assigned to a user in the specified organization with the provided data.

Path parameters

  • id string Required

    The unique identifier of the organization.

  • userId string Required

    The unique identifier of the user.

application/json

Body Required

  • organizationRoleIds array[string] Required

    An array of organization role IDs to update for the user.

    Minimum length of each is 1.

Responses

  • Roles were updated for the user successfully.

  • Bad Request

  • Unauthorized

  • Forbidden

  • 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.

PUT /api/organizations/{id}/users/{userId}/roles
curl \
 -X PUT https://[tenant_id].logto.app/api/organizations/{id}/users/{userId}/roles \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"organizationRoleIds":["string"]}'
Request examples
{
  "organizationRoleIds": [
    "string"
  ]
}