Skip to main content

I am using the subscribe api and keep getting the error mentioned in subject, regardless of which format I specify.

Any input appreciated, thanks…

 

here is the payload:

{

    "data": {

        "type": "profile-subscription-bulk-create-job",

        "attributes": {

            "profiles": {

                "data":

                    {

                        "type": "profile",

                        "attributes": {

                            "subscriptions": {

                                "email": {

                                    "marketing": {

                                        "consent": "SUBSCRIBED",

                                        "consented_at": "2025-06-18T21:54:30"

                                    }

                                }

                            },

                            "email": "ekstra@kontakt.zzy"

                        },

                        "id": "01JY2CZ2H7BNTB5FK5G8BNX0JY"

                    }

                ]

            },

            "custom_source": "",

            "historical_import": true

        },

        "relationships": {

            "list": {

                "data": {

                    "type": "list",

                    "id": "WX4UN6"

                }

            }

        }

    }

}

@FBreitenkamp Could you please confirm if the timestamp you are specifying may be set to a time beyond the current moment? Currently, the date is June 18, 2025, but depending on whether the time zone is UTC or your local region, it could be interpreted as a later time by Klaviyo.


So, I am situated in Denmark UTC+1 (+DST) and is currently building a set of integrations with Power Automate against the K. API’s. Any input in this thread is based off of Postman results.

I just realized I was using the wrong ID - anyway, just subscribed the profile successfully, unsubscribed and now it won’t let me re-subscribe (same issue as originally stated).

I put in a set of screen dumps below using different datetime formats etc, all giving different results:

 

 

 


@FBreitenkamp I have observed that you are utilizing the https://developers.klaviyo.com/en/reference/bulk_subscribe_profiles endpoint.

I would like to kindly advise that the usage of the  historical_import  flag may not be aligned with its intended purpose. Please find below the relevant details from our documentation for your reference.

If this flag is set true, profiles being subscribed will bypass double opt-in emails and be subscribed immediately. They will also bypass any associated "Added to list" flows. This is useful for importing historical data where you have already collected consent. If historical_import is set to true, the consented_at field is required and must be in the past.

As you are providing consent for the current time, there is no need to set historical_import to true or to specify the consented_at field. Please let me know if I have overlooked anything.


Thank you for your fast replies.

I can confirm, that omitting the consented_at and historical_import fields actually did it for me - I now have a flow that can flip/flop the subscribed/unsubscribed information on the profile’s list(s).

 

One other different question:

 

I am to migrate a bunch of contacts into Klaviyo, preferably setting the ‘subscribed’ information immediately.

 

  1. do I need the consented_at and historical_import fields to be set during import/migration and if yes, I guess current datetime and true (?)
  2. when a new contact is created in CRM and should be created in Klaviyo as well does the same as above apply?

@FBreitenkamp I would advise only leveraging historical_import to true and specifying the consented_at field if the profile is net new

I would leverage this call to check if profile already exists:

GET https://a.klaviyo.com/api/profiles/
Query Parameter filter:   equals(email,"email@example.com") (replace with actual email)