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 (statusgenerated) 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.
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
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
project | path | string | yes | The project's public id. |
name | body | string | yes | Display name for the load test. |
config | body | object | no | Canonical LoadConfig document (see below). Omit for the default. |
config document
| Field | Type | Applies to | Description |
|---|---|---|---|
mode | string | both | "simple" or "advanced". Omit to infer from features. |
targetUrl | string | both | Target URL. Defaults to the project base URL at run time. |
features | array | simple | Journeys to replay: [{ "id": 7, "name": "" }]. |
repeatsPerUser | integer | simple | How many times each concurrent user repeats the journeys (default 3). |
vus | integer | both | Concurrent users (simple, 1–100) / virtual users (advanced). |
durationSeconds | integer | advanced | Steady-load duration. |
rampUpSeconds | integer | advanced | Seconds to ramp up to vus. |
thinkTimeSeconds | number | advanced | Pause between requests. |
paths | array | advanced | URL paths to hit, e.g. ["/", "/pricing"]. |
thresholds | array | advanced | Pass/fail gates: [{ "metric": "http_req_duration", "condition": "p(95)<1000" }]. |
- cURL
- CLI
- MCP
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"
# Simple mode — replay two functional features as 30 concurrent users
testvibe load create --name "Checkout under load" --features 7,8 --vus 30 --repeats 5
# Advanced mode — protocol k6 against paths, with a latency gate
testvibe load create --name "API soak" --mode advanced \
--paths /,/pricing --vus 50 --duration 300 --ramp 30 \
--thresholds "http_req_duration:p(95)<1000,http_req_failed:rate<0.01"
Tool create_load_test — { "name": "API soak", "mode": "advanced", "paths": ["/", "/pricing"], "vus": 50, "durationSeconds": 300, "thresholds": ["http_req_duration:p(95)<1000"] }.
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
| HTTP | When |
|---|---|
400 invalid_request | Missing name. |
404 not_found | No such project in this workspace. |