KeyEnvKeyEnv
API Reference

Scans

Secret scanning for detecting hardcoded secrets

Scans

Secret scanning for detecting hardcoded secrets

List scans

GET /api/v1/projects/{projectId}/scans

Lists secret scan results for a project

Operation ID: listScans · Authentication: Authorization: Bearer <token>

Path parameters

NameTypeRequiredDescription
projectIdstringyesProject UUID or slug (e.g., "my-project")

Responses

StatusDescriptionBody
200List of scansobject[]
401Authentication requiredError
403Insufficient permissionsError

Response body (200)

FieldTypeDescription
idstring (uuid)
project_idstring (uuid)
sourceenum (cli, action, app)
commit_shastring
branchstring
findings_countinteger
created_atstring (date-time)
created_bystring (uuid)

Example

curl -X GET "https://api.keyenv.dev/api/v1/projects/{projectId}/scans" \
  -H "Authorization: Bearer $KEYENV_TOKEN"

Upload scan results

POST /api/v1/projects/{projectId}/scans

Uploads secret scan results from CLI or GitHub Action

Operation ID: uploadScan · Authentication: Authorization: Bearer <token>

Path parameters

NameTypeRequiredDescription
projectIdstringyesProject UUID or slug (e.g., "my-project")

Request body

application/json (required)

FieldTypeRequiredDescription
findingsobject[]no
sourceenum (cli, action, app)no
commit_shastringno
branchstringno

Responses

StatusDescriptionBody
201Scan uploadedUploadScanResponse
400Invalid requestError
401Authentication requiredError
403Insufficient permissionsError

Response body (201)

FieldTypeDescription
scan_idstring (uuid)
findings_countinteger

Example

curl -X POST "https://api.keyenv.dev/api/v1/projects/{projectId}/scans" \
  -H "Authorization: Bearer $KEYENV_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"findings":[{"pattern_id":"string","pattern_name":"string","severity":"critical","file_path":"string","line_number":0,"matched_text":"string"}],"source":"cli","commit_sha":"string","branch":"string"}'

Get scan

GET /api/v1/projects/{projectId}/scans/{scanId}

Returns a scan with its findings

Operation ID: getScan · Authentication: Authorization: Bearer <token>

Path parameters

NameTypeRequiredDescription
projectIdstringyesProject UUID or slug (e.g., "my-project")
scanIdstring (uuid)yes

Responses

StatusDescriptionBody
200Scan details with findingsobject
401Authentication requiredError
403Insufficient permissionsError
404Resource not foundError

Example

curl -X GET "https://api.keyenv.dev/api/v1/projects/{projectId}/scans/{scanId}" \
  -H "Authorization: Bearer $KEYENV_TOKEN"

Update finding status

PATCH /api/v1/projects/{projectId}/scans/{scanId}/findings/{findingId}

Updates a scan finding status (dismiss or reactivate)

Operation ID: updateFindingStatus · Authentication: Authorization: Bearer <token>

Path parameters

NameTypeRequiredDescription
projectIdstringyesProject UUID or slug (e.g., "my-project")
scanIdstring (uuid)yes
findingIdstring (uuid)yes

Request body

application/json (required)

FieldTypeRequiredDescription
statusenum (active, dismissed, fixed)yes
dismissed_reasonstringno

Responses

StatusDescriptionBody
200Finding updatedScanFinding
400Invalid requestError
401Authentication requiredError
403Insufficient permissionsError

Response body (200)

FieldTypeDescription
idstring (uuid)
scan_idstring (uuid)
pattern_idstring
pattern_namestring
severityenum (critical, high, medium, low)
file_pathstring
line_numberinteger
snippetstring
statusenum (active, dismissed, fixed)
dismissed_bystring (uuid)
dismissed_atstring (date-time)
dismissed_reasonstring
created_atstring (date-time)

Example

curl -X PATCH "https://api.keyenv.dev/api/v1/projects/{projectId}/scans/{scanId}/findings/{findingId}" \
  -H "Authorization: Bearer $KEYENV_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status":"active","dismissed_reason":"string"}'

On this page