Skip to main content

AI API Quick Reference Guide

KillIT v3 AI-Powered Endpoints


Business Service Analyzer

Enrich Service Definition

POST /api/business-service-analyzer/enrich

Request:
{
"description": "E-commerce platform",
"selectedSoftware": [
{ "catalogId": "apache-2.4", "name": "Apache", "vendor": "Apache" }
],
"manualProcesses": ["payment-processor"],
"manualSoftware": [
{ "name": "Custom App", "version": "1.0", "source": "manual" }
]
}

Response:
{
"enrichedData": {
"processes": [...],
"software": [...],
"ports": [...],
"searchPatterns": {...},
"aiExplanation": "AI reasoning..."
}
}

Discover Service Infrastructure

POST /api/business-service-analyzer/discover

Request:
{
"processes": ["apache2", "mysql", "redis"],
"software": [{ "name": "Apache", "version": "2.4" }],
"ports": [{ "port": 443, "protocol": "tcp", "description": "HTTPS" }],
"searchPatterns": { ... },
"timeRange": {
"start": "2024-10-01T00:00:00Z",
"end": "2024-10-29T23:59:59Z"
},
"existingServerIds": ["server-1", "server-2"],
"includeAllConnections": true
}

Response:
{
"servers": [
{
"ciId": "web-01",
"hostname": "web-server-01",
"ipAddress": "192.168.1.10",
"operatingSystem": "RHEL 8",
"installedSoftware": [...],
"runningProcesses": [...]
}
],
"connections": [...],
"statistics": {
"totalServers": 8,
"totalConnections": 47,
"uniqueProcesses": 23
}
}

Classify Discovered Servers

POST /api/business-service-analyzer/classify

Request:
{
"servers": [...],
"connections": [...],
"serviceDescription": "E-commerce platform"
}

Response:
{
"classifiedServers": [
{
"ciId": "web-01",
"hostname": "web-server-01",
"role": "web-server",
"tier": "frontend",
"confidence": 0.95,
"reasoning": "Runs Apache, listens on 443, high network activity"
}
],
"serviceTiers": {
"frontend": { "servers": ["web-01", "web-02"], "description": "..." },
"application": { "servers": [...], "description": "..." },
"data": { "servers": [...], "description": "..." },
"infrastructure": { "servers": [...], "description": "..." }
},
"serviceTopology": {
"entryPoints": ["web-01", "web-02"],
"coreSystems": ["app-01", "app-02"],
"dependencies": ["db-01", "cache-01"],
"supportSystems": ["monitor-01"]
}
}

Generate Service Insights

POST /api/business-service-analyzer/insights

Request:
{
"serviceMap": { ... },
"connections": [...],
"serviceDescription": "E-commerce platform"
}

Response:
{
"summary": "Well-architected e-commerce platform with good separation of concerns",
"insights": {
"architecture": "Three-tier architecture with load balancing and caching",
"dependencies": ["MySQL primary", "Redis cache", "External payment gateway"],
"risks": ["Single database write point", "No failover for cache"],
"recommendations": [
"Implement database replication",
"Add Redis cluster for high availability"
],
"anomalies": []
},
"businessImpact": {
"criticality": "Critical",
"affectedUsers": "All customers in APAC region",
"downstreamDependencies": ["Order fulfillment", "Inventory management"]
},
"technicalAnalysis": {
"redundancy": "Medium - database is single point of failure",
"scalability": "Horizontal - can add web and app servers",
"performanceBottlenecks": ["Database write capacity"],
"securityConcerns": ["No TLS between internal services"]
},
"structureMetrics": {
"serverCount": 8,
"connectionCount": 47,
"connectionDensity": 0.84,
"tierDistribution": { "frontend": 2, "application": 3, "data": 2, "infrastructure": 1 },
"criticalNodes": [
{ "hostname": "db-01", "connectionCount": 12, "role": "database" }
]
}
}

Save Service

POST /api/business-service-analyzer/save

Request:
{
"name": "E-Commerce Platform",
"description": "Main online sales platform",
"category": "Web Application",
"discoveryConfig": { ... },
"components": { ... },
"analysis": { ... }
}

