> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Resolve SCA config and run ID

> Resolve SCA config and a canonical run ID for a future upload



## OpenAPI

````yaml /api-reference/bundled.yaml post /v0/sca/start-run
openapi: 3.1.0
info:
  title: Gable API
  description: >
    API to interact with the Gable platform

    ## Authorization

    All API requests require an API key to be passed in the `X-API-KEY` header.
    For instructions on finding your API key and api endpoint check out the [API
    Key documentation](../docs/api-keys.md).

    Example: `curl -H "X-API-KEY: <your-api-key>"
    https://api-{organization}.gable.ai/v0/ping`
  contact:
    name: Gable Engineering
    url: https://gable.ai
    email: engineers@gable.ai
  version: 1.28.0
servers:
  - url: https://{hostname}.gable.ai
    description: Gable API
    variables:
      hostname:
        default: demo-api
        description: Customer environment assigned by Gable
security:
  - ApiKeyAuth: []
tags:
  - name: action
  - name: api-keys
  - name: auth
  - name: changelog
  - name: config
  - name: contract
  - name: data-asset
  - name: debug
  - name: s3
  - name: settings
  - name: slack
  - name: sso
  - name: webhook
  - name: notifications
  - name: constraints
  - name: telemetry
  - name: component
  - name: components
  - name: sca
  - name: cross-service-components
  - name: lineage
  - name: events
  - name: measurements
  - name: defect-report
  - name: experimental
