Unsetting Fields on Leads

On June 25, we will release an update to the Leads API that allows integrations to unset fields on Leads. The current API does not allow unsetting a Lead’s phone number, for example, instead that change must be made directly in the CRM’s user interface. This change provides greater flexibility to enable the development of more advanced 3rd party integrations.

You can take advantage of this new capability via a new v2 Lead endpoint on the Incoming Leads API:

PATCH /sites/{site-uuid}/v2/leads/{lead-id}

As part of this change, existing integrations may begin receiving Lead messages that contain keys with empty values via the Outgoing Leads API. These empty values represent a Lead field that has been unset in the CRM or via the Incoming Leads API. Existing integrations may need to be updated to handle these empty values. Any local lead representation should be updated with the new, empty value.

For example, an update to a Lead to unset phone2:

curl -X POST 'https://receivers.leadrouter.realgeeks.com/rest/sites/{site-uuid}/leads/{lead-id}/activities' \ 
  -u '{user}:{password}' \
  -d '{"phone2":""}'

Will produce the following message on the Outgoing Leads API:

{
  "action": "updated",
  "id": ":lead_id",
  "partner_id": "001",
  "phone2": "", // <-- Notice new, empty field
  "site_domain": "testsite.realgeeks.com",
  "site_login_url": "http://testsite.realgeeks.com/member/quick_login/:lead_id/",
  "site_uuid": ":site_id",
  "source": "test",
  "source_system": "test"
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s