Skip to main content

email and sms klaviyo subscription of v2024

  • July 30, 2024
  • 1 reply
  • 36 views

Forum|alt.badge.img

POST URL : https://a.klaviyo.com/client/subscriptions/?company_id=”companyID

header : revision:2024-07-15
content-type:application/json

Body : {"data":{"type":"subscription","attributes":{"custom_source":"Homepage footer signup form","profile":{"data":{"type":"profile","attributes":{"email":"sarah.mason@klaviyo-demo.com","phone_number":"+15005550006","anonymous_id":"01GDDKASAP8TKDDA2GRZDSVP4H","first_name":"Sarah","last_name":"Mason","organization":"Example Corporation","title":"Regional Manager","image":"https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg","location":{"address1":"89 E 42nd St","address2":"1st floor","city":"New York","country":"United States","region":"NY","zip":"10017","timezone":"America/New_York","ip":"127.0.0.1"},"properties":{"newKey":"New Value"}},"meta":{"patch_properties":{"append":{"newKey":"New Value"},"unappend":{"newKey":"New Value"},"unset":"skus"}}}}},"relationships":{"list":{"data":{"type":"list","id":"Y6nRLr"}}}}}

when i am hitting i am getting below error 

{
    "errors": [
        {
            "id": "aa918a35-e7b2-4209-886a-f0ed1cfbd8da",
            "status": 400,
            "code": "invalid",
            "title": "Invalid input.",
            "detail": "List not found",
            "source": {
                "pointer": "/data/relationships/list"
            },
            "links": {},
            "meta": {}
        }
    ]
}

in Response can any one help me what i am doing mistake i have generate correct id API key from klaviyo portal.

1 reply

chloe.strange
Community Manager
Forum|alt.badge.img+42
  • Community Manager
  • August 9, 2024

Hi @anilrove, thanks for sharing this 

It sounds like the list ID in the request might be incorrect or invalid.

 "detail": "List not found" indicates that the Klaviyo API can't find a list with the ID you've provided in the relationships.list.data.id field.

Here are some troubleshooting suggestions:

  1. First, verify the the list ID existence and that the current API key you are using corresponds to an account that has access to the list.

  2. Use API to retrieve list ID: You can use the Klaviyo API to list all available lists and verify that the list ID is correct. Here's an example of how to do that:GET https://a.klaviyo.com/api/v2/lists

    • this will return a list of all the lists in your account along with their IDs. Make sure the ID you use in your subscription request matches one of these.
  3. If there is a small number of lists, you can use the GET /lists api. However if there is a large number, it might make sense to first try GET on the specific ID since the /lists api might return a large number of results that would need to be paginated.

I hope this helps! 

~Chloe