CI/CD Webhooks
A webhook lets your pipeline start saved test cases after a deploy. Your pipeline sends one POST request to your webhook address; InsightJet answers at once and runs the tests in the background.
Set it up
Section titled “Set it up”-
Open Settings → Integrations → Webhook.
-
Enter the Primary URL to check (your app’s address) and, if you like, a Business context (
general,ecommerce,dashboardornews_platform). -
Click Create webhook. The page shows your Webhook URL:
https://insightjet.ai/api/webhooks/trigger/<your-token>The token is the last part of the address. There is no separate header: the address itself is the secret.
-
Store the full address as a secret in your CI platform (for example GitHub Actions secrets or GitLab CI variables).
Each person has one webhook. Only a team admin can create it, rotate its token or turn it off; other members see the address with the token hidden.
Choose what to run
Section titled “Choose what to run”Send one of these two bodies as JSON.
Run specific test cases by their ids:
curl -X POST "$INSIGHTJET_WEBHOOK_URL" \ -H "Content-Type: application/json" \ -d '{"testCaseIds": [101, 102, 103]}'Run every test case saved on one crawl. Both fields are needed:
curl -X POST "$INSIGHTJET_WEBHOOK_URL" \ -H "Content-Type: application/json" \ -d '{"runId": 123, "runAllForRun": true}'Only test cases from your own crawls run. A request with neither testCaseIds nor runId with runAllForRun: true is refused.
Optional fields
Section titled “Optional fields”| Field | What it does |
|---|---|
recordVideo | false turns off the video recording (on by default). |
url | The address to start from when a test does not name one. Defaults to the webhook’s primary URL. |
businessContext | Overrides the webhook’s business context for this call. |
timeoutMs | How long each test may take, in milliseconds. Default 180000 (3 minutes). |
Commit details
Section titled “Commit details”InsightJet records where a call came from with each test run. It reads GitHub’s and GitLab’s own webhook bodies when their event header is present. From any other caller it reads these body fields: repo, ref (for example refs/heads/main), commit or sha, user, and message.
When a GitHub or GitLab event header is sent, only these events start tests: push, pull request or merge request, release, tag push, workflow job and workflow run. Other events are answered with "accepted": false and nothing runs.
The answer
Section titled “The answer”A started call answers 202 with "accepted": true, a correlationId that ties the call’s runs together, and queuedRuns, the list of test runs it started.
| Answer | Meaning |
|---|---|
202 | Accepted. The tests run one after another in the background. |
400 | No tests named. Send testCaseIds, or runId with runAllForRun: true. |
403 | Not started: the account is out of agent-hours, all its agents are busy, or its owner is no longer in the webhook’s team. The body’s message says which. |
404 | The address is unknown or turned off, or no matching test cases were found. |
503 | Not started: InsightJet could not check hours, agents or team membership just then. Try again in a minute. |
Runs use the agent-hours of the team the webhook was created in.
Rotate or turn off the token
Section titled “Rotate or turn off the token”Open Settings → Keys → CI webhook token:
- Rotate makes a new token. The old address stops working at once, so update your CI secret.
- Turn off stops the webhook. To turn it on again, rotate the token.
Saving the Webhook page again with a webhook already in place also rotates the token; the page asks first.
Pipeline examples
Section titled “Pipeline examples”GitHub Actions
Section titled “GitHub Actions”- name: Run InsightJet tests run: | curl -X POST "${{ secrets.INSIGHTJET_WEBHOOK_URL }}" \ -H "Content-Type: application/json" \ -d '{"runId": 123, "runAllForRun": true, "commit": "${{ github.sha }}", "ref": "${{ github.ref }}"}'GitLab CI
Section titled “GitLab CI”insightjet-tests: stage: test script: - | curl -X POST "$INSIGHTJET_WEBHOOK_URL" \ -H "Content-Type: application/json" \ -d "{\"runId\": 123, \"runAllForRun\": true, \"commit\": \"$CI_COMMIT_SHA\"}"See the results
Section titled “See the results”Open Test Reports and set Source to CI Webhook. Each run is also listed in the run history of its test case.
For pull request tests that create a ticket and comment the result on the pull request, see GitHub pull request tests.