Start a repository source scan in CI
Pass {} to use the latest successful default-branch scan's commit, falling back to the default branch HEAD. Repository scanning settings apply. Read the new scan via GET /v1/scans/{scanUuid}.
Request
POST
https://appsec.sourcecraft.tech/v1/scans
Query parameters
|
Name |
Description |
|
gitRepo |
Type: string Repository identifier. Accepts either internal repository ID (e.g., 88769874964302633) or public UUID (e.g., 0199140f-4343-7c06-a7e3-b835c305b629). These values can be obtained from the getRepo API (fields: id and uuid). Pattern: Example: `` |
Body
application/json
{
"commit": "example",
"scanUuid": "example",
"engineType": "UNSPECIFIED"
}
|
Name |
Description |
|
commit |
Type: string | null Full 40-character Git commit SHA. Takes precedence over the selected scan's commit. Example: |
|
engineType |
Type: string Engine category to run. Omit or use UNSPECIFIED for the repository's configured engines. Enum: |
|
scanUuid |
Type: string | null UUID of an earlier scan in this repository to use as the commit source. Example: |
RepositoryScanEngine
Type: string
Enum: UNSPECIFIED, SAST, SECRETS, SCA, SBOM_SPDX, SBOM_CYCLONEDX
Responses
202 Accepted
CI accepted the new scan
Body
application/json
{
"scanUuid": "example",
"fluxId": "example"
}
|
Name |
Description |
|
fluxId |
Type: string Example: |
|
scanUuid |
Type: string Example: |
400 Bad Request
Invalid request body, commit, engine type or scan UUID
401 Unauthorized
Authentication required
403 Forbidden
AppSec scan permission denied
404 Not Found
Repository or selected scan not found
409 Conflict
Scanning is disabled or there is no commit to scan
502 Bad Gateway
CI did not accept the scan
503 Service Unavailable
Repository metadata unavailable