Skip to main content
Solved

Getting invalid phone number - For Update List API


Forum|alt.badge.img+2

We followed this link to check for the valid phone number formats : https://help.klaviyo.com/hc/en-us/articles/360046055671-Accepted-Phone-Number-Formats-for-SMS-in-Klaviyo

While updating the profiles from the Update list api ( URL: {{baseUrl}}/v2/list/:list_id/members)

But few of the formats aren’t working correctly. PFB the respective request body.

Working correctly for below Request Body:

{

"profiles": [{ "country":"USA","phone_number":"+12345678900" }]

}

 

Not working for below:

{

"profiles": [{ "country":"USA","phone_number":"2345678900" }]

}

&

{

"profiles": [{ "country":"US","phone_number":"2345678900" }]

}

 

Error Response:

{

"detail": "+2345678900 is not a valid phone number."

}

Best answer by alex.hong

Hi there @pranjal.thakur,

Welcome to the Community.

If you are trying to submit a phone number that is available for SMS messaging it has to be in E.164 format that starts with "+1" then the rest of the US phone number.  You can see an example in our API documents.

You can also use Klaviyo's v2 List API to collect SMS consent. This is particularly helpful if you want to, for example, integrate a non-Klaviyo signup form to gather consented phone numbers for SMS marketing. For details on how to leverage APIs for SMS, check out our List API documentation

Thanks,

Alex
 

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

4 replies

alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • Answer
  • May 24, 2022

Hi there @pranjal.thakur,

Welcome to the Community.

If you are trying to submit a phone number that is available for SMS messaging it has to be in E.164 format that starts with "+1" then the rest of the US phone number.  You can see an example in our API documents.

You can also use Klaviyo's v2 List API to collect SMS consent. This is particularly helpful if you want to, for example, integrate a non-Klaviyo signup form to gather consented phone numbers for SMS marketing. For details on how to leverage APIs for SMS, check out our List API documentation

Thanks,

Alex
 


Forum|alt.badge.img+1
  • Contributor I
  • 1 reply
  • June 29, 2022
alex.hong wrote:

Hi there @pranjal.thakur,

Welcome to the Community.

If you are trying to submit a phone number that is available for SMS messaging it has to be in E.164 format that starts with "+1" then the rest of the US phone number.  You can see an example in our API documents.

You can also use Klaviyo's v2 List API to collect SMS consent. This is particularly helpful if you want to, for example, integrate a non-Klaviyo signup form to gather consented phone numbers for SMS marketing. For details on how to leverage APIs for SMS, check out our List API documentation

Thanks,

Alex
 

What about the case of when you do not want to submit the phone number that is available for sms messaging. What if i just want to submit a 10 digit phone number without any country code. Are you telling me that is not an option?

 

Please emphasize.


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • June 29, 2022

Hi there @timbogdanov,

Thanks for asking. Quick question, what is the objective of submitting numbers that cannot be used for SMS into a profile? If you wanted to attach a number, you could add it as part of a CSV upload to update profile properties.


Forum|alt.badge.img
  • Contributor I
  • 2 replies
  • August 16, 2024

Klaviyo API doesn’t accept all E.164 formats, so please don’t say it has to be E.164. After countless testing I was able to found numerous valid numbers that are not accepted by the API...