Turnjo
Log in
← All docs/Webhooks

Webhooks

Webhooks let you receive lead data at any HTTP endpoint in real time. Turnjo signs every request so you can verify it came from Turnjo and not a third party.

Adding a webhook

  1. Open a Popup in the editor and go to the Integrations step.
  2. Under Webhooks, click Add Webhook.
  3. Enter a name and your endpoint URL.
  4. Save — Turnjo generates a signing secret for this webhook.

Payload

Turnjo sends a JSON POST request to your endpoint for every lead submission:

{
  "event": "lead.submitted",
  "created_at": "2026-06-27T10:00:00Z",
  "source": "capture",
  "duplicate": false,
  "hook": { "id": 1, "name": "Homepage Popup", "type": "popup" },
  "campaign": { "id": 1, "name": "Summer 2026" },
  "lead": {
    "email": "[email protected]",
    "data": { "first_name": "Alex" },
    "page_url": "https://yoursite.com/pricing",
    "submitted_at": "2026-06-27T10:00:00Z"
  }
}

duplicate is true when this email has already sent a lead from the same form (or, for Chat, the same site). Update the record you already have rather than adding a new one.

For a lead from Chat's Contact Card, source is chat and hook and campaign are null. Chat's webhooks are set in Chat → Settings → Webhooks.

Verifying the signature

Every request includes an X-Turnjo-Signature header:

X-Turnjo-Signature: sha256=abc123...

To verify it, compute HMAC-SHA256 of the raw request body using the webhook's signing secret and compare it to the value in the header:

$expected = 'sha256=' . hash_hmac('sha256', $rawBody, $signingSecret);
$valid = hash_equals($expected, $request->header('X-Turnjo-Signature'));

Reject any request where the signatures don't match.

Retries

If your endpoint returns a non-2xx status or times out, Turnjo retries the delivery up to 5 times with exponential backoff (1 min, 2 min, 3 min, 4 min, 5 min).

Delivery log

The last 20 deliveries for each webhook are shown in the Popup's Integrations step, including response status code, error details, and the lead's email. You can manually retry failed deliveries from there.

Regenerating the signing secret

If your secret is compromised, open the webhook in the Popup's Integrations step and click Regenerate next to its secret. Update your endpoint immediately — requests signed with the old secret will fail verification.