Documentation > Dashboard User Guide

Working with Webhooks

CleverTap enables developers to receive profile data on their configured webhook endpoint whenever people on their app(s) perform a certain event (through live user segments), as well as for past behavior.

Authentication

Developers can specify a webhook endpoint through the CleverTap dashboard. The endpoint may have Basic Authentication (username + password) enabled, for which the credentials can be added through the dashboard at the time of webhook campaign creation. These credentials would be passed to the endpoint as HTTP POST request headers, and it is the developers’ responsibility to enable authentication at their server. Unauthenticated webhooks are also supported.

Please use a HTTP POST request

Payload

You have the option to receive email, identity, objectId (CleverTap ID), profileData (custom profile variables), and push_token for each profile object within the profiles array, if present. Below is a sample webhook payload containing all possible fields.

targetId corresponds to the webhook campaign ID for which you are receiving the payload.

{
    "targetId": 1472124953,
    "key_values": {
        "PromoCode": "MT50",
        "PowerUser": "true"
    },
    "profiles": [
        {
            "email": "jack@gmail.com",
            "identity": "foo",
            "objectId": "-g55b74fb1030740e4a4931910a8abb862",
            "profileData": {
                "Last Score": 308,
                "High Score": 308,
                "Replayed": true
            },
            "event_properties": {
                "Score": 1200,
                "Game Mode": "Practice",
                "Rating": 1
            },
            "push_token": "19403aa5d3bb376769a8101c9cbf22159cb1836117659cc684a71243589982ea"
        },
        {
            "email": "jill@gmail.com",
            "identity": "bar",
            "objectId": "__g09c9bf3b0d374a259c86f5b855ec9b19",
            "profileData": {
                "Last Score": 309,
                "High Score": 309,
                "Replayed": true
            },
            "event_properties": {
                "Score": 500,
                "Game Mode": "Tournament",
                "Rating": 2
            },
            "push_token": "fiCjRO_opjw:APA91bH0yzS_eBj1Xx8TcakMzz4yTc3id29A79GOjnaaMtIQLrjztNfzzRz7slqWmNzndECx_hHh7qiL0LZJOkGwzr9Zp_g1mC9B6BVuEbsjrMFoxXX830zMRuvxtU_AhFTC0JPHejZh"
        }
    ]
}
copy Copied