LabscoMCP early access ↗
PostHog avatar✓ Official

creating-an-endpoint

MCP connection required★ 59 on GitHub
part of posthog/ai-pluginby posthog

Publishing one of your saved queries as something other programs can call over the web — and getting its name, its inputs and its caching right on the first go, because callers break when you change those later.

WHEN TO USE

SCOPE

USE FOR

  • Turn an existing HogQL query or insight into a callable API endpoint.
  • Decide which fields of a new endpoint's query should become caller-supplied variables.
  • Pick a cache freshness setting that balances cost against how stale the data can be.
  • Decide whether a new endpoint is worth materialising on day one.

NOT FOR

  • An internal dashboard or insight that never needs an external API — use the insight directly.
  • One-off exploratory analysis — run it with execute-sql instead of creating an endpoint.
  • Wiring an existing endpoint into client code — that's consuming-endpoints-from-client-code.