Solved

How to update consent using API?

  • 8 July 2021
  • 3 replies
  • 126 views

Badge

Hi!

I’m using the Identify API to update customer information including $consent. But I want to update the consent or sometimes remove it.

Updating $consent: [“”] or $consent: null doesn’t change the Consent Status on my customer profile.

Also sending $consent: [“sms”] shows as consent status subscribed on my email channel section instead of sms channel section. It doesn’t matter what value I send to the $consent array it always subscribes to email. Is this right?

Thanks,

Guillermo

icon

Best answer by Dov 9 July 2021, 16:43

Hello @Guillermo Tama,

Thank you for sharing your question with the Klaviyo Community.

First, I recommend ensuring that you have met all of the SMS setup requirements before you attempt to update the subscription status via the API. I also recommend double-checking that your API request for $consent matches the formatting used in our sample code. Also, since collecting SMS consent utilizes the List V2 API’s Subscribe endpoint, by default, a confirmation message will be sent out, only after consent is confirmed via SMS, will the SMS portion under the Channels section of the profile update. If the value under $consent is [“sms”] this will apply to the SMS consent portion of the profile, rather than the email consent status.

View original

3 replies

Userlevel 6
Badge +5

Hello @Guillermo Tama,

Thank you for sharing your question with the Klaviyo Community.

First, I recommend ensuring that you have met all of the SMS setup requirements before you attempt to update the subscription status via the API. I also recommend double-checking that your API request for $consent matches the formatting used in our sample code. Also, since collecting SMS consent utilizes the List V2 API’s Subscribe endpoint, by default, a confirmation message will be sent out, only after consent is confirmed via SMS, will the SMS portion under the Channels section of the profile update. If the value under $consent is [“sms”] this will apply to the SMS consent portion of the profile, rather than the email consent status.

Badge

Thanks for your response @dov.derin! That was very helpful.

What about other $consent values? web, directmail, mobile and email? Is there any required configuration for this? I need to cover all scenarios.

Also, Can I unsubscribe to consent status with Identify API? For example: I subcribe with $consent: [‘email’] and we need to unsubscribe that consent status. I tried sending email_consent: false but it doesn’t work I guess this fields works only with the List API.

 

Thanks,

Guillermo

Userlevel 6
Badge +4

Hello @Guillermo Tama,

Building on top of the great points @dov.derin has already made, there wouldn’t be any further required configurations for the consent values so long as you are making the correct calls utilizing Klaviyo’s List V2 endpoint. To learn more about Consent is stored within Klaviyo, I would recommend reviewing the How Consent is Stored in Klaviyo subsection in the Guide to Collecting GDPR Compliant Consent article. 

Furthermore, you depending on what it is you were trying to accomplish, you can either unsubscribe users from a specific list through once again, leveraging Klaviyo’s List V2 endpoint as detailed in the Unsubscribe Profiles From List subsection of the  Klaviyo API Documentation. Alternatively, if you wish to suppress a contact and you can leverage Klaviyo’s List V1 endpoint as highlighted in the Exclude Profile From All Email section of the same API Document. 

I hope this helps!

David

Reply