> For the complete documentation index, see [llms.txt](https://docs.elevateab.com/elevate-helpcenter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elevateab.com/elevate-helpcenter/developer-reference/external-api/authentication.md). Agents can also search and read this documentation through its [MCP server](https://docs.elevateab.com/elevate-helpcenter/~gitbook/mcp).

# External API Authentication and API Keys

How to authenticate Elevate A/B Testing External API requests with a store API key or write key, and how to generate, regenerate, or revoke them in Settings, then API.

Send your key in the `Authorization` header of every request:

```http
Authorization: Bearer elv_your_key
```

A missing or invalid key returns `401 UNAUTHORIZED`.

{% hint style="info" %}
**Keys belong to one store.** The key decides which store you read, so you never pass a store ID and can never read another store's data. It only works for the External API: your MCP keys are separate.
{% endhint %}

## Two kinds of key

| Key       | Starts with | What it can do                                                                     |
| --------- | ----------- | ---------------------------------------------------------------------------------- |
| API key   | `elv_`      | Read your experiments and results                                                  |
| Write key | `elvw_`     | Everything the API key can, plus create, launch, pause, resume and end experiments |

Both are sent the same way. [`GET /me`](https://docs.elevateab.com/elevate-helpcenter/developer-reference/external-api/api-reference/me.md) returns `access`, `read` or `write`, so you can check which one you have. A write endpoint called with an API key returns `403 WRITE_ACCESS_REQUIRED`.

## How do I generate or regenerate an External API key?

The External API key has its own tab in **Settings**, called **API**.

* **Generate API key** creates the key when your store doesn't have one yet.
* Once a key exists, the tab shows it masked: `elv_` followed by dots and the key's last 4 characters.
* **Regenerate** replaces the key. Elevate A/B Testing asks you to confirm first, because the current key stops working right away and every integration using it disconnects until you update it with the new key. Click **Regenerate key** to confirm.

There is no option to delete the key without replacing it. To cut off every integration at once, regenerate the key and don't share the new one.

{% hint style="warning" %}
Anyone with the key can read your experiment data. Keep it out of public code, and regenerate it if it leaks.
{% endhint %}

## How do I create a write key?

On the same **API** tab, select **Create write key** and confirm. The key is shown once, so copy it before you close the page.

* Your store has one write key at a time. **Regenerate** replaces it, and the old key stops working right away.
* **Revoke** turns the write key off without replacing it.
* Uninstalling Elevate A/B Testing revokes the write key.

{% hint style="warning" %}
Anyone with the write key can launch experiments that change what your shoppers see. Keep it on your server, never in a browser, an app, or a shared file. See [Write access](https://docs.elevateab.com/elevate-helpcenter/developer-reference/external-api/write-access.md).
{% endhint %}
