Skip to main content
Note: If you have the QA Wolf GitHub integration enabled for your preview testing, GitHub will notify us of PRs being merged or closed, and we use that notification to stop runs and trigger flow promotion. In this case, it is typically redundant and unnecessary to call this.
We highly recommend using our JavaScript SDK notifyTerminatedEphemeralEnvironment function directly. See @qawolf/ci-sdk

Post to /api/webhooks/environment_terminated Webhook

HTTP Method: POST

Sample Query

Shell
curl -X POST -H "Authorization: Bearer <ApiKey>" \
     -H "Content-Type: application/json" \
     "https://app.qawolf.com/api/webhooks/environment_terminated" \
	     -d '{"deploymentUrl": "<DeploymentUrl>"}'
Go to https://app.qawolf.com/<team slug>/settings/integrationsOr, navigate via the UI:

Required Request Headers

Header NameHeader ValueDescription
AuthorizationBearer api_***Provide a string constructed by appending your team API Key to Bearer.
Content-Typeapplication/json

JSON-formatted Request Body

This POST request supports a JSON-formatted object with the below fields. All fields are optional.

Commonly Used Fields

FieldValueDescription
environmentIdEphemeral environment idID of the environment to terminate
environmentAliasEphemeral environment aliasAlias of the environment to terminate
deploymentUrlURLPreview URL for runs created with ephemeral_environment: true using Deploy Success Webhook

Response

200 Responses

The response will look like this:
TypeScript
{
  "results": [{
    "environmentId":"cl1f6i0in15676w115vt43vw2",
    "promotionTaskId":"ckzoog9wy01720xyrvl8ah7gu",
    "code": "terminated"
  }]
}

HTTP Status Error Codes

CodeDescription
401Missing or invalid credentials. Make sure you are using the Authorization: Bearer XXX with XXX the API token for your team.
403Forbidden. Usually indicates a disabled team. Contact support.
404Environment not found.
409Conflict. Environment is already terminated
500Internal server error. If the issue persists, contact support.
Last modified on February 9, 2026