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

# Add a user to a project or update their project role

> Upsert (insert or update) a user's role for a project.

The caller must have ``project:manage_members`` on the project's
organization — enforced by RLS on the user-scoped client. The target
user must already belong to the caller's organization.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /projects/{project_id}/members
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /projects/{project_id}/members:
    post:
      summary: Add a user to a project or update their project role
      description: |-
        Upsert (insert or update) a user's role for a project.

        The caller must have ``project:manage_members`` on the project's
        organization — enforced by RLS on the user-scoped client. The target
        user must already belong to the caller's organization.
      operationId: upsert_project_member_projects__project_id__members_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertProjectMemberBody'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpsertProjectMemberBody:
      properties:
        user_id:
          type: string
          title: User Id
          description: ID of the user whose project role to set.
        project_role_id:
          type: string
          title: Project Role Id
          description: ID of the project role to assign.
      type: object
      required:
        - user_id
        - project_role_id
      title: UpsertProjectMemberBody
    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

````