Response:
{
"success": true,
"serviceId": "service-12345",
"message": "Service saved successfully"
}

Infrastructure Analysis

POST /api/business-service-analyzer/infrastructure-analysis

Request:
{
"tenantId": "tenant-123",
"sessionId": "analysis-1698592000000-xyz"
}

Response:
{
"success": true,
"message": "Analysis started",
"sessionId": "analysis-1698592000000-xyz"
}

// Monitor progress via SSE:
GET /sse/business-service-analyzer/infrastructure-analysis/progress/analysis-1698592000000-xyz

Events:
- connected: Initial connection established
- progress: { step, message, current, total, serviceName, category }
- complete: { totalServices, discoveredAt }
- error: Error message

CMDB AI - CI Insights

Get CI Insights

GET /api/cmdb-ai/insights/:ciId

Response:
{
"ciId": "web-01",
"insights": "This is the primary web server for the e-commerce platform...",
"generatedAt": "2024-10-29T10:30:00Z"
}

Generate & Store CI Insights

POST /api/cmdb-ai/insights/:ciId

Response:
{
"success": true,
"insight": "...",
"storedAt": "2024-10-29T10:30:00Z"
}

View Insights History

GET /api/cmdb-ai/insights/:ciId/history?limit=10

Response:
{
"insights": [
{
"generatedAt": "2024-10-29T10:30:00Z",
"content": "..."
},
{
"generatedAt": "2024-10-25T14:15:00Z",
"content": "..."
}
]
}

AI Relationships

Analyze & Create Relationships

POST /api/cmdb/ai-relationships/analyze/:ciId

Request:
{
"networkConnections": [
{
"sourceServer": "app-01",
"targetServer": "db-01",
"port": 3306,
"protocol": "tcp",
"frequency": 1000
}
]
}

Response:
{
"relationships": [
{
"source": "app-01",
"target": "db-01",
"type": "depends-on",
"confidence": 0.95,
"reasoning": "Application connects to database on port 3306 with high frequency"
}
]
}

Create Relationship

POST /api/cmdb/ai-relationships

Request:
{
"source": "app-01",
"target": "db-01",
"type": "depends-on",
"confidence": 0.95
}

Response:
{
"success": true,
"relationshipId": "rel-12345"
}

List Relationships

GET /api/cmdb/ai-relationships?source=app-01&type=depends-on

Response:
{
"relationships": [...]
}

Update Relationship

PUT /api/cmdb/ai-relationships/:id

Request:
{
"type": "communicates-with",
"confidence": 0.87
}

Response:
{
"success": true
}

Delete Relationship

DELETE /api/cmdb/ai-relationships/:id

Response:
{
"success": true
}

Change Risk Analysis

Analyze Change

POST /api/change-analysis/analyze

Request:
{
"ciId": "db-01",
"changeType": "patch",
"description": "Apply security patches",
"plannedDuration": "2 hours",
"plannedTime": "2024-11-05T02:00:00Z"
}

Response:
{
"riskScore": 6,
"riskLevel": "medium",
"affectedSystems": [
{
"ciId": "app-01",
"name": "Order Processing",
"criticality": "critical",
"impact": "Database becomes unavailable"
}
],
"upstreamDependencies": ["backup-01"],
"recommendations": [
"Schedule change during maintenance window",
"Notify dependent teams in advance",
"Have rollback plan ready"
],
"historicalIncidents": [
{
"date": "2024-09-15",
"type": "Database patch failure",
"impact": "2 hour outage"
}
]
}

Quick Assessment

POST /api/change-analysis/quick-assess

Request:
{
"ciId": "web-01",
"changeType": "reboot"
}

Response:
{
"riskScore": 2,
"riskLevel": "low",
"summary": "Low risk - server is load-balanced"
}

AI Chatbot

Chat with Function Calling

POST /api/chatbot

Request:
{
"message": "Show me all production databases",
"conversationId": "conv-123",
"context": {
"currentCI": "web-01",
"userId": "user-456"
}
}

