Skip to main content
A
Docs

API Reference

Complete API reference for Anar Comply compliance assessment endpoints.

Base URL

http://localhost:8004/api/v1/comply

Endpoints

GET
/api/v1/comply/health

Health check — returns service status

GET
/api/v1/comply/frameworks

List all compliance frameworks

GET
/api/v1/comply/frameworks/{id}

Get framework details with requirements

POST
/api/v1/comply/assess

Run a compliance assessment

GET
/api/v1/comply/reports

List all assessment reports

GET
/api/v1/comply/reports/{id}

Get a specific assessment report

GET
/api/v1/comply/gaps

Get compliance gaps from a report

POST
/api/v1/comply/certificate

Generate a compliance certificate

GET /api/v1/comply/frameworks

List all available compliance frameworks.

curl http://localhost:8004/api/v1/comply/frameworks

Returns an array of framework summaries including ID, name, version, region, and requirement count.

GET /api/v1/comply/frameworks/{id}

Get full framework details including all requirements with categories, weights, and descriptions.

curl http://localhost:8004/api/v1/comply/frameworks/uae-ai-ethics

POST /api/v1/comply/assess

Run a compliance assessment against one or more frameworks.

Query Parameters:

ParameterTypeRequiredDescription
framework_idsstring[]YesFramework IDs to assess against (pass multiple times for multi-framework)

Request:

{
  "system_name": "Anar Chat",
  "system_type": "conversational_ai",
  "risk_level": "medium",
  "data_types": ["personal_data", "government_data"],
  "deployment_region": "uae",
  "features": {
    "has_audit_trail": true,
    "has_bias_detection": true,
    "has_human_oversight": true,
    "has_data_encryption": true,
    "has_consent_mechanism": false,
    "has_explainability": true
  }
}

Response:

{
  "id": "rpt-001",
  "system_name": "Anar Chat",
  "overall_score": 78.5,
  "framework_scores": {
    "uae-ai-ethics": 82.0,
    "sdaia-ai-ethics": 75.0
  },
  "total_requirements": 24,
  "met_requirements": 19,
  "gap_count": 5,
  "assessed_at": "2024-01-15T10:30:00Z"
}

GET /api/v1/comply/reports

List all assessment reports.

curl http://localhost:8004/api/v1/comply/reports

GET /api/v1/comply/reports/{id}

Get a specific assessment report with full scoring details.

curl http://localhost:8004/api/v1/comply/reports/rpt-001

GET /api/v1/comply/gaps

Retrieve compliance gaps from a specific report. Supports filtering by framework and severity.

Query Parameters:

ParameterTypeRequiredDescription
report_idstringYesAssessment report ID
framework_idstringNoFilter gaps to a specific framework
severitystringNoFilter by severity: critical, high, medium, low
curl "http://localhost:8004/api/v1/comply/gaps?report_id=rpt-001&severity=high"

Response:

[
  {
    "requirement_id": "req-005",
    "framework_id": "uae-ai-ethics",
    "requirement": "Consent mechanism for data collection",
    "severity": "high",
    "status": "not_met",
    "remediation": "Implement explicit user consent flow before data collection"
  }
]

POST /api/v1/comply/certificate

Generate a compliance certificate from an assessment report.

Query Parameters:

ParameterTypeRequiredDescription
report_idstringYesAssessment report to base the certificate on

Request:

{
  "organization": "Abu Dhabi Government",
  "issued_to": "Anar Chat System",
  "valid_months": 12
}

Response:

{
  "certificate_id": "cert-001",
  "organization": "Abu Dhabi Government",
  "system_name": "Anar Chat",
  "frameworks": ["uae-ai-ethics", "sdaia-ai-ethics"],
  "overall_score": 78.5,
  "issued_at": "2024-01-15T10:30:00Z",
  "valid_until": "2025-01-15T10:30:00Z"
}

Certificate Validity

The default validity period is 12 months. Adjust valid_months based on your organization's compliance review cadence and regulatory requirements.

Environment Variables

VariableDefaultDescription
COMPLY_FRAMEWORKS_DIR<project>/frameworksDirectory containing framework JSON definitions
COMPLY_CORS_ORIGINS["http://localhost:3004","http://localhost:3000"]Allowed CORS origins

MCP Server

Comply exposes a Model Context Protocol server at /mcp, enabling integration with AI assistants and development tools that support the MCP specification.