Webhook notification

When a user completes the Pleenk approve flow, a webhook (HTTP POST request) is sent to your configured endpoint. The body of this request contains an events array, where each object represents a distinct event. Below is an example payload and a table describing the structure.

JSON Structure

PathTypeDescription
eventsArray of ObjectsAn array containing all events in the webhook. Approve will always contains only one event.
events[].eventTypeStringThe type of event: APPROVE.
events[].dataObjectHolds detailed information about the event.
events[].data["@type"]StringThe event category: APPROVE_EVENT.
events[].data.userRefString (UUID)A unique reference for the user or session. Match this with your internal user reference.
events[].data.requestStringThe requested verification check, e.g., age_over_18.
events[].data.resultObjectContains the verification outcome.
events[].data.result.age_over_18Booleantrue if the user is verified as over 18, otherwise false.

Example Payload

{
  "events": [
    {
      "eventType": "APPROVE",
      "data": {
        "@type": "APPROVE_EVENT",
        "userRef": "407eebe2-a380-44d8-9397-6663849afeb4-e2e",
        "request": "age_over_18",
        "result": {
          "age_over_18": true
        }
      }
    }
  ]
}

Processing the Webhook

  1. Receive Webhook

    • Configure your server to listen for an HTTP POST request at the endpoint you provided to Pleenk or configured as pw_notification params.
  2. Verify signature: Refer to signature verification procedure

  3. Parse the Payload

    • Extract the events array from the incoming JSON.
    • Get first event as approve always containing only one event.
  4. Apply Logic

    • Match userRef to the corresponding user or session in your system.
    • If age_over_18 is true, grant or maintain access to age-restricted sections. Otherwise, deny or revoke access.
  5. Acknowledge Receipt

    • Return an HTTP 200 OK (or suitable) response to confirm successful handling of the webhook.