: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(data-deletion): clarify alpha API access (#109876)
Paweł Szczur464be8ccf525
diff --git a/posthog/api/data_deletion_request.py b/posthog/api/data_deletion_request.pyindex fc829938cbed..47b02cb16e5c 100644--- a/posthog/api/data_deletion_request.py+++ b/posthog/api/data_deletion_request.py@@ -179,7 +179,7 @@ class DataDeletionRequestViewSet(def initial(self, request: Request, *args: object, **kwargs: object) -> None:super().initial(request, *args, **kwargs)if not self_service_data_deletion_enabled(self.team):- raise PermissionDenied("Self-service data deletion is not enabled for this project.")+ raise PermissionDenied("This endpoint is in alpha and is not yet publicly available.")def safely_get_queryset(self, queryset: QuerySet[DataDeletionRequest]) -> QuerySet[DataDeletionRequest]:return queryset.filter(request_type=RequestType.HOGQL_EVENT_REMOVAL)diff --git a/posthog/api/test/test_data_deletion_request.py b/posthog/api/test/test_data_deletion_request.pyindex a1540d7b9611..36b964698bfc 100644--- a/posthog/api/test/test_data_deletion_request.py+++ b/posthog/api/test/test_data_deletion_request.py@@ -240,8 +240,11 @@ class TestDataDeletionRequestAPIAccess(APIBaseTest):url = f"/api/projects/{self.team.id}/data_deletion_requests"with patch(FEATURE_FLAG, return_value=False):- assert self.client.get(f"{url}/").status_code == status.HTTP_403_FORBIDDEN- assert self.client.post(f"{url}/preview/", {}).status_code == status.HTTP_403_FORBIDDEN+ responses = [self.client.get(f"{url}/"), self.client.post(f"{url}/preview/", {})]++ for response in responses:+ assert response.status_code == status.HTTP_403_FORBIDDEN+ assert response.json()["detail"] == "This endpoint is in alpha and is not yet publicly available."def test_organization_member_has_no_deletion_access_by_default(self) -> None:url = f"/api/projects/{self.team.id}/data_deletion_requests/"