API Reference

ByteHide Radar provides a REST API that allows you to programmatically trigger scans, retrieve findings, and integrate security testing into your development workflow. The API uses your project token for authentication.


Authentication

Include your project token in the Authorization header of every request:

CODE
Authorization: Bearer {project-token}

Find your token on the Project Settings page. Click the copy icon to copy it.

Protect Your Token

Treat your project token as a secret. Do not hardcode it in source code or commit it to version control. Use environment variables or a secret management tool.

Base URL

CODE
https://api.bytehide.com/v1/radar

Endpoints

Trigger Scan

CODE
POST /projects/{projectId}/scans

Request Body:

ParameterTypeRequiredDescription
branchstringNoBranch to scan. Defaults to the project's configured default branch

Response:

FieldTypeDescription
scanIdstringUnique identifier for the initiated scan
statusstringInitial scan status (queued)
estimatedCompletionTimestringEstimated time for scan completion

Get Scan Status

CODE
GET /projects/{projectId}/scans/{scanId}

Response:

FieldTypeDescription
scanIdstringUnique identifier of the scan
statusstringqueued, in_progress, completed, or failed
startTimestringISO 8601 timestamp when the scan started
endTimestringISO 8601 timestamp when the scan finished (null if running)
findingsobjectFinding counts by type: sast, sca, secrets

List Findings

CODE
GET /projects/{projectId}/findings

Query Parameters:

ParameterTypeRequiredDescription
typestringNoFilter by type: sast, sca, secrets
severitystringNoFilter: critical, high, medium, low
statusstringNoFilter: open, fixed, ignored, false_positive
pageintegerNoPage number (default: 1)
per_pageintegerNoResults per page (default: 25, max: 100)

Response:

FieldTypeDescription
totalintegerTotal findings matching filters
pageintegerCurrent page number
per_pageintegerResults per page
findingsarrayArray of finding objects

Get Finding Detail

CODE
GET /projects/{projectId}/findings/{findingId}

Response:

FieldTypeDescription
findingIdstringUnique identifier
fingerprintstringStable fingerprint for tracking across scans
titlestringVulnerability title
descriptionstringDetailed description
severitystringSeverity level
statusstringCurrent status
locationobjectFile path, line number, and code snippet
cwearrayCWE identifiers (SAST findings)
cvearrayCVE identifiers (SCA findings)
aiExplanationstringAI-generated contextual analysis

Update Finding Status

CODE
PATCH /projects/{projectId}/findings/{findingId}

Request Body:

ParameterTypeRequiredDescription
statusstringYesNew status: ignored or false_positive

Returns the updated finding object.


Get Project Summary

CODE
GET /projects/{projectId}/summary

Response:

FieldTypeDescription
totalFindingsobjectFinding counts by type and severity
openFindingsintegerTotal open findings
fixedFindingsintegerTotal fixed findings
scanHistoryarrayRecent scan results with timestamps and counts
trendsobjectFinding trend data over time

Example Workflow

Bash
# Trigger a scan
curl -X POST https://api.bytehide.com/v1/radar/projects/{projectId}/scans \
  -H "Authorization: Bearer {project-token}" \
  -H "Content-Type: application/json" \
  -d '{"branch": "main"}'

# Check scan status
curl https://api.bytehide.com/v1/radar/projects/{projectId}/scans/{scanId} \
  -H "Authorization: Bearer {project-token}"

# List critical findings
curl "https://api.bytehide.com/v1/radar/projects/{projectId}/findings?severity=critical&status=open" \
  -H "Authorization: Bearer {project-token}"

# Get a specific finding with AI explanation
curl https://api.bytehide.com/v1/radar/projects/{projectId}/findings/{findingId} \
  -H "Authorization: Bearer {project-token}"

# Mark a finding as false positive
curl -X PATCH https://api.bytehide.com/v1/radar/projects/{projectId}/findings/{findingId} \
  -H "Authorization: Bearer {project-token}" \
  -H "Content-Type: application/json" \
  -d '{"status": "false_positive"}'

Rate Limits

Endpoint CategoryLimit
General API requests100 requests per minute
Scan triggers10 per hour

If you exceed the limit, the API returns 429 Too Many Requests with a Retry-After header. For increased limits on Enterprise plans, contact ByteHide support.


Error Handling

Status CodeMeaning
200 OKRequest succeeded
201 CreatedResource created
400 Bad RequestInvalid parameters
401 UnauthorizedInvalid or expired token
404 Not FoundProject or finding not found
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorRetry after a short delay

Error responses include a JSON body:

JSON
{
  "error": "Invalid project token",
  "code": "UNAUTHORIZED",
  "message": "The provided token is invalid or has been revoked."
}

API vs Dashboard

The API is designed for automation and CI/CD integration. For interactive use, the ByteHide Cloud dashboard provides visual charts, filtering, and one-click actions.


Next Steps

CI/CD Integration

Integrate Radar into your build pipeline for automated security scanning.

Project Settings

Find your project token and configure project-level settings.

Previous
Notifications