Skip to main content

REST API Reference

The Osmedeus server provides a REST API for managing workflows, runs, and assets. Start the server with:
osmedeus server --port 8080

Authentication

All endpoints require bearer token authentication:
curl -H "Authorization: Bearer <your_token>" http://localhost:8080/osm/api/...

Endpoints Overview

CategoryBase PathDescription
Runs/osm/api/runsManage workflow executions
Workflows/osm/api/workflowsList and query workflows
Schedules/osm/api/schedulesManage scheduled triggers
Assets/osm/api/assetsQuery discovered assets
Vulnerabilities/osm/api/vulnerabilitiesQuery vulnerabilities
Workspaces/osm/api/workspacesManage workspaces
Functions/osm/api/functionsExecute utility functions
Snapshots/osm/api/snapshotsExport/import workspaces
LLM/osm/api/llmLLM chat/embeddings
Install/osm/api/installBinary management
Step Results/osm/api/step-resultsQuery step execution results

Runs

Create Run

Start a new workflow execution.
POST /osm/api/runs
Request Body:
{
  "workflow": "general",
  "target": "example.com",
  "params": {
    "threads": "20"
  }
}
Response:
{
  "data": {
    "run_id": "run-abc123",
    "status": "running",
    "workflow": "general",
    "target": "example.com",
    "started_at": "2025-01-15T10:00:00Z"
  }
}

List Runs

GET /osm/api/runs
GET /osm/api/runs?status=running
GET /osm/api/runs?workspace=example_com
Query Parameters:
ParameterDescription
statusFilter by status (pending, running, completed, failed)
workspaceFilter by workspace name
limitMaximum results (default: 50)
offsetPagination offset

Get Run

GET /osm/api/runs/:run_id

Get Run Steps

GET /osm/api/runs/:run_id/steps

Get Run Artifacts

GET /osm/api/runs/:run_id/artifacts

Cancel Run

POST /osm/api/runs/:run_id/cancel

Workflows

List Workflows

GET /osm/api/workflows
GET /osm/api/workflows?kind=module
GET /osm/api/workflows?tags=recon,fast
Query Parameters:
ParameterDescription
kindFilter by kind (module, flow, fragment)
tagsFilter by tags (comma-separated)
Response:
{
  "data": [
    {
      "name": "subdomain-enum",
      "kind": "module",
      "description": "Enumerate subdomains",
      "tags": ["recon", "subdomain"],
      "params": [
        {"name": "threads", "default": "10", "required": false}
      ]
    }
  ]
}

Get Workflow

GET /osm/api/workflows/:name

Get Workflow Tags

Get all unique tags from indexed workflows.
GET /osm/api/workflows/tags
Response:
{
  "tags": ["recon", "subdomain", "fast", "vuln", "scan"],
  "count": 5
}

Refresh Workflow Index

Re-index all workflows from filesystem to database.
POST /osm/api/workflows/refresh
POST /osm/api/workflows/refresh?force=true
Query Parameters:
ParameterRequiredDescription
forceNoForce re-index all workflows regardless of checksum
Response:
{
  "message": "Workflows indexed successfully",
  "added": 5,
  "updated": 2,
  "removed": 1,
  "errors": []
}

Schedules

List Schedules

GET /osm/api/schedules

Create Schedule

POST /osm/api/schedules
Request Body:
{
  "name": "daily-scan",
  "workflow": "general",
  "target": "example.com",
  "trigger_type": "cron",
  "schedule": "0 2 * * *",
  "enabled": true,
  "params": {
    "threads": "10"
  }
}

Get Schedule

GET /osm/api/schedules/:id

Update Schedule

PUT /osm/api/schedules/:id

Delete Schedule

DELETE /osm/api/schedules/:id

Enable/Disable Schedule

POST /osm/api/schedules/:id/enable
POST /osm/api/schedules/:id/disable

Trigger Schedule

Execute a scheduled workflow immediately.
POST /osm/api/schedules/:id/trigger

Assets

List Assets

GET /osm/api/assets
GET /osm/api/assets?workspace=example_com
GET /osm/api/assets?asset_type=subdomain
GET /osm/api/assets?status_code=200
Query Parameters:
ParameterDescription
workspaceFilter by workspace
asset_typeFilter by type (subdomain, url, ip, etc.)
status_codeFilter by HTTP status code
limitMaximum results (default: 100)
offsetPagination offset

Get Asset

GET /osm/api/assets/:id

Asset Diff

Compare assets between two time points to identify changes.
GET /osm/api/assets/diff?workspace=example_com&from=2025-01-01T00:00:00Z&to=2025-01-15T00:00:00Z
Query Parameters:
ParameterRequiredDescription
workspaceYesWorkspace name
fromYesStart time (RFC3339 or Unix timestamp)
toNoEnd time (default: now)
Supported Time Formats:
  • RFC3339: 2025-01-15T10:00:00Z
  • Unix timestamp: 1705312800
  • Date only: 2025-01-15
  • DateTime: 2025-01-15 10:00:00
