Skip to content

Compliance API

Built-in compliance. Access audit logs, generate compliance reports, and verify regulatory status through the API.


Endpoints

Method Endpoint Description
GET /v1/compliance/status Get compliance status
GET /v1/compliance/audit-logs List audit log entries
GET /v1/compliance/audit-logs/{id} Get specific log entry
POST /v1/compliance/reports Generate compliance report
GET /v1/compliance/reports/{id} Get report status/download

GET /compliance/status

Get current compliance certification status.

Request

curl https://api.pauhu.ai/v1/compliance/status \
  -H "Authorization: Bearer pk_..."

Response

{
  "data": {
    "organization_id": "org_abc123",
    "certifications": [
      {
        "standard": "EU AI Act",
        "status": "compliant",
        "articles": ["Article 52", "Article 57", "Article 58"],
        "verified_at": "2025-01-01T00:00:00Z",
        "expires_at": "2026-01-01T00:00:00Z"
      },
      {
        "standard": "VAHTI ST IV",
        "status": "compliant",
        "level": "IV (Classified)",
        "verified_at": "2025-01-01T00:00:00Z",
        "expires_at": "2026-01-01T00:00:00Z"
      },
      {
        "standard": "ISO 27001",
        "status": "compliant",
        "certificate_id": "ISO-27001-2025-001",
        "verified_at": "2025-01-01T00:00:00Z",
        "expires_at": "2028-01-01T00:00:00Z"
      },
      {
        "standard": "SOC 2 Type II",
        "status": "compliant",
        "report_period": "2024-01-01 to 2024-12-31",
        "verified_at": "2025-01-15T00:00:00Z"
      },
      {
        "standard": "FedRAMP High",
        "status": "in_progress",
        "expected_date": "2025-06-01"
      }
    ],
    "data_residency": {
      "region": "EU",
      "locations": ["Helsinki, FI", "Frankfurt, DE"],
      "encryption": "AES-256-GCM"
    }
  }
}

GET /compliance/audit-logs

Retrieve audit log entries.

Request

curl "https://api.pauhu.ai/v1/compliance/audit-logs?limit=100&start=2025-01-01" \
  -H "Authorization: Bearer pk_..."

Query Parameters

Parameter Type Description
limit integer Max entries (default: 100, max: 1000)
offset integer Pagination offset
start string Start date (ISO 8601)
end string End date (ISO 8601)
action string Filter by action type
user_id string Filter by user
resource string Filter by resource type

Response

{
  "data": {
    "entries": [
      {
        "id": "log_abc123",
        "timestamp": "2025-01-15T10:30:00Z",
        "action": "translate",
        "resource": "document",
        "resource_id": "doc_xyz789",
        "user_id": "user_abc",
        "ip_address": "203.0.113.42",
        "user_agent": "Pauhu-Python/1.0",
        "request_id": "req_abc123",
        "metadata": {
          "source_language": "en",
          "target_language": "fi",
          "word_count": 500,
          "domain": "12 Law"
        },
        "result": "success"
      }
    ],
    "pagination": {
      "total": 15420,
      "limit": 100,
      "offset": 0,
      "has_more": true
    }
  }
}

Action Types

Action Description
translate Text translation
translate_document Document translation
detect Language detection
document_upload Document upload
document_download Document download
document_delete Document deletion
api_key_create API key created
api_key_revoke API key revoked
user_login User authentication
settings_change Settings modification

POST /compliance/reports

Generate a compliance report.

Request

curl -X POST https://api.pauhu.ai/v1/compliance/reports \
  -H "Authorization: Bearer pk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "gdpr_dpa",
    "period": {
      "start": "2024-01-01",
      "end": "2024-12-31"
    },
    "format": "pdf"
  }'

Report Types

Type Description
gdpr_dpa GDPR Data Processing Agreement report
gdpr_dpia Data Protection Impact Assessment
eu_ai_act EU AI Act compliance report
vahti VAHTI security report
soc2 SOC 2 attestation summary
iso27001 ISO 27001 controls report
usage Usage and billing report
audit Complete audit log export

Response

{
  "data": {
    "id": "report_abc123",
    "type": "gdpr_dpa",
    "status": "generating",
    "format": "pdf",
    "period": {
      "start": "2024-01-01",
      "end": "2024-12-31"
    },
    "created_at": "2025-01-15T10:30:00Z",
    "estimated_completion": "2025-01-15T10:35:00Z"
  }
}

GET /compliance/reports/{id}

Get report status or download.

Request

# Check status
curl https://api.pauhu.ai/v1/compliance/reports/report_abc123 \
  -H "Authorization: Bearer pk_..."

# Download when ready
curl https://api.pauhu.ai/v1/compliance/reports/report_abc123/download \
  -H "Authorization: Bearer pk_..." \
  -o compliance_report.pdf

Response

{
  "data": {
    "id": "report_abc123",
    "type": "gdpr_dpa",
    "status": "completed",
    "format": "pdf",
    "size_bytes": 1048576,
    "download_url": "https://api.pauhu.ai/v1/compliance/reports/report_abc123/download",
    "expires_at": "2025-01-22T10:35:00Z",
    "created_at": "2025-01-15T10:30:00Z",
    "completed_at": "2025-01-15T10:33:00Z"
  }
}

Python SDK

from pauhu import Pauhu

client = Pauhu()

# Check compliance status
status = client.compliance.status()
for cert in status.certifications:
    print(f"{cert.standard}: {cert.status}")

# Get audit logs
logs = client.compliance.audit_logs(
    start="2025-01-01",
    limit=100
)
for entry in logs:
    print(f"{entry.timestamp}: {entry.action} by {entry.user_id}")

# Generate report
report = client.compliance.generate_report(
    type="gdpr_dpa",
    period={"start": "2024-01-01", "end": "2024-12-31"}
)
report.wait()
report.save("gdpr_report.pdf")

Webhooks

Get notified of compliance events:

client.webhooks.create(
    url="https://yourapp.com/compliance-webhook",
    events=[
        "compliance.certification_expiring",
        "compliance.audit_log_exported",
        "compliance.report_ready"
    ]
)