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

# Update Team Member Role

> Change a member's role (Admin only). Blocks demoting the last admin.



## OpenAPI

````yaml /openapi.json patch /api/v1/teams/{team_id}/members/{member_user_id}
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/teams/{team_id}/members/{member_user_id}:
    patch:
      tags:
        - Teams
      summary: Update Team Member Role
      description: Change a member's role (Admin only). Blocks demoting the last admin.
      operationId: >-
        update_team_member_role_api_v1_teams__team_id__members__member_user_id__patch
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Team Id
        - name: member_user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Member User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeamMemberRoleUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamUserResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    TeamMemberRoleUpdate:
      properties:
        role:
          type: string
          enum:
            - admin
            - standard
          title: Role
          description: New role for the member
      type: object
      required:
        - role
      title: TeamMemberRoleUpdate
    TeamUserResponse:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
        email:
          type: string
          title: Email
        display_name:
          type: string
          title: Display Name
        role:
          type: string
          title: Role
        created_at:
          type: string
          format: date-time
          title: Created At
        invited_by_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Invited By User Id
      type: object
      required:
        - user_id
        - email
        - display_name
        - role
        - created_at
      title: TeamUserResponse
      description: A human member of a team.
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````