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

# Update Member Role

> Update a team member's role.

**Required Role:** ADMIN or OWNER

Restrictions:
- Cannot change your own role
- Cannot change owner role (unless you're also an owner)
- Cannot set role to owner (use ownership transfer instead)



## OpenAPI

````yaml PATCH /v1/teams/{team_id}/members/{user_id}
openapi: 3.1.0
info:
  title: Data Raven API
  description: Cloud-to-cloud data transfer platform powered by RClone
  version: 0.5.0
servers: []
security: []
paths:
  /v1/teams/{team_id}/members/{user_id}:
    patch:
      tags:
        - Teams
      summary: Update Member Role
      description: |-
        Update a team member's role.

        **Required Role:** ADMIN or OWNER

        Restrictions:
        - Cannot change your own role
        - Cannot change owner role (unless you're also an owner)
        - Cannot set role to owner (use ownership transfer instead)
      operationId: update_member_role_v1_teams__team_id__members__user_id__patch
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Team Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeamMemberRoleUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamMemberResponse'
        '400':
          description: Cannot change your own role
        '403':
          description: Only owners can modify other owners' roles
        '404':
          description: Member not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    TeamMemberRoleUpdate:
      properties:
        role:
          $ref: '#/components/schemas/UserRole'
      type: object
      required:
        - role
      title: TeamMemberRoleUpdate
      description: Schema for updating team member role.
    TeamMemberResponse:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        role:
          $ref: '#/components/schemas/UserRole'
        joined_at:
          type: string
          format: date-time
          title: Joined At
        invited_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Invited By
      type: object
      required:
        - user_id
        - role
        - joined_at
      title: TeamMemberResponse
      description: Schema for team member in responses.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserRole:
      type: string
      enum:
        - viewer
        - operator
        - admin
        - owner
      title: UserRole
      description: >-
        User roles within teams (hierarchical).


        - OWNER (4): Full control including team deletion

        - ADMIN (3): All operations except team deletion

        - OPERATOR (2): Day-to-day operations (run jobs, view logs), no
        setup/config

        - VIEWER (1): Read-only audit access
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````