Skip to main content
Solved

API create event call do not change Subscription details


Forum|alt.badge.img

I’m new to Klayviyo, 

I have problem that I tried to use API to create event “Subscribed to email marketing”.

API has worked, return 202 and this created new profile, also add event to profile. But Subscription details status still “Never subscribed”.
Is there any way to change Subscription details through API call.

{

  "data": {

    "type": "event",

    "attributes": {

      "properties": {

        "event":"Subscribed to email Marketing",

        "email_address": "test@gmail.com"

    },

      "metric": {

        "data": {

          "type": "metric",

          "attributes": {

            "name": "Subscribed to email Marketing"

          }

        }

      },

      "profile": {

        "data": {

          "type": "profile",

          "attributes": {

            "email": "test@gmail.com",

            "phone_number":"+12345698901",

            "first_name": "test",

            "last_name": "account"

          }

        }

      },

    "unique_id": "4b5d3f33-2e21-4c1c-b392-2eae2a74920e"

    }

  }

}

Best answer by saulblum

Hi! You want to use the Subscribe Profiles call: https://developers.klaviyo.com/en/reference/subscribe_profiles

Your API call will create an event “Subscribed to email marketing” but you’ll notice it has the gear icon on the profile, meaning it came from the API, vs the black Klaviyo icon for the “native” “Subscribed to email marketing” event.

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

2 replies

Forum|alt.badge.img+7
  • Klaviyo Employee
  • 169 replies
  • Answer
  • May 8, 2024

Hi! You want to use the Subscribe Profiles call: https://developers.klaviyo.com/en/reference/subscribe_profiles

Your API call will create an event “Subscribed to email marketing” but you’ll notice it has the gear icon on the profile, meaning it came from the API, vs the black Klaviyo icon for the “native” “Subscribed to email marketing” event.


Forum|alt.badge.img
  • Author
  • Contributor II
  • 4 replies
  • May 9, 2024

I noticed it.
That mean I can’t change “Subscription details” of profile through API call? Even I use API provided in subscribe_profiles still not work.