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.

feat(integrations): capture integration created event (#69274)

Fernando Gomesa2888b014fea
diff --git a/posthog/api/integration.py b/posthog/api/integration.py
index 73739b4cb835..9a38c61411a7 100644
--- a/posthog/api/integration.py
+++ b/posthog/api/integration.py
@@ -429,7 +429,13 @@ class IntegrationSerializer(serializers.ModelSerializer, UserAccessControlSerial
self.context["request"].user, self.context["get_team"]()
):
raise PermissionDenied("Editing an existing integration requires project admin access.")
- return instance
+ report_user_action(
+ self.context["request"].user,
+ "integration created",
+ {"integration_kind": kind, "is_overwrite": is_overwrite},
+ team=self.context["get_team"](),
+ )
+ return instance
def _build_integration(self, validated_data: Any) -> Any:
request = self.context["request"]