paths:
  /v0/sca/start-run:
    post:
      tags:
        - sca
      summary: Resolve SCA config and run ID
      description: Resolve SCA config and a canonical run ID for a future upload
      operationId: postScaStartRun
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostScaStartRunRequest'
      responses:
        '200':
          description: The SCA config and canonical run ID for this upload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostScaStartRunResponse'
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PostScaStartRunRequest:
      type: object
      properties:
        code_info:
          $ref: '#/components/schemas/StaticAnalysisCodeMetadata'
        sca_info:
          $ref: '#/components/schemas/StaticAnalysisToolMetadata'
        action:
          type: string
          description: >-
            Action to perform upon receiving the results. Register should be
            used when the results are active (like on a 'main' branch or
            production system), as assets will be registered from the lineage
            data. Check should be used when the results are from a proposed
            change (like a pull request) and resultant assets will be checked
            against any contracts. Upload is the same as register except that no
            assets will be registered, only the lineage data will be uploaded.
          enum:
            - register
            - check
            - upload
        pr_link:
          type: string
          description: >-
            Link to the pull request in the source code repository, if
            applicable
        include_unchanged_assets:
          type: boolean
          description: Whether to include assets that have not changed since the last run
          default: false
        output_format:
          type: string
          description: Format of the output, either 'json', 'text', or 'markdown'
          enum:
            - json
            - text
            - markdown
        type:
          type: string
          description: >-
            Type of the run, either 'code', 'data_store', 'edge', or
            'code_strands'
          enum:
            - CODE
            - DATA_STORE
            - EDGE
            - CODE_STRANDS
          default: CODE
        run_id:
          type: string
          description: The ID of the run that the component belongs to
        collection_mechanism:
          type: string
          description: >-
            How the lineage data was collected. SCA means Gable's static code
            analysis tool scanned the code. BYOL (Bring Your Own Lineage) means
            the caller produced the lineage data externally and is uploading it
            directly.
          enum:
            - SCA
            - BYOL
          default: BYOL
      required:
        - code_info
        - action
    PostScaStartRunResponse:
      type: object
      description: The response from the postScaStartRun function
      properties:
        runId:
          description: The unique run ID assigned to this SCA run
          type: string
        config:
          oneOf:
            - $ref: '#/components/schemas/GetConfigResponse'
            - $ref: '#/components/schemas/EncryptedResponse'
      required:
        - runId
    ErrorResponse:
      type: object
      required:
        - message
      properties:
        id:
          type: number
        title:
          type: string
        message:
          type: string
    StaticAnalysisCodeMetadata:
      type: object
      description: Metadata about the code that is being analyzed
      additionalProperties: true
      required:
        - repo_uri
        - repo_branch
        - repo_commit
        - project_root
      properties:
        repo_uri:
          type: string
          description: URI of the code repository
        repo_ui_url:
          type: string
          description: URL of the code repository UI (e.g. GitHub URL)
        repo_branch:
          type: string
          description: Branch of the code repository
        repo_commit:
          type: string
          description: Commit hash of the code
        project_root:
          type: string
          description: Root directory targeted by the static analysis tool
        external_component_id:
          type: string
          description: ID of the external component that was analyzed
        repo_name:
          type: string
          description: Name of the code repository
        event_repo:
          type: string
          description: Name of the repository from the GitHub event
        job_trigger:
          type: string
          enum:
            - MERGE_TO_MAIN
            - PULL_REQUEST_COMMENT
            - PULL_REQUEST_CREATED
            - PULL_REQUEST_UPDATED
            - MANUAL
            - UNKNOWN
          description: Type of the GitHub event
        repo_commit_timestamp:
          type: string
          description: Timestamp of the commit
        is_default_branch:
          type: boolean
          description: Whether this is the default branch of the code repository
        namespace:
          type: string
          description: Namespace of the customer (e.g. dev, qa, prod)
        docker_image_version:
          type: string
          description: Version of the Docker image used
        has_uncommitted_changes:
          type: boolean
          description: Whether there are uncommitted changes in the code repository
        operating_system:
          type: string
          description: Operating system of the machine that ran the static analysis tool
        sca_config_version:
          type: string
          description: Version (git SHA) of the SCA configuration files used
        scan_duration_ms:
          type: integer
          format: int64
          description: >-
            Total elapsed time, in milliseconds, spent running the Gable scan
            command for this component
        raw_payload_size_bytes:
          type: integer
          format: int64
          description: Size, in bytes, of the raw scan payload generated before upload
        upload_duration_ms:
          type: integer
          format: int64
          description: >-
            Total elapsed time, in milliseconds, spent processing the SCA
            results upload
        pr_base_branch:
          type: object
          properties:
            branch:
              type: string
              description: Base branch of the pull request
            commit:
              type: string
              description: Commit hash of the base branch
          description: Base branch of the pull request, if this was run from a pull request
        pr_number:
          type: integer
          description: Number of the pull request
        gable_cli_version:
          type: string
          description: Version of the Gable CLI used for this run
        sca_prime_version:
          type: string
          description: Version of the SCA Prime binary used for this run
        dependencies:
          type: array
          items:
            $ref: '#/components/schemas/StaticAnalysisDependencyMetadata'
          description: Dependencies of the code repository
    StaticAnalysisToolMetadata:
      type: object
      required:
        - name
        - version
      properties:
        name:
          type: string
          description: Name of the SCA tool used
        version:
          type: string
          description: Version of the SCA tool
        config:
          $ref: '#/components/schemas/StaticAnalysisToolConfig'
    GetConfigResponse:
      type: object
      required:
        - config_type
        - version
        - config_value
        - created_at
        - project_root
        - namespace
      properties:
        config_type:
          description: Type of configuration
          type: string
        language:
          description: Programming language associated with the config (optional)
          type: string
          nullable: true
        repo:
          description: Repository associated with the config (optional)
          type: string
          nullable: true
        project_root:
          description: Project root directory (optional)
          type: string
        version:
          description: Version of the configuration
          type: string
        config_value:
          description: Configuration value as JSON
          type: object
          additionalProperties:
            type: string
        namespace:
          description: Namespace (qa/sandbox/prod) of config
          type: string
        created_at:
          description: Date time at which the config was created
          type: string
          format: date-time
    EncryptedResponse:
      type: object
      description: A response payload that has been encrypted
      properties:
        encrypted_payload:
          description: The encrypted payload
          type: string
      required:
        - encrypted_payload
    StaticAnalysisDependencyMetadata:
      type: object
      description: Metadata about a dependency of the code repository
      properties:
        repo_name:
          type: string
          description: Name of the dependency repository
        commit_sha:
          type: string
          description: Associated commit hash of the dependency repository
        commit_timestamp:
          type: string
          description: Timestamp of the commit
    StaticAnalysisToolConfig:
      type: object
      description: Configuration for a static analysis tool
      required:
        - ingress_signatures
        - egress_signatures
      properties:
        ingress_signatures:
          type: array
          items:
            $ref: '#/components/schemas/StaticAnalysisSignature'
        egress_signatures:
          type: array
          items:
            $ref: '#/components/schemas/StaticAnalysisSignature'
    StaticAnalysisSignature:
      type: object
      description: A signature for a static analysis tool
      required:
        - class_names
        - method_names
        - kind
      properties:
        class_names:
          type: array
          items:
            type: string
          description: The names of the classes
        method_names:
          type: array
          items:
            type: string
          description: The names of the methods
        kind:
          type: string
          description: >-
            Unique name for the ingress/egress signature (e.g. "postgres",
            "gateway_response"). All the signatures with the same kind are
            grouped together.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````