> ## 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.

# 添加组织权限

> 为组织添加 Git 权限

需要企业管理员的个人 API key。

为你的 Enterprise 账户中的特定组织添加一个或多个 Git 仓库权限。


## OpenAPI

````yaml zh/v2-openapi.yaml POST /v2/enterprise/organizations/{org_id}/git/permissions
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}/git/permissions:
    post:
      tags:
        - organizations
      summary: Enterprise 组织权限添加接口
      description: |-
        向组织添加新的 Git 权限。

        按与输入相同的顺序返回新建的权限 ID，并提供一个从 permission_id 到仓库/分组路径的映射。
      operationId: >-
        enterprise_organization_permission_addition_endpoint_v2_enterprise_organizations__org_id__git_permissions_post
      parameters:
        - in: path
          name: org_id
          required: true
          schema:
            title: Org Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/GitPermissionRequest'
              title: Payload
              type: array
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionsCreatedSuccessResponse'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    GitPermissionRequest:
      properties:
        connection_id:
          title: Connection Id
          type: string
        group_prefix:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Group Prefix
        group_prefix_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Prefix Url
        prefix_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Prefix Path
        repo_path:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Repo Path
        repo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Repo Url
      required:
        - connection_id
      title: GitPermissionRequest
      type: object
    PermissionsCreatedSuccessResponse:
      properties:
        permission_ids:
          items:
            type: string
          title: Permission Ids
          type: array
        permission_names:
          additionalProperties:
            type: string
          title: Permission Names
          type: object
        status:
          default: success
          title: Status
          type: string
      required:
        - permission_ids
        - permission_names
      title: PermissionsCreatedSuccessResponse
      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

````