Skip to content

article

Creating and Testing Webhooks

How to register a webhook for repository events, send a test delivery, and manage webhook status in the StretchDev API console.

Overview

Webhooks let StretchDev notify an external system when something happens — for example, when a repository is pushed to. You register a subscription with a target URL and a list of events, then StretchDev delivers a signed payload to that URL as events occur. This article covers creating, testing, and managing webhooks.

Create a webhook

1. Open the API console and go to Webhooks.
2. Click New webhook.

3. Fill in:

- Name (required) — a label like CI trigger or Slack notifier.

- Target URL (required) — the HTTPS endpoint StretchDev will POST to.

- Events — which events to subscribe to. The default is repo.push; add others as your workflow needs.

- Secret hint (optional) — a reminder of the signing secret your receiver uses to verify payloads.

- Statusactive, paused, or disabled.

4. Click Create. The webhook appears in the list with a generated ID and a delivery count.

Send a test delivery

Before relying on a webhook, confirm your endpoint receives it:

  1. Find the webhook in the Webhooks list.
  2. Click Test.
  3. StretchDev sends a test event (a dev.ping) to your target URL and records the attempt in the delivery log with its response status and duration.
  4. Open Deliveries to confirm the test arrived and your endpoint returned a success status.

Manage a webhook

  • Edit the name, target URL, events, secret hint, or status at any time.
  • Pause a webhook (paused) to stop deliveries temporarily without deleting it.
  • Disable (disabled) to keep the record but stop it firing.
  • Delete to remove the subscription and its delivery history.

Each webhook in the list shows its total delivery count and the time of its most recent delivery, so you can see at a glance whether it's active and healthy.

Example

You want your CI to kick off a StretchDev scan whenever code lands on main. You create a webhook named CI scan trigger, target URL https://ci.example.com/hooks/stretchdev, event repo.push, and a secret hint of see CI vault. You click Test, then open Deliveries and confirm a dev.ping arrived with a 200 response in 84 ms. With the endpoint verified, real repo.push events now trigger your pipeline reliably.

Tips

  • Always Test a new webhook and check Deliveries before depending on it.
  • Use HTTPS target URLs and verify the signature on your receiver using your signing secret — the secret hint is just a reminder of which secret to use, not the secret itself.
  • Subscribe to only the events you handle to keep delivery volume and noise down.
  • Have your receiver return a 2xx quickly and do heavy work asynchronously, so deliveries record as successful.

Troubleshooting

  • "A webhook name is required" / "A target URL is required." Both fields are mandatory — fill them in.
  • The test delivery shows a non-2xx response. Your endpoint rejected or errored on the payload; check its logs and that the URL is reachable and returns success quickly.
  • "Webhook subscription not found." The webhook ID isn't in your organization; confirm the workspace and that it wasn't deleted.
  • No deliveries are arriving for real events. Confirm the webhook is active (not paused/disabled) and subscribed to the right event, and re-run Test to isolate endpoint versus subscription problems.

Was this helpful?

Help us improve this article

Use these controls to share whether this answer solved the issue. Feedback helps prioritize updates to StretchSuite Support.