API Reference

Kolega DevSec Public API

REST API for organization-scoped automation around repositories, scans, findings, fixes, and pull request creation.

Base URL
https://api.kolega.dev
Base path
/api/v1

Authentication

Organization API key. Generate keys in Organization Settings -> API Keys and send them as Bearer tokens.

  • Generate API keys in Organization Settings -> API Keys.
  • Send the key in the Authorization header as a Bearer token.
  • Keys are organization-scoped and intended for requests under /api/v1.

Quickstart

Typical flow: list repositories, trigger a scan batch, poll the batch progress endpoint, read aggregated batch results, review findings, create a fix, then poll fix progress before opening pull requests.

List repositories

curl -s "https://api.kolega.dev/api/v1/repositories?limit=10" \
  -H "Authorization: Bearer kcp_live_your_api_key_here" \
  -H "Accept: application/json"

Trigger a scan batch and poll progress

curl -s "https://api.kolega.dev/api/v1/repositories/$REPOSITORY_ID/scans" \
  -X POST \
  -H "Authorization: Bearer kcp_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "scan_type": "deep_ai_scan"
  }'

curl -s "https://api.kolega.dev/api/v1/repositories/$REPOSITORY_ID/scans/$SCAN_ID/progress" \
  -H "Authorization: Bearer kcp_live_your_api_key_here"

curl -s "https://api.kolega.dev/api/v1/repositories/$REPOSITORY_ID/scans/$SCAN_ID/results" \
  -H "Authorization: Bearer kcp_live_your_api_key_here"

Create a fix, poll progress, and open pull requests

curl -s "https://api.kolega.dev/api/v1/repositories/$REPOSITORY_ID/fixes" \
  -X POST \
  -H "Authorization: Bearer kcp_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "finding_ids": ["'$FINDING_ID'"],
    "title": "Remediate SQL injection in auth flow",
    "instructions": "Preserve current API behavior and add regression coverage.",
    "source_repo": "acme/auth-service",
    "source_repo_provider": "github",
    "source_scan_branch": "main"
  }'

curl -s "https://api.kolega.dev/api/v1/repositories/$REPOSITORY_ID/fixes/$FIX_ID/progress" \
  -H "Authorization: Bearer kcp_live_your_api_key_here"

curl -s "https://api.kolega.dev/api/v1/repositories/$REPOSITORY_ID/fixes/$FIX_ID/pull-requests" \
  -X POST \
  -H "Authorization: Bearer kcp_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{}'
  • scan_type accepts secrets_scan, semgrep_scan, deep_ai_scan, or sbom_scan.
  • GET /repositories/{repository_id}/scans/{scan_id} now returns the scan batch detail created by POST /scans.
  • GET /repositories/{repository_id}/scans/{scan_id}/progress is the primary polling endpoint for live scan progress.
  • GET /repositories/{repository_id}/scans/{scan_id}/results returns findings aggregated across every repository in the batch.
  • GET /repositories/{repository_id}/fixes/{fix_id}/progress is the primary polling endpoint for active fixes.
  • GET /me returns the calling key's organization, scopes, and quota period — handy for verifying credentials before automating.
  • GET /finding-events is an organization-wide, reverse-chronological feed of finding lifecycle events for audit trails and webhook-style polling.
  • POST /repositories/{repository_id}/fixes/{fix_id}/refine re-runs the agent with follow-up instructions; POST .../cancel stops a pending or running fix.

Account

Inspect the identity, organization, and scopes of the calling API key.

GET/api/v1/me

Get Public Api Me

Return safe metadata for the authenticated API key connection.

Responses
StatusDescriptionSchema
200

Successful Response

PublicMeResponse

Repositories

Discover the repository ids and source inventory available to the calling organization.

GET/api/v1/repositories

List Repositories

List repositories for the calling organization.

Parameters
NameTypeRequiredDescription
include_archivedbooleanNo

Include archived repositories

Default: false
limitintegerNo

query parameter.

Default: 50
skipintegerNo

query parameter.

Default: 0
Responses
StatusDescriptionSchema
200

Successful Response

PublicPaginatedResponse_PublicRepositoryResponse_
422

Validation Error

