Skip to content
Pitchlane API

Guide

Webhook payload versions

Version 2 sends one body structure for every webhook event, with the video, its view counts and the lead. Version 1 is the older body of each event and stays supported.

Every webhook subscription has a payload version, which decides the structure of the JSON body it is sent:

  • Version 2 is one structure for every event: the same envelope, the video as the API returns it with its view counts, and the lead’s contact fields under fixed names. Use it for a new integration.
  • Version 1 is the older body, which differs from event to event. It is what a subscription gets unless it asks for version 2, and what Zapier uses.

Which events exist, when they are sent and how they are delivered is the same for both. The Webhooks guide covers that.

Choosing a version

Send payloadVersion when you create the subscription:

curl https://api.pitchlane.com/api/public/v1/webhooks \
  -H "X-API-Key: $PITCHLANE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "https://example.com/hooks/pitchlane",
    "trigger": "VIDEO_RENDERED",
    "payloadVersion": 2
  }'

Left out, the subscription has version 1. payloadVersion is 1 or 2; anything else is answered with 400.

Every answer that describes a subscription states its version: creating one, updating one, and GET /webhooks. A subscription made before payload versions existed is listed with "payloadVersion": 1.

In the app, the webhook dialog has the same choice as Payload format. A webhook created there is Version 2 unless you choose Legacy (v1), and one on version 1 is marked Legacy in the list.

The version belongs to the subscription, not to your account. Two subscriptions to the same event can have different versions, and each is sent its own.

Version 2

Every version 2 body starts with the same six fields:

Field Type
payloadVersion number Always 2.
eventId string evt_…, unique per event and the same on every attempt. Also in the webhook-id header.
event string The trigger, for example VIDEO_RENDERED.
eventAt string (date-time) When it happened (ISO 8601, UTC).
campaignId string The campaign the event is about.
campaignName string Its name.

What follows depends on the event:

Events After those fields
VIDEO_CREATED, VIDEO_UPDATED, VIDEO_RENDERED video, lead
VIDEO_UNRENDERABLE video, lead, error
VIDEO_VIEWED, VIDEO_FIRST_VIEWED, VIDEO_STARTED, VIDEO_FIRST_STARTED, VIDEO_FINISHED, VIDEO_FIRST_FINISHED video, lead, and viewerUrl when the browser sent it
CAMPAIGN_READY, CAMPAIGN_FAILED campaign

A VIDEO_FIRST_STARTED body, with the HTML embed fields shortened:

{
  "payloadVersion": 2,
  "eventId": "evt_3Kx9VhQ2mLwP8sTzR4nB1c",
  "event": "VIDEO_FIRST_STARTED",
  "eventAt": "2026-11-23T10:00:00.000Z",
  "campaignId": "5jTuhVapNA0uDohhB00xl",
  "campaignName": "Example Campaign",
  "video": {
    "id": "XEKcAejz6cWRlUOtn0SGw",
    "shortId": "OFcf-PfxLI9q",
    "title": "Video for John",
    "campaignId": "5jTuhVapNA0uDohhB00xl",
    "campaignName": "Example Campaign",
    "createdAt": "2026-11-23T09:47:30.172Z",
    "renderedAt": "2026-11-23T09:52:10.885Z",
    "variables": { "first_name": "John", "website_0": "https://example.com" },
    "originalRow": {
      "first_name": "John",
      "email": "[email protected]",
      "website": "https://example.com"
    },
    "overrideRow": {},
    "originalUid": "[email protected]",
    "importId": "manual import",
    "videoUrl": "https://videos.example.com/OFcf-PfxLI9q",
    "videoFileUrl": "https://media.example.com/outputs/XEKcAejz6cWRlUOtn0SGw.mp4",
    "thumbnailUrl": "https://videos.example.com/thumbnail/OFcf-PfxLI9q.gif",
    "gifUrl": "https://videos.example.com/thumbnail/OFcf-PfxLI9q.gif",
    "thumbnailUrlPNG": "https://videos.example.com/thumbnail/OFcf-PfxLI9q.png",
    "thumbnailEmbed": "<div>…</div>",
    "viewCount": 1,
    "startedCount": 1,
    "finishedCount": 0,
    "firstViewedAt": "2026-11-23T10:00:00.000Z",
    "lastViewedAt": "2026-11-23T10:00:00.000Z"
  },
  "lead": {
    "email": "[email protected]",
    "firstName": "John",
    "lastName": null,
    "companyName": null,
    "website": "https://example.com",
    "linkedinUrl": null
  },
  "viewerUrl": "https://videos.example.com/OFcf-PfxLI9q"
}

The API reference lists the full body of every event in both versions: version 2 under Webhook events (payload version 2), version 1 under Webhook events.

What a body describes

A version 2 body describes its event as it was when it happened. campaignName, video and lead are as they were right after the change the event reports, and do not follow later changes: if the video is updated again, rendered, re-rendered or deleted before the event is sent, the body still describes the video as this event left it. Two updates in a row are two events, each with its own video.

Everything else in the body is fixed when the event happens. The view counts on video are the one exception: they are counted once, when the event’s version 2 body is first built, at its first attempt for any of your version 2 subscriptions, so they can include views made after the event up to then. That one body is then sent to every version 2 subscription of the event, on every attempt, retries included, and also to a subscription switched to version 2 after it was built: its counts are not taken again.

video

