REST API
Integrate Optral with your tools and workflows using our REST API.
Authentication
All API requests require authentication using an API key
Creating an API Key
- Navigate to Settings
- Click "API Keys" tab
- Click "Create API Key"
- Copy and securely store the key - it won't be shown again
Using the API Key
Include your API key in the Authorization header:
curl -H "Authorization: Bearer mht_YOUR_API_KEY" \
https://api.optral.ai/v1/clustersSecurity
Base URL
https://api.optral.ai/v1Endpoints
Clusters
/clustersList all clusters in your organization
/clusters/:idGet details for a specific cluster
/clustersCreate a new cluster
/clusters/:idUpdate cluster settings
/clusters/:idDelete a cluster
Issues
/issuesList issues. Supports filtering by cluster, severity, status, type.
/issues/:idGet details for a specific issue including analysis
/issues/:id/analyzeTrigger AI analysis for an issue
/issues/:idUpdate issue status (resolve, acknowledge)
Runbooks
/runbooksList all runbooks
/runbooks/:idGet runbook details and recent executions
/runbooksCreate a new runbook
/runbooks/:id/executeExecute a runbook manually
Resources
/resourcesList Kubernetes resources. Filter by cluster, kind, namespace.
/resources/:idGet resource details including YAML manifest
Agent Connection
How Optral agents connect to the control plane
Secure gRPC Tunnel
Outbound-only connection
Agents initiate the connection - no ingress rules needed in your cluster
mTLS encryption
All traffic is encrypted with mutual TLS authentication
Bi-directional communication
Agents push data and receive commands through the same tunnel
Real-time Events (SSE)
Subscribe to live updates via Server-Sent Events
/events/streamSubscribe to real-time events. Returns a stream of server-sent events.
Event Types
issue.createdissue.resolvedissue.updatedcluster.onlinecluster.offlinerunbook.startedrunbook.completedanalysis.readyconst events = new EventSource('/api/events', {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
});
events.addEventListener('issue.created', (e) => {
const issue = JSON.parse(e.data);
console.log('New issue:', issue);
});Rate Limits
API rate limits depend on your plan:
Rate limit headers are included in all responses:X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset
Example: List Issues
curl -X GET "https://api.optral.ai/v1/issues?status=open&severity=critical" \
-H "Authorization: Bearer mht_YOUR_API_KEY" \
-H "Content-Type: application/json"
# Response
{
"issues": [
{
"id": "iss_abc123",
"type": "OOMKilled",
"severity": "critical",
"status": "open",
"cluster": "production-us-east",
"resource": "api-server-7d4f8b9c6-xk2lm",
"namespace": "default",
"detectedAt": "2024-01-15T10:30:00Z",
"hasAnalysis": true
}
],
"total": 1,
"page": 1,
"pageSize": 20
}OpenAPI Specification
A complete OpenAPI 3.0 specification is available for code generation and API exploration.