Bugabase API

Run your tests from anywhere

The Bugabase API lets your pipeline start the tests you built in Bugabase and read their results. Use it to block a merge when a test fails, re-test every deploy or check a preview link before it goes live.

Every request and response is JSON over HTTPS. Requests are authenticated with a workspace API key, and everything you can reach is limited to that workspace.

Base URL
https://bugabase.com/api/public/v1

Get started

Quickstart

  1. 1

    Create an API key

    In Bugabase open Integrations → API keys and create a key. Only owners and admins can do this. Copy it now; it's shown only once.

  2. 2

    Store it as a secret

    Save it in your CI as BUGABASE_API_KEY. Never put it in browser code or commit it.

  3. 3

    Start a run

    Send POST /runs with a website, test group or test ID. You get back a groupId straight away.

  4. 4

    Read the result

    Poll GET /runs?group=… until done is true, then check passed.

curl -X POST https://bugabase.com/api/public/v1/runs \
  -H "Authorization: Bearer $BUGABASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "websiteId": "YOUR_WEBSITE_ID", "source": "api" }'

Get started

Authentication

Send your key in the Authorization header on every request:

Authorization: Bearer trc_…

Keys start with trc_ followed by 48 characters. Bugabase stores only a fingerprint of each key, so a lost key can't be shown again; create a new one.

Managing keys

  • Each key belongs to one workspace and can only reach that workspace's tests and runs.
  • The API keys list shows when each key was last used.
  • Revoking a key stops it working on the next request.
  • Use a separate key per pipeline so you can revoke one without breaking the others.
Never call the API from a web page or mobile app. Anyone could read the key. Call it from CI, a server or a deploy hook.
Header
curl https://bugabase.com/api/public/v1/runs?group=GROUP_ID \
  -H "Authorization: Bearer $BUGABASE_API_KEY"
401 response
{ "error": "Missing or invalid API key." }

Get started

Core concepts

Website

An app you test. Runs only start on active websites.

Test

One user journey, such as signing up or checking out.

Test group

A named set of tests (called a suite in the API) you run together.

Run

One test on one device. A test on desktop and mobile is two runs.

Run group

All runs started by one API call, identified by groupId.

Device

desktop, tablet or mobile. Your plan decides which are available.

Run statuses

queuedWaiting for a free browser.
runningA browser is performing the steps right now.
passedEvery step and check succeeded.
failedYour app did not behave as expected. This counts toward issues and alerts.
errorThe test couldn't run (for example the page never loaded).
blockedSomething stopped Bugabase before it could test, such as bot protection. See the docs on hard-to-reach sites.
skippedNot run, for example because the device isn't in your plan.
cancelledStopped before finishing.
A run that passes only after an automatic retry is reported as passed with flaky: true. Tests Bugabase has quarantined for being unreliable are skipped when you run a whole website.

Endpoints

Start runs

POST/api/public/v1/runs

Queues runs for one test, a test group, or every test on a website. Returns immediately with 202 Accepted; tests then run in parallel up to your plan's limit.

Body

testIduuidone of required

Run a single test.

suiteIduuidone of required

Run every test in a test group.

websiteIduuidone of required

Run every test on a website. Quarantined (flaky) tests are skipped.

baseUrlurl

Run against a different address, such as a preview deploy. Must be a public URL (max 2,000 characters). Private and internal addresses are rejected.

devicesarray

Any of "desktop", "tablet", "mobile" (up to 3). Defaults to each test's own device settings, limited by your plan.

sourcestring

"api" (default), "deploy" or "ci". Shown on each run so you can tell where it came from.

Pass exactly one of testId, suiteId or websiteId. If you pass more than one, the first in that order wins.

Response

groupIduuid

Identifies this batch of runs. Use it to poll results.

statusstring

Always "queued" on success.

runsarray

One entry per test and device: id, test_id, device.

statusUrlurl

Ready-made GET address for the results of this group.

curl -X POST https://bugabase.com/api/public/v1/runs \
  -H "Authorization: Bearer $BUGABASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "websiteId": "YOUR_WEBSITE_ID", "source": "api" }'
