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

# Set Project Collaborator Role

> Create or update an explicit collaborator role on a project.

Create or update an explicit collaborator role on a project. This allows granting project-specific access to users without changing their namespace or organization roles.


## OpenAPI

````yaml openapi.json PUT /projects/{project_id}/collaborators/{member_id}
openapi: 3.1.0
info:
  title: Sb0 API
  version: 0.1.0
servers: []
security: []
paths:
  /projects/{project_id}/collaborators/{member_id}:
    put:
      tags:
        - Projects
      summary: Set Project Collaborator Role
      description: Create or update an explicit collaborator role on a project.
      operationId: projects_upsert_collaborator
      parameters:
        - in: path
          name: project_id
          required: true
          schema:
            title: Project Id
            type: string
        - in: path
          name: member_id
          required: true
          schema:
            title: Member Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertProjectCollaboratorRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectCollaboratorResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    UpsertProjectCollaboratorRequest:
      description: Request model for setting/updating a project collaborator role.
      properties:
        role:
          description: Role to assign.
          enum:
            - discoverer
            - viewer
            - editor
            - owner
          title: Role
          type: string
      required:
        - role
      title: UpsertProjectCollaboratorRequest
      type: object
    ProjectCollaboratorResponse:
      description: Response model for project collaborator.
      properties:
        member_id:
          description: The WorkOS user ID of the collaborator.
          title: Member Id
          type: string
        role:
          description: Collaborator role.
          enum:
            - discoverer
            - viewer
            - editor
            - owner
          title: Role
          type: string
      required:
        - member_id
        - role
      title: ProjectCollaboratorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````