ServerEngine REST API
A simple, powerful REST API for triggering automation jobs in ServerEngine. Schedule scripts, runbooks, and workflows with a single HTTP POST request using Basic Authentication.
API Capabilities
Simple REST Endpoint
One endpoint for all automation triggers
- Single POST endpoint for job scheduling
- Basic HTTP authentication (username:password)
- JSON request body for job configuration
- Dynamic parameter passing to scripts
- Support for scripts, runbooks, and installers
- Immediate job execution or scheduled runs
Hover to see specs
Basic Authentication
Simple username/password security
- Basic HTTP authentication
- Base64 encoded credentials
- Default admin user
- Configurable password
- Standard port 5000
- Localhost or network access
Hover to see specs
Authentication Details
ServerEngine API uses Basic HTTP Authentication with Base64 encoding
Username
Must be admin user for full API access
Username
admin
Only the admin account has permission to schedule and trigger automation jobs via the API.
Password
Default password, configurable in settings
Password
cforce-it.com
Change this in ServerEngine settings. Use a strong password when exposing the API on a network.
Port
Default listening port, configurable
Port
5000
The API listens on port 5000 by default. Accessible from localhost or any network-reachable IP.
Encoding
Base64 encode credentials for the header
Encoding
Basic YWRtaW46...
Base64 encode “username:password” and pass as the Authorization header on every request.
Request Parameters
Time & Scheduling
-
TimeStringExecution time in HH:mm format (e.g., “14:30”)
-
DateStringExecution date in yyyy/MM/dd format
-
RepeatIntervalString“One time”, “Daily”, “Weekly”, etc.
-
StatusString“Enabled” or “Disabled”
Hover for details
Time & Scheduling
Combine Time + Date + RepeatInterval to schedule a one-off or recurring job. Set Status to “Disabled” to create a job without immediately running it.
Target & Script
-
HostStringTarget server or “(This Computer)”
-
RunStringScript, Runbook, or Installer
Hover for details
Target & Script
Host accepts a hostname, IP, or the special value “(This Computer)” to run locally. Run accepts any .ps1, .py, .runbook, or installer registered in ServerEngine.
Dynamic Parameters
-
xTest1StringCustom param passed directly to your script
-
xTest2StringAny additional custom parameters
-
xTest3…NStringUnlimited additional parameters supported
Hover for details
Dynamic Parameters
Any key prefixed with x (e.g. xTest1) is injected into your PowerShell script as a variable at runtime. Pass as many as you need — no limit.
API Usage Examples
# Define the username and password
$username = "admin" #user must be admin
$password = "cforce-it.com" #default password
$port = 5000 #default port
$time = Get-Date -Format "HH:mm" #time syntax for now
$date = Get-Date -Format "yyyy/MM/dd" #date syntax for today
# Encode the credentials
$pair = $username+":"+$password
$encodedCredentials = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair))
# Create the headers
$headers = @{
"Content-Type" = "application/json"
"Authorization" = "Basic $encodedCredentials"
}
# Create the body
$body = @{
Time = $time
Date = $date
RepeatInterval = "One time"
Host = "(This Computer)"
Run = "myscript.ps1"
Status = "Enabled"
xTest1 = "someText"
xTest2 = "verysomesome"
} | ConvertTo-Json
# Make the POST request
$response = Invoke-WebRequest -Uri http://localhost:$port/ -Method POST -Headers $headers -Body $body -UseBasicParsing
$response.Content
# Schedule a job using cURL with Basic Authentication
curl -u admin:cforce-it.com -X POST http://192.168.1.123:5000/ \
-H "Content-Type: application/json" \
-d '{
"Time": "12:01",
"Date": "2024/08/05",
"RepeatInterval": "One time",
"Host": "WIN-SRV-AUS.CForce-IT.network",
"Run": "ServerDeployment.runbook",
"Status": "Enabled",
"xTest1": "someText",
"xTest2": "verysomesome"
}'
# Alternative: Using base64 encoded credentials
curl -X POST http://192.168.1.123:5000/ \
-H "Content-Type: application/json" \
-H "Authorization: Basic YWRtaW46Y2ZvcmNlLWl0LmNvbQ==" \
-d '{
"Time": "14:30",
"Date": "2024/12/25",
"RepeatInterval": "Daily",
"Host": "(This Computer)",
"Run": "DailyBackup.ps1",
"Status": "Enabled",
"xBackupPath": "C:\\Backup",
"xRetentionDays": "30"
}'
import requests
import base64
from datetime import datetime
username = "admin"
password = "cforce-it.com"
host = "localhost"
port = 5000
url = f"http://{host}:{port}/"
credentials = f"{username}:{password}"
encoded_credentials = base64.b64encode(credentials.encode()).decode()
headers = {
"Content-Type": "application/json",
"Authorization": f"Basic {encoded_credentials}"
}
payload = {
"Time": datetime.now().strftime("%H:%M"),
"Date": datetime.now().strftime("%Y/%m/%d"),
"RepeatInterval": "One time",
"Host": "(This Computer)",
"Run": "automation_script.ps1",
"Status": "Enabled",
"xParameter1": "value1",
"xParameter2": "value2"
}
response = requests.post(url, headers=headers, json=payload)
if response.status_code == 200:
print("Job scheduled successfully!")
print("Response:", response.json())
else:
print(f"Error: {response.status_code}")
print(response.text)
const scheduleServerEngineJob = async () => {
const username = 'admin';
const password = 'cforce-it.com';
const host = 'localhost';
const port = 5000;
const url = `http://${host}:${port}/`;
const encodedCredentials = btoa(`${username}:${password}`);
const now = new Date();
const time = now.toTimeString().slice(0, 5);
const date = `${now.getFullYear()}/${String(now.getMonth()+1).padStart(2,'0')}/${String(now.getDate()).padStart(2,'0')}`;
const payload = {
Time: time, Date: date,
RepeatInterval: "One time",
Host: "(This Computer)",
Run: "webhook_triggered.ps1",
Status: "Enabled",
xWebhookData: "received from API",
xTimestamp: now.toISOString()
};
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Basic ${encodedCredentials}`
},
body: JSON.stringify(payload)
});
if (response.ok) {
const result = await response.json();
console.log('Job scheduled!', result);
return result;
} else {
throw new Error(`HTTP ${response.status}`);
}
};
scheduleServerEngineJob()
.then(r => console.log('Success:', r))
.catch(e => console.error('Failed:', e));
Common Integration Scenarios
Multi-VM Provisioning
Automate Windows VM configuration by using the VMware PowerCLI module from a ServerEngine-runbook triggered via API.
Multi-VM Provisioning
Trigger a PowerCLI runbook via the API to spin up, configure, and validate multiple Windows VMs in a single automated flow.
VM Lifecycle Health
Automate health checks & remediate issues (e.g., restart services, clear logs) on VMware Windows VMs via scheduled ServerEngine jobs.
VM Lifecycle Health
Schedule recurring health-check runbooks that automatically restart failed services or clear stale logs — no manual intervention required.
Automate Microsoft 365
Manage M365 via the Microsoft Graph PowerShell SDK from a ServerEngine script scheduled to run nightly.
Automate Microsoft 365
Nightly Graph API scripts handle user provisioning, license assignment, and mailbox settings automatically across your entire M365 tenant.
Azure Virtual Machine
Enforce baseline security on Azure Windows VMs using the Azure PowerShell module from a ServerEngine runbook.
Azure Virtual Machine
Check configurations, apply hardening scripts, and report deviations against your security baseline across all Azure Windows VMs.
Windows Server Security
Continuously enforce security benchmarks (CIS or Microsoft Security Baselines) across your entire Windows Server estate.
Windows Server Security
Scheduled and event-triggered runbooks keep every server aligned to CIS or Microsoft baselines, with automatic remediation on drift detection.
Automated AWS EC2
Centralize Windows patching for AWS and on-premises with a unified webhook-triggered workflow.
Automated AWS EC2
AWS Systems Manager patches EC2 instances; on completion its webhook triggers the ServerEngine API to patch on-premises servers in the same pipeline.
Google Workspace
Sync user lifecycle from on-prem AD to Google Workspace via the Admin SDK, fully automated.
Google Workspace
A ServerEngine script monitors AD for changes and automatically creates, updates, or suspends Google Workspace accounts to stay in sync.
CI/CD Pipeline for .NET
Automate final-stage deployment to Windows servers triggered by Jenkins or GitLab via the ServerEngine API.
CI/CD Pipeline for .NET
Jenkins or GitLab calls the ServerEngine API with the build artifact name and target servers — deployment runs automatically with full log capture.
Automated Remediation
Create “self-healing” actions — monitoring alerts trigger the ServerEngine API to run remediation scripts automatically.
Automated Remediation
OpManager or any monitoring tool sends a webhook; a bridge script interprets it and calls the ServerEngine API to remediate the affected server instantly.