← Back to Docs

OpenAPI Specification

Complete reference for all K0NSULT public API endpoints. Version 1.0 • Updated 2026-03-23.

Base URL: https://k0nsult.fly.dev

Governance & Control

POST /api/n8n/pre-check Pre-execution risk assessment
Request Body
FieldTypeRequiredDescription
workflow_idstringrequiredUnique workflow identifier
workflow_namestringrequiredHuman-readable workflow name
userstringrequiredInitiating user/agent ID
data_classificationstringrequiredData sensitivity level (public, internal, confidential, restricted)
action_typestringrequiredType of action (read, write, delete, external_call)
Response (200)
{ "ok": true, "decision": "ALLOW", "risk_score": 0.15, "level": "LOW", "timestamp": "2026-03-23T10:15:00Z" }
Example cURL
curl -X POST https://k0nsult.fly.dev/api/n8n/pre-check \ -H "Content-Type: application/json" \ -d '{"workflow_id":"wf_001","workflow_name":"Invoice Processing","user":"agent_fin01","data_classification":"internal","action_type":"write"}'
POST /api/n8n/execution-log Log workflow execution result
Request Body
FieldTypeRequiredDescription
workflow_idstringrequiredWorkflow identifier
workflow_namestringrequiredWorkflow name
statusstringrequiredExecution result (success, failure, partial)
duration_msintegerrequiredExecution duration in milliseconds
nodes_executedintegerrequiredNumber of nodes executed
Response (200)
{ "ok": true, "logged": true, "timestamp": "2026-03-23T10:16:00Z" }
POST /api/n8n/pause-for-approval Pause workflow pending human approval
Request Body
FieldTypeRequiredDescription
workflow_idstringrequiredWorkflow identifier
workflow_namestringrequiredWorkflow name
reasonstringrequiredReason for requiring approval
required_approverstringrequiredApprover role or ID
Response (200)
{ "ok": true, "approval_id": "apr_00142", "status": "PENDING", "message": "Workflow paused. Awaiting approval from 0n40i4." }
POST /api/n8n/resume-after-approval Resume paused workflow after approval decision
Request Body
FieldTypeRequiredDescription
approval_idstringrequiredApproval request ID
approvedbooleanrequiredApproval decision
approverstringrequiredPerson who approved/rejected
commentstringoptionalApproval comment
Response (200)
{ "ok": true, "approval_id": "apr_00142", "decision": "APPROVED", "timestamp": "2026-03-23T10:20:00Z" }
POST /api/n8n/cancel-execution Cancel a running workflow
Request Body
FieldTypeRequiredDescription
workflow_idstringrequiredWorkflow to cancel
reasonstringrequiredCancellation reason
cancelled_bystringrequiredWho cancelled
Response (200)
{ "ok": true, "status": "CANCELLED", "timestamp": "2026-03-23T10:22:00Z" }
GET /api/n8n/policy/:workflowId Get governance policy for workflow
URL Parameters
FieldTypeRequiredDescription
workflowIdstringrequiredWorkflow identifier
Response (200)
{ "ok": true, "policy": { "max_risk_auto": 0.3, "allowed_actions": ["read", "write"], "blocked_actions": ["delete", "external_payment"], "escalation_sla": "15m" } }
GET /api/n8n/audit/:workflowId Get audit trail for workflow
URL Parameters
FieldTypeRequiredDescription
workflowIdstringrequiredWorkflow identifier
Response (200)
{ "ok": true, "entries": [ { "action": "PRE_CHECK", "result": "ALLOW", "ts": "2026-03-23T10:15:00Z" }, { "action": "EXECUTION", "result": "SUCCESS", "ts": "2026-03-23T10:16:00Z" } ], "count": 2 }
POST /api/n8n/escalate Escalate workflow to higher authority
Request Body
FieldTypeRequiredDescription
workflow_idstringrequiredWorkflow identifier
reasonstringrequiredEscalation reason
severitystringrequiredSeverity level (low, medium, high, critical)
Response (200)
{ "ok": true, "priority": "P1", "escalation_id": "esc_0087" }
POST /api/n8n/register-exception Register governance exception
Request Body
FieldTypeRequiredDescription
workflow_idstringrequiredWorkflow identifier
exception_typestringrequiredType of exception (policy_override, timeout, resource_limit)
severitystringrequiredSeverity (low, medium, high, critical)
descriptionstringrequiredException details
Response (200)
{ "ok": true, "exception_id": "exc_0031", "severity": "high", "flag": "REVIEW_REQUIRED" }

