Overview
Base URL:http://localhost:8002
API Prefix: /osm/api (for authenticated endpoints)
Default Port: 8002
Authentication
Most API endpoints require JWT authentication. Obtain a token via the login endpoint, then include it in subsequent requests using theAuthorization: Bearer <token> header.
Alternatively, API key authentication can be enabled via server configuration.
Quick Start
Table of Contents
- Public Endpoints
- Authentication
- Workflows
- Runs
- Jobs
- File Uploads
- Snapshots
- Workspaces
- Artifacts
- Assets
- Vulnerabilities
- Event Logs
- Functions
- System Statistics
- Settings
- Installation
- Schedules
- LLM API
- Distributed Mode
- Reference
Public Endpoints
These endpoints do not require authentication.Server Info
Get server version and information./status, /api/info
Response:
Health Check
Check if the server is running.Readiness Check
Check if the server is ready to accept requests.Prometheus Metrics
Access Prometheus metrics endpoint.Swagger Documentation
Access interactive API documentation.Authentication
Login
POST/osm/api/login
Authenticate and obtain a JWT token.
| Field | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Username configured in server settings |
password | string | Yes | Password for the user |
Using the Token
Include the token in subsequent requests:Disabling Authentication
Authentication can be disabled by starting the server with the--no-auth flag:
Workflows
List All Workflows
GET/osm/api/workflows
Get a paginated list of all available workflows.
| Parameter | Type | Default | Description |
|---|---|---|---|
source | string | db | Data source: db or filesystem |
tags | string | - | Comma-separated list of tags to filter by |
kind | string | - | Filter by workflow kind: flow or module |
search | string | - | Search in workflow name and description |
offset | int | 0 | Pagination offset |
limit | int | 50 | Maximum records to return |
Get Workflow Tags
GET/osm/api/workflows/tags
Get all unique tags from indexed workflows.
Refresh Workflow Index
POST/osm/api/workflows/refresh
Re-index all workflows from filesystem to database.
| Parameter | Type | Default | Description |
|---|---|---|---|
force | bool | false | Force re-index all workflows |
Get Workflow Details
GET/osm/api/workflows/:name
Get workflow content. Returns raw YAML by default, or JSON with parsed details.
| Parameter | Type | Default | Description |
|---|---|---|---|
json | bool | false | Return JSON instead of raw YAML |
?json=true):
Runs
Create a New Run
POST/osm/api/runs
Execute a workflow against a target.
Basic scan with flow workflow:
| Field | Type | Required | Description |
|---|---|---|---|
flow | string | No* | Flow workflow name |
module | string | No* | Module workflow name |
target | string | No** | Single target |
targets | array | No** | Multiple targets |
target_file | string | No** | Path to targets file |
params | object | No | Custom parameters |
concurrency | int | No | Concurrent target limit |
priority | string | No | Priority: low, medium, high |
timeout | int | No | Timeout in minutes |
runner_type | string | No | host, docker, or ssh |
docker_image | string | No | Docker image (for docker runner) |
ssh_host | string | No | SSH host (for ssh runner) |
flow or module is required.
**One of target, targets, or target_file is required (or empty_target: true).
Response (202 Accepted):
Multi-Target Scanning
Scan multiple targets with concurrency control:List Runs
GET/osm/api/runs
Get a paginated list of all runs.
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | - | Filter by status: pending, running, completed, failed |
workflow_name | string | - | Filter by workflow name |
target | string | - | Filter by target |
offset | int | 0 | Pagination offset |
limit | int | 20 | Maximum records to return |
Get Run Details
GET/osm/api/runs/:id
Get details of a specific run by ID.
Cancel Run
DELETE/osm/api/runs/:id
Cancel a running workflow execution.
Get Run Steps
GET/osm/api/runs/:id/steps
Get all step results for a specific run.
Get Run Artifacts
GET/osm/api/runs/:id/artifacts
Get all output artifacts for a specific run.
Jobs
Get Job Status
GET/osm/api/jobs/:id
Get aggregated status of a multi-target run group.
File Uploads
Upload Input File
POST/osm/api/upload-file
Upload a file containing a list of inputs (targets, URLs, etc.).
Upload Workflow
POST/osm/api/workflow-upload
Upload a raw YAML workflow file.
Snapshots
List Snapshots
GET/osm/api/snapshots
Get a list of available snapshot files.
Export Workspace Snapshot
POST/osm/api/snapshots/export
Export a workspace to a compressed zip archive.
| Field | Type | Required | Description |
|---|---|---|---|
workspace | string | Yes | Name of the workspace to export |
Content-Disposition: attachment; filename=<workspace>_<timestamp>.zipContent-Type: application/zipX-Snapshot-Size: <size_in_bytes>
Import Workspace Snapshot
POST/osm/api/snapshots/import
Import a workspace from an uploaded zip file or URL.
Import from file upload:
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | No* | Snapshot zip file to import |
url | string | No* | URL of snapshot to download |
force | bool | No | Overwrite existing workspace |
skip_db | bool | No | Skip database import |
file or url is required.
Response:
Delete Snapshot
DELETE/osm/api/snapshots/:name
Delete a snapshot file by name.
Legacy Snapshot Download
GET/osm/api/snapshot-download/:workspace_name
Legacy endpoint for backward compatibility.
Workspaces
List Workspaces
GET/osm/api/workspaces
Get a list of all run workspaces.
| Parameter | Type | Default | Description |
|---|---|---|---|
filesystem | bool | false | List from filesystem instead of database |
offset | int | 0 | Pagination offset |
limit | int | 20 | Maximum records to return |
List Workspace Names
GET/osm/api/workspace-names
Get a sorted list of workspace names.
Artifacts
List Artifacts
GET/osm/api/artifacts
Get a paginated list of artifacts.
| Parameter | Type | Default | Description |
|---|---|---|---|
workspace | string | - | Filter by workspace name |
search | string | - | Search artifact name/path |
status_code | int | - | Filter by HTTP status code |
verify_exist | bool | false | Check if files still exist |
offset | int | 0 | Pagination offset |
limit | int | 20 | Maximum records to return |
Download Workspace Artifact
GET/osm/api/artifacts/:workspace_name
Download an artifact file from a workspace.
| Parameter | Type | Required | Description |
|---|---|---|---|
artifact_path | string | Yes | Relative path to artifact within workspace |
Assets
List Assets
GET/osm/api/assets
Get a paginated list of discovered assets.
| Parameter | Type | Default | Description |
|---|---|---|---|
workspace | string | - | Filter by workspace |
search | string | - | Search in asset_value, url, title, host_ip |
status_code | int | - | Filter by HTTP status code |
offset | int | 0 | Pagination offset |
limit | int | 20 | Maximum records to return |
Vulnerabilities
List Vulnerabilities
GET/osm/api/vulnerabilities
Get a paginated list of vulnerabilities.
| Parameter | Type | Default | Description |
|---|---|---|---|
workspace | string | - | Filter by workspace name |
severity | string | - | Filter by severity (critical, high, medium, low, info) |
confidence | string | - | Filter by confidence |
asset_value | string | - | Filter by asset value (partial match) |
offset | int | 0 | Pagination offset |
limit | int | 20 | Maximum records to return |
Get Vulnerability Summary
GET/osm/api/vulnerabilities/summary
Get a summary of vulnerabilities grouped by severity.
| Parameter | Type | Default | Description |
|---|---|---|---|
workspace | string | - | Filter by workspace name |
Get Vulnerability by ID
GET/osm/api/vulnerabilities/:id
Retrieve a single vulnerability by its ID.
Create Vulnerability
POST/osm/api/vulnerabilities
Create a new vulnerability record.
| Field | Type | Required | Description |
|---|---|---|---|
workspace | string | Yes | Workspace/target name |
vuln_info | string | No | CVE or vulnerability identifier |
vuln_title | string | No | Short title |
vuln_desc | string | No | Detailed description |
vuln_poc | string | No | Proof of concept |
severity | string | No | Severity level |
asset_type | string | No | Type of asset |
asset_value | string | No | Affected asset URL |
tags | array | No | Tags for categorization |
Delete Vulnerability
DELETE/osm/api/vulnerabilities/:id
Delete a vulnerability by ID.
Event Logs
List Event Logs
GET/osm/api/event-logs
Get a paginated list of event logs.
| Parameter | Type | Description |
|---|---|---|
topic | string | Filter by event topic |
name | string | Filter by event name |
source | string | Filter by event source |
workspace | string | Filter by workspace name |
run_id | string | Filter by run ID |
workflow_name | string | Filter by workflow name |
processed | bool | Filter by processed status |
offset | int | Pagination offset (default: 0) |
limit | int | Maximum records (default: 20) |
| Topic | Description |
|---|---|
run.started | Workflow execution started |
run.completed | Workflow execution completed |
run.failed | Workflow execution failed |
asset.discovered | New asset discovered |
schedule.triggered | Scheduled workflow triggered |
step.completed | Individual step completed |
step.failed | Individual step failed |
Functions
Execute Utility Function
POST/osm/api/functions/eval
Execute a utility function script.
| Field | Type | Required | Description |
|---|---|---|---|
script | string | Yes | The JavaScript script to execute |
target | string | No | Target value for {{target}} variable |
params | object | No | Additional parameters for template rendering |
List Utility Functions
GET/osm/api/functions/list
Get a categorized list of all available utility functions.
System Statistics
Get System Stats
GET/osm/api/stats
Get aggregated system statistics.
Settings
Get YAML Configuration
GET/osm/api/settings/yaml
Get the YAML configuration file with sensitive fields redacted.
Installation
Get Registry Info
GET/osm/api/registry-info
Fetch binary registry metadata with installation status.
| Parameter | Type | Default | Description |
|---|---|---|---|
registry_mode | string | direct-fetch | Mode: direct-fetch or nix-build |
Install Binaries or Workflows
POST/osm/api/registry-install
Install binaries from registry or workflows from git/zip URL.
Install specific binaries (direct-fetch):
| Field | Type | Description |
|---|---|---|
type | string | Required. binary or workflow |
names | array | Binary names to install |
install_all | bool | Install all binaries |
source | string | Git URL or zip URL (for workflows) |
registry_mode | string | direct-fetch or nix-build |
Schedules
List Schedules
GET/osm/api/schedules
Get a paginated list of all scheduled workflows.
Create Schedule
POST/osm/api/schedules
Create a new scheduled workflow execution.
Get Schedule
GET/osm/api/schedules/:id
Get details of a specific schedule.
Update Schedule
PUT/osm/api/schedules/:id
Update an existing schedule.
Delete Schedule
DELETE/osm/api/schedules/:id
Delete a schedule.
Enable Schedule
POST/osm/api/schedules/:id/enable
Enable a disabled schedule.
Disable Schedule
POST/osm/api/schedules/:id/disable
Disable an enabled schedule.
Trigger Schedule
POST/osm/api/schedules/:id/trigger
Manually trigger a scheduled workflow execution.
LLM API
OpenAI-compatible API endpoints for Large Language Model capabilities.Chat Completion
POST/osm/api/llm/v1/chat/completions
Send a chat completion request.
| Field | Type | Required | Description |
|---|---|---|---|
messages | array | Yes | Array of message objects with role and content |
model | string | No | Model to use |
max_tokens | int | No | Maximum tokens in response |
temperature | float | No | Sampling temperature (0.0-2.0) |
top_p | float | No | Top-p sampling parameter |
tools | array | No | Tool definitions for function calling |
tool_choice | string | No | Tool selection strategy |
response_format | object | No | Response format |
With Tools (Function Calling)
Generate Embeddings
POST/osm/api/llm/v1/embeddings
Generate vector embeddings for input text.
| Field | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array of strings to embed |
model | string | No | Embedding model |
Distributed Mode
These endpoints are only available when running the server in master mode (osmedeus server --master).
List Workers
GET/osm/api/workers
Get a list of all registered workers.
Get Worker
GET/osm/api/workers/:id
Get details of a specific worker.
List Tasks
GET/osm/api/tasks
Get a list of all running and completed tasks.
Get Task
GET/osm/api/tasks/:id
Get details of a specific task.
Submit Task
POST/osm/api/tasks
Submit a new task to the distributed worker queue.
Reference
Error Responses
All endpoints return errors in a consistent format:| Code | Description |
|---|---|
200 | Success |
201 | Created |
202 | Accepted (async operation started) |
400 | Bad Request (invalid input) |
401 | Unauthorized (missing or invalid token) |
404 | Not Found |
500 | Internal Server Error |
Pagination
Endpoints that return lists support pagination via query parameters:| Parameter | Default | Max | Description |
|---|---|---|---|
offset | 0 | - | Number of records to skip |
limit | 20 | 10000 | Maximum records to return |
Cron Expression Reference
Schedules use standard cron expressions:| Expression | Description |
|---|---|
0 2 * * * | Every day at 2:00 AM |
0 0 * * 0 | Every Sunday at midnight |
*/30 * * * * | Every 30 minutes |
0 9-17 * * 1-5 | Every hour from 9 AM to 5 PM, Monday to Friday |
Run Status Values
| Status | Description |
|---|---|
pending | Queued, waiting to start |
running | Currently executing |
completed | Finished successfully |
failed | Execution failed |
cancelled | Cancelled by user |
Severity Levels
| Severity | Description |
|---|---|
critical | Critical severity - immediate action required |
high | High severity - action required soon |
medium | Medium severity - should be addressed |
low | Low severity - minor issue |
info | Informational - no action required |
Workflow Kinds
| Kind | Description |
|---|---|
flow | Orchestrates multiple modules |
module | Single workflow unit |
Runner Types
| Type | Description |
|---|---|
host | Execute on local host |
docker | Execute in Docker container |
ssh | Execute on remote host via SSH |
Trigger Types
| Type | Description |
|---|---|
cron | Scheduled execution via cron expression |
event | Event-driven execution |
watch | File watch trigger |
manual | Manual execution via API/CLI |