Other bodies
# One test
-d '{ "testId": "TEST_ID" }'

# A test group on desktop and mobile
-d '{ "suiteId": "SUITE_ID", "devices": ["desktop", "mobile"] }'

# Everything on a website, against a preview deploy
-d '{ "websiteId": "WEBSITE_ID", "baseUrl": "https://pr-42.myapp.com", "source": "deploy" }'
202 Accepted
{
  "groupId": "6f1c2a9e-1b7d-4c3e-9a51-2f0d8e7b4c11",
  "status": "queued",
  "runs": [
    { "id": "b3e0…", "test_id": "a91d…", "device": "desktop" },
    { "id": "c71f…", "test_id": "a91d…", "device": "mobile" }
  ],
  "statusUrl": "https://bugabase.com/api/public/v1/runs?group=6f1c2a9e-…"
}

Endpoints

Get run results

GET/api/public/v1/runs?group={groupId}

Returns every run in a group and an overall verdict. Poll every 10–15 seconds until done is true, then use passed to pass or fail your pipeline.

Query

groupuuidrequired

The groupId returned when you started the runs.

Response

groupIduuid

The group you asked for.

doneboolean

true once no run is queued or running.

passedboolean

true only when done and every run passed.

runs[].iduuid

Run ID.

runs[].teststring

Test name.

runs[].devicestring

desktop, tablet or mobile.

runs[].statusstring

queued, running, passed, failed, error, blocked, skipped or cancelled.

runs[].flakyboolean

Passed only after a retry.

runs[].errorstring | null

Plain-language reason when a run did not pass.

runs[].reportUrlurl

Full report with screenshots for every step (requires sign-in).

curl "https://bugabase.com/api/public/v1/runs?group=GROUP_ID" \
  -H "Authorization: Bearer $BUGABASE_API_KEY"
200 OK
{
  "groupId": "6f1c2a9e-…",
  "done": true,
  "passed": false,
  "runs": [
    {
      "id": "b3e0…",
      "test": "Checkout with saved card",
      "device": "desktop",
      "status": "failed",
      "flaky": false,
      "error": "Expected to see \"Order confirmed\" but the page showed \"Payment declined\".",
      "reportUrl": "https://bugabase.com/app/run/b3e0…"
    }
  ]
}

Endpoints

Errors

Errors return a non-2xx status and a JSON body with a plain-language error message you can show as is.

400Bad request

Message: "Pass testId, suiteId or websiteId.", "Invalid JSON body.", "Pass ?group=<groupId>." or a URL safety message

Fix: Check the body is valid JSON with one target ID, and that baseUrl is a public https address.

401Unauthorized

Message: "Missing or invalid API key."

Fix: Send Authorization: Bearer trc_… with an active key. Revoked keys stop working immediately.

402Plan limit

Message: A plain explanation of the limit you reached

Fix: Wait for running tests to finish, activate the website, or upgrade your plan.

404Not found

Message: "Suite not found.", "No tests found." or "Run group not found."

Fix: IDs must belong to the same workspace as the API key. Copy them from the app.

Error body
{ "error": "Missing or invalid API key." }

Events

Outgoing webhooks

Bugabase can POST to your server whenever a test fails or can't run. Set the address under Integrations → Webhook and use Send test to check it.

run.failed payload

eventstring

"run.failed"

runIduuid

The run that did not pass.

teststring

Test name.

statusstring

"failed" or "error".

errorstring | null

Reason, up to 300 characters.

newIssueboolean

false when this repeats an issue that is already open.

The test button sends { "event": "test", "message": "Bugabase webhook test" }.

Delivery

  • Public https:// addresses only; private network addresses are refused.
  • Each event is sent once, with User-Agent: Bugabase-Webhook. Redirects are not followed.
  • Turn on Only new failures to skip repeats of an issue that's already open.
Reply with a 2xx quickly and do slow work afterwards. Treat the address as a secret, and ignore events you don't recognise so future event types don't break you.
run.failed
POST https://your-server.com/bugabase
User-Agent: Bugabase-Webhook
Content-Type: application/json

