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.

fix(user-interviews): allow personal API keys on topic action endpoints (#58601)

coryslater2259c2f12c4e
diff --git a/products/user_interviews/backend/api.py b/products/user_interviews/backend/api.py
index 2cd77335c23b..b2c562659d56 100644
--- a/products/user_interviews/backend/api.py
+++ b/products/user_interviews/backend/api.py
@@ -458,6 +458,19 @@ class UserInterviewTopicViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""Planned user interview topics: who we want to target (cohort) and what we want to ask about."""
scope_object = "user_interview"
+ # Treat the custom @action endpoints as writes so personal API keys with
+ # `user_interview:write` can hit them. Without this override, APIScopePermission
+ # can't map a custom action name to a scope and rejects the request with
+ # "This action does not support personal API key access".
+ scope_object_write_actions = [
+ "create",
+ "update",
+ "partial_update",
+ "patch",
+ "destroy",
+ "generate_links",
+ "send_invites",
+ ]
queryset = UserInterviewTopic.objects.select_related("created_by").all()
serializer_class = UserInterviewTopicSerializer
filter_backends = [filters.SearchFilter]