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 load test starts from a small-steady-load default 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. Custom multi-stage ramps stay in-app — use vus + rampUpSeconds + durationSeconds here.

Request

POST /api/v1/ops/projects/{project}/load
ParameterInTypeRequiredDescription
projectpathstringyesThe project's public id.
namebodystringyesDisplay name for the load test.
configbodyobjectnoCanonical LoadConfig document (see below). Omit for the default.

config document

FieldTypeApplies toDescription
modestringboth"simple" or "advanced". Omit to infer from features.
targetUrlstringbothTarget URL. Defaults to the project base URL at run time.
featuresarraysimpleJourneys to replay: [{ "id": 7, "name": "" }].
repeatsPerUserintegersimpleHow many times each concurrent user repeats the journeys (default 3).
vusintegerbothConcurrent users (simple, 1–100) / virtual users (advanced).
durationSecondsintegeradvancedSteady-load duration.
rampUpSecondsintegeradvancedSeconds to ramp up to vus.
thinkTimeSecondsnumberadvancedPause between requests.
pathsarrayadvancedURL paths to hit, e.g. ["/", "/pricing"].
thresholdsarrayadvancedPass/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_requestMissing name.
404 not_foundNo such project in this workspace.