> ## 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 を通じてインジェストプロファイルを使用し、外部スキャナーの検出結果をトリアージする、インジェストモードの Devin コードスキャンを開始します

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

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

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

インジェストモードのコードスキャンをキューに追加します。インジェストスキャンは、問題を一から検出する代わりに、外部で生成された検出結果 (たとえば SAST レポート) を取り込み、Devin がリポジトリに対してトリアージと検証を行います。スキャンはスキャンディスパッチャーによって非同期で開始され、呼び出し元のプリンシパルに紐付けられます。Enterprise スコープの同等の機能については、[Start Ingestion Scan (Enterprise)](/ja/api-reference/v3/code-scans/enterprise-code-scans-start-ingestion)を参照してください。

<div id="request-fields">
  ### リクエストフィールド
</div>

* `repo_name` (必須) : 完全なリポジトリ名。例: `owner/repo`。
* `profile_id` (必須) : `ingest` モードの[スキャンプロファイル](/ja/api-reference/v3/code-scans/organizations-code-scans-profiles)。`discover` モードのプロファイルは `400` エラーで拒否されます。
* `host`: リポジトリから推測できない場合の Git ホスト。
* `attachment_urls`: スキャンに提供する Devin の添付ファイル URL (例: エクスポートしたスキャナーレポート) 。ファイルはまず、`UseDevinSessions` 権限が必要な[添付ファイル API](/ja/api-reference/v3/attachments/post-organizations-attachments)を使用してアップロードしてください。

<div id="errors">
  ### エラー
</div>

* `400`: `profile_id` がインジェストモード用のプロファイルではない場合。
* `404`: リポジトリまたはプロファイルが組織に表示されていない場合。
* `409`: 組織のスキャンバックログが上限に達している場合。時間をおいて再試行してください。


## OpenAPI

````yaml ja/v3-openapi.yaml POST /v3/organizations/{org_id}/code-scans/ingestion
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/organizations/{org_id}/code-scans/ingestion:
    post:
      tags:
        - code-scans
      summary: 取り込みスキャンを開始
      description: |-
        組織内のリポジトリに対して取り込みモードのコードスキャンを開始します。

        スキャンはキューに追加され、スキャンディスパッチャーによって非同期で開始されます。
        取り込みモードのプロファイルのみを受け付けます。取り込み以外のプロファイルは
        ``400`` で拒否されます。任意の添付 URL（attachments API を介してアップロードされたもの）
        がスキャンに指定されます。組織のスキャン
        バックログが上限に達している場合は ``409`` を返します。
      operationId: >-
        handle_start_ingestion_scan_v3_organizations__org_id__code_scans_ingestion_post
      parameters:
        - description: '組織 ID（プレフィックス: 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/StartIngestionScanRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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:
    StartIngestionScanRequest:
      description: |-
        取り込みモードのコードスキャンを開始するためのリクエストボディ。

        取り込み（ingest-mode）スキャンプロファイルのみを受け付けます。プロファイルは指定されたリポジトリに対して実行されます。
      properties:
        attachment_urls:
          anyOf:
            - items:
                format: uri
                maxLength: 2083
                minLength: 1
                type: string
              maxItems: 10
              type: array
            - type: 'null'
          description: >-
            スキャンに指定する Devin 添付ファイルの URL（例: attachments API
            を介してアップロードされたファイル）。添付ファイルは、スキャン対象の組織に属している必要があります。
          title: Attachment Urls
        host:
          anyOf:
            - type: string
            - type: 'null'
          description: 判明している場合は、リポジトリの Git ホスト。
          title: Host
        profile_id:
          description: >-
            実行する取り込みモードのスキャンプロファイル。取り込みプロファイルである必要があります。取り込み以外のプロファイルは 400
            で拒否されます。
          title: Profile Id
          type: string
        repo_name:
          description: スキャン対象のリポジトリの完全名。
          title: Repo Name
          type: string
      required:
        - repo_name
        - profile_id
      title: StartIngestionScanRequest
      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
    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
    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

````