DOCS / GUIDES

Webhooks: listening for the dawn

Receive events from Pollosoft and verify they are real.

Intermediate9 min read
Before you beginYou need the cluck CLI, a Pollosoft account, and a coop to work in. No prior experience required. Curiosity and a mild fondness for chickens are helpful.

Overview

Receive events from Pollosoft and verify they are real. The whole thing takes about 9 minutes, and the commands below are the ones you will use along the way.

$ cluck webhook create --url https://example.com/hook
$ cluck webhook test
$ cluck webhook logs

Steps

  1. Create an endpoint. Provide an HTTPS URL that accepts POST. Pollosoft sends events as JSON with a signature header.
  2. Verify signatures. Compute an HMAC of the body with your signing secret and compare it to the header. Reject anything that does not match.
  3. Respond fast. Return a 2xx within five seconds. Do real work in a queue. Pollosoft retries failed deliveries with exponential backoff.
  4. Replay events. Use the dashboard or cluck webhook replay to resend events if your endpoint was down overnight.

Commands used

Keep going

Stuck? Check the error codes, the FAQ, or the glossary.