Skip to main content
Before you run these examples, select your deployment API address. Set VIDOC_API_URL without a trailing slash or /v1, and keep the key in VIDOC_API_KEY. The Scanning API starts and monitors full scans of a repository. There are two routes to start a scan:
Manual codebase scans are available on Enterprise plans. Pull request scans run from the SCM integration and do not use this API.

Start a Full Scan

Endpoint

Starts a full scan of the source branch of one repository. If the repository is connected through GitHub, GitLab, or Bitbucket, Vidoc first reads the latest commit of the branch. The route needs a user API key. System, GitHub, and legacy tokens get 403 user_token_required, because Vidoc records who started the scan in the audit log.

Request Body

The route has no branch field: Vidoc always scans the source branch. To change it, refer to Repositories. A field that the route does not know gives 400 unknown_parameter.

Scan Modes

Use fresh or revalidate after your team adds memories, to apply them to findings that Vidoc validated before.
fresh retires findings: they leave the dashboard, and the scan finds them again as new findings. Use it only when you want a new baseline for the branch. Ask your team before you start it from a script.

Example Request

Response

202 Accepted:
The scan runs after the response. Use scanId with the status endpoint, or find the scan in GET /v1/scans. branch is the source branch that Vidoc scans.

When the Scan Does Not Start

Branch your code on code, not on message. Refer to API Authentication for the error body.

Start a Scan of a Branch

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

List Scans

Returns the scans of the project, newest first.

Query Parameters

string
The ID of a repository. Get it from GET /v1/codebase.
string
A branch name. You can use it without codebaseId. Then the API returns the scans of that branch in all repositories.
string
push, pull_request, or manual.
string
pending, in_progress, completed, failed, or superseded.
integer
default:"50"
The number of scans on one page, from 1 to 100.
integer
default:"0"
The number of scans to skip.
A parameter that the endpoint does not know gives the error unknown_parameter. An unknown codebaseId gives codebase_not_found.

Example Request

Response

total is the number of scans that agree with the filters, on all pages.

Polling for Completion

Poll the status endpoint until the scan reaches a final state. It works for scans from both start routes:

Finding Your Codebase ID

Both start routes need a codebaseId. 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

For the errors of POST /v1/scans, refer to When the Scan Does Not Start. This table is for POST /v1/scan-workflows/start and the status route.
POST /v1/scan-workflows/start answers a plan restriction with 500 Internal server error, and the body carries no detail. If a scan start fails with 500 on a non-Enterprise plan, that is the cause. POST /v1/scans answers 403 plan_not_allowed instead.

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