Skip to main content
API Referencev1

REST API Documentation

Complete reference for the Akmatori REST API. Most endpoints require authentication via JWT token or API key, while login, health checks, setup bootstrap endpoints, alert webhooks, and API docs are public.

Authentication

Most API requests require authentication. You can use either a JWT token or an API key. Akmatori accepts API keys via X-API-Key, Authorization: ApiKey ..., or Authorization: Bearer ....

bash
# Using Bearer Token
curl -H "Authorization: Bearer <your-jwt-token>" \
  https://your-instance/api/incidents

# Using API Key header
curl -H "X-API-Key: <your-api-key>" \
  https://your-instance/api/incidents

# Using Authorization: ApiKey
curl -H "Authorization: ApiKey <your-api-key>" \
  https://your-instance/api/incidents
Public endpoints include /auth/login, /health, /auth/setup-status, /auth/setup, /api/docs, /api/openapi.yaml, and alert webhooks under /webhook/alert/:uuid.

Base URL

text
https://your-akmatori-instance/api
Visit /api/docs on your Akmatori instance for an interactive Swagger UI where you can explore and test all endpoints directly.

Endpoints

Incidents

GET/incidents

List incidents with pagination and optional Unix timestamp filters (page, per_page, from, to)

GET/incidents/:uuid

Get a specific incident by UUID, including execution state and logs

POST/incidents

Create and start a new API-driven incident. Request body requires task and may include optional context.

POST/incidents/:uuid/feedback

Submit thumbs-up / thumbs-down style execution feedback for a completed incident so Akmatori can store operator signal alongside the run.

Skills

GET/skills

List all available skills

POST/skills

Create a new skill

GET/skills/:name

Get skill details by name

PUT/skills/:name

Update skill configuration

DELETE/skills/:name

Delete a skill (user-created only)

GET/skills/:name/prompt

Get skill prompt content

PUT/skills/:name/prompt

Update skill prompt

GET/skills/:name/tools

List tools assigned to a skill

PUT/skills/:name/tools

Assign tool instances to a skill

GET/skills/:name/scripts

List skill scripts

DELETE/skills/:name/scripts

Clear all scripts for a skill

GET/skills/:name/scripts/:filename

Get a specific script by filename

PUT/skills/:name/scripts/:filename

Create or update a skill script

DELETE/skills/:name/scripts/:filename

Delete a specific script

POST/skills/sync

Sync skills from filesystem to database

Tools

GET/tool-types

List available tool types

GET/tools

List configured tool instances

POST/tools

Create a new tool instance

GET/tools/:id

Get tool instance details

PUT/tools/:id

Update tool configuration

DELETE/tools/:id

Delete a tool instance

GET/tools/:id/ssh-keys

List SSH keys for an SSH tool

POST/tools/:id/ssh-keys

Add an SSH key to a tool

PUT/tools/:id/ssh-keys/:keyId

Update an SSH key

DELETE/tools/:id/ssh-keys/:keyId

Delete an SSH key

Alert Sources

GET/alert-source-types

List supported alert source types

GET/alert-sources

List configured alert sources

POST/alert-sources

Create a new webhook alert source. Deprecated source types such as slack_channel are rejected; configure Slack listeners through Channels instead.

GET/alert-sources/:uuid

Get alert source details by UUID

PUT/alert-sources/:uuid

Update alert source configuration

DELETE/alert-sources/:uuid

Delete an alert source

Messaging Integrations

GET/integrations

List messaging provider integrations such as Slack, with credentials masked in responses.

POST/integrations

Create a provider integration with provider, name, optional metadata, and provider-specific credentials.

GET/integrations/:uuid

Get integration details by UUID, including masked credential metadata.

PUT/integrations/:uuid

Update integration name, credentials, metadata, or enabled state.

DELETE/integrations/:uuid

Delete a messaging integration and its provider configuration.

Channels

GET/channels

List provider channels with optional filters for integration, posting, listening, default post target, and enabled state.

POST/channels

Create a channel for a messaging integration using integration_uuid, provider external_id, posting/listening flags, and optional extraction prompt.

GET/channels/:uuid

Get channel details by UUID, including its parent integration when loaded.

PUT/channels/:uuid

Update channel routing, display name, listen/post flags, extraction prompt, human-message processing, or enabled state.

DELETE/channels/:uuid

Delete a channel mapping and reload listener routing for supported providers.

Cron Jobs

GET/cron-jobs

List agent-only scheduled jobs, including channel target, next run time, system flag, last-run status, and each job's secret-free tool allowlist.

POST/cron-jobs

Create an agent cron job with name, five-field cron schedule, prompt, optional channel_uuid, enabled, and tool_instance_ids.

GET/cron-jobs/:uuid

Get a scheduled job, including last-run status, next run time, delivery target, system flag, and assigned tool summaries.

PUT/cron-jobs/:uuid

Update schedule, prompt, channel target, enabled state, or replace the per-cron tool_instance_ids allowlist. Omit tool_instance_ids to keep existing tools; pass [] to clear them.

POST/cron-jobs/:uuid/run

Start a job immediately in the background and return 202 Accepted.

DELETE/cron-jobs/:uuid

Delete an operator-created scheduled job. Seeded system jobs can be disabled but return 409 Conflict on delete.

Context Files

GET/context

List all context files

POST/context

Upload a new context file via multipart form with file and filename, plus optional description.

GET/context/:id

Get context file metadata

GET/context/:id/download

Download context file content

