> ## 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 API）

> v3 API を使用して、Enterprise 全体の Devin コードスキャンを一覧表示し、時刻、リポジトリ、組織でフィルタリングしてスキャンステータスをポーリングします

<div id="permissions">
  ## 権限
</div>

Enterprise レベルの `ViewAccountCodeScans` 権限を持つ[サービスユーザー](/ja/api-reference/v3/service-users/members-service-users)または[パーソナルアクセストークン](/ja/api-reference/personal-access-tokens)が必要です。

<div id="behavior">
  ## 動作
</div>

Enterprise 全体のコードスキャンを新しい順に返します。[Start Code Scan](/ja/api-reference/v3/code-scans/enterprise-code-scans-start) で開始したスキャンの `status` をポーリングする際に利用します。状態は `waiting` → `pending` → `running` → `completed` (または `failed` / `cancelled`) の順に遷移します。`awaiting_user_input` は web app から開始したインタラクティブなスキャンにのみ適用され、API で開始したスキャンはこの状態にはなりません。

<div id="filters">
  ### フィルター
</div>

* `time_after` / `time_before`: スキャンの作成時刻の範囲を指定する、UTC の秒単位の Unix タイムスタンプ。
* `repo_name`: このリポジトリを対象とするスキャンのみ。対象リポジトリを含む複数リポジトリのスキャンにも一致します。
* `org_ids`: 指定した組織内のスキャンのみ。

結果は不透明なカーソル (`after` / `first`) を使用してページネーションされます。単一の組織については、[コードスキャンの一覧 (Organization)](/ja/api-reference/v3/code-scans/organizations-code-scans-list) を使用してください。


## OpenAPI

````yaml ja/v3-openapi.yaml GET /v3/enterprise/code-scans/scans
openapi: 3.1.0
info:
  description: Service User 認証および RBAC に対応した Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/enterprise/code-scans/scans:
    get:
      tags:
        - code-scans
      summary: コードスキャンを一覧表示
      description: >-
        Enterpriseアカウントのコードスキャンを一覧表示します。


        スキャンは新しい順に返されます。必要に応じて ``org_ids``、``repo_name``、作成時刻（``time_after`` /
        ``time_before``）で絞り込めます。結果は不透明なカーソル（``after`` /
        ``first``）を使用してページ分割されます。
      operationId: handle_list_code_scans_v3_enterprise_code_scans_scans_get
      parameters:
        - in: query
          name: time_before
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time Before
        - in: query
          name: time_after
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time After
        - in: query
          name: after
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: After
        - in: query
          name: first
          required: false
          schema:
            default: 100
            maximum: 200
            minimum: 1
            title: First
            type: integer
        - description: >-
            このリポジトリをスキャンしたスキャンに絞り込みます。リポジトリがそのスキャンの主要なリポジトリでない場合でも、複数リポジトリを対象とするスキャンに一致します。そのため、返されるアイテムの
            repo_name には別のリポジトリ名が表示されることがあります。
          in: query
          name: repo_name
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              このリポジトリをスキャンしたスキャンに絞り込みます。リポジトリがそのスキャンの主要なリポジトリでない場合でも、複数リポジトリを対象とするスキャンに一致します。そのため、返されるアイテムの
              repo_name には別のリポジトリ名が表示されることがあります。
            title: Repo Name
        - description: これらの組織内のスキャンに絞り込みます。
          in: query
          name: org_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: これらの組織内のスキャンに絞り込みます。
            title: Org Ids
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_CodeScanResponse_'
          description: 成功レスポンス
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未認証
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: アクセス禁止
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 見つかりません
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 競合
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 処理できないコンテンツ
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: リクエストが多すぎます
components:
  schemas:
    PaginatedResponse_CodeScanResponse_:
      properties:
        end_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: 次のページを取得するためのカーソル。これが最後のページの場合は None。
          title: End Cursor
        has_next_page:
          default: false
          description: このページの後に利用可能なアイテムがあるかどうか。
          title: Has Next Page
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/CodeScanResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: 任意の合計件数（パフォーマンスのため省略可能）。
          title: Total
      required:
        - items
      title: PaginatedResponse[CodeScanResponse]
      type: object
    ProblemDetail:
      description: >-
        v3 API 用の RFC 9457 application/problem+json エラーボディ。


        detail は後方互換性のため、レガシーな {"detail": ...}
        ボディから引き継がれます。その他のメンバーは追加式です。errors にはフィールドレベルのバリデーションエラーが含まれます（422
        の場合のみ）。
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: この事象に固有の、人が読める説明。
          title: Detail
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: フィールド単位のバリデーションエラー（422 レスポンスのみ）。
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: この発生箇所の URI 参照（リクエストパス）。
          title: Instance
        status:
          description: HTTP ステータスコード。
          title: Status
          type: integer
        title:
          description: 問題タイプを人が読める短い要約。
          title: Title
          type: string
        type:
          default: about:blank
          description: 問題タイプを識別する URI 参照。
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    CodeScanResponse:
      description: 1件のコードスキャン。
      properties:
        created_at:
          description: スキャンの作成日時（Unix秒）。
          title: Created At
          type: integer
        host:
          anyOf:
            - type: string
            - type: 'null'
          description: 既知の場合のリポジトリの Git ホスト。
          title: Host
        org_id:
          description: スキャンが属する組織。
          title: Org Id
          type: string
        profile:
          anyOf:
            - $ref: '#/components/schemas/CodeScanProfileResponse'
            - type: 'null'
          description: スキャンの実行時に使用されたプロファイル（ある場合）。
        repo_name:
          description: スキャンの主要なリポジトリ。マルチリポジトリスキャンには、ここに記載されていない追加のリポジトリも含まれます。
          title: Repo Name
          type: string
        scan_id:
          description: スキャンの一意の識別子。
          title: Scan Id
          type: string
        scan_type:
          description: 作成時に記録されるスキャンのタイプ。
          enum:
            - security
            - performance
            - db-queries
            - test-coverage
            - dead-code
            - code-quality
            - telemetry
            - accessibility
            - general
            - migration-docs
          title: Scan Type
          type: string
        status:
          description: >-
            スキャンのステータス:
            waiting、pending、running、awaiting_user_input、completed、failed、または
            cancelled。
          enum:
            - waiting
            - pending
            - running
            - awaiting_user_input
            - completed
            - failed
            - cancelled
          title: Status
          type: string
      required:
        - scan_id
        - org_id
        - repo_name
        - host
        - status
        - profile
        - scan_type
        - created_at
      title: CodeScanResponse
      type: object
    CodeScanProfileResponse:
      description: スキャンの実行時に使用されたプロファイルの要約。
      properties:
        name:
          description: プロファイル名。
          title: Name
          type: string
        profile_id:
          description: プロファイルの一意の識別子。
          title: Profile Id
          type: string
      required:
        - profile_id
        - name
      title: CodeScanProfileResponse
      type: object
  securitySchemes:
    bearerAuth:
      description: 'サービスユーザーの認証情報（接頭辞: cog_）'
      scheme: bearer
      type: http

````