Agent Runtime

POST /api/agents/map-to-runtime Map agent profile to runtime environment
Request Body
FieldTypeRequiredDescription
profile_idstringrequiredAgent profile identifier
role_idstringrequiredRole to assign
allowed_toolsarrayrequiredList of permitted tools
max_autonomynumberrequiredAutonomy level 0.0 to 1.0
Response (200)
{ "ok": true, "status": "MAPPED" }
GET /api/agents/runtime-status List all active agent runtimes
Response (200)
{ "ok": true, "agents": [ { "id": "agt_fin01", "role": "FinCtrl", "status": "ACTIVE", "autonomy": 0.6 }, { "id": "agt_aud03", "role": "Auditor", "status": "ACTIVE", "autonomy": 0.4 } ], "count": 2 }
POST /api/agents/suspend-runtime Suspend an active agent
Request Body
FieldTypeRequiredDescription
agent_idstringrequiredAgent to suspend
reasonstringrequiredSuspension reason
suspended_bystringrequiredWho initiated suspension
Response (200)
{ "ok": true, "status": "SUSPENDED" }

Forum Moderation

POST /api/forum/auto-moderate Auto-moderate forum post
Request Body
FieldTypeRequiredDescription
post_idstringrequiredPost identifier
authorstringrequiredPost author
titlestringrequiredPost title
contentstringrequiredPost content
Response (200)
{ "ok": true, "decision": "APPROVED", "score": 0.92, "response": "Content meets community guidelines." }
GET /api/forum/mod-stats Get moderation statistics
Response (200)
{ "ok": true, "stats": { "total": 156, "approved": 142, "reviewed": 11, "rejected": 3 } }
GET /api/forum/auto-scan Trigger forum content scan
Response (200)
{ "ok": true, "scanned": 48, "moderated": 2 }

Contact & Orders

POST /api/contact Submit contact/order request
Request Body
FieldTypeRequiredDescription
namestringrequiredContact name
emailstringrequiredContact email
companystringoptionalCompany name
rolestringoptionalJob role/title
needstringrequiredPrimary need (audit, deployment, consulting, custom)
budgetstringoptionalBudget range
timelinestringoptionalExpected timeline
messagestringoptionalAdditional message
Response (200)
{ "ok": true, "message": "Contact request received. We will respond within 24 hours." }
GET /api/check-inbox Check for new contact submissions
Response (200)
{ "ok": true, "new_emails": 3, "timestamp": "2026-03-23T12:00:00Z" }

System

GET /health System health check
Response (200)
{ "ok": true, "service": "k0nsult", "version": "1.4.2", "db": "connected", "uptime": "14d 6h 32m" }
Example cURL
curl https://k0nsult.fly.dev/health

Try It — Live cURL Examples

These commands can be run against the live API. The health endpoint is open; governance endpoints require API key authentication in production.

1. Check system health (no auth required)
curl -s https://k0nsult.fly.dev/health | python3 -m json.tool
2. Run a pre-check on a workflow
curl -X POST https://k0nsult.fly.dev/api/n8n/pre-check \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "workflow_id": "wf_test_001", "workflow_name": "Test Workflow", "user": "demo_user", "data_classification": "public", "action_type": "read" }'
3. Get moderation stats
curl -s https://k0nsult.fly.dev/api/forum/mod-stats \ -H "Authorization: Bearer YOUR_API_KEY" | python3 -m json.tool