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

# Update Project User Role

> Update a user's role on a project.

Works for both full users and stub users.

Requirements:
- Requires FULL_ACCESS on the project
- Cannot update project role for workspace owners
- Role must be a valid project role: full_access, editor, commenter, downloader, viewer, no_access

Note: For MEMBER_LIMITED users, setting NO_ACCESS removes their explicit permission
(equivalent to DELETE) since they have no access without explicit permission.



## OpenAPI

````yaml /api-reference/openapi.json patch /projects/{project_id}/users/{user_id}
openapi: 3.1.0
info:
  title: Aspect Platform API
  description: A FastAPI application for Aspect Platform functionality
  version: 0.0.0
servers:
  - url: https://api.aspect.inc
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /projects/{project_id}/users/{user_id}:
    patch:
      tags:
        - Projects
      summary: Update Project User Role
      description: >-
        Update a user's role on a project.


        Works for both full users and stub users.


        Requirements:

        - Requires FULL_ACCESS on the project

        - Cannot update project role for workspace owners

        - Role must be a valid project role: full_access, editor, commenter,
        downloader, viewer, no_access


        Note: For MEMBER_LIMITED users, setting NO_ACCESS removes their explicit
        permission

        (equivalent to DELETE) since they have no access without explicit
        permission.
      operationId: patch_Projects_projects_project_id_users_user_id
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectUpdateRoleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectUserResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ProjectUpdateRoleRequest:
      properties:
        role:
          $ref: '#/components/schemas/ResourceRole'
          description: >-
            New role for the user (must be a project role: full_access, editor,
            commenter, downloader, viewer, no_access). Note: For MEMBER_LIMITED
            users, if the role is set to no_access and this is the user's last
            project with access in the workspace, the user will be removed from
            the workspace.
      type: object
      required:
        - role
      title: ProjectUpdateRoleRequest
      description: >-
        API request schema for updating a user's role on a project.


        Note: For MEMBER users, NO_ACCESS blocks their default project access.

        For MEMBER_LIMITED users, setting NO_ACCESS removes their explicit
        permission

        (equivalent to removing them from the project) since they have no access
        without it.
    ProjectUserResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: User ID
        first_name:
          type: string
          title: First Name
          description: User's first name
        last_name:
          type: string
          title: Last Name
          description: User's last name
        email:
          type: string
          title: Email
          description: User's email address
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
          description: User's avatar URL
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: External user ID from auth provider (None for stub users)
        role:
          $ref: '#/components/schemas/ResourceRole'
          description: User's effective role on this project
        actions:
          type: integer
          title: Actions
          description: Permission bitmap derived from role
        workspace_role:
          $ref: '#/components/schemas/ResourceRole'
          description: User's workspace role (for determining editability)
        has_explicit_permission:
          type: boolean
          title: Has Explicit Permission
          description: True if user has explicit permission on this project
      type: object
      required:
        - id
        - first_name
        - last_name
        - email
        - role
        - actions
        - workspace_role
        - has_explicit_permission
      title: ProjectUserResponse
      description: API response schema for a user with project access.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResourceRole:
      type: string
      enum:
        - owner
        - member
        - member_limited
        - full_access
        - editor
        - commenter
        - downloader
        - viewer
        - no_access
      title: ResourceRole
      description: |-
        Unified role enum for both workspace and project permissions.
        Stored as PostgreSQL ENUM type 'resourcerole' in database.

        Pattern follows existing enums like AssetType:
        - Python enum: ResourceRole.OWNER = "owner" (lowercase value)
        - PostgreSQL ENUM: 'OWNER', 'MEMBER', etc. (uppercase in DB)
        - SQLAlchemy: sa.Enum('OWNER', 'MEMBER', ..., name='resourcerole')
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT in Authorization header. 'Bearer ' prefix optional.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Aspect API key (sk_...) in Authorization header. 'Bearer ' optional.

````