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

# PostHog

> Integrate your application with the PostHog API

## 🚀 Quickstart

Connect to PostHog with Nango and see data flow in 2 minutes.

**1. Create an integration**

In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *PostHog*.

**2. Authorize PostHog**

Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then enter your **Subdomain** (e.g. `us` or `eu.i`) and **API Key**. Later, you'll let your users do the same directly from your app.

**3. Call the PostHog API**

Let's make your first request to the PostHog API (get current user). Replace the placeholders below with your [Environment API key](https://nango.dev/docs/reference/backend/http-api/api-keys.md), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

> [tab] cURL
>
> ```bash theme={null}
> curl "https://api.nango.dev/proxy/api/users/@me" \
>   -H "Authorization: Bearer <NANGO-API-KEY>" \
>   -H "Provider-Config-Key: <INTEGRATION-ID>" \
>   -H "Connection-Id: <CONNECTION-ID>"
> ```

> [tab] Node
>
> Install Nango's backend SDK with `npm i @nangohq/node`. Then run:
>
> ```typescript theme={null}
> import { Nango } from '@nangohq/node';
>
> const nango = new Nango({ apiKey: '<NANGO-API-KEY>' });
>
> const response = await nango.get({
>     endpoint: '/api/users/@me',
>     providerConfigKey: '<INTEGRATION-ID>',
>     connectionId: '<CONNECTION-ID>'
> });
>
> console.log(response.data);
> ```

Or fetch credentials dynamically via the [Node SDK](https://nango.dev/docs/reference/backend/backend-sdk/node.md#get-a-connection-with-credentials) or [API](https://nango.dev/docs/reference/backend/http-api/connections/get.md).

✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.

**4. Implement Nango in your app**

Follow our [Auth implementation guide](https://nango.dev/docs/guides/primitives/auth.md) to integrate Nango in your app.

To obtain your own credentials (subdomain and API key), follow the connect guide linked below.

## 📚 PostHog Integration Guides

Nango-maintained guides for common use cases.

* [How do I link my PostHog account?](https://nango.dev/docs/api-integrations/posthog/connect)\
  Connect your PostHog account using the Connect UI (subdomain and API key)

> [!NOTE]
>
> **Subdomain:** Use the part of your PostHog URL after `https://` and before `.posthog.com` (e.g. `us`, `eu.i` for US/EU Cloud). PostHog enforces different [rate limits](https://posthog.com/docs/api#rate-limiting) per resource.

> [!NOTE]
>
> Only need to send events, not read data? Use the [PostHog (Capture API)](https://nango.dev/docs/api-integrations/posthog-capture.md) integration instead — it authenticates with a public Project Token instead of a personal API key, and doesn't require a logged-in PostHog user (events still need a `distinct_id`).

Official docs: [PostHog API documentation](https://posthog.com/docs/api)

## 🧩 Pre-built syncs & tools for PostHog

Explore Nango-provided tools in your dashboard. Extend and customize them to fit your needs.

### Others

| Function name | Description | Type |
| - | - | - |
| `capture-event` | Capture a PostHog event. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-action` | Create an action (saved event pattern) in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-alert` | Create an alert on an insight in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-annotation` | Create an annotation in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-cohort` | Create a cohort in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-dashboard` | Create a dashboard in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-early-access-feature` | Create an early access feature in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-experiment` | Create an A/B experiment in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-feature-flag` | Create a feature flag in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-insight` | Create a insight in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-person` | Create a person in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-survey` | Create a survey in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-action` | Delete an action in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-alert` | Delete an alert in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-annotation` | Delete or archive an annotation in PostHog by setting it as deleted. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-cohort` | Delete or archive a cohort in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-dashboard` | Delete or archive a dashboard in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-early-access-feature` | Delete an early access feature in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-feature-flag` | Delete or archive a feature flag in PostHog | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-insight` | Delete or archive an insight in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-person` | Delete or archive a person in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-survey` | Delete a survey in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-action` | Retrieve a single action from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-alert` | Retrieve a single alert from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-annotation` | Retrieve a single annotation from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-cohort` | Retrieve a single cohort from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-dashboard` | Retrieve a single dashboard from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-early-access-feature` | Retrieve a single early access feature from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-event-definition` | Retrieve a single event definition from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-event` | Retrieve a single event from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-experiment` | Retrieve a single experiment from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-feature-flag` | Retrieve a single feature flag from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-insight` | Retrieve a single insight from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-person` | Retrieve a single person from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-project` | Retrieve a single project from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-property-definition` | Retrieve a single property definition from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-survey` | Retrieve a single survey from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `identify-person` | Identify or update a PostHog person. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-actions` | List actions (saved event patterns) from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-alerts` | List alerts from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-annotations` | List annotations from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-cohorts` | List cohorts from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-dashboards` | List dashboards from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-early-access-features` | List early access features from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-event-definitions` | List event definitions (auto-detected event schemas) from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-events` | List events from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-experiments` | List experiments from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-feature-flags` | List feature flags from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-insights` | List insights from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-persons` | List persons from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-projects` | List projects from PostHog | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-property-definitions` | List property definitions from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-session-recordings` | List session recordings from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-surveys` | List surveys from PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-action` | Update an action in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-alert` | Update an alert in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-annotation` | Update an annotation in PostHog | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-cohort` | Update a cohort in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-dashboard` | Update a dashboard in PostHog | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-early-access-feature` | Update an early access feature in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-experiment` | Update an experiment in PostHog | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-feature-flag` | Update a feature flag in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-insight` | Update a insight in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-person` | Update a person in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-property-definition` | Update a property definition in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-survey` | Update a survey in PostHog. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `actions` | Sync actions (saved event patterns) from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `annotations` | Sync annotations from PostHog | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `cohorts` | Sync cohorts from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `dashboards` | Sync dashboards from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `early-access-features` | Sync early access features from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `event-definitions` | Sync event definitions (auto-detected event schemas) from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `events` | Sync events from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `experiments` | Sync experiments from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `feature-flags` | Sync feature flags from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `insights` | Sync insights from PostHog | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `persons` | Sync persons from PostHog | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `projects` | Sync projects from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `session-recordings` | Sync session recording metadata from PostHog | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `surveys` | Sync surveys from PostHog. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.