Webhooks

Template Variables and Payloads

Use delivery context in URLs, headers, query parameters, and body templates.

Webhook destinations can render templates for the URL, headers, query parameters, and body. Template variables use double braces around a path.

{{ event.type }}
{{ workspace.uuid }}
{{ contact.attributes.email }}

Common template variables

VariableDescription
event.idUnique event id for the delivery event.
event.typeEvent type, such as contact.created.
event.occurred_atISO timestamp for when the event occurred.
workspace.uuidWorkspace UUID.
workspace.nameWorkspace name.
contact._idContact id.
contact.workspace_uuidWorkspace UUID stored on the contact.
contact.subscribedContact subscription state.
contact.providerContact provider value when present.
contact.attributes.emailEmail attribute when present.
changes.beforePrevious values for changed fields when available.
changes.afterNew values for changed fields when available.
delivery.uuidWebhook delivery UUID.
delivery.event_idEvent id stored on the delivery.
destination.uuidDestination UUID.
destination.nameDestination name.

If a path is missing, Leadpush renders it as an empty string.

Contact lifecycle payload

Contact lifecycle deliveries include the event, workspace, contact, changes, and campaign fields.

{
  "event": {
    "id": "01jz6r7h1k6ts70v9x9p0j4r1a",
    "type": "contact.updated",
    "occurred_at": "2026-04-22T18:30:00+00:00"
  },
  "workspace": {
    "uuid": "9a8b7c6d-1111-2222-3333-444455556666",
    "name": "Example Workspace"
  },
  "contact": {
    "_id": "contact_123",
    "workspace_uuid": "9a8b7c6d-1111-2222-3333-444455556666",
    "subscribed": true,
    "provider": null,
    "attributes": {
      "email": "person@example.com",
      "first_name": "Avery"
    },
    "created_at": "2026-04-20T14:15:00+00:00",
    "updated_at": "2026-04-22T18:30:00+00:00"
  },
  "changes": {
    "before": {
      "attributes.first_name": "Ava"
    },
    "after": {
      "attributes.first_name": "Avery"
    }
  },
  "campaign": null
}

Test payload

Manual test deliveries use the webhook.test event type. They do not include a contact.

{
  "event": {
    "id": "01jz6r7h1k6ts70v9x9p0j4r1b",
    "type": "webhook.test",
    "occurred_at": "2026-04-22T18:35:00+00:00"
  },
  "workspace": {
    "uuid": "9a8b7c6d-1111-2222-3333-444455556666",
    "name": "Example Workspace"
  },
  "contact": null,
  "changes": {
    "before": {},
    "after": {}
  },
  "campaign": null
}

Template examples

URL template:

https://example.com/hooks/{{ event.type }}/{{ contact._id }}

Query template:

KeyValue
workspace{{ workspace.uuid }}
event{{ event.type }}

Body template:

{
  "type": "{{ event.type }}",
  "contact_id": "{{ contact._id }}",
  "email": "{{ contact.attributes.email }}",
  "delivery": "{{ delivery.uuid }}"
}

Default request body

When no body template is configured, Leadpush sends the full event payload for HTTP methods that send a body by default. This includes POST, PUT, PATCH, and DELETE.

GET destinations do not send a request body unless a body template is configured.

Troubleshooting