Response:
{
"conversationId": "conv-123",
"response": "I found 4 production databases: MySQL-01, Oracle-02...",
"toolCalls": [
{
"tool": "search-cis",
"params": { "type": "database", "environment": "production" },
"result": [...]
}
]
}

Available Tools:

  • search-cis(name, type, status) - Search for CIs
  • get-ci-details(ciId) - Get CI details and relationships
  • search-relationships(sourceId, targetId, type) - Find relationships
  • analytics-query(metric, ciId, timeRange) - Get analytics
  • search-events(ciId, severity, timeRange) - Find events/incidents
  • get-context() - Get current context

Events AI Analysis

Automatically triggered for events and incidents. No direct API call needed.

Data Stored:

{
eventId: "event-123",
ciId: "db-01",
anomalyScore: 0.87, // 0-1, higher = more unusual
rootCauseHypothesis: "Connection pool exhaustion due to...",
relatedEvents: [...],
recommendedActions: [...]
}

Holiday Generator

Generate Holidays

POST /api/ai/holiday-generator

Request:
{
"country": "Turkey",
"year": 2025,
"includeRegional": true
}

Response:
{
"country": "Turkey",
"year": 2025,
"holidays": [
{
"date": "2025-01-01",
"name": "New Year's Day",
"type": "fixed",
"isPublicHoliday": true
},
{
"date": "2025-04-30",
"name": "Ramadan Feast",
"type": "floating",
"isPublicHoliday": true
}
]
}

AI Monitoring

Get AI Metrics

GET /api/monitoring/ai?startDate=2024-10-01&endDate=2024-10-29&groupBy=service

Response:
{
"metrics": [
{
"service": "business-service-analyzer",
"callCount": 245,
"inputTokens": 1230000,
"outputTokens": 450000,
"estimatedCost": 75.60,
"averageLatency": 2.3,
"errorRate": 0.02
}
],
"summary": {
"totalTokens": 4250000,
"estimatedCost": 280.00,
"totalCalls": 1250,
"averageLatency": 1.8
}
}

Error Handling

All endpoints return standard error responses:

{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Service description is required",
"details": { ... }
}
}

Common Codes:

  • INVALID_REQUEST - Missing or invalid parameters
  • AI_SERVICE_ERROR - Claude/Bedrock API error
  • RATE_LIMIT_EXCEEDED - Too many requests
  • TENANT_NOT_FOUND - Invalid tenant context
  • UNAUTHORIZED - Authentication failed
  • INTERNAL_ERROR - Unexpected server error

Rate Limiting

All endpoints subject to:

  • 100 requests/minute per tenant
  • 4000 tokens max per request
  • 3 automatic retries with exponential backoff

Rate Limit Headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1698592860

Authentication

All endpoints require:

  • Valid JWT token in Authorization: Bearer <token> header
  • Tenant context in request headers or JWT claims
  • Appropriate RBAC permissions

Examples

Complete Business Service Discovery Flow

# 1. Enrich the service definition
curl -X POST /api/business-service-analyzer/enrich \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": "E-commerce platform",
"selectedSoftware": [...],
"manualProcesses": [],
"manualSoftware": []
}'

# 2. Discover infrastructure
curl -X POST /api/business-service-analyzer/discover \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"processes": [...],
"software": [...],
"ports": [...],
"searchPatterns": {}
}'

# 3. Classify servers
curl -X POST /api/business-service-analyzer/classify \
-H "Authorization: Bearer $TOKEN" \
-d '{
"servers": [...],
"connections": [...],
"serviceDescription": "E-commerce platform"
}'

# 4. Generate insights
curl -X POST /api/business-service-analyzer/insights \
-H "Authorization: Bearer $TOKEN" \
-d '{...}'

# 5. Save service
curl -X POST /api/business-service-analyzer/save \
-H "Authorization: Bearer $TOKEN" \
-d '{...}'

Implementation Notes

  • All API endpoints are multi-tenant aware
  • AI metrics are tracked per tenant/customer for billing
  • All responses include request IDs for troubleshooting
  • Timeout: 120+ seconds for complex operations
  • Retry behavior: Automatic for rate limits and transient errors