Response:
{
  "data": {
    "workspace_name": "example_com",
    "from_time": "2025-01-01T00:00:00Z",
    "to_time": "2025-01-15T00:00:00Z",
    "added": [
      {
        "id": 123,
        "asset_value": "new.example.com",
        "asset_type": "subdomain",
        "url": "https://new.example.com",
        "status_code": 200,
        "created_at": "2025-01-10T12:00:00Z"
      }
    ],
    "removed": [
      {
        "id": 45,
        "asset_value": "old.example.com",
        "asset_type": "subdomain",
        "last_seen_at": "2024-12-20T00:00:00Z"
      }
    ],
    "changed": [
      {
        "asset_id": 67,
        "asset_value": "api.example.com",
        "url": "https://api.example.com",
        "changes": [
          {
            "field": "status_code",
            "old_value": 200,
            "new_value": 301
          }
        ]
      }
    ],
    "summary": {
      "total_added": 5,
      "total_removed": 2,
      "total_changed": 3
    }
  }
}

Vulnerabilities

List Vulnerabilities

GET /osm/api/vulnerabilities
GET /osm/api/vulnerabilities?workspace=example_com
GET /osm/api/vulnerabilities?severity=critical
Query Parameters:
ParameterDescription
workspaceFilter by workspace
severityFilter by severity (critical, high, medium, low, info)
asset_valueFilter by asset
limitMaximum results (default: 100)
offsetPagination offset

Get Vulnerability

GET /osm/api/vulnerabilities/:id

Vulnerability Diff

Compare vulnerabilities between two time points.
GET /osm/api/vulnerabilities/diff?workspace=example_com&from=2025-01-01T00:00:00Z
Query Parameters:
ParameterRequiredDescription
workspaceYesWorkspace name
fromYesStart time (RFC3339 or Unix timestamp)
toNoEnd time (default: now)
Response:
{
  "data": {
    "workspace_name": "example_com",
    "from_time": "2025-01-01T00:00:00Z",
    "to_time": "2025-01-15T00:00:00Z",
    "added": [
      {
        "id": 789,
        "vuln_info": "CVE-2025-1234",
        "asset_value": "api.example.com",
        "severity": "critical",
        "template_id": "CVE-2025-1234",
        "created_at": "2025-01-12T08:00:00Z"
      }
    ],
    "removed": [],
    "changed": [],
    "summary": {
      "total_added": 1,
      "total_removed": 0,
      "total_changed": 0
    }
  }
}

Workspaces

List Workspaces

GET /osm/api/workspaces

Get Workspace

GET /osm/api/workspaces/:name

Delete Workspace

DELETE /osm/api/workspaces/:name

Functions

Execute Function

Execute a utility function.
POST /osm/api/functions/execute
Request Body:
{
  "expression": "fileLength('{{Output}}/subdomains.txt')",
  "context": {
    "Output": "/workspaces/example_com"
  }
}
Response:
{
  "data": {
    "result": 1234
  }
}

List Functions

GET /osm/api/functions
GET /osm/api/functions?category=file

Snapshots

List Snapshots

GET /osm/api/snapshots

Export Snapshot

POST /osm/api/snapshots/export
Request Body:
{
  "workspace": "example_com",
  "include_artifacts": true
}

Import Snapshot

POST /osm/api/snapshots/import
Upload a snapshot ZIP file.

LLM

Chat Completions

OpenAI-compatible chat completions endpoint.
POST /osm/api/llm/chat/completions
Request Body:
{
  "model": "gpt-4",
  "messages": [
    {"role": "system", "content": "You are a security analyst."},
    {"role": "user", "content": "Analyze this finding..."}
  ],
  "temperature": 0.7,
  "max_tokens": 2000
}

Embeddings

POST /osm/api/llm/embeddings
Request Body:
{
  "model": "text-embedding-ada-002",
  "input": ["text to embed"]
}

Install

List Binary Registry

GET /osm/api/install/registry
GET /osm/api/install/registry?method=nix
GET /osm/api/install/registry?method=direct

Check Binary Status

GET /osm/api/install/status/:binary_name

Install Binary

POST /osm/api/install/binary
Request Body:
{
  "name": "nuclei",
  "method": "nix"
}

Event Logs

List Events

GET /osm/api/events
GET /osm/api/events?topic=assets.new
GET /osm/api/events?run_id=run-abc123
Query Parameters:
ParameterDescription
topicFilter by event topic
run_idFilter by run ID
fromStart time filter
toEnd time filter
limitMaximum results

Step Results

List Step Results

Query step execution results with filtering and pagination.
GET /osm/api/step-results
GET /osm/api/step-results?workspace=example_com
GET /osm/api/step-results?status=completed
GET /osm/api/step-results?run_id=123
Query Parameters:
ParameterDescription
workspaceFilter by workspace name
statusFilter by status (pending, running, completed, failed)
step_typeFilter by step type (bash, function, etc.)
run_idFilter by run ID
offsetPagination offset (default: 0)
limitMaximum results (default: 20, max: 10000)
Response:
{
  "data": [
    {
      "id": 123,
      "step_name": "subfinder",
      "step_type": "bash",
      "status": "completed",
      "run_id": 456,
      "workspace": "example_com",
      "started_at": "2025-01-15T10:00:00Z",
      "completed_at": "2025-01-15T10:05:00Z"
    }
  ],
  "pagination": {
    "total": 100,
    "offset": 0,
    "limit": 20
  }
}

Health

Health Check

GET /osm/api/health
Response:
{
  "status": "healthy",
  "version": "5.0.0",
  "database": "connected",
  "workflows_loaded": 42
}

Error Responses

All error responses follow this format:
{
  "error": true,
  "message": "Error description"
}
Common HTTP status codes:
CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Missing or invalid token
404Not Found - Resource doesn’t exist
500Internal Server Error - Server error