Skip to main content

create_load_test

Create a load test — a feature of kind load, the same object the app's Load section authors. A load test runs in one of two modes:

  • Simple — replays your functional feature journeys as concurrent browser users. Pass the feature ids to replay (featureIds); it becomes runnable (status generated) as soon as it has at least one journey.
  • Advanced — drives protocol-level k6 traffic against URL paths (paths). Its k6 script is built immediately, so it is runnable right away.

Omit mode and it is inferred: simple when featureIds are supplied, otherwise advanced. With no configuration fields at all, the server creates a simple-mode draft with no journeys you can refine later with update_load_test.

info

The REST body carries the canonical config document under config (the exact shape the app stores). The CLI and MCP tool expose the common knobs as flat arguments and assemble that document for you. The CLI/MCP wrappers use vus + rampUpSeconds + durationSeconds; REST also accepts stages: [{durationSeconds, target}] for multi-stage ramps.

Request​

POST /api/v1/ops/projects/{project}/load
ParameterInTypeRequiredDescription
projectpathstringyesThe project's public id.
namebodystringno (REST)Display name; REST defaults a blank name to New load test. Required by MCP/CLI.
configbodyobjectnoCanonical LoadConfig document (see below). Omit for the default.

config document​

FieldTypeApplies toDescription
modestringboth"simple" or "advanced". Omit to infer from features.
targetUrlstringbothSaved target URL; when set it takes precedence over run siteUrl, then the project URL.
featuresarraysimpleJourneys to replay: [{ "id": 7, "name": "" }].
repeatsPerUserintegersimpleHow many times each concurrent user repeats the journeys (default 3).
vusintegerbothConcurrent browser users / protocol virtual users. Parsed values have a minimum of 1; dispatch is subject to current plan caps.
durationSecondsintegeradvancedSteady-load duration.
rampUpSecondsintegeradvancedSeconds to ramp up to vus.
thinkTimeSecondsnumberadvancedPause between requests.
pathsarrayadvancedURL paths to hit, e.g. ["/", "/pricing"].
thresholdsarraybothPass/fail gates: [{ "metric": "http_req_duration", "condition": "p(95)<1000" }].
curl -X POST -H "Authorization: Bearer $TESTVIBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Checkout under load",
"config": {
"mode": "advanced",
"paths": ["/", "/checkout"],
"vus": 50, "durationSeconds": 300, "rampUpSeconds": 30,
"thresholds": [{ "metric": "http_req_duration", "condition": "p(95)<1000" }]
}
}' \
"$TESTVIBE_SERVER/api/v1/ops/projects/$PROJECT/load"

Response​

201 Created

{ "featureId": 51, "name": "Checkout under load", "mode": "advanced", "status": "generated" }

A simple load test with no journeys yet comes back "status": "draft" — add journeys with update_load_test before running it. Dispatch with run_load_test.

Errors​

HTTPWhen
400 invalid_requestMalformed request input.
404 not_foundNo such project in this workspace.

REST also accepts configName for the simple-mode Playwright configuration and stages for advanced ramps. targetUrl stored on the load test takes precedence over a later run siteUrl; clear or update it if a different target is intended. Simple-mode threshold duration measures a whole feature replay, and request counts represent replays. Read current plan limits rather than assuming the config parser enforces a fixed user cap.