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

# 検出を取得

> 指定した検出の詳細を取得します

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



## OpenAPI

````yaml /ja/api-reference/openapi.json get /detections/{issue_id}
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:
  /detections/{issue_id}:
    get:
      tags:
        - 検出
      summary: 検出を取得
      description: |-
        指定した検出の詳細を取得します

        以前の名前である`/api/v1/issue/{issue_id}`でも引き続き利用でき、パラメーターとレスポンスは同じです。
      operationId: getIssue
      parameters:
        - name: issue_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 問題ID
        - name: show_full_code
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: レスポンスにコード全文を含めるかどうか
        - name: include_metadata
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: >-
            スキャナーが提供する識別子をissue.metadataに含めます。既定では省略されます。指定した場合、識別子がなければmetadataはnullになります。
        - name: include_reachability
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: 問題のエンドポイント到達可能性の詳細を含めます。
        - name: generate_fix
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: >-
            trueを指定すると、生成可能で未生成の修正をバックグラウンドで生成し始めます。省略した場合またはfalseの場合は、修正生成を開始せずに問題の現在の状態を返します。
        - name: wait_for_the_fix
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: >-
            バックグラウンドでの修正生成を待ってから応答します。generate_fixがtrueで、生成可能な修正がまだない場合にのみ適用されます。待機時間には上限があります（デフォルトは120秒）。生成中の場合、応答はgeneratingを返します。問題を再取得して、修正が完成したか確認してください。
      responses:
        '200':
          description: 問題の詳細を正常に取得しました
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  issue:
                    $ref: '#/components/schemas/IssueDetail'
        '404':
          description: 問題が見つかりません
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  message:
                    type: string
                    example: Issue not found
components:
  schemas:
    IssueDetail:
      type: object
      properties:
        finding_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            この問題が検出として属するファインディングのID。再スキャンを経ても変わりません。ファインディングが導入される前に取り込まれた問題ではnullです。
        id:
          type: string
          format: uuid
        scan_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - open
            - fix_in_progress
            - fixed
            - false_positive
            - accepted_risk
            - duplicate
        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と同じ値になります。
        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
        location:
          $ref: '#/components/schemas/IssueLocation'
        details:
          type: object
          properties:
            explanation:
              type: string
            policy_guidance:
              type: object
              nullable: true
              description: この問題に適用されるポリシーのガイダンスです。適用されるガイダンスがない場合はnullです。
              properties:
                policy:
                  type: string
                  description: ポリシー名
                text:
                  type: string
                  description: ガイダンスのテキスト
            full_code:
              type: string
              description: 対象ファイルのソースコード全体です。show_full_codeがtrueの場合にのみ返されます。
        auto_triage:
          $ref: '#/components/schemas/AutoTriage'
        auto_fix_suggestion:
          $ref: '#/components/schemas/AutoFixSuggestion'
        assigned_to:
          $ref: '#/components/schemas/AssignedTo'
        scanner_metadata:
          type: object
          description: スキャナーが提供し、問題に関連付けられたメタデータ。
          additionalProperties:
            type: string
        reachability:
          $ref: '#/components/schemas/IssueReachabilityDetail'
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Fortifyのinstance_idやCheckmarxのdeep_linkなど、この問題についてスキャナーが提供する識別子です。include_metadata=trueの場合のみ含まれ、識別子がなければnullになります。
        status_comment:
          type: string
          nullable: true
          description: 記録されたステータス変更のコメント。ない場合はnullです。
    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です。
    IssueReachabilityDetail:
      type: object
      description: include_reachabilityがtrueの場合に返されるエンドポイント到達可能性の詳細。
      properties:
        is_reachable:
          type: boolean
        endpoints:
          type: array
          items:
            $ref: '#/components/schemas/IssueReachabilityEndpoint'
    IssueReachabilityEndpoint:
      type: object
      properties:
        path:
          type: string
        method:
          type: string
        file_path:
          type: string
          nullable: true
        line_number:
          type: integer
          nullable: true
        pathways:
          type: array
          items:
            $ref: '#/components/schemas/IssueReachabilityPathway'
    IssueReachabilityPathway:
      type: object
      properties:
        pathway_id:
          type: string
        total_depth:
          type: integer
        confidence_score:
          type: number
        target:
          type: object
          additionalProperties: true
        steps:
          type: array
          items:
            $ref: '#/components/schemas/IssueReachabilityStep'
    IssueReachabilityStep:
      type: object
      properties:
        depth:
          type: integer
        file_path:
          type: string
        line_number:
          type: integer
        function_name:
          type: string
        target_line_number:
          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.