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

# Upload Source Code File

> Upload individual source code files for a specific scan run. This is used to upload the actual source files that will be analyzed.



## OpenAPI

````yaml /api-reference/openapi.json post /code-upload
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: >-
    API for interacting with Corgea's scanning and vulnerability management
    features
servers:
  - url: https://www.corgea.app/api/v1
    description: Production server
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /code-upload:
    post:
      tags:
        - Uploading 3rd Party Scan
      summary: Upload Source Code File
      description: >-
        Upload individual source code files for a specific scan run. This is
        used to upload the actual source files that will be analyzed.
      operationId: codeUpload
      parameters:
        - name: run_id
          in: query
          required: true
          schema:
            type: string
          description: The scan run ID associated with this file
        - name: path
          in: query
          required: true
          schema:
            type: string
          description: The repository path of the file being uploaded
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The source code file to upload
      responses:
        '200':
          description: Source code file uploaded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                    example: ok
                required:
                  - status
        '400':
          description: Bad request - validation errors
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: missing run_id
              examples:
                missing_run_id:
                  summary: Missing run_id parameter
                  value:
                    status: missing run_id
                missing_path:
                  summary: Missing path parameter
                  value:
                    status: missing path
                no_file_provided:
                  summary: No file uploaded
                  value:
                    status: no_file_provided
                invalid_content:
                  summary: File content validation failed
                  value:
                    status: invalid content
components:
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: API key for authentication
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token (JWT) in the Authorization header

````