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

# Patch apiorganizations members 

> PATCH  /api/organizations/{pk}/members/{user_pk}/  — change role.
DELETE /api/organizations/{pk}/members/{user_pk}/  — remove member.
SysAdmin or OrgAdmin only.



## OpenAPI

````yaml /api-reference/openapi.yaml patch /api/organizations/{id}/members/{user_pk}/
openapi: 3.0.3
info:
  title: Console API
  version: 1.0.0
  description: Central control plane API for the Dataerai platform.
servers:
  - url: https://{server}
    description: Your Dataerai deployment (the API is served under /api)
    variables:
      server:
        default: your-deployment.dataerai.com
        description: Host of your Dataerai deployment
security: []
paths:
  /api/organizations/{id}/members/{user_pk}/:
    patch:
      tags:
        - api
      description: |-
        PATCH  /api/organizations/{pk}/members/{user_pk}/  — change role.
        DELETE /api/organizations/{pk}/members/{user_pk}/  — remove member.
        SysAdmin or OrgAdmin only.
      operationId: api_organizations_members_partial_update
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_pk
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedOrganizationMemberWrite'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedOrganizationMemberWrite'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedOrganizationMemberWrite'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationMember'
          description: ''
      security:
        - cookieAuthCsrfExempt: []
components:
  schemas:
    PatchedOrganizationMemberWrite:
      type: object
      description: Used for POST (add member) and PATCH (change role).
      properties:
        user_id:
          type: string
          format: uuid
        role:
          $ref: '#/components/schemas/OrgMemberRoleEnum'
    OrganizationMember:
      type: object
      description: Read-only membership row shown inside org member lists.
      properties:
        id:
          type: integer
          readOnly: true
        user:
          allOf:
            - $ref: '#/components/schemas/UserSearch'
          readOnly: true
        role:
          allOf:
            - $ref: '#/components/schemas/OrgMemberRoleEnum'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - id
        - role
        - user
    OrgMemberRoleEnum:
      enum:
        - member
        - admin
      type: string
      description: |-
        * `member` - Member
        * `admin` - Admin
    UserSearch:
      type: object
      description: |-
        Resolve ``user.person`` once per serialization pass.

        ``user.person`` memoizes per instance, but distinct users in a list are
        distinct instances — so a list serializer would still issue one
        ``Person`` query per row. When used ``many=True`` this mixin routes
        through :class:`_PersonReadThroughListSerializer`, which calls
        ``User.attach_persons`` to batch the whole page into a single query;
        the per-render ``context`` cache below then dedups the name+email
        double-read for each user.

        The context cache lives only for the lifetime of the serializer tree,
        so one ``.data`` render resolves each distinct user's ``Person`` at
        most once and re-batches fresh on the next render.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          readOnly: true
        email:
          type: string
          readOnly: true
      required:
        - email
        - id
        - name

````