Skip to main content
The Scanning API allows you to programmatically trigger and monitor full scans of a branch. A scan started here is the same scan as the Scan button of a repository in the dashboard.
Manual codebase scans are available on Enterprise plans. Pull request scans run from the SCM integration and do not use this API.

Start a Scan

Endpoint

Requires the permission codebase:scan (roles developer, security_engineer and admin).

Request Body

Example Request

Response

201 Created:
id is the scan ID. Use it with the status endpoint below. The scan starts as pending and moves to in_progress as soon as the workflow is running.

Scan Specific Files

To scan only certain files:
See Finding File IDs for where the IDs come from.

Get Scan Status

Endpoint

Requires issue:view. The scan must belong to the key’s project; otherwise the API answers 404 Scan not found.

Example Request

Response

The response is the scan record. It can carry more internal fields (for example githubCheckId and scmCheckId); ignore them. It has no issue count: once the status is completed, read the results with GET /v1/issues?codebaseId=....

Status Values

Polling for Completion

Poll the status endpoint until the scan reaches a final state:

Finding Your Codebase ID

The codebaseId is required to start a scan. Find it:

Via Dashboard

  1. Go to Repositories
  2. Click a repository
  3. The codebase ID is the last segment of the URL: /projects/<projectId>/repositories/<codebaseId>

Via API

GET /v1/codebase lists the repositories of the key’s project (permission issue:view). Each item carries id, name, url and defaultBranchName, among other fields. GET /v1/codebase/:codebaseId returns one repository.

Finding File IDs

For scanSpecificFiles, list the files of a branch:
branchName is required. The response is { "files": [...] }, and each file has fileId, filePath, version, isIndexed and isScanned. Use fileId in fileIds.

Error Handling

Common Errors

A plan restriction is answered with 500 Internal server error today, and the body carries no detail. If a scan start fails with 500 on a non-Enterprise plan, that is the cause.

Error Response Format

See API Authentication for the full error contract.

Rate Limits

The API does not rate-limit requests today. Poll the status endpoint every few seconds, not in a tight loop.

Complete Example

API Authentication

Authentication setup

Issues API

Access scan results

CLI Scanning

CLI alternative

CI/CD Integration

Automate scans