Contact Update Subscriptions

❗️

This webhook requires an elevated scope.

This event allows you to listen to all contact updates, such as those to contact attributes 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.

Adding the contact_updated webhook

Example webhook event with one contact attribute update:

{
    "orgId": 1,
    "type": "contact_updated",
    "data": {
        "endUserId": 13326063,
        "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 be fired. This is to ensure all events that affect contact attributes (even those by other apps) will also be broadcasted to you.

❗️

This webhook capture contact updates

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

Additional questions? Please ping us in the developer slack.

Updated 11 months ago

Contact Update Subscriptions


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.