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

# スキャンの検出を取得

> 指定したスキャンの検出一覧を取得します。 デフォルトでは作成日時の新しい順に並びます。同じ作成日時の結果は検出IDで順序を決めるため、ページ分割時も順序が安定します。

以前の名前である`/api/v1/scan/{scan_id}/issues`でも引き続き利用でき、パラメーターとレスポンスは同じです。



## OpenAPI

````yaml /ja/api-reference/openapi.json get /scan/{scan_id}/detections
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: Corgeaのスキャン機能および脆弱性管理機能を操作するためのAPI
servers:
  - url: https://www.corgea.app/api/v1
    description: 本番サーバー
  - url: https://eu.corgea.app/api/v1
    description: EU本番サーバー
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /scan/{scan_id}/detections:
    get:
      tags:
        - 検出
      summary: スキャンの検出を取得
      description: >-
        指定したスキャンの検出一覧を取得します。
        デフォルトでは作成日時の新しい順に並びます。同じ作成日時の結果は検出IDで順序を決めるため、ページ分割時も順序が安定します。


        以前の名前である`/api/v1/scan/{scan_id}/issues`でも引き続き利用でき、パラメーターとレスポンスは同じです。
      operationId: getScanIssues
      parameters:
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: スキャンID
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
          description: ページネーションのページ番号
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            default: 20
            maximum: 50
          description: 1ページあたりの結果件数
        - name: urgency
          in: query
          required: false
          schema:
            type: string
          description: '緊急度で絞り込みます（カンマ区切り）。有効な値: CR、HI、ME、LO'
          example: CR,HI
        - name: status
          in: query
          required: false
          schema:
            type: string
          description: >-
            ステータスで絞り込みます（カンマ区切り）。有効な値:
            fixed、false_positive、accepted_risk、open、fix_in_progress、duplicate
          example: open,fix_in_progress
        - name: show_false_positives
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: 誤検知（手動またはAI）と判定された問題を含めます。デフォルトでは誤検知は除外されます。
          example: true
        - name: include_reachability
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: 各問題のエンドポイント到達可能性の概要を含めます。
        - name: language
          in: query
          required: false
          schema:
            type: string
          description: プログラミング言語で絞り込みます（大文字と小文字を区別しません）
          example: python
        - name: file_path
          in: query
          required: false
          schema:
            type: string
          description: ファイルパスで絞り込みます（部分一致）
          example: src/auth
        - name: classification
          in: query
          required: false
          schema:
            type: string
          description: >-
            分類（部分一致）またはCWE識別子で絞り込みます。CWEの照合では先頭のゼロを無視し、識別子全体を比較します。CWE-79はCWE-079に一致しますが、CWE-798には一致しません。
          example: CWE-89
        - name: file_path_exact
          in: query
          required: false
          schema:
            type: string
          description: >-
            ファイルパスの完全一致で絞り込みます。file_pathとは異なり、値を含むだけのパスには一致しないため、グループ用エンドポイントが返したファイルグループの詳細を確認する場合に使用できます。
          example: src/api/auth.py
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: 分類とファイルパスを対象にフリーテキストで検索します
          example: sql injection
        - name: cwe
          in: query
          required: false
          schema:
            type: string
          description: >-
            1つ以上のCWE識別子で絞り込みます（カンマ区切り）。照合方法はclassificationと同じです。グループ用エンドポイントが返したCWEグループの詳細を確認する場合に使用します。
          example: CWE-79,CWE-89
        - name: sla_status
          in: query
          required: false
          schema:
            type: string
          description: 'SLAステータスで絞り込みます（カンマ区切り）。有効な値: overdue、escalated'
          example: overdue
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - created_at
              - '-created_at'
              - urgency
              - '-urgency'
              - status
              - '-status'
              - classification
              - '-classification'
          description: フィールドで結果を並べ替えます（降順の場合は先頭に「-」を付けます）. 並べ替えの値が同じ場合は、問題IDで順序を決めます。
          example: '-created_at'
      responses:
        '200':
          description: 問題を正常に取得しました
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: integer
                  total_pages:
                    type: integer
                  total_issues:
                    type: integer
                  issues:
                    type: array
                    items:
                      $ref: '#/components/schemas/Issue'
        '403':
          description: 権限がありません
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Permission denied
        '404':
          description: >-
            スキャンが見つからないか、プロジェクトのアクセス制御が有効な場合に、呼び出し元が会社の管理者ではなく、スキャンのプロジェクトへのアクセス権もありません。
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  message:
                    type: string
                    example: Scan not found
