So I see now that the error returned is saying it is not a supported region for phone number?
{
"errors": s
{
"id": "9cb12681-2dcd-432f-b5a4-1611d43e3c6d",
"status": 400,
"code": "invalid",
"title": "Invalid input.",
"detail": "Phone number is valid but is not in a supported region for this account. Please configure a sending number for this region.",
"source": {
"pointer": "/data/attributes/profiles/data/0/attributes/phone_number"
},
"links": {},
"meta": {}
}
]
}
Here is the payload I am sending with personal info masked. Why is it rejecting this phone number?
{
"data": {
"type": "profile-subscription-bulk-create-job",
"attributes": {
"profiles": {
"data": i
{
"type": "profile",
"id": "01J068W6SV0D5EJ7YPXXXXXXX",
"attributes": {
"email": "marXXXX@gmail.com",
"phone_number": "+1386235XXXX",
"subscriptions": {
"email": {
"marketing": {
"consent": "SUBSCRIBED"
}
},
"sms": {
"marketing": {
"consent": "SUBSCRIBED"
}
}
}
}
}
]
}
},
"relationships": {
"list": {
"data": {
"type": "list",
"id": "TcXXXX"
}
}
}
}
}
Hey @MaxT, stricter validation rules were added in the 2024-05-15 revision of the API.
If you do not have a sending number configured for the region — based on your example with a +1, I’m guessing this is for the US — the API will reject with a 400. This is because you cannot modify consent for this phone # given the account’s setup.
If you want to create a profile with email + phone_number but only update email marketing consent, you should remove the “sms” block from your payload like so:
{
"data": {
"type": "profile-subscription-bulk-create-job",
"attributes": {
"profiles": {
"data":
{
"type": "profile",
"id": "01J068W6SV0D5EJ7YPXXXXXXX",
"attributes": {
"email": "marXXXX@gmail.com",
"phone_number": "+1386235XXXX",
"subscriptions": {
"email": {
"marketing": {
"consent": "SUBSCRIBED"
}
}
}
}
}
]
}
},
"relationships": {
"list": {
"data": {
"type": "list",
"id": "TcXXXX"
}
}
}
}
}
Hi @Kim Strauch,
Yes, this does solve my problem. I removed the "sms": {"marketing": {"consent": "SUBSCRIBED"}}
code from my payload and now getting Email Status “Subscribed” for all Profiles.
However, I am pretty surprised a breaking change would be made like this after only 3 months. Yes, I know I could have left my code using Feb 2023 revision, but was hoping Klaviyo would make breaking changes only in rare circumstances. Klaviyo is going to keep us devs busy in the next few years;)
My 2 cents.