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

# Indexar repositórios em lote

> Habilita a indexação de forma idempotente para um lote de repositórios e aciona jobs de indexação.

<div id="permissions">
  ## Permissões
</div>

Requer um usuário de serviço com a permissão `IndexOrgRepositories` em nível de organização.

<div id="behavior">
  ## Comportamento
</div>

Este endpoint é **idempotente** — chamá-lo várias vezes com os mesmos repositórios não criará trabalhos de indexação duplicados. Ele ativa a indexação e aciona trabalhos de indexação para cada repositório da requisição.

Opcionalmente, você pode especificar `branch_names` para cada repositório a fim de indexar branches específicas. Se for omitido, a branch padrão será usada.


## OpenAPI

````yaml pt-BR/v3-openapi.yaml PUT /v3beta1/organizations/{org_id}/repositories/indexing
openapi: 3.1.0
info:
  description: API Devin v3 com autenticação de usuário de serviço e RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3beta1/organizations/{org_id}/repositories/indexing:
    put:
      tags:
        - repositories
      summary: Indexar repositórios em lote
      description: >-
        Habilita a indexação de forma idempotente para um lote de repositórios e
        aciona jobs de indexação.
      operationId: >-
        handle_bulk_index_repositories_v3beta1_organizations__org_id__repositories_indexing_put
      parameters:
        - description: 'ID da organização (prefixo: org-)'
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkIndexRepositoriesRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/RepositoryIndexingResponse'
                title: >-
                  Response Handle Bulk Index Repositories V3Beta1 Organizations 
                  Org Id  Repositories Indexing Put
                type: array
          description: Resposta bem-sucedida
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Erro de validação
components:
  schemas:
    BulkIndexRepositoriesRequest:
      properties:
        repositories:
          items:
            $ref: '#/components/schemas/RepositoryIndexingItem'
          maxItems: 100
          minItems: 1
          title: Repositories
          type: array
      required:
        - repositories
      title: BulkIndexRepositoriesRequest
      type: object
    RepositoryIndexingResponse:
      properties:
        branches:
          items:
            type: string
          title: Branches
          type: array
        indexing_enabled:
          title: Indexing Enabled
          type: boolean
        indexing_status:
          anyOf:
            - $ref: '#/components/schemas/RepoIndexingStatusResponse'
            - type: 'null'
        repository_path:
          title: Repository Path
          type: string
      required:
        - repository_path
        - indexing_enabled
        - branches
      title: RepositoryIndexingResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    RepositoryIndexingItem:
      properties:
        branch_names:
          items:
            type: string
          title: Branch Names
          type: array
        repository_path:
          description: por exemplo, 'org/repo-name'
          title: Repository Path
          type: string
      required:
        - repository_path
      title: RepositoryIndexingItem
      type: object
    RepoIndexingStatusResponse:
      properties:
        indexing_enabled:
          title: Indexing Enabled
          type: boolean
        latest_completed_search_index_job:
          anyOf:
            - $ref: '#/components/schemas/RepoIndexJobResponse'
            - type: 'null'
        latest_completed_wiki_index_job:
          anyOf:
            - $ref: '#/components/schemas/RepoIndexJobResponse'
            - type: 'null'
        latest_indexes:
          items:
            $ref: '#/components/schemas/RepoIndexJobResponse'
          title: Latest Indexes
          type: array
      required:
        - indexing_enabled
        - latest_indexes
        - latest_completed_search_index_job
        - latest_completed_wiki_index_job
      title: RepoIndexingStatusResponse
      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
    RepoIndexJobResponse:
      properties:
        branch_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch Name
        commit:
          title: Commit
          type: string
        created_at:
          title: Created At
          type: integer
        job_id:
          title: Job Id
          type: string
        status:
          enum:
            - failed
            - completed
            - in_progress
          title: Status
          type: string
      required:
        - job_id
        - status
        - commit
        - branch_name
        - created_at
      title: RepoIndexJobResponse
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Credencial de usuário de serviço (prefixo: cog_)'
      scheme: bearer
      type: http

````