Skip to main content
Solved

What is a valid choice for 'consent' for sms?

  • 23 July 2024
  • 4 replies
  • 46 views

Hi

 

I am using the Subscribe profile api but I am getting this error:

Array ( errors] => Array ( 0] => Array ( id] => 29986cec-6e3b-4455-a06f-aaaa376e76e1 status] => 400 code] => invalid title] => Invalid input. detail] => 'Never subscribed' is not a valid choice for 'consent'. source] => Array ( pointer] => /data/attributes/profiles/data/0/attributes/subscriptions/sms/marketing/consent ) links] => Array ( ) meta] => Array ( ) ) ) )

 

Thanks.

Adrian (Tudsy)

4 replies

Userlevel 7
Badge +60

Hi there @Tudsy

 

I wonder if any of our API experts @retention or @DavidV could help! 

 

Thanks for participating in the Community! 

-Taylor 

Userlevel 5
Badge +25

Hey @Tudsy 

Can you try and let me know if this works?

Replace 'Never subscribed' with a valid consent value like explicit, implicit, or soft-opt-in.

I think the value 'Never subscribed' is not valid for the consent attribute in the Subscribe Profile API request for Klaviyo.

let me know if this helps

Cheers

Arpit

Badge +2

Hi

I tried ‘soft-opt-in’ but it did not work. I tried ‘true’ and ‘false’ but it did not work.

Thanks.

 

Adrian (tudsy)

Userlevel 6
Badge +26

Hi @Tudsy,

Thank you for your question and thanks for the tag @Taylor Tarpley!

The correct value for sms→marketing-->consent = SUBSCRIBED

 

If you are doing a historical import (ie. consent provided outside of Klaviyo) - take note of the below from the documentation:

This endpoint now supports a historical_import flag. If this flag is set true, profiles being subscribed will bypass double opt-in emails and be subscribed immediately. They will also bypass any associated "Added to list" flows. This is useful for importing historical data where you have already collected consent. If historical_import is set to true, the consented_at field is required and must be in the past.

I hope that helps - let me know if you have any questions!

Thanks
David

Reply