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

# コードスキャンの検出結果を修正する

> コードスキャンの検出結果を修正するためのDevinセッションを開始します

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

Enterprise レベルで `UseAccountCodeScans` 権限が付与されたサービスユーザーが必要です。

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

指定されたコードスキャンの検出結果を修正するための Devin セッションを起動します。このセッションでは、脆弱なコードを分析し、修正を実装して、プルリクエストを作成します。セッションは、呼び出し元のプリンシパル (リクエストを行ったサービスユーザーまたは PAT) に紐付けられます。

検出結果にすでに修正用のセッションがある場合は、`409 Conflict` を返します。


## OpenAPI

````yaml ja/v3-openapi.yaml POST /v3/enterprise/organizations/{org_id}/code-scans/{scan_id}/findings/{finding_id}/remediate
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/organizations/{org_id}/code-scans/{scan_id}/findings/{finding_id}/remediate:
    post:
      tags:
        - code-scans
      summary: コードスキャンの検出結果を修復
      description: >-
        コードスキャンの検出結果を修復するために Devin セッションを起動します。


        このセッションは脆弱なコードを分析し、修復を実装して、pull request
        を作成します。このセッションは呼び出し元のプリンシパル（リクエストを行ったサービスユーザーまたは
        PAT）に紐付けられます。検出結果にすでに修復セッションがある場合は ``409`` を返します。
      operationId: >-
        handle_remediate_code_scan_finding_v3_enterprise_organizations__org_id__code_scans__scan_id__findings__finding_id__remediate_post
      parameters:
        - description: '組織 ID（プレフィックス: org-）'
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
        - in: path
          name: scan_id
          required: true
          schema:
            title: Scan Id
            type: string
        - in: path
          name: finding_id
          required: true
          schema:
            title: Finding Id
            type: string
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemediateFindingResponse'
          description: 成功レスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: バリデーションエラー
components:
  schemas:
    RemediateFindingResponse:
      description: コードスキャンの検出結果に対して起動された修復セッション。
      properties:
        finding_id:
          description: 修正対象の検出結果。
          title: Finding Id
          type: string
        session_id:
          description: 検出結果を修復するために起動された Devin セッションの ID。
          title: Session Id
          type: string
      required:
        - finding_id
        - session_id
      title: RemediateFindingResponse
      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: 'サービスユーザーの認証情報（接頭辞: cog_）'
      scheme: bearer
      type: http

````