---
title: "SetRole"
method: POST
path: "/gitpod.v1.OrganizationService/SetRole"
tags: ["gitpod.v1.OrganizationService"]
---

# SetRole

`POST /gitpod.v1.OrganizationService/SetRole`

Manages organization membership and roles by setting a user's role within the organization.

 Use this method to:
 - Promote members to admin role
 - Change member permissions
 - Demote admins to regular members

 ### Examples

 - Promote to admin:

   Makes a user an organization administrator.

   ```yaml
   organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
   userId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
   role: ORGANIZATION_ROLE_ADMIN
   ```

 - Change to member:

   Changes a user's role to regular member.

   ```yaml
   organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
   userId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
   role: ORGANIZATION_ROLE_MEMBER
   ```

## Request body

- GitpodV1SetRoleRequest
  - `organizationId` string, uuid, required
  - `role` 'ORGANIZATION_ROLE_UNSPECIFIED' | 'ORGANIZATION_ROLE_ADMIN' | 'ORGANIZATION_ROLE_MEMBER'
  - `userId` string, uuid, required

## Response `200`

Success

- GitpodV1SetRoleResponse

## Other responses

- `default` — Error

## Changes

- **2025-02-21** `3655d5ad0ac3` — 2 breaking, 1 warning, 3 info
  - request property `role` was restricted to a list of enum values
  - the `role` request property type/format changed from ``/`` to `string`/``
  - removed `#/components/schemas/gitpod.v1.OrganizationRole` from the `role` request property `allOf` list
  - added the new `ORGANIZATION_ROLE_ADMIN` enum value to the request property `role`
  - …2 more
- **2025-02-18** `cd6a05ae99d2` — 1 warning
  - removed the optional property `detail` from the response with the `default` status
- **2025-02-14** `988164042da1` — 2 breaking
  - the request property `organizationId` became required
  - the request property `userId` became required

[Change history](https://skmtc.dev/gitpod-io/apis/gitpod-v1/changes/gitpod.v1.OrganizationService/SetRole/post.md)

---

[API](https://skmtc.dev/gitpod-io/apis/gitpod-v1.md) · [All operations](https://skmtc.dev/gitpod-io/apis/gitpod-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gitpod-io/gitpod-v1/revisions/44d50c2ac284/schema)
