Rest V2 request

@OmarAlmonte I need the ability to remove a leadsource from a contact record. In the past, this could be accomplished by setting the leadsource ID to 0 via an action set and choosing the checkbox option to overwrite a contacts leadsource.

Since action sets are legacy - I don’t see a way to do this with rest v2.

If you added a method to the contacts API to remove a leadsource from a contact, then I could explicitly call this before trying to set a leadsource. I don’t want to change the behavior of the leadsource field, I just need a method that I can explicitly call to remove the leadsource from a contact so the contact can get a new one assigned.

Thanks - Casey

@Casey_Page, have you tried setting the “leadsource_id” to an empty string via the Contact - Update a Contact Endpoint.

https://developer.infusionsoft.com/docs/restv2/#tag/Contact/operation/updateContact

The Update Mask also has a “leadsource_id” parameter so you can target it directly.

Hi Casey and Pav,

The expected behavior is that if you include leadsource_id in the update_mask and either omit it from the request body or set it to null, the value should be cleared.

At the moment, that is incorrectly returning a 400 error, so we’ll be making a correction for that. I’ll keep you updated as we work through it.

Thanks for bringing this up.

@Pav @OmarAlmonte

The Leadsource has always been a special field in the sense that after it is set, it can not be over-written or updated. This is the only field that I know of that works like this. I’ve always had to explicitly remove the leadsource first, then set it.

In my testing, it seemed like this was the same behavior with Rest V2 which is good, but it would be nice to be able to over-write it if needed, even if that mean’t making a separate API call to deliberately remove the leadsource first.

If passing a leadsource_id in the update mask to update the Leadsource for a contact will now over-write the leadsource a contact already has, then this will be a leadsource behavior change that works different from the XMLRPC API. (just a heads up here)

Thanks,
Casey

Hey @OmarAlmonte

I re-tested this with the latest SDK and still got an error. I checked the known issues tracker and didn’t see it on the list, so I just wanted to tag you here to make sure this made it to the list and didn’t get lost since I know you’re managing alot of different things.

Thanks,
Casey

Hey @Casey_Page,

No problem, this issue is on our radar and we already have a fix in testing. It’s currently planned for release by the end of next week.

Thanks for following up and helping keep it visible.

Omar

Hey @Casey_Page,

Just a quick update, this is now supported.

To clear the value, include leadsource_id in the update_mask and either send an empty payload for that field or set leadsource_id: null. Either approach will clear the value.

Also, if your use case was simply updating it to a different Lead Source ID and your workaround was to clear it first and then set the new value, that’s no longer necessary. The endpoint now supports updating leadsource_id directly in a single request.

Let me know if you run into any issues with it.