Skip to content

perf-monitor API

Base URL: http://your-host:8000/api

All endpoints require authentication via API key header: X-API-Key: your-key


GET /api/monitors

Response:

[
{
"id": "monitor-uuid",
"name": "Login flow",
"tool": "k6",
"schedule": "*/15 * * * *",
"enabled": true,
"thresholds": {
"latencyMs": 2000,
"errorRatePercent": 5.0,
"apdexMin": 0.7
},
"lastRun": "2026-03-29T08:15:00Z",
"lastStatus": "pass"
}
]
POST /api/monitors
Content-Type: multipart/form-data
name=Login flow
schedule=*/15 * * * *
tool=k6
thresholds[latencyMs]=2000
thresholds[errorRatePercent]=5.0
parameters[TARGET_HOST]=https://api.example.com
script=@load-test.js (file upload)

Or JSON (script content as base64):

{
"name": "Login flow",
"schedule": "*/15 * * * *",
"tool": "k6",
"scriptContent": "base64-encoded-script",
"thresholds": {
"latencyMs": 2000,
"errorRatePercent": 5.0
},
"parameters": {
"TARGET_HOST": "https://api.example.com"
}
}
GET /api/monitors/{monitorId}
PATCH /api/monitors/{monitorId}
Content-Type: application/json
{
"schedule": "*/5 * * * *",
"enabled": false
}
DELETE /api/monitors/{monitorId}
POST /api/monitors/{monitorId}/run

Returns {"runId": "uuid", "status": "queued"} immediately. The run executes asynchronously.


GET /api/monitors/{monitorId}/runs?limit=20&offset=0
GET /api/runs/{runId}

Response:

{
"id": "run-uuid",
"monitorId": "monitor-uuid",
"startedAt": "2026-03-29T08:15:00Z",
"completedAt": "2026-03-29T08:16:02Z",
"status": "pass",
"tool": "k6",
"metrics": {
"p50": 142, "p95": 387, "avg": 158,
"errorRate": 0.001,
"throughput": 12.4
},
"thresholdBreaches": [],
"agentId": "default"
}
GET /api/runs/{runId}/logs

Returns raw execution output from the test tool.


GET /api/alerts?monitorId={uuid}&limit=50
POST /api/alerts/{alertId}/acknowledge
Content-Type: application/json
{
"note": "Investigating — known deployment in progress"
}

GET /api/agents

Response:

[
{
"id": "eu-west-1",
"name": "EU West Agent",
"status": "online",
"lastHeartbeat": "2026-03-29T08:14:55Z",
"location": "eu-west-1"
}
]
GET /api/agents/{agentId}/metrics

GET /api/settings/license

Response:

{
"tier": "professional",
"monitorLimit": 50,
"monitorsUsed": 12,
"validUntil": "2027-01-15T00:00:00Z"
}
POST /api/settings/license
Content-Type: application/json
{
"licenseKey": "your-new-key"
}

StatusMeaning
400Invalid request
401Missing or invalid API key
403License limit reached (e.g., monitor count exceeded)
404Monitor or run not found
409Schedule conflict
429Rate limit
500Internal error