Contact Update Subscriptions

❗️

This webhook requires an elevated scope.

This event allows you to listen to all contact updates, like names, emails, etc, that occur in a connected organization's Drift environment. Requires the all_contact_read scope, which can be added in your apps settings, in order to be used.

The Contact Update Subscriptions webhook is technically an event as described on the previous tab, but is deserving of it's own category as it enables staying in sync with updates that occur to Drift contacts (when used in tandem with the contact_identified webhook).

For example, you can use this hook to trigger or update contact records in external systems to keep them up to date with Drift, or fire notifications or emails.

{
    "orgId": (int),
    "type": "contact_updated",
    "data": {
        "endUserId": (long),
        "timestamp": (long), // timestamp
        "orgId": (int), // same as above (from contact)
        "diff": [
            {
                "name": (string), // See definition below
                "previous": (varies), // could be int, string, etc.
                "updated": (varies) // could be int, string, etc.
            },
          ...
        ]
    },
    "token": (string), // verification token
}

Diff Field Definition

The diff object in the response will be a list of all the contact attributes that have changed in this update.

fieldtypedescription
namestringName of the field that changed, will take the form attributes.XXX if a top level attribute such as name or email, or may be nested (i.e. XXX.YYY for map-based attributes such as an update like socialProfiles.twitter).
previousvaries (could be int, string, etc. depending on the field)Previous value of the field corresponding to 'name'
updatedvaries (could be int, string, etc. depending on the field)New value of the field corresponding to 'name'

This hook can be enabled from the events tab in the app settings.

1844

Adding the contact_updated webhook

Example webhook event with one contact attribute update:

{
    "orgId": 0,
    "type": "contact_updated",
    "data": {
        "endUserId": 12345678,
        "timestamp": 1538591450493,
        "diff": [
            {
                "name": "attributes.alias",
                "previous": null,
                "updated": "nadine"
            }
        ]
    },
    "token": "XXX"
}

📘

Contact Update API Calls will also trigger this hook

If a contact is updated via the API, this webhook will also fire. This is to ensure all events that affect contact attributes (even those by other apps) will also be broadcasted to you.

❗️

This webhook captures contact updates

You should still use contact_identified to detect when new contacts get added into Drift.