DELETE/context/:id

Delete a context file

POST/context/validate

Validate context file references in text

Runbooks

GET/runbooks

List all runbooks for AI-guided incident investigation

POST/runbooks

Create a new runbook (title, content). Akmatori syncs the markdown file automatically and, when QMD is configured, triggers background re-indexing.

GET/runbooks/:id

Get runbook details by ID

PUT/runbooks/:id

Update runbook title and content, then resync exported markdown and optional QMD indexing metadata

DELETE/runbooks/:id

Delete a runbook and clean up its synced markdown export

Cross-Incident Memory

GET/memories

List stored cross-incident memories, with optional filtering by scope, source, or query terms.

POST/memories

Create a new memory record that can be reused across future incidents.

GET/memories/scopes

List available memory scopes so operators can understand where shared context will be applied.

GET/memories/:id

Get a single memory entry by ID, including its scope and extracted content.

PUT/memories/:id

Update an existing memory entry when shared knowledge needs correction or enrichment.

DELETE/memories/:id

Delete a memory entry that should no longer influence incident analysis.

HTTP Connectors

GET/http-connectors

List all HTTP connectors for external API integration

POST/http-connectors

Create a new HTTP connector with tool_type_name, base_url_field, optional auth_config, and generated tools definitions.

GET/http-connectors/:id

Get HTTP connector details by ID

PUT/http-connectors/:id

Update HTTP connector configuration

DELETE/http-connectors/:id

Delete an HTTP connector

MCP Servers

GET/mcp-servers

List all MCP server configurations for external tool proxying

POST/mcp-servers

Register a new MCP server with name, transport, and namespace_prefix, using either url or command/args/env_vars.

GET/mcp-servers/:id

Get MCP server configuration by ID

PUT/mcp-servers/:id

Update MCP server configuration

DELETE/mcp-servers/:id

Delete an MCP server registration

Settings

GET/settings/general

Get general settings (base URL for links in notifications)

PUT/settings/general

Update general settings

GET/settings/slack

Legacy Slack settings endpoint. Returns 410 Gone; use /integrations and /channels instead.

PUT/settings/slack

Legacy Slack settings endpoint. Returns 410 Gone; configure Slack through messaging integrations and channels.

GET/settings/llm

List all saved LLM configurations and return the currently active config ID

POST/settings/llm

Create a new LLM configuration for OpenAI, Anthropic, Google, OpenRouter, or a custom provider, including optional thinking_level (off, minimal, low, medium, high, xhigh).

GET/settings/llm/:id

Get a single LLM configuration by numeric ID

PUT/settings/llm/:id

Update an existing LLM configuration, including name, model, thinking level, base URL, or API key

DELETE/settings/llm/:id

Delete an LLM configuration that is no longer needed

PUT/settings/llm/:id/activate

Mark a specific LLM configuration as the active one used for incident execution

GET/settings/proxy

Get outbound proxy configuration, including the masked proxy URL, no_proxy, and per-service toggles for llm, slack, zabbix, victoria_metrics, catchpoint, grafana, pagerduty, netbox, kubernetes, and jira. SSH is currently reported as unsupported.

PUT/settings/proxy

Update proxy configuration, including the shared proxy URL, no_proxy, and service-specific enablement flags used by the agent worker and supported integrations.

GET/settings/retention

Get incident data retention policy settings, including enablement, retention window, and cleanup interval

PUT/settings/retention

Update retention policy settings (enabled, retention_days, cleanup_interval_hours)

GET/settings/formatting

Get global response-formatting settings used to rewrite final agent answers before persistence, including the editable output_schema_example used to infer the final JSON shape.

PUT/settings/formatting

Update formatting settings (enabled, system_prompt, max_tokens, temperature, output_schema_example). Empty prompt or schema values fall back to built-in defaults; custom schema examples must be valid JSON objects and stay within the 8 KB limit.

Authentication & System

POST/auth/login

Exchange credentials for a JWT token

GET/auth/verify

Verify the current JWT token and return the authenticated user context

GET/auth/setup-status

Check whether the instance still requires initial admin setup

POST/auth/setup

Create the initial admin account during first-run bootstrap

GET/health

Liveness and readiness check for Akmatori services

Webhooks

POST/webhook/alert/:uuid

Receive alerts from monitoring systems (no auth required)

API Documentation

GET/docs

Interactive Swagger UI for exploring and testing API endpoints

GET/openapi.yaml

OpenAPI 3.1 specification in YAML format

Pagination

List endpoints support pagination via page and per_page query parameters. Default: page=1, per_page=50. Maximum per_page is 200.

bash
# Get page 2 with 25 items per page
curl -H "Authorization: Bearer <token>" \
  "https://your-instance/api/incidents?page=2&per_page=25"

# Filter by date range (Unix timestamps)
curl -H "Authorization: Bearer <token>" \
  "https://your-instance/api/incidents?from=1709251200&to=1709337600"

When using pagination, the response wraps data with metadata:

json
{
  "data": [...],
  "pagination": {
    "page": 2,
    "per_page": 25,
    "total": 147,
    "total_pages": 6
  }
}

Example Request

Create Incident
curl -X POST https://your-instance/api/incidents \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "Investigate sustained CPU saturation on web-server-01 and summarize likely root cause",
    "context": {
      "host": "web-server-01",
      "severity": "critical",
      "environment": "production"
    }
  }'

Error Responses

400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing token
404Not Found - Resource doesn't exist
500Internal Error - Server error