The same object that GET /videos/{videoId} would have answered when the event happened, with the same field names and the same id. Nothing from Pitchlane’s internal record is in it.

  • variables, originalRow and overrideRow are there in full, under the names you gave your columns.
  • videoUrl, videoFileUrl and the thumbnail fields are null until the video is rendered. gifUrl is the animated GIF, the same address as thumbnailUrl.
  • viewCount, startedCount, finishedCount, firstViewedAt and lastViewedAt count the video’s views up to when the body was first built (see above), including the one this event reports. Sessions that look like an email security scanner are left out.

On VIDEO_UPDATED, video is the stored video as that update left it, under its real id. (In version 1 that event describes the row you sent, under an id of its own.)

lead

The lead’s contact details under six fixed names, so you do not have to know what each customer called their columns:

Field The lead’s
email email address
firstName first name
lastName last name
companyName company name
website website
linkedinUrl LinkedIn profile

All six are always present. A field is a string, or null when Pitchlane does not know which of the lead’s values it is.

Pitchlane never guesses from a column’s name. For each field it uses the first of these that gives a value:

  1. The field type chosen for a column when the leads were imported. In the app’s import, each column can be marked as Email, First name, Last name, Company name, Website or LinkedIn profile. A value edited in the app afterwards wins over the imported one.
  2. The campaign’s Smartlead or Instantly connection. The column that is sent to that tool as the lead’s email, first name and so on.
  3. The standard variable name. A value named email, first_name, last_name, company_name, website or linkedin in the video’s variables or its row. This is what applies to videos you create through the API. A page’s variable counts too, such as website_0.

So a column called E-mail address that was not marked as Email anywhere gives "email": null. The value is still in video.originalRow, under your own name for it. Values are trimmed, and an empty one counts as missing.

error

VIDEO_UNRENDERABLE only: why the video cannot be rendered.

Field Type
error.type string UNRECORDABLE, INVALID_LEAD, UNSUPPORTED or VALIDATION_ERROR.
error.code string or null A more specific code, when there is one.
error.message string or null For a person to read.
error.erroredAt string (date-time) or null When it failed.

All four are always present, and error has no other fields.

campaign

CAMPAIGN_READY and CAMPAIGN_FAILED only: the same Campaign object that GET /campaigns/{campaignId} answers, as it was when the event happened, with its status (ready or failed) and problems.

Switching versions

PUT /webhooks changes the version of a subscription you already have. Send the subscription as it is, with the other payloadVersion:

curl -X PUT https://api.pitchlane.com/api/public/v1/webhooks \
  -H "X-API-Key: $PITCHLANE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "DHFG2C09n_3qrsSymZjjm",
    "webhookUrl": "https://example.com/hooks/pitchlane",
    "trigger": "VIDEO_RENDERED",
    "payloadVersion": 2
  }'

For a subscription that belongs to one campaign, send its campaignId as well, as with any update: without it the subscription is moved to cover every campaign.

What happens at the switch:

  • The subscription keeps its id, its URL and its createdAt. You can switch back the same way.
  • The new version applies from the next delivery attempt. That includes events that happened before the switch and are still being retried: their next attempt carries the whole body of the new version, never a mixture. An attempt already on its way when you switch can still arrive in the old version. One exception: an event too large to keep in version 2 (several megabytes of lead data, which alerts us) is not sent to a version 2 subscription at all, rather than sent in the wrong version.
  • Only this subscription changes: another subscription that sends to the same URL keeps its own version.
  • An event keeps its eventId across the switch, and every attempt, in either version, carries it as the webhook-id header. An event can be delivered again after the switch (an attempt that got no answer in time is tried again, now in the new version), so deduplicate on webhook-id: a receiver that skips ids it has already handled processes each event once, though it may receive it twice.
  • A PUT without payloadVersion leaves the version as it is.
  • Switching is an update like any other, so a subscription that was turned off for failing is turned back on by it. Turning one back on any other way keeps its version.

Because the body changes shape for everything sent after the switch, change what reads your webhooks first. Reading payloadVersion in the body tells the two apart: version 2 bodies have "payloadVersion": 2, version 1 bodies have no payloadVersion. Or subscribe a second URL with version 2, move over, and delete the old subscription.

A signed subscription stays signed with the same secret across the switch. Each attempt is signed over the body that attempt carries, so verify the raw body you received before you parse it, whichever version it is.

Check payloadVersion in a version 2 receiver. Read a body as version 2 only when it says "payloadVersion": 2, and log any other you get rather than reading it as one. A version 2 subscription is sent version 2 bodies; a receiver that checks never misreads a body, whatever happens.

Version 1

Version 1 is the body each event had before payload versions existed. It is described under Payloads in the Webhooks guide and listed under Webhook events in the API reference, where it has always been, each entry marked “payload version 1, legacy”.

Version 1 stays supported. Its bodies are not changed and there is no date after which they stop. A subscription is never moved to version 2 for you: it changes only when you send payloadVersion yourself.

How the two differ:

Version 1 Version 2
Structure Differs between video, viewing and campaign events. The same envelope for every event.
video on viewing events Pitchlane’s stored record: _id, no videoUrl. The API’s Video object: id, videoUrl, thumbnails.
rawVideo Sent with video events. Not sent.
View counts Not sent. On video.
lead Not sent. Sent with every video and viewing event.
VIDEO_UPDATED The row you sent, under an id of its own. The stored video, under its real id.