Local development
Receive Shortcut webhook events on your own computer while you build, through an HTTPS tunnel, and test them with test events and real changes.
After this page you can receive real, signed Shortcut events in a receiver running on your own computer, and test it end to end before you deploy.
Shortcut only sends events to a public https URL on port 443, and refuses localhost and private addresses (see Limits and URL rules). So while you build, put an HTTPS tunnel in front of your receiver: a service that gives you a public https address and forwards each request to a port on your computer. It takes about 10 minutes.
1. Run your receiver
Start a receiver on your computer, for example the Express server from Verify signatures, which listens on port 3000 and accepts events at /webhooks/shortcut. Set SHORTCUT_WEBHOOK_SECRET to any placeholder value for now, so the receiver starts and answers 400 to unsigned requests; you get the real secret in step 3.
2. Start a tunnel
Any tunnel that gives you a public https URL on the standard port works, such as ngrok or Cloudflare Tunnel:
ngrok http 3000
# or
cloudflared tunnel --url http://localhost:3000Each prints a public address such as https://quiet-meadow-4821.example-tunnel.dev. Keep the tunnel running while you test.
3. Create a development webhook
The commands below use $SHORTCUT_API for the base URL, as in Environments. If your company has a workspace on Shortcut's dev environment, use its address and a scut_dev_ token from that workspace:
export SHORTCUT_API="https://dev.shortcutco.com/api/platform/v1"Create a webhook pointed at the tunnel, with the events you are building for. Use a token with webhooks:manage and the read scope of each family, here leads:read:
Copy secret from the response into SHORTCUT_WEBHOOK_SECRET and restart your receiver. Note the webhook's id.
A company admin can create the same webhook in Settings → API & integrations instead.
4. Send a test event
Shortcut sends a signed webhook.test event at once and answers with the delivery, including what your receiver answered:
This one failed: the receiver refused the signature, so status is exhausted (test events are never retried) and lastResponseExcerpt shows the receiver's answer. Check the secret and that nothing parses the body before the verifier runs (When verification fails), then send another. When your receiver answers 2xx, status is succeeded.
lastError values such as unresolvable or connect_timeout mean the request never reached your receiver: check that the tunnel is still running and that the webhook's URL matches it. See Retries and monitoring for every value.
5. Make a real change
Now cause the event you subscribed to. Create a lead, in the app or with the API (this needs leads:write):
Within about a minute your receiver gets a lead.created event with the lead in data.object. Edit the lead in the app and a lead.updated follows. Dismiss the test lead when you are done.
6. Clean up
When the tunnel's address changes, as it does each time some tunnels restart, point the webhook at the new one with
PATCH /v1/webhooks/{id}and{ "url": "..." }. The new URL is checked like the first.When you stop for the day, pause the webhook (
"status": "paused") so events wait for you instead of failing. A paused webhook keeps events for up to 30 days and sends them when you resume it.When you are done, delete the development webhook with
DELETE /v1/webhooks/{id}. It counts toward the workspace's 20 webhooks, and an endpoint that stays down fails attempts until Shortcut turns the webhook off and emails your company admins.
Tips for the real receiver
Answer fast. Verify, store, and answer
200; do the work from a queue. Shortcut waits 15 seconds at most, and slow answers come back as retries.Expect duplicates and any order. Skip an envelope
idyou have handled, and keep the newer copy of a record byupdatedAt.Log the
Shortcut-Delivery-Id. It is the delivery'sidin the deliveries list, so you can match your logs to what Shortcut recorded.Use the deliveries list to debug, and retry a delivery once your fix is deployed instead of waiting for the next change.
Keep the production webhook separate from development ones, with its own secret, so rotating or deleting one never touches the other.
Last updated