Skip to main content
Contributor I
September 16, 2025
Solved

API Error - Invalid Company ID

  • September 16, 2025
  • 8 replies
  • 319 views

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": {}

        }

    ]

}

    Best answer by jrdgdfg

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

     

    8 replies

    ChristianPaget
    Klaviyo Employee
    Klaviyo Employee
    September 16, 2025

    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.

    whereisjad
    Expert Problem Solver IV
    Expert Problem Solver IV
    September 16, 2025

    @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

    — Jad A | Klaviyo + Shopify + API Integrations Specialist • 7+ Years' Experience Helping with new setups, seamless integrations, and API connections—happy to connect. http://ja-technical-consulting.xyz/
    jrdgdfgAuthorAnswer
    Contributor I
    September 17, 2025

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

     

    Contributor II
    October 22, 2025

    @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”.

    Kim from Cadence
    Partner
    Partner
    October 23, 2025

    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? 

    Kim — Founder @ Cadence | Helping brands automate recurring campaigns (daily, weekly, monthly) | Happy to connect! | https://cadencecampaigns.com
    Contributor II
    October 23, 2025

    @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?

    Kim from Cadence
    Partner
    Partner
    October 23, 2025

    @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. 

    Kim — Founder @ Cadence | Helping brands automate recurring campaigns (daily, weekly, monthly) | Happy to connect! | https://cadencecampaigns.com
    Contributor II
    November 5, 2025

    Thank you and sorry for the late reply -- this turned out to be a bug in the URL query arg which didn’t show up transparently in our logs. All is good now!