HTTPValidationError
GET/api/v1/repositories/{repository_id}

Get Repository

Get a single repository by id.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicRepositoryResponse
422

Validation Error

HTTPValidationError

Scans

Create scan batches, poll live batch progress, inspect batch details, and fetch aggregated findings.

GET/api/v1/repositories/{repository_id}/scans

List Scans

List scan batches for the repository.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

scan_typesecrets_scan | semgrep_scan | deep_ai_scan | sbom_scan | nullNo

Filter by scan type

statusstring | nullNo

Filter by status

limitintegerNo

query parameter.

Default: 20
skipintegerNo

query parameter.

Default: 0
Responses
StatusDescriptionSchema
200

Successful Response

PublicPaginatedResponse_PublicScanBatchResponse_
422

Validation Error

HTTPValidationError
POST/api/v1/repositories/{repository_id}/scans

Create Scan

Trigger a security scan for the repository.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

Request body
NameTypeRequiredDescription
scan_typesecrets_scan | semgrep_scan | deep_ai_scan | sbom_scanYes

Available scan types for repository security scanning.

Responses
StatusDescriptionSchema
202

Successful Response

PublicScanBatchResponse
422

Validation Error

HTTPValidationError
GET/api/v1/repositories/{repository_id}/scans/{scan_id}

Get Scan

Get the scan batch you created. scan_id is the batch id.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

scan_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicScanBatchResponse
422

Validation Error

HTTPValidationError
GET/api/v1/repositories/{repository_id}/scans/{scan_id}/progress

Get Scan Progress

Fine-grained progress for a scan batch.

Returns the batch's aggregate counters plus a per-repository breakdown (including placeholder entries for repos that haven't been materialized as scans yet when the batch is still QUEUED/CREATING_SCANS). A CLI can poll this and render a progress bar from percent_complete.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

scan_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicScanProgressResponse
422

Validation Error

HTTPValidationError
GET/api/v1/repositories/{repository_id}/scans/{scan_id}/results

Get Scan Results

Aggregate findings from every repository in the batch.

scan_id is the batch id from POST /scans. Returns every finding attributed to this batch across all repositories. For per-repository slicing, use /progress to see the breakdown and then filter findings by scan_batch_id if needed.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

scan_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicScanResultsResponse
422

Validation Error

HTTPValidationError

Findings

List findings for a repository, inspect one finding, or update its lifecycle status.

GET/api/v1/repositories/{repository_id}/findings

List Findings

List findings for the repository.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

scan_batch_idstring | nullNo

Filter by scan batch id

severitystring | nullNo

Filter by severity

statusstring | nullNo

Filter by status

scan_typestring | nullNo

Filter by scan type

limitintegerNo

query parameter.

Default: 50
skipintegerNo

query parameter.

Default: 0
Responses
StatusDescriptionSchema
200

Successful Response

PublicPaginatedResponse_PublicFindingResponse_
422

Validation Error

HTTPValidationError
GET/api/v1/repositories/{repository_id}/findings/{finding_id}

Get Finding

Get a single finding by id.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

finding_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicFindingResponse
422

Validation Error

HTTPValidationError
PATCH/api/v1/repositories/{repository_id}/findings/{finding_id}

Update Finding Status

Update the status of a finding (open / resolved / ignored / etc).

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

finding_idstringYes

path parameter.

Request body
NameTypeRequiredDescription
statusopen | resolved | ignored | false_positive | needs_manual_reviewYes

Status of a security finding.

Responses
StatusDescriptionSchema
200

Successful Response

PublicFindingResponse
422

Validation Error

HTTPValidationError

Finding Events

Stream organization-wide finding lifecycle events for audit trails and webhook-style polling.

GET/api/v1/finding-events

List Finding Events

List finding lifecycle events for the calling organization.

Events are returned reverse-chronologically so polling consumers such as Zapier can use the event id as a stable dedupe key.

Parameters
NameTypeRequiredDescription
repository_idstring | nullNo

Filter by repository id

finding_idstring | nullNo

Filter by finding id

scan_typestring | nullNo

Filter by scan type

severitystring | nullNo

Filter by severity

event_typestring | nullNo

Filter by event type

