Skip to main content
Contributor I
June 2, 2025
Solved

Issue with Private Key Format – Guidance Needed

  • June 2, 2025
  • 1 reply
  • 66 views

Hello Team,

I hope you're doing well.

When I generate a private key, it starts with "pk_", but we require a key that begins with "KLA_". Could you please advise on the correct steps to generate the appropriate key?

Additionally, when I use the "pk_" key in my code, it returns an "invalid key" error. I also checked with ChatGPT, which suggests using a key starting with "KLA_".

For your reference, I’ve attached a screenshot of the issue.

Looking forward to your guidance.

Best regards,

 

    Best answer by whereisjad

    @ajay070796 that is not correct.  If you refer to Klaviyo’s help docs here

    Specifically it says the following:

    Private API key
    An API key that reads data and manipulates sensitive objects (e.g., lists in Klaviyo). It’s important to keep private API keys private. Treat them like passwords, kept in a safe place and never exposed to the public., 
    In Klaviyo, private API keys all start with the prefix “pk_” and are followed by 34 alphanumeric characters. For example, a private key will look something like: pk_abc123def456ghi789jkl0mno123pqrst4.

    1 reply

    whereisjad
    Expert Problem Solver IV
    Expert Problem Solver IV
    June 2, 2025

    @ajay070796 that is not correct.  If you refer to Klaviyo’s help docs here

    Specifically it says the following:

    Private API key
    An API key that reads data and manipulates sensitive objects (e.g., lists in Klaviyo). It’s important to keep private API keys private. Treat them like passwords, kept in a safe place and never exposed to the public., 
    In Klaviyo, private API keys all start with the prefix “pk_” and are followed by 34 alphanumeric characters. For example, a private key will look something like: pk_abc123def456ghi789jkl0mno123pqrst4.

    — 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/