> ## 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 中的一个或多个组织

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

此端点允许你在一次 API 调用中将多个用户添加到多个组织。它专为在大规模管理组织成员关系时进行高效批量操作而设计。


## OpenAPI

````yaml zh/v2-openapi.yaml POST /v2/enterprise/organizations/{org_id}/members
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:
    post:
      tags:
        - organizations
      summary: Enterprise 组织添加成员接口
      description: |-
        批量向组织中添加用户

        注意：从 app.routers.enterprises.py 复制而来。需要适当重构到 membership SDK 中。
      operationId: >-
        enterprise_organizations_member_addition_endpoint_v2_enterprise_organizations__org_id__members_post
      parameters:
        - in: path
          name: org_id
          required: true
          schema:
            title: Org Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnterpriseBulkOrgMembersUpdate'
        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:
    EnterpriseBulkOrgMembersUpdate:
      properties:
        group_names:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Group Names
        org_ids:
          items:
            type: string
          title: Org Ids
          type: array
        org_role:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Role
        user_ids:
          items:
            type: string
          title: User Ids
          type: array
      required:
        - user_ids
        - org_ids
      title: EnterpriseBulkOrgMembersUpdate
      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

````