PostHog
Instead of following these steps manually, you can use the AI Credential Assistant — describe what you want to connect and the AI will walk you through the setup step by step, tailored to your account.
Overview
Connect your PostHog account to Nirvai to automate product analytics, access event data, and integrate user insights into your workflows.
Supported Authentication Methods
- Personal API Key - For private API endpoints
- Project API Key - For public endpoints (analytics tracking)
Prerequisites
- A PostHog account (Cloud or Self-hosted)
- Access to API key settings
Setup Instructions
Personal API Key (Recommended)
For accessing private API endpoints (user data, events, etc.):
- Log in to your PostHog account
- Click your avatar in the bottom-left corner
- Select Settings (or go to your user settings)
- Navigate to Personal API Keys
- Click Create personal API key
- Enter a label (e.g., "Nirvai Integration")
- Copy the key immediately
- In Nirvai, enter:
- API URL: Select your region (US, EU, or self-hosted URL)
- API Key: Paste your Personal API Key
Project API Key (For Analytics)
For analytics tracking and public endpoints:
- Go to Project Settings > General
- Find Project API Key
- Copy the key
- This key is for client-side analytics only
Configuration Fields
| Field | Description | Example |
|---|---|---|
| API URL | PostHog instance URL | https://us.posthog.com |
| API Key | Personal or Project API key | phx_xxxxx... |
API URL Options
Select based on your PostHog setup:
| Setup | API URL |
|---|---|
| US Cloud | https://us.posthog.com |
| EU Cloud | https://eu.posthog.com |
| Self-hosted | Your custom URL (e.g., https://posthog.yourcompany.com) |
Key Types
| Key Type | Use Case | Access Level |
|---|---|---|
| Personal API Key | Backend/API access | Full read access to your data |
| Project API Key | Frontend analytics | Limited to tracking events |
Available Operations
With PostHog credentials, you can:
- Query events and user data
- Access feature flags
- Retrieve analytics insights
- Manage persons and groups
- Access cohorts
- Query trends and funnels
Troubleshooting
Common Issues
- 401 Unauthorized: API key is invalid or expired. Create a new key.
- 403 Forbidden: Key doesn't have access to the endpoint.
- Wrong Region: Using US key with EU endpoint. Match your account region.
- Self-hosted Issues: Verify your PostHog URL is accessible.
Finding Your Region
Check your PostHog dashboard URL:
us.posthog.com→ US Cloudeu.posthog.com→ EU Cloud- Custom domain → Self-hosted
Key Scopes
Personal API keys have full read access by default. You cannot restrict scopes on personal keys.
Rate Limiting
PostHog has API rate limits:
- Standard rate limits apply to all endpoints
- Implement retry logic with exponential backoff
Related Resources
Adapted from n8n documentation for Nirvai platform
Next Steps
Use the AI Tool Creator to turn this credential into agent-callable tools. Describe what your agent should be able to do and the AI investigates the API, configures the endpoints, and gives you a reviewable toolkit before saving anything.