curl --request GET \
--url https://api.example.com/api/scan/history{
"scans": [
{
"id": "<string>",
"policy_id": "<string>",
"score": 123,
"violation_count": 123,
"new_violations": 123,
"resolved_violations": 123,
"unchanged_count": 123,
"status": "<string>",
"created_at": "<string>",
"completed_at": "<string>",
"audit_name": "<string>"
}
]
}Retrieve all completed scans for the authenticated user
curl --request GET \
--url https://api.example.com/api/scan/history{
"scans": [
{
"id": "<string>",
"policy_id": "<string>",
"score": 123,
"violation_count": 123,
"new_violations": 123,
"resolved_violations": 123,
"unchanged_count": 123,
"status": "<string>",
"created_at": "<string>",
"completed_at": "<string>",
"audit_name": "<string>"
}
]
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Basit-Ali0/Yggdrasil/llms.txt
Use this file to discover all available pages before exploring further.
Show Scan Item
"completed" in history results{
"scans": [
{
"id": "abc12345-def6-7890-ghij-klmnopqrstuv",
"policy_id": "550e8400-e29b-41d4-a716-446655440000",
"score": 87.5,
"violation_count": 23,
"new_violations": 5,
"resolved_violations": 12,
"unchanged_count": 18,
"status": "completed",
"created_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:30:04Z",
"audit_name": "Q1 2024 Compliance Audit"
},
{
"id": "prev1234-5678-90ab-cdef-ghijklmnopqr",
"policy_id": "550e8400-e29b-41d4-a716-446655440000",
"score": 82.3,
"violation_count": 30,
"new_violations": 8,
"resolved_violations": 3,
"unchanged_count": 22,
"status": "completed",
"created_at": "2023-12-15T14:20:00Z",
"completed_at": "2023-12-15T14:20:03Z",
"audit_name": "Q4 2023 Compliance Audit"
},
{
"id": "scan5678-90ab-cdef-ghij-klmnopqrstuv",
"policy_id": "660e9511-f30c-52e5-b827-557766551111",
"score": 95.2,
"violation_count": 7,
"new_violations": 0,
"resolved_violations": 15,
"unchanged_count": 7,
"status": "completed",
"created_at": "2023-11-20T09:15:00Z",
"completed_at": "2023-11-20T09:15:02Z",
"audit_name": null
}
]
}
completed scans are returnedcreated_at descending (most recent first)created_at, score, violation_count. Default: created_atasc, desc. Default: desc{
"error": "UNAUTHORIZED",
"message": "Authentication required"
}
{
"error": "INTERNAL_ERROR",
"message": "Failed to fetch scan history"
}
created_at)rule_id:accountnew_violations: equals violation_countresolved_violations: 0unchanged_count: 0const { scans } = await fetch('/api/scan/history').then(r => r.json());
// Group by policy
const byPolicy = scans.reduce((acc, scan) => {
if (!acc[scan.policy_id]) acc[scan.policy_id] = [];
acc[scan.policy_id].push(scan);
return acc;
}, {});
// Chart compliance scores over time
Object.entries(byPolicy).forEach(([policyId, policScans]) => {
const scores = policyScans.map(s => ({
date: s.created_at,
score: s.score
}));
renderChart(policyId, scores);
});
const { scans } = await fetch('/api/scan/history').then(r => r.json());
const withPersistentIssues = scans.filter(s =>
s.unchanged_count > 0 && s.unchanged_count / s.violation_count > 0.5
);
console.log(`Found ${withPersistentIssues.length} scans with 50%+ persistent violations`);