Skip to main content
GET
/
api
/
compliance
/
score
curl -X GET "https://api.example.com/api/compliance/score?scan_id=abc123" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "score": 85,
  "total_violations": 42,
  "open_violations": 15,
  "resolved_violations": 27,
  "false_positives": 5,
  "by_severity": {
    "CRITICAL": 3,
    "HIGH": 8,
    "MEDIUM": 4
  },
  "by_rule_type": {
    "AML_HIGH_RISK_COUNTRY": 5,
    "AML_STRUCTURING": 7,
    "KYC_MISSING_INFO": 3
  }
}
Returns the compliance score, violation statistics, and detailed breakdowns by severity and rule type for a given scan. Also includes score history trend data from the scans.score_history JSONB field.

Query Parameters

scan_id
string
required
The unique identifier of the scan to retrieve the compliance score for

Response

score
number
Overall compliance score for the scan (0-100)
total_violations
number
Total number of violations detected in the scan (includes all statuses)
open_violations
number
Number of violations that are still open (not resolved or marked as false positive)
resolved_violations
number
Number of violations that have been resolved (approved or marked as false positive)
false_positives
number
Number of violations marked as false positives
by_severity
object
Breakdown of active violations by severity level
CRITICAL
number
Number of active critical severity violations
HIGH
number
Number of active high severity violations
MEDIUM
number
Number of active medium severity violations
by_rule_type
object
Breakdown of active violations grouped by rule ID. Keys are rule IDs, values are violation counts.

Error Responses

error
string
Error code: VALIDATION_ERROR, NOT_FOUND, or INTERNAL_ERROR
message
string
Human-readable error message
curl -X GET "https://api.example.com/api/compliance/score?scan_id=abc123" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "score": 85,
  "total_violations": 42,
  "open_violations": 15,
  "resolved_violations": 27,
  "false_positives": 5,
  "by_severity": {
    "CRITICAL": 3,
    "HIGH": 8,
    "MEDIUM": 4
  },
  "by_rule_type": {
    "AML_HIGH_RISK_COUNTRY": 5,
    "AML_STRUCTURING": 7,
    "KYC_MISSING_INFO": 3
  }
}

Build docs developers (and LLMs) love