copying-endpoints-across-projects

Copies PostHog endpoints between projects by reading and recreating their query configuration.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill copying-endpoints-across-projects
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: copying-endpoints-across-projects
Source: https://github.com/PostHog/posthog-foss/tree/main/products/endpoints/skills/copying-endpoints-across-projects
Command: npx skills add https://github.com/PostHog/posthog-foss --skill copying-endpoints-across-projects

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostHog endpoints have no native cross-project copy operation, unlike feature flags or experiments. This Skill guides the read-then-recreate workflow needed to duplicate an endpoint into another project or under a new name in the same project, avoiding common mistakes like copying out of the wrong source project or silently overwriting an existing name.

Core Features & Use Cases

  • Read-then-recreate workflow: Reads the full source endpoint config with endpoint-get (query, variables, freshness, materialisation, tags) and recreates it with endpoint-create in the target project.
  • Active-project switching: Coordinates switching the active MCP project between the source read and the target create, since neither tool accepts a project id.
  • Safe defaults and collision checks: Verifies name availability in the target project and defaults the copy to unmaterialised to avoid unnecessary recompute costs.
  • Use Case: Promote a validated endpoint from a staging project to production by reading its HogQL query and variables, switching to the production project, recreating it under the same name, and verifying it with endpoint-run.

Quick Start

Copy the endpoint named weekly_active_users from my staging project to the production project and verify it runs correctly.

Frequently Asked Questions about copying-endpoints-across-projects

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

FAQPage Schema
How do I copy a PostHog endpoint to another project?

Read the full source endpoint config with endpoint-get, switch the active MCP project to the target, then recreate it with endpoint-create using the same query, description, and freshness settings. There is no native server-side copy operation for endpoints.

How do I duplicate an endpoint in the same PostHog project?

Read the endpoint with endpoint-get and recreate it with endpoint-create under a new unique name, since endpoint names must be unique within a project. Use a clearly derived snake_case name such as weekly_active_users_v2.

Can I copy a PostHog endpoint across organizations?

No, endpoints can only be recreated in projects within the same organization where you have editor access. There is no org-to-org copy path for endpoints or their queries.

Does copying an endpoint keep it synced with the source?

No, the copied endpoint owns its own copy of the query. Later edits to the source endpoint do not propagate to the copy, so each must be maintained independently.

Why is my copied endpoint not materialized like the source?

The copy defaults to is_materialized false to avoid recompute and storage costs before the endpoint has proven traffic in the target project. Enable materialisation later once usage justifies it, noting that Funnels and cohort-breakdown queries cannot be materialised.