Solved

API create event call do not change Subscription details


Badge

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"

    }

  }

}

icon

Best answer by saulblum 8 May 2024, 15:33

View original

2 replies

Userlevel 5
Badge +7

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.

Badge

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.

Reply