> For the complete documentation index, see [llms.txt](https://docs.appmixer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appmixer.com/connector-configuration/posthog.md).

# PostHog

The Appmixer PostHog connector uses **Personal API Key** authentication. No OAuth app registration is required — you only need to generate a Personal API key in your PostHog account and know your PostHog instance URL.

***

## 1. Identify Your PostHog Host URL

PostHog can be used in the cloud or self-hosted. Use the appropriate base URL:

| Instance        | Host URL                                                       |
| --------------- | -------------------------------------------------------------- |
| **US Cloud**    | `https://us.posthog.com`                                       |
| **EU Cloud**    | `https://eu.posthog.com`                                       |
| **Self-hosted** | Your own instance URL (e.g. `https://posthog.yourcompany.com`) |

***

## 2. Generate a Personal API Key

1. Log in to your PostHog instance.
2. Click your avatar or name in the top-right corner and go to **Settings**.
3. In the left sidebar, navigate to **User → Personal API Keys**.
4. Click **+ Create personal API key**.
5. Enter a descriptive name (e.g. `Appmixer Integration`).
6. Click **Create key**.
7. Copy the generated key immediately — it will not be shown again.

{% hint style="warning" %}
The Personal API key is shown **only once** at creation. Store it securely before closing the dialog.
{% endhint %}

{% hint style="info" %}
Personal API keys authenticate as you (the user who created them) and inherit your PostHog permissions. For production integrations, consider creating a dedicated PostHog user with appropriate project access.
{% endhint %}

***

## 3. Connect in Appmixer

When adding a PostHog component in Appmixer, you will be prompted to authenticate. Provide:

| Field                | Value                                                  |
| -------------------- | ------------------------------------------------------ |
| **PostHog Host**     | Your PostHog base URL (from Step 1, no trailing slash) |
| **Personal API Key** | The key generated in Step 2                            |

Appmixer will verify the credentials by calling `GET /api/users/@me/` on your PostHog instance. Your account email will be used as the display name for the connection.

***

## Troubleshooting

### "Authentication failed" / 401 Unauthorized

* Make sure the **Personal API Key** is correct and has not been revoked.
* Regenerate the key under **Settings → User → Personal API Keys** if needed.

### "Connection refused" / network error

* Double-check the **PostHog Host** URL. It should include the protocol (`https://`) and no trailing slash.
* For self-hosted instances, confirm the URL is publicly reachable from the Appmixer server.

### 403 Forbidden

* Your PostHog user may lack permissions for the requested project or resource.
* Verify that your user account has access to the relevant PostHog project.

***

## Resources

* [PostHog Personal API Keys documentation](https://posthog.com/docs/api#authentication)
* [PostHog API reference](https://posthog.com/docs/api)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.appmixer.com/connector-configuration/posthog.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
