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

# 更新组织成员角色

> 为特定成员更新组织角色

需要 Enterprise 管理员的个人 API key。

为某个组织内的一个或多个成员更新组织级别角色。此 endpoint 可让你一次性为多个用户分配新的组织角色。


## OpenAPI

````yaml zh/v2-openapi.yaml PATCH /v2/enterprise/organizations/{org_id}/members/roles
openapi: 3.1.0
info:
  description: 供企业管理员使用的 Devin v2 API（个人 API key）
  title: Devin API v2
  version: 2.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v2/enterprise/organizations/{org_id}/members/roles:
    patch:
      tags:
        - organizations
      summary: Enterprise 组织成员角色更新接口
      description: |-
        为用户所属 Enterprise 中的可用用户更新其组织角色。
        接收一个包含多个 user_id 的列表和一个 role_id。
      operationId: >-
        enterprise_organization_members_role_update_endpoint_v2_enterprise_organizations__org_id__members_roles_patch
      parameters:
        - in: path
          name: org_id
          required: true
          schema:
            title: Org Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
          description: 成功的响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    RoleUpdateRequest:
      properties:
        role_id:
          title: Role Id
          type: string
        user_ids:
          items:
            type: string
          title: User Ids
          type: array
      required:
        - user_ids
        - role_id
      title: RoleUpdateRequest
      type: object
    SuccessResponse:
      properties:
        status:
          default: success
          title: Status
          type: string
      title: SuccessResponse
      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
  securitySchemes:
    bearerAuth:
      description: 仅供 Enterprise 管理员使用的个人 API Key（apk_user_*）
      scheme: bearer
      type: http

````