Skip to content

LeadConsent Created

Description

This event is triggered when a new consent is created for a lead. Consents are used to store the permissions a lead has given us to store and process their data. Consents can be email double opt-ins, frontend checkboxes, or external consents that are requested from another system and can later be activated via an API call from the external system to the scanleads API.

Payload Structure

type: string

Type of the event, always "lead_consent_created".

version: string

Version of the webhook payload.

retry_count: number

Number of times the webhook has been retried.

trigger_time: string

Time when the event was triggered.

current_time: string

Current time when the webhook is sent.

data: object

Example Payload

{
  "type": "lead_consent_created",
  "version": "1.0",
  "retry_count": 0,
  "trigger_time": "2023-10-01T13:00:00Z",
  "current_time": "2023-10-01T13:00:00Z",
  "data": {
    "lead_consent": {
      "id": "string",
      "type": "external",
      "name": "Newsletter Double Opt-In",
      "status": "requested",

      "meta": {
        "key": "value"
      }
    },
    "lead": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "email": "example@example.com",
      "lists": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "name": "Main Newsletter",
          "status": "is_signed_up",
          "meta": {
            "resource-name": "newsletter-1"
          }
        },
        {
          "id": "223e4567-e89b-12d3-a456-426614174000",
          "name": "Raffle",
          "status": "is_verified",
          "meta": {
            "resource-name": "main-raffle"
          }
        }
      ],
      "personal_data": {
        "email": "example@example.com",
        "salutation": "Herr",
        "title": "Dr.",
        "first_name": "Max",
        "last_name": "Mustermann",
        "birthdate": "1968-04-19",
        "phone": "+49 030 3994744",
        "mobile": "+49 0178 0178 0178",
        "address_line_1": "Feldmarkweg 50",
        "city": "Berlin",
        "country": "deutschland",
      },
      "consents": [
        {
          "id": "string",
          "type": "checkbox",
          "name": "Newsletter Wanted",
          "status": "active",

          "meta": {
            "key": "value"
          }
        },
        {
          "id": "string",
          "type": "external",
          "name": "Newsletter Double Opt-In",
          "status": "requested",

          "meta": {
            "key": "value"
          }
        }
      ],
      "meta": {
        "campaign_id": "1234abcd"
      },
      "delete_lead_url": "https://scanly.net/[...]"
    }
  },
  "meta": {
    "custom_key": "some webhook handler specific data"
  }
}