Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.3 KB
Raw Blame
from posthog.api.routing import RouterRegistry

from products.growth.backend.api.ai_enrichment import AIEnrichmentViewSet
from products.growth.backend.api.identity_matching import IdentityMatchingLinkViewSet
from products.growth.backend.api.product_push import ProductPushCampaignViewSet
from products.growth.backend.presentation.views.rescore import GrowthEnrichmentViewSet
from products.growth.backend.presentation.views.scoring import ScoringViewSet


def register_routes(routers: RouterRegistry) -> None:
    routers.projects.register(
        r"identity_matching_links", IdentityMatchingLinkViewSet, "project_identity_matching_links", ["team_id"]
    )
    routers.organizations.register(
        r"product_push_campaign",
        ProductPushCampaignViewSet,
        "organization_product_push_campaign",
        ["organization_id"],
    )
    # Staff-only, unscoped: prompt configs are instance-global, not team/org scoped.
    routers.root.register(r"growth_ai_enrichment", AIEnrichmentViewSet, "growth_ai_enrichment")
    routers.root.register(r"growth_enrichment_scoring", ScoringViewSet, "growth_enrichment_scoring")
    # Unauthenticated, unscoped: called by a realtime destination via shared-secret header.
    routers.root.register(r"growth_enrichment", GrowthEnrichmentViewSet, "growth_enrichment")