> ## Documentation Index
> Fetch the complete documentation index at: https://docs.userjourneys.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Authenticate API requests with a project API key.

Every API request must include a project API key in the `Authorization` header.

```bash theme={null}
Authorization: Bearer uj_live_your_key_here
```

## Creating an API key

<Steps>
  <Step title="Open Settings">
    Go to **Settings** in the sidebar, then select the **API** tab.
  </Step>

  <Step title="Create a key">
    Click **Create Key**, enter a name (e.g., "Production"), and click **Create**.
  </Step>

  <Step title="Copy your key">
    Copy the key immediately. It starts with `uj_live_` and will not be shown again.
  </Step>
</Steps>

<Warning>
  API keys are shown once at creation and cannot be retrieved later. Store your key securely.
</Warning>

## Using your key

Include it as a Bearer token in the `Authorization` header of every request:

```bash cURL theme={null}
curl -H "Authorization: Bearer uj_live_your_key_here" \
  https://app.userjourneys.ai/api/v1/experiments
```

```javascript Node.js theme={null}
const response = await fetch(
  "https://app.userjourneys.ai/api/v1/experiments",
  {
    headers: {
      Authorization: "Bearer uj_live_your_key_here",
    },
  }
);
```

```python Python theme={null}
import requests

response = requests.get(
    "https://app.userjourneys.ai/api/v1/experiments",
    headers={"Authorization": "Bearer uj_live_your_key_here"},
)
```

Each API key is scoped to a single project. All endpoints return `401 Unauthorized` if the key is missing or invalid.
