Getting an API Key
- Open app.vidoc.dev or your custom deployment URL (the web app URL from your admin for on-premises installations)
- Select your project
- Navigate to Project switcher > API keys
- Click “Create new key”, enter a name and pick an expiry
- Copy the key and store it securely
Base URL
Select the API address of your deployment before you run an example. SetVIDOC_API_URL without a trailing slash or /v1:
- Vidoc Cloud
- Self-hosted
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 thex-vidoc-token header. This is the only header the REST API reads.
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 includestatusCode, 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.
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 no429 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
- Never commit API keys - Use environment variables
- Pick the shortest expiry that fits the job - Keys expire at the chosen preset; plan the rotation before that date
- Use separate keys - One per environment/purpose
- 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
- Delete compromised keys - Immediately if exposed
Related Pages
API Keys
Manage API keys
Scanning API
Start scans via API
Issues API
Access issues via API
CLI Authentication
CLI auth methods

