Hello, folks!
I have an issue while subscribing/unsubscribing from sms marketing:
[error ] 400 https://a.klaviyo.com/api/profile-subscription-bulk-delete-jobs attempt=1 data={"errors":[{"id":"28d2750b-5eff-44f0-b09d-776922595491","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":{}}]} duration=0.8783969879150391 endpoint=https://a.klaviyo.com/api/profile-subscription-bulk-delete-jobs error={"errors":[{"id":"28d2750b-5eff-44f0-b09d-776922595491","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":{}}]} from_cache=False headers={'Authorization': '***REDACTED***', 'content-type': 'application/vnd.api+json', 'revision': '2025-01-15'} non_unique_url=https://a.klaviyo.com/api/profile-subscription-bulk-delete-jobs status_code=400 url_host=a.klaviyo.com
Here’s the code for the request:
headers = {
'Authorization': f'Klaviyo-API-Key {api_key}',
'content-type': 'application/vnd.api+json',
'revision': '2025-01-15',
}
response = self.requests.post(
'https://a.klaviyo.com/api/profile-subscription-bulk-delete-jobs',
data=json.dumps({
'data': {
'type': 'profile-subscription-bulk-delete-job',
'attributes': {
'profiles': {
'data': [
{
'type': 'profile',
'attributes': {
'subscriptions': {
'sms': {
'marketing': {
'consent': 'UNSUBSCRIBED'
},
}
},
'phone_number': '+1XXXYYYZZZZ'
}
}
]
}
}
}
}
),
headers=headers,
)
Is there anything we can do to fix this? The phone number we use for testing is real and valid, and belongs to USA. I also tried Canadian number.