posthog

Run HogQL queries and manage PostHog feature flags via REST API.

8|1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/mnlt/teleport --skill posthog-mnlt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: posthog
Source: https://github.com/mnlt/teleport/tree/main/skills/posthog
Command: npx skills add https://github.com/mnlt/teleport --skill posthog-mnlt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostHog is primarily used through its UI; this skill provides programmatic access via REST API to run HogQL queries, manage feature flags, fetch insights, and retrieve cohorts and session recordings without opening the UI.

Core Features & Use Cases

  • HogQL queries: execute SQL-like queries against events to generate charts and dashboards.
  • Flag and insight management: inspect, read, and fetch flag definitions and insights programmatically.
  • Cohorts and sessions: retrieve user cohorts and session recording metadata for analyses and experiments.
  • Deployment flexibility: works with US cloud, EU cloud, or self-hosted PostHog deployments.

Quick Start

Run a HogQL query against a PostHog project using your API key to fetch the top events for today.

Frequently Asked Questions about posthog

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run HogQL queries on PostHog event data without using the UI?

Run HogQL queries on PostHog event data without the UI by sending requests to the /api/projects/{project_id}/query/ endpoint via REST API. You execute SQL-like queries against events programmatically to generate charts and dashboards on demand.

Can I retrieve PostHog user cohorts and session recordings via REST API?

Retrieve PostHog user cohorts and session recording metadata via REST API by calling the /api/projects/{project_id}/cohorts/ and /session_recordings/ endpoints. This fetches user cohort lists and session recording metadata for analyses and experiments.

Does PostHog REST API access work with self-hosted deployments and EU cloud?

PostHog REST API access works with US cloud, EU cloud, and self-hosted PostHog deployments. Deployment flexibility allows programmatic access to query event data, manage feature flags, and retrieve insights across different hosting environments.

What's the best way to manage PostHog feature flags programmatically?

Manage PostHog feature flags programmatically by interacting with the /api/projects/{project_id}/feature_flags/ endpoint via REST API. You can inspect, read, and fetch flag definitions automatically without needing to navigate through the PostHog UI.

Do I need a personal API key to authenticate PostHog REST API requests?

You need a POSTHOG_PERSONAL_API_KEY or POSTHOG_API_KEY to authenticate PostHog REST API requests. Bearer token authentication is required for all API calls to securely access project insights, event data, and feature flags.

Why fetch PostHog insights programmatically instead of through the dashboard?

Fetch PostHog insights programmatically via the /api/projects/{project_id}/insights/ endpoint to integrate on-demand analytics, experiment results, and event data directly into external workflows, bypassing manual UI navigation for automated reporting.