{
  "event": "run.failed",
  "runId": "b3e0…",
  "test": "Checkout with saved card",
  "status": "failed",
  "error": "Expected to see \"Order confirmed\"…",
  "newIssue": true
}
Receiver
// Express example
app.post("/bugabase", express.json(), (req, res) => {
  const e = req.body;
  if (e.event === "run.failed" && e.newIssue) {
    notifyOnCall(`${e.test}: ${e.error}`);
  }
  res.sendStatus(200); // reply quickly; do slow work afterwards
});

Recipes

GitHub Actions

Run a test group on every pull request and fail the check when any test fails. Add BUGABASE_API_KEY as a repository secret and BUGABASE_SUITE_ID as a variable.

Make the job a required status check in your branch rules to block merges until Bugabase passes. Each run's reportUrl is printed in the log.
bugabase.yml
# .github/workflows/bugabase.yml
name: Bugabase tests
on: [pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Start Bugabase tests
        id: start
        run: |
          RES=$(curl -sf -X POST https://bugabase.com/api/public/v1/runs \
            -H "Authorization: Bearer ${{ secrets.BUGABASE_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{ "suiteId": "${{ vars.BUGABASE_SUITE_ID }}", "source": "ci" }')
          echo "group=$(echo "$RES" | jq -r .groupId)" >> "$GITHUB_OUTPUT"

      - name: Wait for results
        run: |
          for i in $(seq 1 80); do
            BODY=$(curl -sf "https://bugabase.com/api/public/v1/runs?group=${{ steps.start.outputs.group }}" \
              -H "Authorization: Bearer ${{ secrets.BUGABASE_API_KEY }}")
            if [ "$(echo "$BODY" | jq -r .done)" = "true" ]; then
              echo "$BODY" | jq '.runs[] | {test, device, status, reportUrl}'
              [ "$(echo "$BODY" | jq -r .passed)" = "true" ] && exit 0 || exit 1
            fi
            sleep 15
          done
          echo "Timed out"; exit 1

Recipes

Vercel deploys

Vercel reports each finished deployment to GitHub. This workflow catches that event and tests the preview address using baseUrl, so every pull request is checked on its own preview.

If your previews are password-protected or behind bot protection, turn on the access key for that website in its Safety settings so Bugabase can get in.
bugabase-preview.yml
# .github/workflows/bugabase-preview.yml
# Runs after Vercel finishes a preview deployment.
name: Test Vercel preview
on: deployment_status

jobs:
  test:
    if: github.event.deployment_status.state == 'success'
    runs-on: ubuntu-latest
    steps:
      - run: |
          curl -sf -X POST https://bugabase.com/api/public/v1/runs \
            -H "Authorization: Bearer ${{ secrets.BUGABASE_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{
              "websiteId": "${{ vars.BUGABASE_WEBSITE_ID }}",
              "baseUrl": "${{ github.event.deployment_status.target_url }}",
              "source": "deploy"
            }'

Recipes

GitLab CI

Add BUGABASE_API_KEY (masked) and BUGABASE_SUITE_ID as CI/CD variables. The job fails when any test fails.

.gitlab-ci.yml
# .gitlab-ci.yml
bugabase:
  stage: test
  image: alpine:3
  before_script: [apk add --no-cache curl jq]
  script:
    - |
      GROUP=$(curl -sf -X POST https://bugabase.com/api/public/v1/runs \
        -H "Authorization: Bearer $BUGABASE_API_KEY" \
        -H "Content-Type: application/json" \
        -d "{\"suiteId\": \"$BUGABASE_SUITE_ID\", \"source\": \"ci\"}" | jq -r .groupId)
      for i in $(seq 1 80); do
        BODY=$(curl -sf "https://bugabase.com/api/public/v1/runs?group=$GROUP" -H "Authorization: Bearer $BUGABASE_API_KEY")
        [ "$(echo $BODY | jq -r .done)" = "true" ] && break
        sleep 15
      done
      [ "$(echo $BODY | jq -r .passed)" = "true" ]

Recipes

Shell script

A portable script for any CI or deploy hook. It needs curl and jq, and exits with 0 only when every test passes.

./bugabase.sh WEBSITE_ID https://staging.myapp.com

bugabase.sh
#!/usr/bin/env bash
# bugabase.sh <websiteId> [baseUrl]  —  exits 0 when every test passes
set -euo pipefail
API=https://bugabase.com/api/public/v1/runs
AUTH="Authorization: Bearer $BUGABASE_API_KEY"
DATA=$(jq -n --arg w "$1" --arg u "${2:-}" '{websiteId:$w, source:"deploy"} + (if $u != "" then {baseUrl:$u} else {} end)')

GROUP=$(curl -sf -X POST "$API" -H "$AUTH" -H "Content-Type: application/json" -d "$DATA" | jq -r .groupId)
echo "Started run group $GROUP"

until BODY=$(curl -sf "$API?group=$GROUP" -H "$AUTH") && [ "$(jq -r .done <<<"$BODY")" = true ]; do
  sleep 15
done
jq -r '.runs[] | "\(.status)\t\(.device)\t\(.test)"' <<<"$BODY"
[ "$(jq -r .passed <<<"$BODY")" = true ]

AI tools

Bugabase MCP

Connect AI coding tools like Claude, Cursor, VS Code and Lovable to Bugabase so they can check test health, read failures and start runs while they fix your code. The address is /mcp on this site.

The tool signs in as you and only gets your own access. Tools marked action change something and most AI tools ask you before using them.

get_healthPass rate, failing tests and open issues at a glance
list_websitesYour websites and how many tests each has
list_testsTests with their latest result
list_issuesOpen issues grouped by root cause
get_issueFull issue detail with Cade's diagnosis
get_failed_testsRegressions with expected vs actual and steps
get_run_resultsProgress and results of a run
discover_projectCoverage and discovery status for a website
get_explore_statusProgress and key flows of an Explore run
start_exploreLet Cade explore an active websiteaction
create_test_suiteCreate a test groupaction
run_suiteRun a test group nowaction
verify_deploymentRe-test after publishing a fixaction
Claude Code
claude mcp add --transport http bugabase https://bugabase.com/mcp
Cursor / VS Code
// .cursor/mcp.json  (or VS Code: .vscode/mcp.json under "servers")
{
  "mcpServers": {
    "bugabase": { "url": "https://bugabase.com/mcp" }
  }
}

Reference

Limits & good practice

  • Concurrency: runs beyond your plan's concurrent test limit wait in the queue; the API never runs more at once than your plan allows.
  • Active websites: runs only start on websites that are active on your plan.
  • Devices: devices outside your plan are skipped rather than failing the call.
  • Public addresses: baseUrl and webhook addresses must be public; internal and private network addresses are rejected.
  • Retries: every POST creates a new run group. If your pipeline retries, reuse the first groupId.
  • Timeouts: give up polling after about 20 minutes and link to the report.

Reference

FAQ & troubleshooting

Where do I find test, test group and website IDs?

Open the item in the app; the ID is the last part of the page address (for example /app/tests/<id>).

How often should I poll for results?

Every 10–15 seconds is plenty. Most tests finish in one to three minutes; stop after around 20 minutes.

Can I run against a preview or staging deploy?

Yes. Pass baseUrl with the preview address. Steps that visit your site use that address instead of the saved one.

Why did I get 402?

Runs count toward your plan's concurrent test limit, and runs only start on active websites. The message says which limit applied.

Is calling POST /runs twice safe?

Each call creates a new run group. If your pipeline retries, keep the first groupId and poll it rather than starting again.

Can I call the API from browser code?

No. Your API key would be visible to anyone. Call it from CI, a server or a deploy hook.

My run says blocked. What now?

Bot protection or a password wall stopped the browser. Follow the hard-to-reach sites guide in the documentation to let Bugabase through.

Do flaky tests fail my pipeline?

A run that passes on retry is reported as passed with flaky: true. Tests Bugabase has quarantined are skipped when you run a whole website.

Reference

Changelog

v1Start runs for a test, test group or website; poll results by group; run.failed webhooks; Bugabase MCP for AI tools.