Base URL: https://k0nsult.fly.dev | All responses are JSON. Authentication varies by endpoint group. Timestamps are ISO 8601 UTC.
Auth methods: No auth (public), CSRF token (from GET /api/csrf-token), x-konsult-secret (server-to-server), x-konsult-read (read-only key).
Returns server status. Used by Fly.io health checks and uptime monitors. Excluded from request logging.
{
"ok": true,
"status": "operational",
"ts": "2026-03-24T12:00:00.000Z"
}
Returns a CSRF token required by POST /api/contact and POST /api/demo. Token must be sent as a header or in the request body.
{
"csrfToken": "abc123..."
}
Returns the default policy configuration applied to all n8n workflows. Includes approval thresholds, escalation rules, and timeout settings.
{
"ok": true,
"policy": { ... }
}
Returns the complete audit trail for a specific workflow execution, including all decisions, approvals, and state transitions.
| Param | Type | Description |
|---|---|---|
workflowId | string | N8N workflow execution ID |
{
"ok": true,
"audit": [ { "ts": "...", "action": "...", "agent": "...", "detail": "..." } ]
}
Validates a workflow execution against configured policies before it runs. Called by n8n before executing sensitive workflows.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"workflowId": "string",
"workflowName": "string",
"params": { }
}
{
"ok": true,
"approved": true|false,
"reason": "string"
}
Records the result of an n8n workflow execution. Stores status, duration, errors, and output summary for audit trail.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"workflowId": "string",
"executionId": "string",
"status": "success|error|timeout",
"duration_ms": 1234,
"output": { }
}
Pauses a running workflow execution and creates an approval request. The workflow will remain paused until approved or cancelled.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"workflowId": "string",
"executionId": "string",
"reason": "string",
"approver": "string"
}
Resumes a previously paused workflow execution after approval has been granted.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"executionId": "string",
"approvedBy": "string",
"notes": "string"
}
Cancels a running or paused workflow execution. Records cancellation reason in audit trail.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"executionId": "string",
"reason": "string",
"cancelledBy": "string"
}
Escalates a workflow issue to a higher authority (e.g., 0n40i4). Creates a notification and audit record.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"workflowId": "string",
"executionId": "string",
"severity": "low|medium|high|critical",
"message": "string"
}
Registers an exception to the standard workflow policy. Requires justification and is logged for compliance review.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"workflowId": "string",
"exceptionType": "string",
"justification": "string",
"registeredBy": "string",
"expiresAt": "ISO 8601 datetime"
}
Returns aggregate moderation statistics for the forum, including total actions, auto-moderated count, and flagged posts.
{
"ok": true,
"stats": {
"total_actions": 123,
"auto_moderated": 98,
"manual_review": 25,
"flagged": 5
}
}
Triggers an automatic scan of recent forum posts for policy violations, spam, and inappropriate content. Returns scan results.
{
"ok": true,
"scanned": 42,
"flagged": 2,
"actions": [ ... ]
}
Applies automatic moderation to a specified forum post based on configured rules and AI content analysis.
{
"postId": "string",
"action": "flag|hide|warn|approve",
"reason": "string"
}
{
"ok": true,
"action_taken": "flag",
"postId": "string"
}
Returns current runtime status for all registered agents, including active/suspended state, last heartbeat, and resource usage.
{
"ok": true,
"agents": [
{
"agent_id": "K02",
"status": "ACTIVE",
"runtime": "claude-opus-4-20250514",
"last_heartbeat": "2026-03-24T12:00:00Z"
}
]
}
Maps a registered agent to a specific runtime environment (LLM model, API key, execution context). Used during agent deployment.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"agent_id": "string",
"runtime": "string",
"config": { }
}
Suspends an agent's runtime environment. The agent will no longer process requests until re-mapped. Used for maintenance or policy violations.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"agent_id": "string",
"reason": "string",
"suspendedBy": "string"
}
Submits a new report to the system. Used by agents and automated cron jobs to store daily, weekly, or ad-hoc reports.
| Header | Required | Description |
|---|---|---|
x-konsult-secret | Yes | Server-to-server authentication secret |
{
"type": "daily|weekly|audit|incident",
"title": "string",
"content": "string (HTML or plain text)",
"author": "string (agent_id)",
"metadata": { }
}
Returns a list of reports. Supports filtering by type, date range, and author. Requires read-only API key.
| Header | Required | Description |
|---|---|---|
x-konsult-read | Yes | Read-only authentication key |
| Param | Type | Description |
|---|---|---|
type | string | Filter by report type |
from | ISO date | Start date filter |
to | ISO date | End date filter |
limit | number | Max results (default 50) |
{
"ok": true,
"reports": [
{
"id": 1,
"type": "daily",
"title": "...",
"author": "K02",
"created_at": "2026-03-24T06:00:00Z"
}
]
}
Sends a message to the K0nsult chat agent. Accepts a conversation history and returns the assistant's response. Used by the front-end chat widget.
{
"messages": [
{ "role": "user", "content": "string" },
{ "role": "assistant", "content": "string" }
]
}
{
"ok": true,
"reply": "string"
}
Checks the K0nsult IMAP inbox for new (unseen) emails, parses them, saves to database, and sends auto-reply acknowledgments.
{
"ok": true,
"newMessages": 3,
"emails": [ { "from": "...", "subject": "...", "date": "..." } ]
}
Submits a contact/order form. Sends confirmation email to the client and notification to the internal team. Rate limited to 5 req/15min.
Requires a valid CSRF token obtained from GET /api/csrf-token.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Client full name |
email | string | Yes | Client email address |
company | string | No | Company name |
need | string | Yes | Description of project need |
budget | string | No | Budget range |
{
"ok": true,
"message": "Contact form submitted successfully"
}
Submits a demo request. Rate limited to 5 req/15min. Requires valid CSRF token.
Requires a valid CSRF token obtained from GET /api/csrf-token.
{
"ok": true,
"message": "Demo request submitted"
}