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

# Update a member's role or team

> Updates a registered member's organization role, team role, or team. Send at least one field. Send `organization_permission` and `team_id` in separate requests. A team must belong to the caller's workspace, and a pending invitation cannot be updated. The last organization owner cannot be demoted.



## OpenAPI

````yaml /openapi/admin-users.json patch /platform/v1/admin/users/{member_id}
openapi: 3.0.3
info:
  title: Qodo API
  version: '2026-09-03'
  description: >-
    Use the User management API to list, invite, update, and remove members in
    your Qodo organization. The API is currently available for eligible
    single-tenant organizations. Qodo must enable API access for your
    organization before you can use these endpoints.


    Authenticate with a personal `sk-` API key that belongs to an organization
    owner. See [Set up the User management
    API](/account-management/user-management-api).


    The `/platform/v1` segment versions the API contract. It is independent of
    the Qodo 1.x and Qodo 2.x product documentation versions.
servers:
  - url: https://qodo-platform.{tenant}.st.qodo.ai
    description: Your Qodo single-tenant API host
    variables:
      tenant:
        default: your-tenant
        description: >-
          Replace this value with your Qodo tenant subdomain before sending a
          request.
security:
  - bearerAuth: []
tags:
  - name: API reference
    description: >-
      Manage registered users and pending invitations. Organization owner access
      is required.
paths:
  /platform/v1/admin/users/{member_id}:
    parameters:
      - name: member_id
        in: path
        required: true
        description: The user's email address or the pending invitation ID.
        schema:
          type: string
      - $ref: '#/components/parameters/RequestId'
    patch:
      tags:
        - API reference
      summary: Update a member's role or team
      description: >-
        Updates a registered member's organization role, team role, or team.
        Send at least one field. Send `organization_permission` and `team_id` in
        separate requests. A team must belong to the caller's workspace, and a
        pending invitation cannot be updated. The last organization owner cannot
        be demoted.
      operationId: updateOrganizationMember
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMemberRequest'
            examples:
              changeOrganizationRole:
                summary: Change the organization role
                value:
                  organization_permission: owner
              moveToTeam:
                summary: Move a member to a team
                value:
                  team_id: team-123
                  permission: user
      responses:
        '200':
          description: The changes applied to the member.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMemberResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/PortalRedirect'
        '422':
          $ref: '#/components/responses/ValidationError'
        '501':
          $ref: '#/components/responses/NotSupported'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    RequestId:
      name: request-id
      in: header
      required: false
      description: A unique request ID generated by the client for request tracing.
      schema:
        type: string
  schemas:
    UpdateMemberRequest:
      type: object
      description: >-
        Provide at least one field. Send `organization_permission` and `team_id`
        in separate requests.
      minProperties: 1
      additionalProperties: false
      not:
        type: object
        properties:
          organization_permission: {}
          team_id: {}
        required:
          - organization_permission
          - team_id
      properties:
        organization_permission:
          $ref: '#/components/schemas/OrganizationPermission'
        permission:
          $ref: '#/components/schemas/TeamPermission'
        team_id:
          type: string
          minLength: 1
          pattern: ^(?!\s*$)(?!\s*-\s*$).+
          description: A team in the caller's workspace.
    UpdateMemberResponse:
      type: object
      properties:
        member_id:
          type: string
        organization_permission:
          type: string
          allOf:
            - $ref: '#/components/schemas/OrganizationPermission'
          nullable: true
        permission:
          type: string
          allOf:
            - $ref: '#/components/schemas/TeamPermission'
          nullable: true
        team_id:
          type: string
          nullable: true
      required:
        - member_id
    OrganizationPermission:
      type: string
      enum:
        - owner
        - user
    TeamPermission:
      type: string
      enum:
        - owner
        - user
    HttpError:
      type: object
      properties:
        detail:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
      required:
        - detail
    PortalRedirectError:
      type: object
      properties:
        detail:
          type: object
          properties:
            redirectTo:
              type: string
              format: uri
          required:
            - redirectTo
      required:
        - detail
    ValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorDetail'
      required:
        - detail
    ValidationErrorDetail:
      type: object
      properties:
        type:
          type: string
        loc:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
      required:
        - type
        - loc
        - msg
  responses:
    BadRequest:
      description: >-
        The requested member operation is not supported in the member's current
        state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
    Unauthorized:
      description: The bearer credential or authenticated identity is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
    Forbidden:
      description: >-
        The caller is not an organization owner, lacks workspace context, or API
        access is not enabled for the organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
    NotFound:
      description: The member or team was not found in the caller's workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
    PortalRedirect:
      description: >-
        The single-tenant identity flow returned another Qodo tenant host.
        Inspect `detail.redirectTo`, but do not forward credentials
        automatically.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PortalRedirectError'
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    NotSupported:
      description: The User management API is not supported for this deployment.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
    Unavailable:
      description: API availability or authorization could not be verified.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk-
      description: >-
        A personal `sk-` API key that belongs to an organization owner. Send it
        as `Authorization: Bearer sk-...`. See [Set up the User management
        API](/account-management/user-management-api).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.