Complete reference for the Guardia AI public REST API. All endpoints require authentication via your
tenant API key. The base URL for all requests is https://app.trustguardia.com.
For the full admin API (platform settings, tenant management, analytics), see /admin/api-docs.
Every API request requires your tenant API key in the X-API-Key header.
Retrieve your key from My Portal → Account.
API keys follow the format gai-xxxxxxxxxxxxxxxxxxxxxxxx.
curl https://app.trustguardia.com/tenant/me \ -H "X-API-Key: gai-your-key-here"
Keys are plan-scoped. Requests that exceed your plan's quota or access
a restricted feature will return 403 Forbidden with a detail field explaining the restriction.
Returns platform health status. No authentication required. Use this endpoint to verify connectivity from CI/CD pipelines before triggering a scan.
{ "status": "ok", "version": "1.0.0" }
Returns all 7 supported compliance frameworks with their identifiers, display names, descriptions, and which plan tiers have access. Use the id field when specifying frameworks in /scan requests.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
[
{
"id": "iso42001",
"name": "ISO 42001:2023",
"description": "AI Management Systems standard",
"category": "AI Governance",
"plans": ["free_trial", "starter", "professional", "enterprise"]
},
{ "id": "sr11_7", "name": "SR 11-7", ... },
{ "id": "eu_ai_act", "name": "EU AI Act", ... },
{ "id": "nist_ai_rmf", "name": "NIST AI RMF 1.0", ... },
{ "id": "mas_trm", "name": "MAS TRM", ... },
{ "id": "dora", "name": "DORA", ... },
{ "id": "sox", "name": "SOX", ... }
]
Returns all subscription tiers with their scan quotas, framework access, governance cadence, and feature flags. Useful for building plan-upgrade prompts or quota dashboards in your own tooling.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
Returns your tenant's subscription plan, scan quota usage, linked Azure subscription IDs, and current governance settings. This is the primary endpoint used by the session widget and portal UI.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
{
"tenant_id": "3f8a2b1c-...",
"purchaser_email": "you@company.com",
"plan_id": "professional",
"status": "active",
"scan_count": 12,
"scan_limit": 100,
"azure_subscription_ids": ["sub-id-1", "sub-id-2"],
"governance_enabled": true,
"governance_cadence": "biweekly",
"report_history_days": 90
}
Replace the list of Azure subscription IDs linked to your account. Plan-based limits apply: Free Trial (1), Starter (3), Professional (15), Enterprise (unlimited). All future scans will scan across all linked subscriptions.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
Content-Type | Required | application/json |
{ "subscription_ids": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] }
| Field | Type | Description | |
|---|---|---|---|
subscription_ids | Required | string[] | Array of Azure subscription UUID strings |
Store or replace the Azure service principal credentials used by Guardia AI to scan your Azure subscriptions. Credentials are encrypted at rest using AES-256-GCM and never logged. The service principal must have Reader RBAC access on all linked subscriptions.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
Content-Type | Required | application/json |
{
"tenant_id": "your-azure-tenant-id",
"client_id": "your-service-principal-app-id",
"client_secret": "your-service-principal-secret"
}
Triggers a synchronous compliance scan of your linked Azure subscriptions against the specified regulatory frameworks. Returns a full JSON report with per-resource findings, risk scores, and AI-generated narratives. This is the primary endpoint for CI/CD integration — fail your pipeline on critical_count > 0.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
Content-Type | Required | application/json |
{
"frameworks": ["iso42001", "sr11_7"],
"subscription_id": "optional-override-sub-id",
"generate_narrative": true,
"scan_label": "pre-deploy-check"
}
| Field | Type | Description | |
|---|---|---|---|
frameworks | Required | string[] | One or more framework IDs from /frameworks. Plan-restricted. Free Trial: iso42001, sr11_7 only. |
subscription_id | Optional | string | Scan a specific linked subscription. Omit to scan all linked subscriptions. |
generate_narrative | Optional | bool | Generate AI-powered plain-English summaries for each finding. Default: true on paid plans. |
scan_label | Optional | string | Custom label stored with the report — useful for tagging CI/CD run IDs. |
{
"report_id": "COMP-20260519-143022",
"tenant_id": "3f8a2b1c-...",
"scan_ts": "2026-05-19T14:30:22Z",
"frameworks": ["iso42001", "sr11_7"],
"aggregate_score": 78,
"critical_count": 2,
"high_count": 5,
"medium_count": 11,
"findings": [
{
"control_id": "ISO42001-4.1",
"framework": "iso42001",
"resource": "/subscriptions/.../providers/Microsoft.MachineLearning/workspaces/ws1",
"severity": "critical",
"status": "fail",
"title": "ML Workspace lacks diagnostic logging",
"description": "...",
"narrative": "Azure OpenAI generated explanation...",
"remediation": "Enable diagnostic settings on the workspace..."
}
]
}
- name: Run Guardia compliance gate
run: |
RESULT=$(curl -s -X POST https://app.trustguardia.com/scan \
-H "X-API-Key: $GUARDIA_KEY" \
-H "Content-Type: application/json" \
-d '{"frameworks":["iso42001","sr11_7"],"scan_label":"${{ github.sha }}"}')
CRITICAL=$(echo $RESULT | jq '.critical_count')
if [[ $CRITICAL -gt 0 ]]; then
echo "❌ BLOCKED: $CRITICAL critical compliance findings"
echo "$RESULT" | jq '.findings[] | select(.severity=="critical")'
exit 1
fi
echo "✅ Compliance gate passed"
Runs a compliance scan in dry-run mode. The scan is fully executed but the result is not persisted and does not count against your monthly scan quota. Useful for testing pipeline integration or previewing findings before a scheduled release. Accepts the same request body as /scan.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
Content-Type | Required | application/json |
Same structure as /scan but with "dry_run": true and no report_id — the report is not stored.
Returns a diff between two previously saved compliance reports — new findings, resolved findings, score delta, and severity changes. Useful for tracking remediation progress between deployments.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
Content-Type | Required | application/json |
{ "report_a": "COMP-20260515-120000", "report_b": "COMP-20260519-143022" }
{
"score_delta": +6,
"new_findings": [ ... ],
"resolved": [ ... ],
"unchanged": [ ... ]
}
Returns all saved compliance reports for your tenant, newest first. Reports are retained per your plan's history window: Free Trial/Starter (30 days), Professional (90 days), Enterprise (365 days).
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
| Param | Description | |
|---|---|---|
limit | Optional | Max results to return (default: 50) |
type | Optional | Filter by scan type: manual or governance |
Returns the full JSON payload of a saved compliance report by ID. Includes all findings, narratives, scores, and resource paths. Report IDs follow the format COMP-YYYYMMDD-HHmmss.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
| Param | Description | |
|---|---|---|
report_id | Required | The report ID, e.g. COMP-20260519-143022 |
Permanently deletes all manual scan reports for your tenant. Governance (CCM) scan reports are not affected. Each deletion is audit-logged. This action is irreversible — deleted reports cannot be recovered from the portal (deleted reports are non-recoverable from the portal).
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
{ "status": "ok", "deleted": 7 }
Permanently deletes a single compliance report by ID. Deletion is audit-logged.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
| Param | Description | |
|---|---|---|
report_id | Required | The report ID to delete |
{ "status": "ok", "deleted": 1, "report_id": "COMP-20260519-143022" }
Returns your tenant's Continuous Control Monitoring (CCM) configuration: cadence, last scan time, next scheduled scan, history of governance scan report IDs, and current health status.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key (Professional or Enterprise) |
{
"governance_enabled": true,
"cadence": "biweekly",
"last_scan_ts": "2026-05-12T06:00:00Z",
"next_scan_ts": "2026-05-26T06:00:00Z",
"governance_score": 82,
"drift_detected": false,
"history": [
{ "report_id": "COMP-20260512-060012", "score": 82, "ts": "2026-05-12T06:00:12Z" }
]
}
Deletes governance (CCM) scan history reports for your tenant. Can be used to clear all history or selectively remove a specific report. Each deletion is audit-logged internally.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
Content-Type | Required | application/json |
{
"selective": false,
"report_id": "COMP-20260512-060012"
}
| Field | Description | |
|---|---|---|
selective | Optional | If true, only delete the report specified in report_id. If false (default), delete all governance history. |
report_id | Optional | Report ID to delete when selective: true |
Returns whether IaC remediation scripts are available for a report, how many findings have associated scripts, and which formats (ARM, Bicep, Terraform) are ready to download.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your Enterprise tenant API key |
{
"report_id": "COMP-20260519-143022",
"iac_available": true,
"finding_count": 7,
"formats": ["arm", "bicep", "terraform"]
}
Downloads the Infrastructure-as-Code remediation script for a report in the specified format. Scripts are pre-filled with your subscription IDs, resource names, resource group paths, and the specific control being remediated. Apply them directly to your deployment pipeline.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your Enterprise tenant API key |
| Param | Description | |
|---|---|---|
report_id | Required | The report ID |
fmt | Required | Format: arm, bicep, or terraform |
Returns the script as plain text (text/plain) or JSON depending on the format. Attach to your CI/CD artifact store or apply directly via az deployment / terraform apply.
Returns whether the authenticated tenant has access to Enterprise scorecard features, and the endpoints to call if access is granted.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your Enterprise tenant API key |
{
"report_id": "COMP-20260519-143022",
"scorecard_available": true,
"plan": "enterprise",
"upgrade_message": null,
"endpoints": {
"scorecard": "/report/COMP-20260519-143022/scorecard",
"roadmap": "/report/COMP-20260519-143022/roadmap",
"auditor_package": "/report/COMP-20260519-143022/auditor-package"
}
}
Generates an AI-powered board-ready Executive Compliance Scorecard from a scan report. Returns RAG (Red/Amber/Green) status per framework, top compliance gaps in plain business language, compliance trajectory, and a CRO-ready board narrative. Backed by Azure OpenAI.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your Enterprise tenant API key |
{
"report_id": "COMP-20260519-143022",
"plan": "enterprise",
"generated_at": "2026-05-28T14:30:00Z",
"scorecard": {
"overall_rag": "AMBER",
"overall_rag_reason": "Critical gaps in access control and model governance remain unresolved.",
"framework_rag": {
"sr11_7": "RED",
"iso42001": "AMBER",
"eu_ai_act": "AMBER",
"nist_ai_rmf":"GREEN"
},
"top_gaps": [
{ "gap": "No model validation documentation found", "business_impact": "Regulatory exam failure risk", "severity": "CRITICAL" }
],
"trajectory": "IMPROVING",
"trajectory_note": "Score improved 12 points across last 3 scans.",
"board_narrative": "Our Azure AI infrastructure achieved an overall compliance score of 68/100 this period. Two critical gaps in SR 11-7 model governance require immediate remediation. The programme is trending in the right direction with 12-point improvement over the last quarter."
}
}
| Status | Description |
|---|---|
403 | Not on Enterprise plan — upgrade required |
404 | Report not found |
500 | Azure OpenAI generation failure |
Generates a prioritised remediation roadmap from scan findings. Each action item includes owner role, estimated effort level, and Azure-specific remediation steps. Grouped into 30-day (immediate/critical), 60-day (short-term/high), and 90-day (strategic/medium-low) horizons.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your Enterprise tenant API key |
{
"report_id": "COMP-20260519-143022",
"plan": "enterprise",
"generated_at": "2026-05-28T14:30:00Z",
"roadmap": {
"immediate": [
{
"action": "Enable diagnostic logging on all Azure ML workspaces",
"framework": "sr11_7",
"effort": "Low",
"owner_role": "Cloud Security Engineer",
"azure_steps": "Navigate to Azure ML workspace → Diagnostic settings → Enable all log categories to Log Analytics.",
"finding_ref": "SR117-LOG-001"
}
],
"short_term": [ "..." ],
"strategic": [ "..." ],
"summary_note": "Focus immediate effort on model governance documentation and logging gaps to address the highest-risk SR 11-7 findings."
}
}
Generates a structured auditor evidence package for presenting to OCC examiners, FCA supervisors, EU AI Act notified bodies, or internal audit teams. Includes assessment scope, methodology, per-framework coverage, finding summary, attestation statement, and recommended next review date.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your Enterprise tenant API key |
{
"report_id": "COMP-20260519-143022",
"plan": "enterprise",
"generated_at": "2026-05-28T14:30:00Z",
"auditor_package": {
"assessment_scope": "Azure subscription sub-abc123 assessed for AI infrastructure compliance across 7 regulatory frameworks.",
"methodology": "Read-only scan of Azure Resource Manager and Microsoft Graph APIs. No data plane access. No workload modification.",
"frameworks_coverage": [
{ "framework": "SR 11-7", "standard_reference": "SR 11-7 (2011)", "controls_assessed": 12, "gaps_found": 4 }
],
"finding_summary": { "critical": 2, "high": 5, "medium": 8, "low": 3 },
"attestation_statement": "This assessment was conducted by Guardia AI on 2026-05-28 using automated infrastructure scanning. All findings reflect the state of the Azure environment at the time of scan.",
"assessor_note": "This is an automated assessment. Manual review is recommended for controls requiring human judgement.",
"recommended_next_review":"Within 30 days given critical findings identified."
}
}
Returns the current CMK configuration status. Use GET /tenant/encryption/status for the full extended view including mode history and version fingerprint.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key (Professional or Enterprise) |
{
"plan": "professional",
"cmk_supported": true,
"cmk_configured": true,
"key_vault_url": "https://your-kv.vault.azure.net/",
"key_vault_secret_name": "guardia-tenant-key",
"cmk_key_version": "abc123def456...",
"cmk_verified_at": "2026-05-20T09:00:00Z",
"cmk_blocked": false,
"cmk_last_error": null,
"cmk_downgrade_pending": false,
"upgrade_required": false
}
Extended encryption status including the last 10 mode-change events and the current key version fingerprint. Use this to audit all PMK↔CMK switches and key rotations on your account.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
{
"encryption_mode": "cmk",
"cmk_supported": true,
"cmk_configured": true,
"key_vault_url": "https://your-kv.vault.azure.net/",
"key_vault_secret_name": "guardia-tenant-key",
"cmk_key_version": "abc123def456...",
"cmk_verified_at": "2026-05-20T09:00:00Z",
"cmk_blocked": false,
"cmk_last_error": null,
"cmk_downgrade_pending": false,
"encryption_mode_history": [
{
"mode": "cmk",
"changed_at": "2026-05-20T09:00:00Z",
"changed_by": "admin@acme.com",
"previous_mode": "pmk",
"reason": "cmk_configure",
"vault_uri": "https://your-kv.vault.azure.net/",
"key_name": "guardia-tenant-key",
"key_version": "abc123def456..."
}
]
}
Enables Customer-Managed Key encryption. Guardia tests connectivity to your Key Vault before saving — the request fails if the vault is unreachable or the secret is inaccessible. On success, a CMK-enabled confirmation email is sent to the account owner and the key version fingerprint is captured for silent-rotation detection.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key (Professional or Enterprise) |
Content-Type | Required | application/json |
{
"key_vault_url": "https://your-kv.vault.azure.net/",
"key_vault_secret_name": "guardia-tenant-key"
}
{
"ok": true,
"message": "CMK enabled — future reports will be encrypted using your Key Vault secret.",
"key_version": "abc123def456...",
"cmk_verified_at": "2026-05-20T09:00:00Z"
}
{ "detail": "CMK connectivity test failed: Secret 'guardia-key' not found. Fix the issue before enabling CMK." }
Call this after rotating your key in Azure Key Vault to refresh Guardia's stored version fingerprint. Guardia verifies connectivity, reads the current key version, and updates the fingerprint. If the version has changed, a rotation-detected email is sent as an audit record and the mode history is stamped.
This is the manual version of what Guardia's 24-hour health check does automatically. You do not need to call this — but calling it provides immediate confirmation after a rotation.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
{
"ok": true,
"rotated": true,
"old_version": "abc123...",
"new_version": "def456...",
"cmk_verified_at": "2026-05-20T10:00:00Z",
"message": "Key rotation confirmed — version fingerprint updated."
}
Two-step process. This call initiates the switch — it does not immediately remove CMK. A one-time confirmation link is sent to the account owner's email address, valid for 30 minutes. The switch only completes when that link is clicked (which calls POST /tenant/encryption/confirm-pmk).
Important: Historical reports encrypted with your CMK key remain bound to that Key Vault key after the switch. Do not delete or disable the key — those reports will become permanently unreadable.
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
{
"ok": true,
"pending": true,
"email_sent": true,
"message": "A confirmation link has been sent to admin@acme.com. Click it within 30 minutes to complete the switch to PMK."
}
Completes the CMK → PMK downgrade using the one-time token from the confirmation email. Token expires after 30 minutes. The portal handles this automatically via a URL parameter — you do not need to call this manually unless building a custom integration.
| Parameter | Required | Description |
|---|---|---|
token | Required | One-time token from the confirmation email |
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your tenant API key |
{
"ok": true,
"mode": "pmk",
"cmk_was_accessible": true,
"warning": null,
"message": "Encryption switched to Platform-Managed Key. Future scans use Guardia's PMK."
}
| Code | Meaning |
|---|---|
400 | No pending downgrade request found |
403 | Invalid token |
410 | Token expired — restart the process |
All errors return a JSON body with a detail field and an appropriate HTTP status code.
{ "detail": "Scan quota exceeded for plan 'starter' (25/25 used this month)" }
| Code | Meaning |
|---|---|
401 | Missing or invalid X-API-Key |
403 | Feature not available on your plan, or scan quota exceeded |
404 | Report or resource not found |
422 | Invalid request body — check required fields |
429 | Rate limited — slow down requests |
500 | Internal server error — contact support@trustguardia.com |