Skip to content

Deployment webhooks

Trigger Smoketest tests from CI, deployment hooks, and custom infrastructure.

View as Markdown

Deployment webhooks are incoming URLs that queue Smoketest runs after your app deploys. A webhook can target one test or every current test with a project tag.

Create a webhook

  1. Open Project → Automations.
  2. Create a webhook and choose a test or tag target.
  3. Optionally bind a mapped GitHub repository so calls with commitSha create a GitHub check.
  4. Copy the trigger URL. The full secret URL is only shown when the webhook is created or regenerated.

The URL has this shape:

Text
https://api.smoketest.sh/v1/deployment-webhooks/<webhookId>/<secret>

Trigger parameters

Call the trigger URL with POST. The simplest form uses query parameters and no request body:

Shell
curl -sf -X POST -G "$SMOKETEST_DEPLOYMENT_WEBHOOK_URL" \
  --data-urlencode "targetUrl=https://preview.example.com" \
  --data-urlencode "commitSha=abc123" \
  --data-urlencode "branch=main" \
  --data-urlencode "externalId=deploy-123"

All parameters are optional.

ParameterTypeDescription
targetUrlstringRun-only URL override. Use this for preview or staging deployments without changing the saved test URL.
commitShastringCommit SHA for GitHub check creation when the webhook is bound to a mapped repository.
branchstringBranch name shown on the GitHub check.
baseBranchstringBase branch metadata for GitHub check details.
prNumbernumberPull request number metadata for GitHub check details.
externalIdstringIdempotency key for CI systems that retry webhook calls.

You can also send the same fields as a JSON body for existing integrations. Query parameters win when both query and JSON body values are provided. Unknown JSON fields are ignored, including environment; deployment webhooks do not select Smoketest variable environments in v1.

Response

JSON
{
  "received": true,
  "status": "queued",
  "deliveryId": "018f1111-abcd-7000-8000-abc123456789",
  "count": 2,
  "runIds": [
    "018f2222-abcd-7000-8000-abc123456789",
    "018f3333-abcd-7000-8000-abc123456789"
  ],
  "checkId": "018f4444-abcd-7000-8000-abc123456789",
  "links": {
    "dashboardIntegrations": "https://smoketest.sh/dashboard/run-triggers",
    "runs": [
      "https://smoketest.sh/runs/018f2222-abcd-7000-8000-abc123456789"
    ],
    "check": "https://smoketest.sh/github/checks/018f4444-abcd-7000-8000-abc123456789"
  }
}

Statuses:

StatusMeaning
queuedOne or more runs were queued.
emptyThe webhook targeted a tag with no current tests.
processingA duplicate idempotent request found a delivery that is still processing.
errorThe delivery failed before queueing runs.

CI examples

GitHub Actions

.github/workflows/smoketest.yml
name: Smoketest

on:
  deployment_status:

jobs:
  smoketest:
    if: github.event.deployment_status.state == 'success'
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Smoketest
        run: |
          curl -sf -X POST -G "$SMOKETEST_DEPLOYMENT_WEBHOOK_URL" \
            -H "Idempotency-Key: ${{ github.event.deployment.id }}" \
            --data-urlencode "targetUrl=${{ github.event.deployment_status.environment_url }}" \
            --data-urlencode "commitSha=${{ github.sha }}" \
            --data-urlencode "branch=${{ github.ref_name }}" \
            --data-urlencode "externalId=${{ github.event.deployment.id }}"
        env:
          SMOKETEST_DEPLOYMENT_WEBHOOK_URL: ${{ secrets.SMOKETEST_DEPLOYMENT_WEBHOOK_URL }}

GitLab CI

.gitlab-ci.yml
smoketest:
  stage: test
  script:
    - |
      curl -sf -X POST -G "$SMOKETEST_DEPLOYMENT_WEBHOOK_URL" \
        -H "Idempotency-Key: $CI_PIPELINE_ID" \
        --data-urlencode "targetUrl=$CI_ENVIRONMENT_URL" \
        --data-urlencode "commitSha=$CI_COMMIT_SHA" \
        --data-urlencode "branch=$CI_COMMIT_REF_NAME" \
        --data-urlencode "externalId=$CI_PIPELINE_ID"

Jenkins or shell

Shell
curl -sf -X POST -G "$SMOKETEST_DEPLOYMENT_WEBHOOK_URL" \
  -H "Idempotency-Key: ${BUILD_TAG}" \
  --data-urlencode "targetUrl=${DEPLOYMENT_URL}" \
  --data-urlencode "commitSha=${GIT_COMMIT}" \
  --data-urlencode "branch=${BRANCH_NAME}" \
  --data-urlencode "externalId=${BUILD_TAG}"

CI and pipeline guides

Use these when your pipeline knows the deployment URL, commit SHA, branch, and retry identity.

Deployment platform guides

Use native platform webhooks for basic fixed-URL testing. Use the CI path when you need dynamic preview URLs, idempotency, or GitHub checks.

GitHub checks

To create GitHub checks from deployment webhooks:

  1. Install the Smoketest GitHub App.
  2. Map the repository to the same project as the webhook.
  3. Select that repository in the webhook form.
  4. Send commitSha as a query parameter or JSON body field.

Smoketest creates one aggregate check named Smoketest / <webhook name>, links queued runs, and finishes the check when all linked runs reach a terminal state.

Idempotency

Use either the Idempotency-Key header or externalId query parameter or JSON body field. If more than one is provided, the header wins. Duplicate calls with the same key return the original delivery and do not queue more runs.

Troubleshooting

ResponseCause
401The webhook ID or secret is invalid.
403The webhook is disabled.
400The JSON body is malformed or a supported field has an invalid type or empty value.
422targetUrl is not an absolute http or https URL, billing blocks enqueueing, or the target cannot run.

On this page