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

# 批量索引代码仓库

> 为 Devin 会话批量索引多个代码仓库（最多 100 个）。

该端点允许你一次性索引多个代码仓库，使 Devin 能在会话期间访问它们。单个请求最多可以索引 100 个代码仓库。

<Note>
  代码仓库索引是异步操作。请使用 [Get Repository Status](/zh/api-reference/v2/repositories/get-repository-status) 端点来检查索引进度。
</Note>


## OpenAPI

````yaml zh/v2-openapi.yaml POST /beta/v2/enterprise/repositories/bulk-index
openapi: 3.1.0
info:
  description: 供企业管理员使用的 Devin v2 API（个人 API key）
  title: Devin API v2
  version: 2.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /beta/v2/enterprise/repositories/bulk-index:
    post:
      tags:
        - repositories
      summary: 批量索引仓库
      description: 一次性为多达 100 个代码仓库建立索引，并可选择启用快速索引和/或 Wiki 生成。
      operationId: bulk_index_repositories_beta_v2_enterprise_repositories_bulk_index_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkRepoIndexRequest'
        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:
    BulkRepoIndexRequest:
      properties:
        org_id:
          title: Org Id
          type: string
        repo_names:
          items:
            type: string
          maxItems: 100
          minItems: 1
          title: Repo Names
          type: array
      required:
        - org_id
        - repo_names
      title: BulkRepoIndexRequest
      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

````