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

# ソースコードファイルをアップロード

> 指定したスキャン実行のソースコードファイルを個別にアップロードします。分析対象となる実際のソースファイルのアップロードに使用します。



## OpenAPI

````yaml /ja/api-reference/openapi.json post /code-upload
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: Corgeaのスキャン機能および脆弱性管理機能を操作するためのAPI
servers:
  - url: https://www.corgea.app/api/v1
    description: 本番サーバー
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /code-upload:
    post:
      tags:
        - サードパーティスキャンのアップロード
      summary: ソースコードファイルをアップロード
      description: 指定したスキャン実行のソースコードファイルを個別にアップロードします。分析対象となる実際のソースファイルのアップロードに使用します。
      operationId: codeUpload
      parameters:
        - name: run_id
          in: query
          required: true
          schema:
            type: string
          description: このファイルに関連付けられたスキャン実行ID
        - name: path
          in: query
          required: true
          schema:
            type: string
          description: アップロードするファイルのリポジトリ内パス
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: アップロードするソースコードファイル
      responses:
        '200':
          description: ソースコードファイルを正常にアップロードしました
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                    example: ok
                required:
                  - status
        '400':
          description: 不正なリクエスト - 検証エラー
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: missing run_id
              examples:
                missing_run_id:
                  summary: run_idパラメーターがありません
                  value:
                    status: missing run_id
                missing_path:
                  summary: pathパラメーターがありません
                  value:
                    status: missing path
                no_file_provided:
                  summary: ファイルがアップロードされていません
                  value:
                    status: no_file_provided
                invalid_content:
                  summary: ファイル内容の検証に失敗しました
                  value:
                    status: invalid content
components:
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: 認証用のAPIキー
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authorizationヘッダーで使用するOAuth2アクセストークン（JWT）

````