Skip to main content
POST
/
v0
/
sca
/
start-run
Resolve SCA config and run ID
curl --request POST \
  --url https://{hostname}.gable.ai/v0/sca/start-run \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "code_info": {
    "repo_uri": "<string>",
    "repo_branch": "<string>",
    "repo_commit": "<string>",
    "project_root": "<string>",
    "repo_ui_url": "<string>",
    "external_component_id": "<string>",
    "repo_name": "<string>",
    "event_repo": "<string>",
    "repo_commit_timestamp": "<string>",
    "is_default_branch": true,
    "namespace": "<string>",
    "docker_image_version": "<string>",
    "has_uncommitted_changes": true,
    "operating_system": "<string>",
    "sca_config_version": "<string>",
    "pr_base_branch": {
      "branch": "<string>",
      "commit": "<string>"
    },
    "pr_number": 123,
    "gable_cli_version": "<string>",
    "sca_prime_version": "<string>",
    "dependencies": [
      {
        "repo_name": "<string>",
        "commit_sha": "<string>",
        "commit_timestamp": "<string>"
      }
    ]
  },
  "pr_link": "<string>",
  "include_unchanged_assets": false,
  "type": "CODE",
  "run_id": "<string>",
  "collection_mechanism": "BYOL"
}
'
{
  "runId": "<string>",
  "config": {
    "config_type": "<string>",
    "project_root": "<string>",
    "version": "<string>",
    "config_value": {},
    "namespace": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "language": "<string>",
    "repo": "<string>"
  }
}

Authorizations

X-API-KEY
string
header
required

Body

application/json
code_info
object
required

Metadata about the code that is being analyzed

action
enum<string>
required

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.

Available options:
register,
check,
upload
sca_info
object

Link to the pull request in the source code repository, if applicable

include_unchanged_assets
boolean
default:false

Whether to include assets that have not changed since the last run

output_format
enum<string>

Format of the output, either 'json', 'text', or 'markdown'

Available options:
json,
text,
markdown
type
enum<string>
default:CODE

Type of the run, either 'code' or 'data_store' or 'edge'

Available options:
CODE,
DATA_STORE,
EDGE
run_id
string

The ID of the run that the component belongs to

collection_mechanism
enum<string>
default:BYOL

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.

Available options:
SCA,
BYOL

Response

The SCA config and canonical run ID for this upload

The response from the postScaStartRun function

runId
string
required

The unique run ID assigned to this SCA run

config
object