---
canonical: https://docs.jentic.com/guides/credentials/posthog-guide/
representation: markdown-alternate
# Canonical page: https://docs.jentic.com/guides/credentials/posthog-guide/
# This is the Markdown alternate of the page above.
title: "Set Up PostHog Credentials in Jentic One (API Key)"
description: >-
  Set up PostHog credentials in Jentic One using a Personal API key pasted as a Bearer
  token, choosing the right US or EU region so your first API call succeeds.
---

# PostHog Credential Setup

This guide walks you through setting up API credentials for PostHog in Jentic One using **Bearer token** auth. In Jentic One the auth type presents as a **Bearer token**, but the value you paste is actually a PostHog **Personal API key** — this guide makes that distinction clear so you can get to a successful API call quickly.

## Overview

### What you'll need

- A PostHog account (free tier available on both regions)
- To know your PostHog **region** — **US Cloud** or **EU Cloud** — because keys and data are region-bound

### What you'll do

1. **Find PostHog** in the Jentic Public API Catalog
2. **Determine your region** (US Cloud vs EU Cloud) and its base URL
3. **Create a Personal API key** in PostHog with the scopes you need
4. **Gather your Project ID** (and Organization ID if required)
5. **Add a Bearer token credential** by pasting the Personal API key, which includes PostHog in your workspace
6. **Verify the connection** to ensure everything is working

### Token Types

PostHog has several kinds of keys. Only one of them authenticates the public API — using the wrong one is the most common setup mistake.

| Token | Looks like | Use in Jentic One? |
| --- | --- | --- |
| **Personal API key** | `phx_...` | **Yes** — this is the value for the Jentic One **Bearer token** field |
| **Project API key** | `phc_...` | **No** — this is a client-side capture/ingestion key for `posthog-js` and SDKs; it does **not** authenticate the REST API |
| **Feature flag secure API key** | — | No — used only for secure server-side local evaluation of feature flags; out of scope for general API auth |

> **Important:** The Jentic One **Bearer token** value **is** your PostHog **Personal API key** (`phx_...`). Do **not** paste the Project API key (`phc_...`) — it will fail authentication.

### Choosing your region

PostHog Cloud is split across two regional hosts. The region you signed up on determines which host Jentic One must call:

- **US Cloud** — base URL `https://us.posthog.com`
- **EU Cloud** — base URL `https://eu.posthog.com`

You can tell your region from the URL you use to log in to PostHog (`us.posthog.com` or `eu.posthog.com`). Keys, projects, and data **do not cross regions** — a key created on US Cloud will not work against the EU host, and vice-versa.

### Reusing credentials

> **Note:** A Personal API key works across all projects it is scoped to within the **same region and organization**. Scope the key to the projects you need, and you can reuse the same key when adding more PostHog operations in Jentic One (as long as the region matches).

---

## Step-by-Step Instructions

### 1. Find PostHog in the Jentic Public API Catalog

1. In the Jentic One UI, open the **Jentic Public API Catalog** and search for "PostHog"
2. Select PostHog and click **Add credential** (adding a credential includes PostHog in your workspace)
3. Keep this tab open — you'll enter your credentials here

### 2. Identify Your Region and Base URL

1. Look at the URL you use to sign in to PostHog:
   - `https://us.posthog.com` → you're on **US Cloud**, base URL `https://us.posthog.com`
   - `https://eu.posthog.com` → you're on **EU Cloud**, base URL `https://eu.posthog.com`
2. Note this base URL — you'll set it as the region host in Jentic One in Step 5, and every key and ID you gather must come from this same region.

### 3. Create a Personal API Key in PostHog

1. Open a new tab and log in to PostHog on your region (`us.posthog.com` or `eu.posthog.com`)
2. Click your account menu and go to **Settings → Personal API keys** (under the **"Your account"** section)
3. Click **Create personal API key**
4. Give the key a descriptive name (e.g., "Jentic Integration")
5. Choose the **scopes** the key should have:
   - Select the read/write scopes for the resources you plan to use (e.g., `query:read`, `insight:read`, `event:read`)
   - Grant the minimum scopes needed — you can create additional keys later
   - Optionally restrict the key to specific organizations/projects
6. Click **Create key**
7. **Copy the key immediately** (`phx_...`) — it is shown only once and cannot be retrieved later

