Skip to main content
The Vidoc REST API authenticates every request with an API key. The key names one project: every route reads and writes that project only.

Getting an API Key

  1. Open app.vidoc.dev or your custom deployment URL (the web app URL from your admin for on-premises installations)
  2. Select your project
  3. Navigate to Project switcher > API keys
  4. Click “Create new key”, enter a name and pick an expiry
  5. Copy the key and store it securely
API keys expire. The default expiry is 1 month. For automation, pick 6 months or 1 year. An expired key answers 401 Invalid or expired token and nothing else warns you.
See API Keys for detailed management.

Base URL

Select the API address of your deployment before you run an example. Set VIDOC_API_URL without a trailing slash or /v1:
The REST examples use VIDOC_API_KEY for the key and pass it explicitly in the header. The CLI uses VIDOC_TOKEN. Keep these values in your shell or CI secret store. Every API route below starts with /v1.

Authentication Method

Send the key in the x-vidoc-token header. This is the only header the REST API reads.
The REST API does not read Authorization: Bearer <key> or X-API-Key. A request that sends the key in one of those headers gets 401 Token is missing.
The MCP server uses a separate endpoint at /mcp. It requires Authorization: Bearer <key> and accepts only user API keys. Refer to MCP setup to connect your coding agent.

Permissions

An API key carries the role of the user who created it. Each route requires one permission: A read_only member cannot create API keys, so every key created in the dashboard has at least the developer role. Status changes and POST /v1/scans also need a key that belongs to a user, because Vidoc records the author. Keys created in the dashboard are user keys. System, GitHub and legacy tokens have no user and get 403 user_token_required.

Request Format

Headers

Request Body

POST and PATCH requests use JSON:

Response Format

Success Response

POST /v1/scans answers 202, because the scan runs after the response. Other POST routes answer 201, every other route answers 200, always with a JSON body. For example, POST /v1/scan-workflows/start returns:

Error Response

Error bodies include statusCode, message, timestamp, and path. Authentication, permission, issue, and scan-list errors also provide a machine-readable code. Use code when it is present, rather than matching the message text. Some older routes provide error, the HTTP status text, without code.
A validation error (400) has the message Validation failed and an errors array. Each item names the field (path) and the reason (message):

Error Codes

The issue and scan-list query schemas reject unknown parameters with 400 and code: unknown_parameter. Other validation errors use validation_failed. Common codes are token_missing, token_invalid, permission_missing, project_access_denied, user_token_required, issue_not_found, and codebase_not_found.

Rate Limits

The API does not rate-limit requests today, so there are no 429 answers and no X-RateLimit-* headers. Rate limiting is planned. Until then:
  • Keep bulk status updates at 100 items or fewer per request, and do not run many bulk requests at the same time
  • Poll a scan status every few seconds, not in a tight loop

Code Examples

JavaScript/Node.js

Python

cURL

Security Best Practices

  1. Never commit API keys - Use environment variables
  2. Pick the shortest expiry that fits the job - Keys expire at the chosen preset; plan the rotation before that date
  3. Use separate keys - One per environment/purpose
  4. Create keys from the right account - A key carries the role of its creator; create automation keys from an account with the smallest role that has the needed permission
  5. Delete compromised keys - Immediately if exposed

API Keys

Manage API keys

Scanning API

Start scans via API

Issues API

Access issues via API

CLI Authentication

CLI auth methods