{
  "schemaVersion": "1.0",
  "item": {
    "slug": "posthog-api",
    "name": "PostHog",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/byungkyu/posthog-api",
    "canonicalUrl": "https://clawhub.ai/byungkyu/posthog-api",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/posthog-api",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=posthog-api",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/posthog-api"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/posthog-api",
    "agentPageUrl": "https://openagent3.xyz/skills/posthog-api/agent",
    "manifestUrl": "https://openagent3.xyz/skills/posthog-api/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/posthog-api/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "PostHog",
        "body": "Access the PostHog API with managed authentication. Query product analytics events with HogQL, manage feature flags, analyze user behavior, view session recordings, and run A/B experiments."
      },
      {
        "title": "Quick Start",
        "body": "# List projects\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/posthog/api/projects/')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Base URL",
        "body": "https://gateway.maton.ai/posthog/{native-api-path}\n\nReplace {native-api-path} with the actual PostHog API endpoint path. The gateway proxies requests to {subdomain}.posthog.com and automatically injects your credentials."
      },
      {
        "title": "Authentication",
        "body": "All requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key"
      },
      {
        "title": "Connection Management",
        "body": "Manage your PostHog OAuth connections at https://ctrl.maton.ai."
      },
      {
        "title": "List Connections",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=posthog&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Create Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'posthog'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Get Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"ce2b0840-4e39-4b58-b607-7290fa7a3595\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-23T09:37:57.686121Z\",\n    \"last_updated_time\": \"2026-02-23T09:39:11.851118Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"posthog\",\n    \"metadata\": {}\n  }\n}\n\nOpen the returned url in a browser to complete OAuth authorization."
      },
      {
        "title": "Delete Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Specifying Connection",
        "body": "If you have multiple PostHog connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/posthog/api/projects/')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', 'ce2b0840-4e39-4b58-b607-7290fa7a3595')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nIf omitted, the gateway uses the default (oldest) active connection."
      },
      {
        "title": "Organizations",
        "body": "Get Current Organization\n\nGET /posthog/api/organizations/@current/"
      },
      {
        "title": "Projects",
        "body": "List Projects\n\nGET /posthog/api/projects/\n\nResponse:\n\n{\n  \"count\": 1,\n  \"next\": null,\n  \"previous\": null,\n  \"results\": [\n    {\n      \"id\": 136209,\n      \"uuid\": \"019583c6-377c-0000-e55c-8696cbc33595\",\n      \"organization\": \"019583c6-3635-0000-5798-c18f20963b3b\",\n      \"api_token\": \"phc_XXX\",\n      \"name\": \"Default project\",\n      \"timezone\": \"UTC\"\n    }\n  ]\n}\n\nGet Current Project\n\nGET /posthog/api/projects/@current/"
      },
      {
        "title": "Users",
        "body": "Get Current User\n\nGET /posthog/api/users/@me/"
      },
      {
        "title": "Query (HogQL)",
        "body": "The query endpoint is the recommended way to retrieve events and run analytics queries.\n\nRun HogQL Query\n\nPOST /posthog/api/projects/{project_id}/query/\nContent-Type: application/json\n\n{\n  \"query\": {\n    \"kind\": \"HogQLQuery\",\n    \"query\": \"SELECT event, count() FROM events GROUP BY event ORDER BY count() DESC LIMIT 10\"\n  }\n}\n\nResponse:\n\n{\n  \"columns\": [\"event\", \"count()\"],\n  \"results\": [\n    [\"$pageview\", 140504],\n    [\"$autocapture\", 108691],\n    [\"$identify\", 5455]\n  ],\n  \"types\": [\n    [\"event\", \"String\"],\n    [\"count()\", \"UInt64\"]\n  ]\n}"
      },
      {
        "title": "Persons",
        "body": "List Persons\n\nGET /posthog/api/projects/{project_id}/persons/?limit=10\n\nResponse:\n\n{\n  \"results\": [\n    {\n      \"id\": \"5d79eecb-93e6-5c8b-90f9-8510ba4040b8\",\n      \"uuid\": \"5d79eecb-93e6-5c8b-90f9-8510ba4040b8\",\n      \"name\": \"user@example.com\",\n      \"is_identified\": true,\n      \"distinct_ids\": [\"user-uuid\", \"anon-uuid\"],\n      \"properties\": {\n        \"email\": \"user@example.com\",\n        \"name\": \"John Doe\"\n      }\n    }\n  ],\n  \"next\": \"https://us.posthog.com/api/projects/{project_id}/persons/?limit=10&offset=10\"\n}\n\nGet Person\n\nGET /posthog/api/projects/{project_id}/persons/{person_uuid}/"
      },
      {
        "title": "Dashboards",
        "body": "List Dashboards\n\nGET /posthog/api/projects/{project_id}/dashboards/\n\nGet Dashboard\n\nGET /posthog/api/projects/{project_id}/dashboards/{dashboard_id}/\n\nCreate Dashboard\n\nPOST /posthog/api/projects/{project_id}/dashboards/\nContent-Type: application/json\n\n{\n  \"name\": \"My Dashboard\",\n  \"description\": \"Analytics overview\"\n}\n\nUpdate Dashboard\n\nPATCH /posthog/api/projects/{project_id}/dashboards/{dashboard_id}/\nContent-Type: application/json\n\n{\n  \"name\": \"Updated Dashboard Name\"\n}"
      },
      {
        "title": "Insights",
        "body": "List Insights\n\nGET /posthog/api/projects/{project_id}/insights/?limit=10\n\nGet Insight\n\nGET /posthog/api/projects/{project_id}/insights/{insight_id}/\n\nCreate Insight\n\nPOST /posthog/api/projects/{project_id}/insights/\nContent-Type: application/json\n\n{\n  \"name\": \"Daily Active Users\",\n  \"query\": {\n    \"kind\": \"InsightVizNode\",\n    \"source\": {\n      \"kind\": \"TrendsQuery\",\n      \"series\": [{\"kind\": \"EventsNode\", \"event\": \"$pageview\", \"math\": \"dau\"}],\n      \"interval\": \"day\",\n      \"dateRange\": {\"date_from\": \"-30d\"}\n    }\n  }\n}"
      },
      {
        "title": "Feature Flags",
        "body": "List Feature Flags\n\nGET /posthog/api/projects/{project_id}/feature_flags/\n\nGet Feature Flag\n\nGET /posthog/api/projects/{project_id}/feature_flags/{flag_id}/\n\nCreate Feature Flag\n\nPOST /posthog/api/projects/{project_id}/feature_flags/\nContent-Type: application/json\n\n{\n  \"key\": \"my-feature-flag\",\n  \"name\": \"My Feature Flag\",\n  \"active\": true,\n  \"filters\": {\n    \"groups\": [{\"rollout_percentage\": 100}]\n  }\n}\n\nUpdate Feature Flag\n\nPATCH /posthog/api/projects/{project_id}/feature_flags/{flag_id}/\nContent-Type: application/json\n\n{\n  \"active\": false\n}\n\nDelete Feature Flag\n\nUse soft delete by setting deleted: true:\n\nPATCH /posthog/api/projects/{project_id}/feature_flags/{flag_id}/\nContent-Type: application/json\n\n{\n  \"deleted\": true\n}"
      },
      {
        "title": "Cohorts",
        "body": "List Cohorts\n\nGET /posthog/api/projects/{project_id}/cohorts/\n\nGet Cohort\n\nGET /posthog/api/projects/{project_id}/cohorts/{cohort_id}/\n\nCreate Cohort\n\nPOST /posthog/api/projects/{project_id}/cohorts/\nContent-Type: application/json\n\n{\n  \"name\": \"Active Users\",\n  \"groups\": [\n    {\n      \"properties\": [\n        {\"key\": \"$pageview\", \"type\": \"event\", \"value\": \"performed_event\"}\n      ]\n    }\n  ]\n}"
      },
      {
        "title": "Actions",
        "body": "List Actions\n\nGET /posthog/api/projects/{project_id}/actions/\n\nCreate Action\n\nPOST /posthog/api/projects/{project_id}/actions/\nContent-Type: application/json\n\n{\n  \"name\": \"Signed Up\",\n  \"steps\": [{\"event\": \"$identify\"}]\n}"
      },
      {
        "title": "Session Recordings",
        "body": "List Session Recordings\n\nGET /posthog/api/projects/{project_id}/session_recordings/?limit=10\n\nResponse:\n\n{\n  \"results\": [\n    {\n      \"id\": \"019c8795-79e3-7a05-ac56-597b102f1960\",\n      \"distinct_id\": \"user-uuid\",\n      \"recording_duration\": 1807,\n      \"start_time\": \"2026-02-22T23:00:46.389000Z\",\n      \"end_time\": \"2026-02-22T23:30:53.297000Z\",\n      \"click_count\": 0,\n      \"keypress_count\": 0,\n      \"start_url\": \"https://example.com/register\"\n    }\n  ],\n  \"has_next\": false\n}\n\nGet Session Recording\n\nGET /posthog/api/projects/{project_id}/session_recordings/{recording_id}/"
      },
      {
        "title": "Annotations",
        "body": "List Annotations\n\nGET /posthog/api/projects/{project_id}/annotations/\n\nCreate Annotation\n\nPOST /posthog/api/projects/{project_id}/annotations/\nContent-Type: application/json\n\n{\n  \"content\": \"New feature launched\",\n  \"date_marker\": \"2026-02-23T00:00:00Z\",\n  \"scope\": \"project\"\n}"
      },
      {
        "title": "Surveys",
        "body": "List Surveys\n\nGET /posthog/api/projects/{project_id}/surveys/\n\nCreate Survey\n\nPOST /posthog/api/projects/{project_id}/surveys/\nContent-Type: application/json\n\n{\n  \"name\": \"NPS Survey\",\n  \"type\": \"popover\",\n  \"questions\": [\n    {\n      \"type\": \"rating\",\n      \"question\": \"How likely are you to recommend us?\"\n    }\n  ]\n}"
      },
      {
        "title": "Experiments",
        "body": "List Experiments\n\nGET /posthog/api/projects/{project_id}/experiments/\n\nCreate Experiment\n\nPOST /posthog/api/projects/{project_id}/experiments/\nContent-Type: application/json\n\n{\n  \"name\": \"Button Color Test\",\n  \"feature_flag_key\": \"button-color-test\"\n}"
      },
      {
        "title": "Event Definitions",
        "body": "List Event Definitions\n\nGET /posthog/api/projects/{project_id}/event_definitions/?limit=10"
      },
      {
        "title": "Property Definitions",
        "body": "List Property Definitions\n\nGET /posthog/api/projects/{project_id}/property_definitions/?limit=10"
      },
      {
        "title": "Pagination",
        "body": "PostHog uses offset-based pagination:\n\nGET /posthog/api/projects/{project_id}/persons/?limit=10&offset=20\n\nResponse includes pagination info:\n\n{\n  \"count\": 100,\n  \"next\": \"https://us.posthog.com/api/projects/{project_id}/persons/?limit=10&offset=30\",\n  \"previous\": \"https://us.posthog.com/api/projects/{project_id}/persons/?limit=10&offset=10\",\n  \"results\": [...]\n}\n\nFor session recordings, use has_next boolean:\n\n{\n  \"results\": [...],\n  \"has_next\": true\n}"
      },
      {
        "title": "JavaScript",
        "body": "const response = await fetch(\n  'https://gateway.maton.ai/posthog/api/projects/',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\nconst data = await response.json();"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/posthog/api/projects/',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\ndata = response.json()"
      },
      {
        "title": "Python - HogQL Query",
        "body": "import os\nimport requests\n\nresponse = requests.post(\n    'https://gateway.maton.ai/posthog/api/projects/@current/query/',\n    headers={\n        'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}',\n        'Content-Type': 'application/json'\n    },\n    json={\n        'query': {\n            'kind': 'HogQLQuery',\n            'query': 'SELECT event, count() FROM events GROUP BY event LIMIT 10'\n        }\n    }\n)\ndata = response.json()"
      },
      {
        "title": "Notes",
        "body": "Use @current as a shortcut for the current project ID (e.g., /api/projects/@current/dashboards/)\nProject IDs are integers (e.g., 136209)\nPerson UUIDs are in standard UUID format\nThe Events endpoint is deprecated; use the Query endpoint with HogQL instead\nSession recordings include activity metrics like click_count, keypress_count\nPostHog uses soft delete: use PATCH with {\"deleted\": true} instead of HTTP DELETE\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. Use Python examples instead."
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning400Missing PostHog connection401Invalid or missing Maton API key429Rate limited4xx/5xxPassthrough error from PostHog API"
      },
      {
        "title": "Rate Limits",
        "body": "Analytics endpoints (insights, persons, recordings): 240/minute, 1200/hour\nHogQL query endpoint: 120/hour\nCRUD endpoints: 480/minute, 4800/hour"
      },
      {
        "title": "Resources",
        "body": "PostHog API Overview\nHogQL Documentation\nFeature Flags\nSession Replay\nExperiments\nMaton Community\nMaton Support"
      }
    ],
    "body": "PostHog\n\nAccess the PostHog API with managed authentication. Query product analytics events with HogQL, manage feature flags, analyze user behavior, view session recordings, and run A/B experiments.\n\nQuick Start\n# List projects\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/posthog/api/projects/')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nBase URL\nhttps://gateway.maton.ai/posthog/{native-api-path}\n\n\nReplace {native-api-path} with the actual PostHog API endpoint path. The gateway proxies requests to {subdomain}.posthog.com and automatically injects your credentials.\n\nAuthentication\n\nAll requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key\nConnection Management\n\nManage your PostHog OAuth connections at https://ctrl.maton.ai.\n\nList Connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=posthog&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nCreate Connection\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'posthog'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nGet Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"ce2b0840-4e39-4b58-b607-7290fa7a3595\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-23T09:37:57.686121Z\",\n    \"last_updated_time\": \"2026-02-23T09:39:11.851118Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"posthog\",\n    \"metadata\": {}\n  }\n}\n\n\nOpen the returned url in a browser to complete OAuth authorization.\n\nDelete Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nSpecifying Connection\n\nIf you have multiple PostHog connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/posthog/api/projects/')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', 'ce2b0840-4e39-4b58-b607-7290fa7a3595')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\nAPI Reference\nOrganizations\nGet Current Organization\nGET /posthog/api/organizations/@current/\n\nProjects\nList Projects\nGET /posthog/api/projects/\n\n\nResponse:\n\n{\n  \"count\": 1,\n  \"next\": null,\n  \"previous\": null,\n  \"results\": [\n    {\n      \"id\": 136209,\n      \"uuid\": \"019583c6-377c-0000-e55c-8696cbc33595\",\n      \"organization\": \"019583c6-3635-0000-5798-c18f20963b3b\",\n      \"api_token\": \"phc_XXX\",\n      \"name\": \"Default project\",\n      \"timezone\": \"UTC\"\n    }\n  ]\n}\n\nGet Current Project\nGET /posthog/api/projects/@current/\n\nUsers\nGet Current User\nGET /posthog/api/users/@me/\n\nQuery (HogQL)\n\nThe query endpoint is the recommended way to retrieve events and run analytics queries.\n\nRun HogQL Query\nPOST /posthog/api/projects/{project_id}/query/\nContent-Type: application/json\n\n{\n  \"query\": {\n    \"kind\": \"HogQLQuery\",\n    \"query\": \"SELECT event, count() FROM events GROUP BY event ORDER BY count() DESC LIMIT 10\"\n  }\n}\n\n\nResponse:\n\n{\n  \"columns\": [\"event\", \"count()\"],\n  \"results\": [\n    [\"$pageview\", 140504],\n    [\"$autocapture\", 108691],\n    [\"$identify\", 5455]\n  ],\n  \"types\": [\n    [\"event\", \"String\"],\n    [\"count()\", \"UInt64\"]\n  ]\n}\n\nPersons\nList Persons\nGET /posthog/api/projects/{project_id}/persons/?limit=10\n\n\nResponse:\n\n{\n  \"results\": [\n    {\n      \"id\": \"5d79eecb-93e6-5c8b-90f9-8510ba4040b8\",\n      \"uuid\": \"5d79eecb-93e6-5c8b-90f9-8510ba4040b8\",\n      \"name\": \"user@example.com\",\n      \"is_identified\": true,\n      \"distinct_ids\": [\"user-uuid\", \"anon-uuid\"],\n      \"properties\": {\n        \"email\": \"user@example.com\",\n        \"name\": \"John Doe\"\n      }\n    }\n  ],\n  \"next\": \"https://us.posthog.com/api/projects/{project_id}/persons/?limit=10&offset=10\"\n}\n\nGet Person\nGET /posthog/api/projects/{project_id}/persons/{person_uuid}/\n\nDashboards\nList Dashboards\nGET /posthog/api/projects/{project_id}/dashboards/\n\nGet Dashboard\nGET /posthog/api/projects/{project_id}/dashboards/{dashboard_id}/\n\nCreate Dashboard\nPOST /posthog/api/projects/{project_id}/dashboards/\nContent-Type: application/json\n\n{\n  \"name\": \"My Dashboard\",\n  \"description\": \"Analytics overview\"\n}\n\nUpdate Dashboard\nPATCH /posthog/api/projects/{project_id}/dashboards/{dashboard_id}/\nContent-Type: application/json\n\n{\n  \"name\": \"Updated Dashboard Name\"\n}\n\nInsights\nList Insights\nGET /posthog/api/projects/{project_id}/insights/?limit=10\n\nGet Insight\nGET /posthog/api/projects/{project_id}/insights/{insight_id}/\n\nCreate Insight\nPOST /posthog/api/projects/{project_id}/insights/\nContent-Type: application/json\n\n{\n  \"name\": \"Daily Active Users\",\n  \"query\": {\n    \"kind\": \"InsightVizNode\",\n    \"source\": {\n      \"kind\": \"TrendsQuery\",\n      \"series\": [{\"kind\": \"EventsNode\", \"event\": \"$pageview\", \"math\": \"dau\"}],\n      \"interval\": \"day\",\n      \"dateRange\": {\"date_from\": \"-30d\"}\n    }\n  }\n}\n\nFeature Flags\nList Feature Flags\nGET /posthog/api/projects/{project_id}/feature_flags/\n\nGet Feature Flag\nGET /posthog/api/projects/{project_id}/feature_flags/{flag_id}/\n\nCreate Feature Flag\nPOST /posthog/api/projects/{project_id}/feature_flags/\nContent-Type: application/json\n\n{\n  \"key\": \"my-feature-flag\",\n  \"name\": \"My Feature Flag\",\n  \"active\": true,\n  \"filters\": {\n    \"groups\": [{\"rollout_percentage\": 100}]\n  }\n}\n\nUpdate Feature Flag\nPATCH /posthog/api/projects/{project_id}/feature_flags/{flag_id}/\nContent-Type: application/json\n\n{\n  \"active\": false\n}\n\nDelete Feature Flag\n\nUse soft delete by setting deleted: true:\n\nPATCH /posthog/api/projects/{project_id}/feature_flags/{flag_id}/\nContent-Type: application/json\n\n{\n  \"deleted\": true\n}\n\nCohorts\nList Cohorts\nGET /posthog/api/projects/{project_id}/cohorts/\n\nGet Cohort\nGET /posthog/api/projects/{project_id}/cohorts/{cohort_id}/\n\nCreate Cohort\nPOST /posthog/api/projects/{project_id}/cohorts/\nContent-Type: application/json\n\n{\n  \"name\": \"Active Users\",\n  \"groups\": [\n    {\n      \"properties\": [\n        {\"key\": \"$pageview\", \"type\": \"event\", \"value\": \"performed_event\"}\n      ]\n    }\n  ]\n}\n\nActions\nList Actions\nGET /posthog/api/projects/{project_id}/actions/\n\nCreate Action\nPOST /posthog/api/projects/{project_id}/actions/\nContent-Type: application/json\n\n{\n  \"name\": \"Signed Up\",\n  \"steps\": [{\"event\": \"$identify\"}]\n}\n\nSession Recordings\nList Session Recordings\nGET /posthog/api/projects/{project_id}/session_recordings/?limit=10\n\n\nResponse:\n\n{\n  \"results\": [\n    {\n      \"id\": \"019c8795-79e3-7a05-ac56-597b102f1960\",\n      \"distinct_id\": \"user-uuid\",\n      \"recording_duration\": 1807,\n      \"start_time\": \"2026-02-22T23:00:46.389000Z\",\n      \"end_time\": \"2026-02-22T23:30:53.297000Z\",\n      \"click_count\": 0,\n      \"keypress_count\": 0,\n      \"start_url\": \"https://example.com/register\"\n    }\n  ],\n  \"has_next\": false\n}\n\nGet Session Recording\nGET /posthog/api/projects/{project_id}/session_recordings/{recording_id}/\n\nAnnotations\nList Annotations\nGET /posthog/api/projects/{project_id}/annotations/\n\nCreate Annotation\nPOST /posthog/api/projects/{project_id}/annotations/\nContent-Type: application/json\n\n{\n  \"content\": \"New feature launched\",\n  \"date_marker\": \"2026-02-23T00:00:00Z\",\n  \"scope\": \"project\"\n}\n\nSurveys\nList Surveys\nGET /posthog/api/projects/{project_id}/surveys/\n\nCreate Survey\nPOST /posthog/api/projects/{project_id}/surveys/\nContent-Type: application/json\n\n{\n  \"name\": \"NPS Survey\",\n  \"type\": \"popover\",\n  \"questions\": [\n    {\n      \"type\": \"rating\",\n      \"question\": \"How likely are you to recommend us?\"\n    }\n  ]\n}\n\nExperiments\nList Experiments\nGET /posthog/api/projects/{project_id}/experiments/\n\nCreate Experiment\nPOST /posthog/api/projects/{project_id}/experiments/\nContent-Type: application/json\n\n{\n  \"name\": \"Button Color Test\",\n  \"feature_flag_key\": \"button-color-test\"\n}\n\nEvent Definitions\nList Event Definitions\nGET /posthog/api/projects/{project_id}/event_definitions/?limit=10\n\nProperty Definitions\nList Property Definitions\nGET /posthog/api/projects/{project_id}/property_definitions/?limit=10\n\nPagination\n\nPostHog uses offset-based pagination:\n\nGET /posthog/api/projects/{project_id}/persons/?limit=10&offset=20\n\n\nResponse includes pagination info:\n\n{\n  \"count\": 100,\n  \"next\": \"https://us.posthog.com/api/projects/{project_id}/persons/?limit=10&offset=30\",\n  \"previous\": \"https://us.posthog.com/api/projects/{project_id}/persons/?limit=10&offset=10\",\n  \"results\": [...]\n}\n\n\nFor session recordings, use has_next boolean:\n\n{\n  \"results\": [...],\n  \"has_next\": true\n}\n\nCode Examples\nJavaScript\nconst response = await fetch(\n  'https://gateway.maton.ai/posthog/api/projects/',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\nconst data = await response.json();\n\nPython\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/posthog/api/projects/',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\ndata = response.json()\n\nPython - HogQL Query\nimport os\nimport requests\n\nresponse = requests.post(\n    'https://gateway.maton.ai/posthog/api/projects/@current/query/',\n    headers={\n        'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}',\n        'Content-Type': 'application/json'\n    },\n    json={\n        'query': {\n            'kind': 'HogQLQuery',\n            'query': 'SELECT event, count() FROM events GROUP BY event LIMIT 10'\n        }\n    }\n)\ndata = response.json()\n\nNotes\nUse @current as a shortcut for the current project ID (e.g., /api/projects/@current/dashboards/)\nProject IDs are integers (e.g., 136209)\nPerson UUIDs are in standard UUID format\nThe Events endpoint is deprecated; use the Query endpoint with HogQL instead\nSession recordings include activity metrics like click_count, keypress_count\nPostHog uses soft delete: use PATCH with {\"deleted\": true} instead of HTTP DELETE\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. Use Python examples instead.\nError Handling\nStatus\tMeaning\n400\tMissing PostHog connection\n401\tInvalid or missing Maton API key\n429\tRate limited\n4xx/5xx\tPassthrough error from PostHog API\nRate Limits\nAnalytics endpoints (insights, persons, recordings): 240/minute, 1200/hour\nHogQL query endpoint: 120/hour\nCRUD endpoints: 480/minute, 4800/hour\nResources\nPostHog API Overview\nHogQL Documentation\nFeature Flags\nSession Replay\nExperiments\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/posthog-api",
    "publisherUrl": "https://clawhub.ai/byungkyu/posthog-api",
    "owner": "byungkyu",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/posthog-api",
    "downloadUrl": "https://openagent3.xyz/downloads/posthog-api",
    "agentUrl": "https://openagent3.xyz/skills/posthog-api/agent",
    "manifestUrl": "https://openagent3.xyz/skills/posthog-api/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/posthog-api/agent.md"
  }
}