Skip to main content
GET
/
scans
List scans
curl --request GET \
  --url https://app.codethreat.com/api/v1/scans \
  --header 'X-API-Key: <api-key>'
"<any>"

Scans API

Trigger and manage security scans via API.

Trigger Scan

POST /v1/scans
Request:
{
  "repository_id": "repo_123",
  "branch": "main"
}
Response:
{
  "scan_id": "scan_456",
  "status": "PENDING",
  "repository_id": "repo_123",
  "branch": "main",
  "created_at": "2024-03-15T14:32:18Z"
}

Get Scan Status

GET /v1/scans/:scan_id
Response:
{
  "scan_id": "scan_456",
  "status": "COMPLETED",
  "repository_id": "repo_123",
  "branch": "main",
  "violations": {
    "critical": 2,
    "high": 5,
    "medium": 12,
    "low": 8,
    "info": 0
  },
  "started_at": "2024-03-15T14:32:20Z",
  "completed_at": "2024-03-15T14:35:42Z"
}

List Scans

GET /v1/scans?repository_id=repo_123&limit=10
Response:
{
  "scans": [
    {
      "scan_id": "scan_456",
      "status": "COMPLETED",
      "created_at": "2024-03-15T14:32:18Z"
    }
  ],
  "pagination": {
    "page": 1,
    "total": 42
  }
}

What’s Next?

Authorizations

X-API-Key
string
header
required

Query Parameters

page
integer
default:1
Required range: x >= 1
limit
integer
default:20
Required range: 1 <= x <= 100
repositoryId
string
status
enum<string>
Available options:
PENDING,
SCANNING,
COMPLETED,
FAILED
scanType
enum<string>
Available options:
sast,
sca,
secrets,
iac
sortBy
enum<string>
default:startedAt
Available options:
startedAt,
completedAt,
status
sortOrder
enum<string>
default:desc
Available options:
asc,
desc

Response

200 - application/json
success
boolean
data
any
pagination
object
meta
object