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

---

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