> **Security tip:** Store your Personal API key in a secure password manager. Treat it like a password — anyone with the key can act with its scopes.

### 4. Find Your Project ID (and Organization ID)

Many PostHog endpoints are project-scoped (`/api/projects/{project_id}/...`), so you'll usually need your Project ID:

1. In PostHog, go to **Settings → Project** (or **Project settings**)
2. Copy the **Project ID** (a numeric value); it also appears in the URL when a project is selected
3. If an operation requires it, get your **Organization ID** from **Settings → Organization** (a UUID value)

### 5. Add Bearer Token Credentials in Jentic One

1. Return to the Jentic One UI tab (where you clicked "Add credential" in Step 1). You'll see fields for Bearer token auth:
   - **Bearer token:** Paste the **Personal API key** (`phx_...`) from Step 3 — this "Bearer token" value **is** your Personal API key
   - **Region host / base URL:** Set the base URL for your region from Step 2 (`https://us.posthog.com` or `https://eu.posthog.com`)
   - **Project ID / Organization ID:** Enter these from Step 4 if Jentic One prompts for them
2. Give your credential a descriptive name (e.g., "PostHog Personal API Key")
3. Click **Save** or **Connect** to complete the setup

> **Note:** PostHog sends the Personal API key as an HTTP `Authorization: Bearer <key>` header. Jentic One's **Bearer token** field maps directly to this — no `Bearer ` prefix needed, just paste the raw key.

### 6. Verify Setup

If no errors occurred, PostHog should now be available in your **workspace** with credentials configured.

---

## Rate Limits & Token Management

- **Rate limits:** PostHog applies per-key rate limits on the public API (analytics endpoints are limited per minute and per hour, with tighter limits on query endpoints). If you hit a limit you'll get an `HTTP 429` response — back off and retry. See the [PostHog API docs](https://posthog.com/docs/api) for current limits.
- **Scopes:** A key can only call endpoints covered by its scopes. Add scopes by creating a new key or editing the key in **Settings → Personal API keys**.
- **Rotation & revocation:** Manage, roll, or revoke keys from **Settings → Personal API keys**. If a key is compromised, revoke it immediately and create a new one.
- **Treat keys as secrets:** Never commit a Personal API key to source control or share it in plain text.

---

## Troubleshooting

### `401 Unauthorized` / authentication failed

**Possible causes and solutions:**

1. **Wrong key type**
   - Make sure you used the **Personal API key** (`phx_...`), **not** the Project API key (`phc_...`). The `phc_` key is for client-side capture and will not authenticate the REST API.
2. **Expired or revoked key**
   - Check the key still exists and is active under **Settings → Personal API keys**. Create a new one if needed (keys are shown only once).
3. **Copy error**
   - Ensure you pasted the full key with no extra spaces, and no `Bearer ` prefix (Jentic One adds that for you).

### Wrong region host

**What it means:** You're calling the wrong regional host for your key (e.g., a US Cloud key against the EU host).

**Solution:** Confirm your region from your PostHog login URL (Step 2) and set the matching base URL (`https://us.posthog.com` or `https://eu.posthog.com`) in Jentic One. Keys and data do not cross regions.

### Missing or incorrect Project ID

**What it means:** Project-scoped endpoints (`/api/projects/{project_id}/...`) return `404` or an error when the Project ID is wrong or missing.

**Solution:** Copy the numeric **Project ID** from **Settings → Project** and ensure it belongs to the same region as your key.

### `403 Forbidden` / insufficient scopes

**What it means:** Your key doesn't have the scope required for the operation.

**Solution:** Edit the key (or create a new one) under **Settings → Personal API keys** and grant the required scopes.

---

## Next Steps

After setting up your PostHog credentials:

- Use PostHog in your self-hosted [Jentic One](https://github.com/jentic/jentic-one)
- Explore other PostHog operations available in the catalogue and add them to your agent

---

## Additional Resources

- [PostHog API documentation](https://posthog.com/docs/api)
- [Personal API keys settings](https://us.posthog.com/settings/user-api-keys) (US Cloud) · [EU Cloud](https://eu.posthog.com/settings/user-api-keys)
- [PostHog API authentication](https://posthog.com/docs/api#authentication)
