> For the complete documentation index, see [llms.txt](https://www.locksmith.guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.locksmith.guide/tutorials/more/klaviyo.md).

# Grow your subscriber lists with Klaviyo

Locksmith allows you to present your customers with a form to subscribe to a Klaviyo email list, which the customer must enter before they gain access to the locked content:

<div data-full-width="false"><figure><img src="https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2FugVzao8tmQUUgxwzsiwo%2FScreenshot%202025-07-31%20at%2011.55.24.png?alt=media&amp;token=dd870d66-2be4-4a12-b500-65c20c33e1d0" alt=""><figcaption></figcaption></figure></div>

## Setup

To get started, create a new lock or navigate to the lock you'd like to use, then add the key condition labelled "if the customer subscribes to a Klaviyo list".

<figure><img src="https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2F4aB4CfFzpB0r0ImN2b48%2FScreenshot%202026-10-14%20at%2012.09.10%E2%80%AFPM.png?alt=media&amp;token=46b8cdf9-f7b7-4f19-88b0-19012943087a" alt=""><figcaption><p>You can optionally filter the list by typing "klaviyo" as the filter.</p></figcaption></figure>

{% hint style="info" %}
You'll notice that Locksmith also supports *only* checking if a customer is already on a list (as opposed to subscribing them). This is a separate key condition, and it also supports checking segments! [We have a dedicated guide on that here](https://www.locksmith.guide/tutorials/more/use-a-klaviyo-list-or-segment-as-an-access-control-list.md).
{% endhint %}

You'll need to create a Klaviyo API key and give it to Locksmith (see below). Once you do that, you'll be presented with your Klaviyo lists, and you'll be able to choose which one to use like so:

<figure><img src="https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2FlikCieEgXM9QVzd60WTG%2FScreenshot%202026-10-14%20at%2012.22.40%E2%80%AFPM.png?alt=media&amp;token=d2b0f2d5-420c-41e9-8f92-1168a686b853" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
As noted within the key condition setup, Klaviyo has their own policies regarding double opt in, and it is typically enabled by default. This setting is adjusted under Settings > API keys, in the "Default opt-in settings" section. There, choose "Double opt-in" or "Single opt-in". This is not a setting that is controlled by Locksmith.
{% endhint %}

### Klaviyo API Access

The first time you select this, Locksmith will prompt you for a Klaviyo API key:

<figure><img src="https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2FT2O2hcBoCH5bfQhnZT4f%2FScreenshot%202026-10-14%20at%2012.13.53%E2%80%AFPM.png?alt=media&amp;token=90eec5dd-06c0-4d32-b18a-eed6973ef019" alt=""><figcaption></figcaption></figure>

In your Klaviyo dashboard, go to Settings > API keys. You can also use the "from your Klaviyo account" link within Locksmith to go directly there:

<figure><img src="https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2FgxCn9I1ex74G1cuB7lw1%2FScreenshot%202026-10-14%20at%2011.55.50%E2%80%AFAM.png?alt=media&amp;token=a1838b23-ff52-4506-9148-e29675943ae7" alt=""><figcaption></figcaption></figure>

The API keys page lists each private key with an "Access Level" column. Use this to see an existing key's access level without recreating it.

Creating a private API key requires Owner or Admin access to the Klaviyo account.

Click the "Create Private API Key" button and name the key. "Select Access Level" offers "Custom Key", "Read-Only Key", and "Full Access Key". For Locksmith, choose one of the following:

* **Custom Key** — the API Scopes table appears on the right. It has "No Access", "Read Access", and "Read/Write Access" columns. The radio button in the "Read/Write Access" column is labelled "Full Access". With "Custom Key" selected, every scope starts at "No Access". Set each required scope to "Full Access": "List", "Profiles", "Segments", and "Subscriptions". Missing any one of these scopes can prevent the integration from working.
* **Full Access Key** — grants full access to every scope in one click. Use this as a simpler alternative to setting the four required scopes individually.

<figure><img src="https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2FgXfxGfeV2ydobrZHSiRP%2FScreenshot%202026-10-14%20at%2011.59.40%E2%80%AFAM.png?alt=media&amp;token=2c871f10-ab9a-42ce-8528-e3cfbe3ff67d" alt=""><figcaption><p>Klaviyo Private API Key Scopes</p></figcaption></figure>

{% hint style="warning" %}
Klaviyo does not allow you to add or edit scopes on a private API key after creating it. If an existing key has the wrong scopes, create a new key with the correct scopes and connect that key instead. <https://help.klaviyo.com/hc/en-us/articles/7423954176283>
{% endhint %}

Copy the API key:

<figure><img src="https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2FRpJz2c7XS207Wie3bc6h%2FScreenshot%202026-10-14%20at%2012.01.13%E2%80%AFPM.png?alt=media&amp;token=86138db7-0e00-478e-ac03-d0906e02863c" alt=""><figcaption><p><strong>Copying the Klaviyo Private API Key</strong></p></figcaption></figure>

Then, head back to Locksmith, where you'll be able to paste in the key. Click "Continue", and Locksmith will present you with a list of Klaviyo lists, to which your new subscribers will be saved.

Once your Locksmith configuration is to your liking, hit the "Save" button. From here on out, new visitors to your locked resource will be required to subscribe before proceeding.

#### Replacing your Klaviyo API key

On the **Settings** page in the Locksmith app, find Klaviyo and click **Change API key**. Paste the new key and click **Save**. Every Klaviyo key condition keeps the list or segment it already uses.

If you disconnect Klaviyo instead (**Disconnect Klaviyo**, on the same card), the Settings page shows a field to connect again with a new key and **Connect**. A lock's Klaviyo key condition also asks for a key while none is connected.

{% hint style="info" %}
**Note**: any customers who are already in your list will be seamlessly granted access when they enter their email address, and will not be added as a duplicate.
{% endhint %}

## Troubleshooting

If visitors enter an email address on a locked page and see "Something went wrong, please refresh and try again," check the connected private API key. This can happen when the lock is configured correctly and the list is selected in Locksmith, but Klaviyo rejects the subscription request because the key lacks required scopes. Klaviyo returns a permission error, and Locksmith cannot complete the subscription.

Create a new private API key with Full Access to "List", "Profiles", "Segments", and "Subscriptions". Then connect the new key in Locksmith.

## Related articles:

{% content-ref url="/pages/9OqKmRBcX77ody3p6kr5" %}
[Customizing the email list signup form](https://www.locksmith.guide/tutorials/more/customizing-the-email-list-signup-form.md)
{% endcontent-ref %}

{% content-ref url="/pages/77iwUv68N0neEBD4ZfM9" %}
[Use a Klaviyo list or segment as an access control list](https://www.locksmith.guide/tutorials/more/use-a-klaviyo-list-or-segment-as-an-access-control-list.md)
{% endcontent-ref %}

{% content-ref url="/pages/eG56o6Uu6VtxcgDbdhwU" %}
[Newsletter keys](https://www.locksmith.guide/keys/more/newsletter-keys.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.locksmith.guide/tutorials/more/klaviyo.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
