Skip to main content
Solved

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


Forum|alt.badge.img+2

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)

Best answer by Tudsy

Hi

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

Thanks.

 

Adrian (tudsy)

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

Taylor Tarpley
Community Manager
Forum|alt.badge.img+60
  • Community Manager
  • 2148 replies
  • July 27, 2024

Hi there @Tudsy

 

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

 

Thanks for participating in the Community! 

-Taylor 


ArpitBanjara
Principal User I
Forum|alt.badge.img+36
  • Principal User I
  • 371 replies
  • July 27, 2024

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


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 0 replies
  • Answer
  • July 27, 2024

Hi

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

Thanks.

 

Adrian (tudsy)


DavidV
Partner - Platinum
Forum|alt.badge.img+30
  • 2025 Champion
  • 208 replies
  • July 29, 2024

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