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

# Set Team Member Role

> Change a member's role within the team (ADMIN or MEMBER).



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json patch /api/admin/teams/{team_id}/members/{user_id}
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/admin/teams/{team_id}/members/{user_id}:
    patch:
      tags:
        - admin-teams
      summary: Set Team Member Role
      description: Change a member's role within the team (ADMIN or MEMBER).
      operationId: set_team_member_role_api_admin_teams__team_id__members__user_id__patch
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            title: Team Id
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTeamMemberRoleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse_AdminTeamMember_'
        '401':
          description: Authorization failed
        '403':
          description: Insufficient permissions
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateTeamMemberRoleRequest:
      properties:
        role:
          $ref: '#/components/schemas/TeamRoleEnum'
      additionalProperties: false
      type: object
      required:
        - role
      title: UpdateTeamMemberRoleRequest
      description: Change an existing member's role within the team.
    GenericResponse_AdminTeamMember_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/AdminTeamMember'
            - type: 'null'
          description: Response data
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Response status
      type: object
      title: GenericResponse[AdminTeamMember]
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    TeamRoleEnum:
      type: string
      enum:
        - ADMIN
        - MEMBER
      title: TeamRoleEnum
    AdminTeamMember:
      properties:
        userId:
          type: string
          title: Userid
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        role:
          type: string
          title: Role
        joinedAt:
          type: string
          format: date-time
          title: Joinedat
      type: object
      required:
        - userId
        - role
        - joinedAt
      title: AdminTeamMember
      description: A team member (user) with their team role and join date.
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````