curl --request POST \
--url https://api.example.com/api/audits \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"policy_type": "<string>",
"selected_categories": [
"<string>"
]
}
'{
"audit_id": "<string>",
"policy_id": "<string>",
"rules": [
{
"rule_id": "<string>",
"name": "<string>",
"type": "<string>",
"description": "<string>",
"threshold": 123,
"time_window": "<string>",
"severity": "<string>",
"conditions": {},
"policy_excerpt": "<string>",
"policy_section": "<string>",
"category": "<string>",
"historical_context": "<string>"
}
],
"error": "<string>",
"message": "<string>",
"details": {}
}Create a new compliance audit with a prebuilt policy pack (AML, GDPR, or SOC2)
curl --request POST \
--url https://api.example.com/api/audits \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"policy_type": "<string>",
"selected_categories": [
"<string>"
]
}
'{
"audit_id": "<string>",
"policy_id": "<string>",
"rules": [
{
"rule_id": "<string>",
"name": "<string>",
"type": "<string>",
"description": "<string>",
"threshold": 123,
"time_window": "<string>",
"severity": "<string>",
"conditions": {},
"policy_excerpt": "<string>",
"policy_section": "<string>",
"category": "<string>",
"historical_context": "<string>"
}
],
"error": "<string>",
"message": "<string>",
"details": {}
}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.
POST /api/audits
Authorization header or authenticated session cookies.
See Authentication for details.
aml - Anti-Money Laundering rulesgdpr - General Data Protection Regulation rulessoc2 - SOC 2 compliance rules["Access Control", "Encryption"]Show Rule object properties
curl -X POST https://your-domain.com/api/audits \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"name": "Q4 2024 SOC2 Compliance Audit",
"policy_type": "soc2",
"selected_categories": ["Access Control", "Encryption"]
}'
const { data: { session } } = await supabase.auth.getSession();
const response = await fetch('/api/audits', {
method: 'POST',
headers: {
'Authorization': `Bearer ${session.access_token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Q4 2024 SOC2 Compliance Audit',
policy_type: 'soc2',
selected_categories: ['Access Control', 'Encryption'],
}),
});
const data = await response.json();
console.log('Audit created:', data.audit_id);
console.log('Loaded rules:', data.rules.length);
{
"audit_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"policy_id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
"rules": [
{
"rule_id": "soc2-ac-001",
"name": "Multi-Factor Authentication Required",
"type": "boolean",
"description": "All user accounts must have MFA enabled",
"severity": "high",
"category": "Access Control",
"policy_excerpt": "The organization shall require multi-factor authentication for all system access.",
"policy_section": "CC6.1",
"conditions": {
"mfa_enabled": true
}
},
{
"rule_id": "soc2-enc-001",
"name": "Data Encryption at Rest",
"type": "boolean",
"description": "All sensitive data must be encrypted at rest",
"severity": "critical",
"category": "Encryption",
"policy_excerpt": "Sensitive data shall be encrypted using industry-standard algorithms.",
"policy_section": "CC6.7",
"conditions": {
"encryption_enabled": true,
"algorithm": "AES-256"
}
}
]
}
{
"error": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"path": ["policy_type"],
"message": "Invalid enum value. Expected 'aml' | 'gdpr' | 'soc2'"
}
]
}
{
"error": "UNAUTHORIZED",
"message": "Not authenticated — no valid session found"
}
{
"error": "INTERNAL_ERROR",
"message": "Failed to create policy"
}
CreateAuditSchema (Zod validation)getUserIdFromRequest()policy_type (AML, GDPR, or SOC2)selected_categories if providedpolicies tablerules table with enriched metadatapolicies table: user_id = auth.uid()rules table: Filtered by policy_id owned by the authenticated user/api/policies/ingest - Extract rules from PDF documents/api/policies/generate-rules - Generate rules using AIaudit_id is a logical session identifier, not stored in the database (MVP design)historical_context metadata stored as JSONis_active: true by defaultactive and type to prebuilt