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
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.
Example Request
Response
202 Accepted:
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
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:Get Scan Status
Endpoint
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
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.
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 acodebaseId. Find it:
Via Dashboard
- Go to Repositories
- Click a repository
- 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
ForscanSpecificFiles, 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 ofPOST /v1/scans, refer to When the Scan Does Not Start. This table is for POST /v1/scan-workflows/start and the status route.
Error Response Format
Rate Limits
The API does not rate-limit requests today. Poll the status endpoint every few seconds, not in a tight loop.Complete Example
Related Pages
API Authentication
Authentication setup
Issues API
Access scan results
CLI Scanning
CLI alternative
CI/CD Integration
Automate scans

