Klaviyo opt-in for email
Status: Open · Asked by Troy Coker on · 0 views
Klaviyo's latest API requires 2 steps to allow email consent against a profile. First it has to be created (by default the profile is unsubscribed), then an Update call needs to be made on the profile ID to change the consent to subscribed.
The Subscription object needs to be called. It is not included in the default set of calls/parameters in the Pabbly Klaviyo version of the Update call. I'm only concerned with email consent for now. How do I make this call? Can this option be added to the Pabbly Klaviyo integration as a matter of urgency.
https://developers.klaviyo.com/en/reference/update_profile



Hello @troycoker08
We have escalated your request to our technical team, they are looking into it. Please allow us some time, we will provide you with the updates as we have some.
Hello @troycoker08
Our team has checked and Informed us that the required action is a beta endpoint(in testing mode) in Klaviyo's API docs, hence it is not stable at the time. We would recommend you use the API by Pabbly module instead for now.

This is the CURL you may need. API docs: https://developers.klaviyo.com/en/reference/update_profile
curl --request POST \
--url https://a.klaviyo.com/client/subscriptions \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2024-10-15.pre' \
--data '
{
"data": {
"type": "subscription",
"attributes": {
"profile": {
"data": {
"type": "profile",
"attributes": {
"properties": {
"newKey": "New Value"
},
"meta": {
"patch_properties": {
"append": {
"newKey": "New Value"
},
"unappend": {
"newKey": "New Value"
}
}
},
"subscriptions": {
"email": {
"marketing": {
"consent": "SUBSCRIBED"
}
},
"sms": {
"marketing": {
"consent": "SUBSCRIBED",
"consented_at": " "
},
"transactional": {
"consent": "SUBSCRIBED"
}
}
}
},
"id": "dfgdfgdfg546546"
}
},
"custom_source": "test"
},
"relationships": {
"list": {
"data": {
"type": "list"
}
}
}
}
}
'