Skip to content
Pitchlane

How to Set Up Webhooks In Pitchlane

Updated

1.) Navigate to your Pitchlane Campaign

2.) Select the “Send” tab.

3.) Select “Create Webhook”

4.) Configure the Webhook with your data

Choose the Payload format, which decides the structure of the data Pitchlane sends to your URL:

  • Version 2 (recommended) sends the same structure for every event: the video with its links and view counts, the lead and the campaign. New webhooks use it unless you choose otherwise.
  • Legacy (v1) sends the older structure, which is different for each event. Choose it only if what receives your webhooks was built for it.

The API documentation describes both formats and what each event sends.

Before you save, you can select “Send unsigned test” to send a sample of the chosen event, in the chosen format, to the URL you typed. This sample is not signed, because the webhook has no signing secret until you save it, so an endpoint that requires signatures may reject it. Pitchlane confirms that the test was requested, not that your endpoint received it: check your endpoint to see that it arrived. Once the webhook is saved, use Send test next to it to see your endpoint’s response. If the webhook has a signing secret, Pitchlane signs the test with it.

Changing the format of a webhook you already have

In the list of webhooks, one that uses the older format is marked Legacy. It keeps working as before, and you don’t have to change it.

To switch it, select “Edit”, choose the other payload format and save. Every request Pitchlane sends for this webhook after that uses the new structure, including retries of events that happened before you saved, so update whatever reads it first. A request that was already on its way when you saved can still arrive in the old structure, and other webhooks that send to the same URL keep their own format. The webhook itself stays the same, with the same signing secret, and you can switch back the same way.

Webhooks managed by Zapier use the legacy format and need no change.

5.) Save your signing secret

After you save a new webhook, Pitchlane shows its signing secret, a value starting with whsec_. Copy it and keep it somewhere safe. Pitchlane shows it only this once, and you can’t look it up later.

Pitchlane signs every request it sends to your webhook with this secret. Your endpoint can use it to check that a request really came from Pitchlane and wasn’t changed on the way. The API documentation explains how to verify a signature.

If you lose the secret, or never saw it, rotate it to get a new one (see step 8).

6.) Sign a webhook you created earlier

In the list of webhooks, each one is marked Signed or Not signed. A webhook you created before signing was available is not signed, and keeps working as before.

To sign it, select “Generate signing secret” next to it. Pitchlane shows the new secret once, the same way as for a new webhook, and signs every request to that webhook from then on. Make sure your endpoint is ready to check signatures, or ignores them, before you start relying on them.

Webhooks managed by Zapier don’t need a signing secret.

7.) Send a test

Select “Send test” next to a webhook to check that your endpoint receives it. Pitchlane sends one example event of the webhook’s type, in the webhook’s payload format, to its URL straight away, and shows the status your endpoint answered (or why it couldn’t be reached).

A test is sent exactly like a real event: if the webhook is signed, the test is signed with its secret too, so you can use it to check your signature verification. You can tell a test from a real event by its id: a test’s id starts with test_, and a real event’s with evt_. If the webhook is signed, check the signature first; the id is part of what is signed. Tests also carry a webhook-test: true header, which is handy for logs but isn’t covered by the signature, so don’t rely on it alone. If a webhook isn’t signed, neither the id nor the header proves where a request came from. Tests aren’t retried, and you can send up to 5 a minute for each webhook.

You can also test a webhook that is Turned off, to check that your endpoint works again. A test doesn’t turn it back on: edit and save the webhook for that.

Webhooks managed by Zapier don’t have a “Send test” button: test them from your Zap.

8.) Rotate a signing secret

To replace a webhook’s signing secret, because you lost it, never saw it, or it may have leaked, select “Rotate signing secret” next to the webhook and confirm. Pitchlane shows the new secret once, the same way as for a new webhook.

Unless you tick “Stop the current secret now” (below), the old secret keeps working for 24 hours: during that time every request is signed with both secrets, so your endpoint accepts it with either one while you update it. After that, or straight away if you stop it, requests carry the new secret’s signature only. If the old secret leaked, tick “Stop the current secret now” before you confirm. From then on, Pitchlane signs new requests with the new secret only and deletes the old one. A request that was already being sent may still carry the old secret.

Pitchlane can’t stop your endpoint from trusting the old secret: anyone who has it can sign requests your endpoint will accept until you remove it there. So after a leak, put the new secret in place and remove the old one from your endpoint. Until your endpoint has the new secret it rejects Pitchlane’s requests; each is retried for about a day and then given up, so update your endpoint promptly.

Webhooks managed by Zapier can’t be rotated here.