startstring (date-time) | nullNo

Start time filter

endstring (date-time) | nullNo

End time filter

limitintegerNo

query parameter.

Default: 100
skipintegerNo

query parameter.

Default: 0
Responses
StatusDescriptionSchema
200

Successful Response

PublicPaginatedResponse_PublicFindingEventResponse_
422

Validation Error

HTTPValidationError

Fixes

Create remediation runs, poll fix progress, inspect diffs, and create pull requests.

GET/api/v1/repositories/{repository_id}/fixes

List Fixes

List fixes for the repository.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

finding_idstring | nullNo

Filter by finding id

limitintegerNo

query parameter.

Default: 50
skipintegerNo

query parameter.

Default: 0
Responses
StatusDescriptionSchema
200

Successful Response

PublicPaginatedResponse_PublicFixResponse_
422

Validation Error

HTTPValidationError
POST/api/v1/repositories/{repository_id}/fixes

Create Fix

Trigger an autofix run for one or more findings in this repository.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

Request body
NameTypeRequiredDescription
finding_idsstring[]No

No description provided.

titlestringYes

No description provided.

instructionsstringYes

No description provided.

source_repostringYes

Repository full_name (owner/repo)

source_repo_providergithub | gitlab | azure_devopsNo

No description provided.

Default: github
source_scan_branchstring | nullNo

Branch the finding was detected on

Responses
StatusDescriptionSchema
201

Successful Response

PublicFixResponse
422

Validation Error

HTTPValidationError
GET/api/v1/repositories/{repository_id}/fixes/{fix_id}

Get Fix

Get a single fix by id.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

fix_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicFixResponse
422

Validation Error

HTTPValidationError
GET/api/v1/repositories/{repository_id}/fixes/{fix_id}/diff

Get Fix Diff

Get the diff for a fix. Returns diff=null while the fix is still running — clients should poll until status is completed.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

fix_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicFixDiffResponse
422

Validation Error

HTTPValidationError
GET/api/v1/repositories/{repository_id}/fixes/{fix_id}/progress

Get Fix Progress

Minimal heartbeat for a running fix.

Returns status, timings, agent step count, and a last-activity timestamp so a CLI can show something like "Running... (42s, 12 steps, last update 3s ago)". Deliberately does not expose message content or tool-call details.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

fix_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicFixProgressResponse
422

Validation Error

HTTPValidationError
POST/api/v1/repositories/{repository_id}/fixes/{fix_id}/refine

Refine Fix

Refine a completed autofix run with follow-up instructions.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

fix_idstringYes

path parameter.

Request body
NameTypeRequiredDescription
instructionsstringYes

Follow-up instructions for refining the generated fix

Responses
StatusDescriptionSchema
200

Successful Response

PublicFixResponse
422

Validation Error

HTTPValidationError
POST/api/v1/repositories/{repository_id}/fixes/{fix_id}/cancel

Cancel Fix

Cancel a pending or running autofix run.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

fix_idstringYes

path parameter.

Responses
StatusDescriptionSchema
200

Successful Response

PublicFixResponse
422

Validation Error

HTTPValidationError
POST/api/v1/repositories/{repository_id}/fixes/{fix_id}/pull-requests

Create Pull Requests

Open pull requests for a completed fix.

Parameters
NameTypeRequiredDescription
repository_idstringYes

path parameter.

fix_idstringYes

path parameter.

Request body
NameTypeRequiredDescription
titlestring | nullNo

PR title; auto-generated if omitted

bodystring | nullNo

PR body in markdown; auto-generated if omitted

branch_namestring | nullNo

Custom branch name; auto-generated if omitted

Responses
StatusDescriptionSchema
201

Successful Response

PublicPullRequestsCreatedResponse
422

Validation Error

HTTPValidationError

Quotas

Check current organization quota balances exposed by the public API.

GET/api/v1/quotas/balance

Get Quota Balance

Return the current-period quota balance for the calling organization.

Check this before triggering a scan or fix — if a counter's remaining is zero, the POST will 403 OPERATION_FAILED with the offending quota_type in the detail.

Responses
StatusDescriptionSchema
200

Successful Response

PublicQuotaBalanceResponse