Skip to main content

Hi, I am trying to subcsribve a customer to a list and i am getting an error-

 

Below is the payload

 

{

  "data": {

    "type": "subscription",

    "attributes": {

      "profiles": {

        "data": [

          {

            "type": "profile",

            "attributes": {

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

              "phone_number": "+97979799"

            }

          }

        ]

      }

    },

    "relationships": {

      "list": {

        "data": {

          "type": "list",

          "id": "Rt4K9n"

        }

      }

    }

  }

}

 

 

and i am geting below error via API 

{

    "errors": [

        {

            "id": "2b2c4d75-3341-41ab-84ac-e434821e5042",

            "status": 400,

            "code": "invalid",

            "title": "Invalid input.",

            "detail": "Invalid Company ID",

            "source": {

                "pointer": "/data"

            },

            "links": {},

            "meta": {}

        }

    ]

}

Hi there,

Can you confirm that you’re using the client-side Subscribe endpoint? And if so, can you share the entire URL that you are calling? That should include the company ID, which is likely where the issue is.


@jrdgdfg I echo Christian that my hunch is that whatever your passing for company_id to the URL eg https://a.klaviyo.com/client/subscriptions?company_id=ddddd is invalid.

Assuming that you are calling this method too

You have to enter the Public API key as specified here


Hi ​@whereisjad ​@ChristianPaget - Issue is resolved. Under company_id i was using API Key instead of Company Id. 

 


@jrdgdfg what do you mean using API Key instead of Company ID? aren’t they the same thing (assuming public API key)

I am having the same issue and I am sure I am appending the six-letters company ID in the request endpoint URL as per https://developers.klaviyo.com/en/reference/create_client_subscription

I am receiving the same error  as OP: “Invalid Company ID”.


I’m guessing OP was using a Private API key vs. the Public API key/company ID. The private API key should not be used with the client APIs.

@beka-kestrel, one thing to double-check- you’re positive the company id you’re using is valid? And are you positive the list ID you’re using belongs to the account referenced by that company? 


@cadence yeah I am pretty certain, I also double checked the list ID (although I’d expect a different error if the list ID was the problem anyway). I have obtained by public API key from  Settings > API Key under Public API Key / site ID.  I made sure it’s enabled for all domains  and “Allow empty domains” is ticked. 

Where else the problem could be? 

I am issuing a POST request to https://a.klaviyo.com/client/subscriptions?company_id=XXXXXX  - I triple checked the request body and even reduced it to a bare minimum with just the required fields (again, I would expect a different error if something went wrong there). 

I used the following headers:

"Accept" => "application/vnd.api+json",
"Content-Type" => "application/vnd.api+json",
"revision" => "2025-10-15"

 

the error received is 

 

{
  "errors": [
    {
      "id": "a8aff291-8ba9-487f-bffc-f284233d2fbc",
      "status": 400,
      "code": "invalid",
      "title": "Invalid input.",
      "detail": "Invalid Company ID",
      "source": {
        "pointer": "/data"
      },
      "links": {},
      "meta": {}
    }
  ]
}

 

what else could I try?


@beka-kestrel, Do you mind sharing a bit more about how you're issuing the request? Is this in postman or somewhere else? If postman, can you confirm that your company_id is being sent over in the console?

I have a feeling your company_id may not be getting propagated correctly in your request URL. 

If you want to share more details, happy to reply over dm as well.