Skip to main content
Solved

Cannot add SMS consent via API

  • January 4, 2022
  • 7 replies
  • 1018 views

Forum|alt.badge.img+2

Hi! I’m trying to set up an API call that would subscribe user and create consents for both e-mail and SMS. My JSON looks like this:

{
"profiles": [
{
"email": "m***@z******s.**",
"phone_number": "+38631******",
"sms_consent": true,
"$consent": ["sms"]
}
]
}

and API url is structured like this:

{{URL}}/list/{{LIST_ID}}/subscribe

I tried both Single and Double opt-in and it’s not working. Both e-mail and phone number are saved to profile, but only e-mail consent is displayed.

 I think I tried everything, but it’s still not working. Does anyone have an idea what I’m doing wrong?

Thank you!

Best answer by alex.hong

Hi there @mihamajetic,

Welcome to the Community and thank you for sharing your findings with us!

Since it looks like you are using an international calling code 386, which indicates it may be a Slovenian number, that is why you are currently experiencing the issue you are running into. At this time, Klaviyo SMS is not available everywhere. Currently, you can only collect SMS consent and send text messages in: 

  • *United States
  • Canada
  • UK
  • Australia

*The United States only includes the 50 US states and not Puerto Rico or other territories.

More info regarding this can be found in the related help center article!

Have a good day!

Alex

7 replies

Forum|alt.badge.img+2
  • Author
  • Contributor I
  • January 4, 2022

It’s very likely that sms consent is not displayed in Klaviyo, because SMS are currently not available in EU. :disappointed_relieved:


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • Answer
  • January 4, 2022

Hi there @mihamajetic,

Welcome to the Community and thank you for sharing your findings with us!

Since it looks like you are using an international calling code 386, which indicates it may be a Slovenian number, that is why you are currently experiencing the issue you are running into. At this time, Klaviyo SMS is not available everywhere. Currently, you can only collect SMS consent and send text messages in: 

  • *United States
  • Canada
  • UK
  • Australia

*The United States only includes the 50 US states and not Puerto Rico or other territories.

More info regarding this can be found in the related help center article!

Have a good day!

Alex


Forum|alt.badge.img+2
  • Contributor III
  • February 17, 2022

Hi, I also have the exact same problem (consent is not showing up properly in the profile) and the “consented to receive sms” event is not triggered, and I cannot build an automation on top of it.

I’ve tried hungarian, USA and australian numbers. Same API call, same non-Klaviyo popup, different - real - mobile numbers.

List is single opt-in!

  • Hungarian numbers are not getting consent. Because SMS is not available? OK, fine...
  • USA numbers are getting consent. Great!
  • Australian numbers not getting consent. Why?

Can you help please?


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • February 18, 2022

Hi there @nandorhargita,

I saw you received an answer on:

Hope others can find the solution there as well.

Thank you!
Alex


Forum|alt.badge.img+1
  • Contributor I
  • March 14, 2022

Check for Prior Consent

The get-members List API endpoint can be leveraged to confirm that a contact number has or has not already consented to receiving SMS. To do so, make a POST request to https://a.klaviyo.com/api/v2/list/LIST_ID/get-members?api_key=API_KEY and include the phone numbers you wish to check for SMS consent in your payload. The example below uses Python. This method can also be used to check for email consent. 

If the phone number passed to the endpoint is not returned in the response, the number has not consented to receive SMS communications from you.

 

import requests

url = "https://a.klaviyo.com/api/v2/list/LIST_ID/get-members?api_key=API_KEY"

payload = {
    "phone_numbers": ["+13239169023", "+12028837032"]
}
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)


Forum|alt.badge.img+6
  • Problem Solver III
  • March 18, 2022

SMS subscription is handled by list API not profile API.  You need to submit $consent AND list API endpoint. 


  • Contributor I
  • April 30, 2026

Hey,

This usually happens because Klaviyo doesn’t treat SMS consent the same way as email consent in the /subscribe endpoint. Setting "sms_consent": true in the profile payload alone won’t register as a valid opt-in.

For SMS, Klaviyo.com requires explicit consent capture with proper method + timestamp, otherwise it won’t show up in the profile even if the phone number is saved.

A couple of things to check:

  • You need to pass consent as a structured object, not just "sms_consent": true
  • Include fields like:
    • consent_method (e.g. "web_form", "api", etc.)
    • consent_timestamp
  • SMS consent also depends on account-level SMS settings + enabled countries

Also, if you're testing with API only, note that Klaviyo sometimes expects consent to come through forms or dedicated consent endpoints, not just profile creation.

Their official docs explain this part better:
https://developers.klaviyo.com/en/reference/subscribe_profiles

If you're still stuck, try creating the profile first and then updating consent separately—it tends to work more reliably.