Skip to main content
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Runs endpoints

API endpoints to trigger, monitor, and stop load tests in BrowserStack Load Testing.

Each run has a unique identifier that you use to query its status and retrieve results.

Trigger a load test run

POST /api/v1/runs

Trigger a saved load test and get back a run ID and status URLs. This is asynchronous. The API returns immediately with a 202 and a run_id, and the test starts provisioning in the background.

Request parameters

Request

curl -u $BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY -X POST \
  https://load-api.browserstack.com/api/v1/runs \
  -H "Content-Type: application/json" \
  -d '{
    "project_name": "my-project",
    "test_name": "checkout-flow",
    "test_version": "1.0"
  }'
  • project_name* String

    Exact name of your Load Testing project.

  • test_name* String

    Exact name of the saved test within the project.

  • test_version String

    Version of the test to run. If omitted, runs the latest version.

Response attributes 202 Accepted JSON

The response includes relative endpoint paths. Prepend https://load-api.browserstack.com to construct the full URLs.

Response

{
  "run_id": "run-abc123",
  "status_url": "/api/v1/runs/run-abc123/status",
  "report_url": "/api/v1/runs/run-abc123/report",
  "stop_url": "/api/v1/runs/run-abc123/stop"
}
  • run_id String

    Unique identifier for the triggered run.

  • status_url String

    Relative URL to poll the run status.

  • report_url String

    Relative URL to fetch the run report once complete.

  • stop_url String

    Relative URL to stop the run.

Poll run status

GET /api/v1/runs/{run_id}/status

Poll every 5 to 10 seconds. The status updates as the test provisions, runs, and is analyzed.

Request parameters

Request

curl -u $BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY \
  https://load-api.browserstack.com/api/v1/runs/{run_id}/status
  • run_id* String

    The run ID returned from the trigger endpoint.

Response attributes 200 OK JSON

Response

{
  "run_id": "run-abc123",
  "state": "running",
  "terminal_reason": null,
  "report_ready": false,
  "started_at": "2026-08-28T14:32:10Z",
  "completed_at": null,
  "duration_seconds": 125
}
  • run_id String

    The run ID you provided in the trigger request.

  • state String

    Current stage of the run. Values are queued, provisioning, running, completed, aborted, or failed.

  • terminal_reason String or null

    Reason the run reached a terminal state (e.g., completed, user_stopped, quota_exceeded, provisioning_timeout, script_error, infra_failure). Null while state is queued, provisioning, or running.

  • report_ready Boolean

    Whether the report is ready to fetch. Always true when state is completed.

  • started_at ISO 8601

    When the test started running.

  • completed_at ISO 8601 or null

    When the run finished. Null if not yet complete.

  • duration_seconds Number

    Elapsed time since start.

State values

The state field shows where the run is in its lifecycle:

State Meaning
queued Run is waiting to start. Infrastructure is being provisioned.
provisioning Test infrastructure is warming up. This can take 30 to 60 seconds depending on the load profile.
running Load test is actively running.
completed Test finished successfully. Fetch the report to see results and sla_verdict.
failed Test ended due to an error. See terminal_reason for details.
aborted Test was stopped via the /stop endpoint before completion.

Terminal reasons

When a run reaches a terminal state, terminal_reason explains how it ended:

Reason State Meaning
completed completed Test ran to completion and evaluation finished. Fetch the report to see results and sla_verdict.
user_stopped aborted You called the /stop endpoint to stop the test. The report may be partially complete.
quota_exceeded failed Insufficient quota remaining for this run. Contact support to increase quota.
provisioning_timeout failed Test infrastructure failed to provision within the time limit. This is rare. Contact support if it persists.
script_error failed The test script had a runtime error and could not proceed.
infra_failure failed Test infrastructure encountered an unexpected error. Contact support.

Fetch run report

GET /api/v1/runs/{run_id}/report

Fetch the full test report once the run is complete. Reports include KPIs, thresholds, and an SLA verdict. The endpoint returns 202 (Not Yet Ready) while the run is still in progress or computing the report.

Request parameters

Request

curl -u $BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY \
  https://load-api.browserstack.com/api/v1/runs/{run_id}/report
  • run_id* String

    The run ID returned from the trigger endpoint.

Response attributes 200 OK JSON

Response

