POLICYCORTEX
API DOCUMENTATION
Build powerful cloud governance integrations with our REST API. Access predictive insights, automate compliance workflows, and integrate PolicyCortex into your existing enterprise infrastructure.
Quick Start Guide
1. Authentication
PolicyCortex API uses OAuth 2.0 with PKCE for secure authentication. Generate your API keys in the developer console.
curl -X POST https://api.policycortex.com/auth/token \ -H "Content-Type: application/json" \ -d '{ "client_id": "your_client_id", "client_secret": "your_client_secret", "grant_type": "client_credentials", "scope": "governance:read compliance:write" }'
2. Make Your First Request
Get an overview of your cloud governance posture with a simple API call.
curl -X GET https://api.policycortex.com/v1/governance/overview \ -H "Authorization: Bearer your_access_token" \ -H "Content-Type: application/json"
Response Example
{ "governance_overview": { "compliance_score": 94.2, "policy_violations": { "critical": 2, "high": 8, "medium": 23, "low": 45 }, "predictive_alerts": [ { "id": "pred_001", "severity": "high", "resource": "azure-vm-prod-001", "predicted_violation": "PCI_DSS_COMPLIANCE", "confidence": 99.2, "days_until_violation": 3, "recommendation": "Update network security group rules" } ], "cost_optimization": { "potential_savings": 245000, "rightsizing_opportunities": 12, "unused_resources": 8 }, "tools_replaced": 23, "automation_level": 87.5 } }
API Endpoints Reference
Governance API
/v1/governance/overview
Get comprehensive governance overview and metrics
/v1/policies/validate
Validate resources against governance policies
/v1/violations/predictive
Get predictive violation alerts with 99.2% accuracy
Compliance API
/v1/compliance/frameworks
List supported compliance frameworks (SOC2, ISO27001, PCI-DSS, HIPAA)
/v1/compliance/evidence
Automated evidence collection with immutable audit trails
/v1/compliance/remediate
Trigger automated remediation workflows
Cost Optimization API
/v1/cost/analysis
Real-time cost analysis and optimization recommendations
/v1/cost/forecast
Predictive spend forecasting with 95%+ accuracy
/v1/cost/rightsizing
Automated rightsizing recommendations and implementation
Interactive API Explorer
Test API endpoints in real-time with our interactive explorer. Authenticate with your API keys and see live responses.
API Explorer
Test PolicyCortex API endpoints with live data simulation
Get comprehensive governance overview
Response will appear here
Add a bearer token and click "Send Request"
Webhook Configuration
Configure webhooks to receive real-time notifications for governance events, policy violations, and compliance changes.
Active Webhooks
Manage webhook endpoints to receive real-time notifications about governance events.
Compliance Violations
ActivehealthyURL: https://your-app.com/webhooks/compliance
Events: policy.violation.detected, compliance.score.changed
Last Delivery: 1/15/2024, 10:30:00 AM
Recent Deliveries
Cost Alerts
ActivehealthyURL: https://your-app.com/webhooks/cost-alerts
Events: cost.anomaly.detected, budget.threshold.exceeded
Last Delivery: 1/15/2024, 9:15:00 AM
Recent Deliveries
Webhook Documentation
Payload Structure
{ "event": "policy.violation.detected", "timestamp": "2024-01-15T10:30:00Z", "webhook_id": "wh_001", "data": { "violation_id": "viol_abc123", "severity": "high", "resource": "azure-vm-prod-001", "policy": "PCI_DSS_NETWORK_SECURITY", "message": "Network security group missing" } }
Verification
Verify webhook authenticity using the signature header:
X-PolicyCortex-Signature: sha256=... X-PolicyCortex-Timestamp: 1642248600 X-PolicyCortex-Webhook-ID: wh_001
Retry Logic
- • Webhooks are retried up to 5 times with exponential backoff
- • Initial retry after 1 second, then 2s, 4s, 8s, 16s
- • Webhooks are disabled after 24 hours of consecutive failures
- • Expected response: 2xx status code within 30 seconds
SDK Downloads & Integration Guides
JavaScript SDK
Full-featured SDK for Node.js and browser applications with TypeScript support.
Python SDK
Comprehensive Python library with async support and data science integrations.
Go SDK
High-performance Go library optimized for microservices and cloud-native applications.
.NET SDK
Enterprise-grade .NET library with Azure integration and Windows compatibility.
Java SDK
Robust Java library with Spring Boot integration and enterprise features.
Terraform Provider
Infrastructure as Code integration for policy management and compliance automation.
Authentication & Rate Limiting
Security & Authentication
OAuth 2.0 with PKCE
Enterprise-grade authentication using OAuth 2.0 with Proof Key for Code Exchange (PKCE) for enhanced security.
Authorization: Bearer your_access_token
API Key Management
- • Scoped permissions (governance:read, compliance:write, cost:admin)
- • Key rotation and lifecycle management
- • IP whitelisting and geographic restrictions
- • Audit logging for all API key usage
Encryption & Security
- • TLS 1.3 encryption for all API communications
- • Post-quantum cryptography for future-proof security
- • Request signing with HMAC-SHA256
- • SOC 2 Type II and ISO 27001 compliance
Rate Limiting & Quotas
Enterprise Plan
- • 10,000 requests/hour per API key
- • 100,000 requests/day total quota
- • Burst allowance: 200 requests/minute
- • Webhook events: Unlimited
Rate Limit Headers
X-RateLimit-Limit: 10000 X-RateLimit-Remaining: 9847 X-RateLimit-Reset: 1640995200 X-RateLimit-Retry-After: 3600
Error Responses
Rate limit exceeded responses include retry information:
{ "error": "rate_limit_exceeded", "message": "API rate limit exceeded", "retry_after": 3600, "limit": 10000, "reset_time": "2024-01-01T12:00:00Z" }
Developer Support
Get help from our developer advocates and technical support team. Join our community or schedule a technical consultation for enterprise integrations.