> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openhands.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Org Member

> Update a member's role in an organization.

Permission rules:
- Admins can change roles of regular members to Admin or Member
- Admins cannot modify other Admins or Owners
- Owners can change roles of Admins and Members to any role (Owner, Admin, Member)
- Owners cannot modify other Owners

Members cannot modify their own role. The last owner cannot be demoted.



## OpenAPI

````yaml /openapi/openhands-cloud.json patch /api/organizations/{org_id}/members/{user_id}
openapi: 3.1.0
info:
  title: OpenHands
  description: 'OpenHands: Code Less, Make More'
  version: 0.0.1
servers: []
security: []
paths:
  /api/organizations/{org_id}/members/{user_id}:
    patch:
      tags:
        - Orgs
      summary: Update Org Member
      description: >-
        Update a member's role in an organization.


        Permission rules:

        - Admins can change roles of regular members to Admin or Member

        - Admins cannot modify other Admins or Owners

        - Owners can change roles of Admins and Members to any role (Owner,
        Admin, Member)

        - Owners cannot modify other Owners


        Members cannot modify their own role. The last owner cannot be demoted.
      operationId: update_org_member_api_organizations__org_id__members__user_id__patch
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Org Id
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
        - name: X-Org-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Org-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgMemberUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgMemberResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    OrgMemberUpdate:
      properties:
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
      type: object
      title: OrgMemberUpdate
      description: Request model for updating an organization member.
    OrgMemberResponse:
      properties:
        user_id:
          type: string
          title: User Id
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        role_id:
          type: integer
          title: Role Id
        role:
          type: string
          title: Role
        role_rank:
          type: integer
          title: Role Rank
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      required:
        - user_id
        - email
        - role_id
        - role
        - role_rank
        - status
      title: OrgMemberResponse
      description: Response model for a single organization member.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Access-Token

````