{
  "run_id": "run-abc123",
  "summary": {
    "duration": 300,
    "users": 100,
    "requests": 50000,
    "errors": 234,
    "error_rate": 0.0047,
    "p95_latency_ms": 2145,
    "p99_latency_ms": 4321
  },
  "thresholds": [
    {
      "name": "error_rate",
      "expected": "< 0.01",
      "actual": 0.0047,
      "passed": true
    },
    {
      "name": "p95_latency",
      "expected": "< 2000",
      "actual": 1850,
      "passed": true
    }
  ],
  "sla_verdict": "passed",
  "report_url": "https://app.browserstack.com/load-testing/reports/run-abc123"
}
  • run_id String

    The run ID.

  • summary Object

    Key performance indicators from the test run.

  • summary.duration Number

    Test duration in seconds.

  • summary.users Number

    Peak concurrent users during the test.

  • summary.requests Number

    Total requests sent.

  • summary.errors Number

    Total failed requests.

  • summary.error_rate Number

    Decimal error rate (e.g., 0.0047 = 0.47%).

  • summary.p95_latency_ms Number

    95th-percentile latency in milliseconds.

  • summary.p99_latency_ms Number

    99th-percentile latency in milliseconds.

  • thresholds Array

    Threshold checks from test configuration. Each entry shows expected vs actual and pass/fail status.

  • sla_verdict String

    Test verdict against configured thresholds. Values are passed (all thresholds met), failed (one or more thresholds not met), not_evaluated (no thresholds configured or evaluator did not complete), or aborted (run was stopped before completion).

  • report_url String

    Deep link to the full HTML report in the Load Testing dashboard.

SLA verdict values

The sla_verdict field in the report indicates the overall test outcome:

Verdict Meaning
passed All configured thresholds were met.
failed One or more thresholds were not met.
not_evaluated No thresholds were configured, or the evaluator did not complete. The test may have produced load successfully, but no verdict is available.
aborted The run was stopped before evaluation could complete.

Stop a run

POST /api/v1/runs/{run_id}/stop

Stop a running test. This is idempotent. Calling it multiple times with the same run ID has the same effect as calling it once.

Request parameters

Request

curl -u $BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY -X POST \
  https://load-api.browserstack.com/api/v1/runs/{run_id}/stop
  • run_id* String

    The run ID returned from the trigger endpoint.

Response attributes 200 OK JSON

Response

{
  "run_id": "run-abc123",
  "state": "aborted",
  "terminal_reason": "user_stopped"
}
  • run_id String

    The run ID.

  • state String

    Current state of the run (will be aborted).

  • terminal_reason String

    Reason for terminal state (will be user_stopped).

Common workflows

The following examples show how to use the Runs API to automate common tasks.

Trigger a test and wait for the report

This bash script triggers a test, polls for completion, and fetches the report:

#!/bin/bash

BROWSERSTACK_USERNAME="..."
BROWSERSTACK_ACCESS_KEY="..."

# 1. Trigger the run
response=$(curl -s -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X POST \
  https://load-api.browserstack.com/api/v1/runs \
  -H "Content-Type: application/json" \
  -d '{
    "project_name": "my-project",
    "test_name": "checkout-flow"
  }')

run_id=$(echo "$response" | jq -r '.run_id')
echo "Run triggered: $run_id"

# 2. Poll status until complete
while true; do
  status=$(curl -s -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
    https://load-api.browserstack.com/api/v1/runs/"$run_id"/status)

  state=$(echo "$status" | jq -r '.state')
  report_ready=$(echo "$status" | jq -r '.report_ready')

  if [[ "$state" == "completed" ]] && [[ "$report_ready" == "true" ]]; then
    echo "Test complete"
    break
  fi

  echo "State: $state | Report ready: $report_ready"
  sleep 10
done

# 3. Fetch the report
report=$(curl -s -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
  https://load-api.browserstack.com/api/v1/runs/"$run_id"/report)

echo "SLA verdict: $(echo "$report" | jq -r '.sla_verdict')"
echo "Full report: $(echo "$report" | jq -r '.report_url')"

Errors

When the API returns an error, the response body contains details:

{
  "error": "Project not found",
  "message": "No project named 'typo-project' exists in your account"
}
Error Likely cause Fix
Project not found Project name doesn’t match (case-sensitive). Check the exact project name in your dashboard.
Test not found Test name doesn’t match or test is in a different project. Verify the test name in the Tests tab.
Invalid credentials Username or Access Key is wrong. Regenerate your Access Key in Settings > API Access.
Rate limit exceeded Too many requests in a short time. Implement exponential backoff and retry.
API namespace is disabled The feature flag is off for your account. Contact support to enable the public API.

Troubleshooting

Refer to these common issues and solutions when working with the Runs API.

Status returns provisioning for a long time

Test infrastructure is warming up. This is expected and can take 30 to 60 seconds depending on the load profile. Once state becomes running, the load test has started.

Report returns 503

The backend reporting service is temporarily unavailable. Retry in 10 to 30 seconds. If 503 persists, contact support.

Report shows sla_verdict: not_evaluated

This means either:

  • No thresholds were configured for the test. All requests succeeded and completed, but there are no pass/fail criteria. Add thresholds to your test configuration to enable SLA evaluation.
  • The evaluator did not complete before the run ended. Check that the test ran to completion (state is completed, not failed or aborted).

Stop endpoint returns 200 but status still shows running

State transitions are asynchronous. Retry the status endpoint in 2 to 5 seconds. The run will transition to aborted shortly.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Download Copy Check Circle