components:
  schemas:
    Issue:
      type: object
      properties:
        finding_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            この問題が検出として属するファインディングのID。再スキャンを経ても変わりません。ファインディングが導入される前に取り込まれた問題ではnullです。
        id:
          type: string
          format: uuid
        classification:
          type: object
          nullable: true
          description: >-
            CWEが不明な場合、または分類が自由形式のラベルの場合、idとnameには元の分類ラベルが入り、descriptionはnullになります。分類が空の場合はnullが返されます。
          properties:
            id:
              type: string
              example: CWE-123
            name:
              type: string
              example: Vulnerability Name
            description:
              type: string
              nullable: true
        urgency:
          type: string
          enum:
            - CR
            - HI
            - ME
            - LO
          description: '緊急度コード: CR（重大）、HI（高）、ME（中）、LO（低）。'
        created_at:
          type: string
          format: date-time
        first_detection_date:
          type: string
          format: date-time
          description: >-
            この問題が出現したすべてのスキャンの中で、Corgeaが最初に検出した日時です。これが最初の検出の場合はcreated_atと同じ値になります。
        status:
          type: string
          nullable: true
          enum:
            - open
            - fix_in_progress
            - fixed
            - false_positive
            - accepted_risk
            - duplicate
        sla_status:
          type: string
          nullable: true
          enum:
            - overdue
            - escalated
          description: SLA違反の状態です。期限超過でもエスカレーション済みでもない場合はnullです。
        location:
          $ref: '#/components/schemas/IssueLocation'
        auto_triage:
          $ref: '#/components/schemas/AutoTriage'
        auto_fix_suggestion:
          $ref: '#/components/schemas/AutoFixSuggestion'
        assigned_to:
          $ref: '#/components/schemas/AssignedTo'
        reachability:
          $ref: '#/components/schemas/IssueReachabilitySummary'
    IssueLocation:
      type: object
      properties:
        file:
          type: object
          properties:
            name:
              type: string
            language:
              type: string
            path:
              type: string
            git_hash:
              type: string
              nullable: true
              description: スキャンしたファイルについて記録されたGitハッシュです。問題の一覧を返すエンドポイントでのみ返されます。
        project:
          type: object
          properties:
            name:
              type: string
            branch:
              type: string
            git_sha:
              type: string
        line_number:
          type: integer
        sink_line_number:
          type: integer
          nullable: true
          description: データフローのシンクがこのファイル内にある場合はその行番号、それ以外の場合はnullです。個別の問題を取得した場合にのみ返されます。
    AutoTriage:
      type: object
      properties:
        false_positive_detection:
          type: object
          properties:
            status:
              type: string
              enum:
                - valid
                - false_positive
                - pending
            reasoning:
              description: 誤検知と判断した理由を、利用可能な場合に返します。修正が生成されなかった場合も対象です。
              type: string
              nullable: true
    AutoFixSuggestion:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - fix_available
            - no_fix
            - generating
            - false_positive
            - on_hold
            - unsupported
            - plan
          description: >-
            現在の修正の利用可否。問題を取得すると、デフォルトで生成可能な未生成の修正をバックグラウンドで生成し始めます。その生成中はステータスがgeneratingになります。生成が完了するまで問題を再取得してください。生成が無効な場合、または修正が生成されない場合、ステータスはno_fixになります。
        patch:
          type: object
          properties:
            diff:
              type: string
              description: unified diff形式のパッチ。修正に差分がない場合は空文字列を返します。
            explanation:
              type: string
              description: 修正によって脆弱性がどのように解消されるかの説明
            full_code:
              type: string
              description: 修正を適用したファイルのソースコード全体です。show_full_codeがtrueで、修正が存在する場合にのみ返されます。
    AssignedTo:
      type: object
      nullable: true
      description: 問題の担当ユーザー。未割り当ての場合はnullです。
      properties:
        id:
          type: string
          description: 担当ユーザーのID。
        email:
          type: string
          format: email
          description: 担当ユーザーのメールアドレス。
        name:
          type: string
          nullable: true
          description: 担当ユーザーの表示名。利用できない場合はnullです。
    IssueReachabilitySummary:
      type: object
      description: include_reachabilityがtrueの場合に返されるエンドポイント到達可能性の概要。
      properties:
        is_reachable:
          type: boolean
        endpoint_count:
          type: integer
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: 認証用のAPIキー 無効なユーザーのAPIトークンは拒否されます。
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authorizationヘッダーで使用するOAuth2アクセストークン（JWT）

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.