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.

chore(api): say retention settings are plan-locked in their help text (#92600)

Ben Leaccf4efa41282
diff --git a/frontend/src/generated/core/api.schemas.ts b/frontend/src/generated/core/api.schemas.ts
index 613105a8fd7f..1ac47c8a906e 100644
--- a/frontend/src/generated/core/api.schemas.ts
+++ b/frontend/src/generated/core/api.schemas.ts
@@ -2613,9 +2613,9 @@ export interface ProjectBackwardCompatApi {
onboarding_tasks?: unknown
/** @nullable */
web_analytics_pre_aggregated_tables_enabled?: boolean | null
- /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. */
+ /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. Read-only: this value follows your plan's data retention entitlement, so neither you nor PostHog support can change it unless your organization is on the enterprise plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly event_retention_months: number
- /** Whether events data retention is currently enforced for this team (cohort/flag gated). */
+ /** Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only: neither you nor PostHog support can turn enforcement off, and the retention window itself only changes with your plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly events_retention_enforced: boolean
}
@@ -3465,9 +3465,9 @@ export interface PatchedProjectBackwardCompatApi {
onboarding_tasks?: unknown
/** @nullable */
web_analytics_pre_aggregated_tables_enabled?: boolean | null
- /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. */
+ /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. Read-only: this value follows your plan's data retention entitlement, so neither you nor PostHog support can change it unless your organization is on the enterprise plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly event_retention_months?: number
- /** Whether events data retention is currently enforced for this team (cohort/flag gated). */
+ /** Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only: neither you nor PostHog support can turn enforcement off, and the retention window itself only changes with your plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly events_retention_enforced?: boolean
}
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index c790a887521a..50a1d8a23101 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -843,9 +843,13 @@ export interface TeamType extends TeamBasicType {
| null
session_recording_masking_config: SessionRecordingMaskingConfig | undefined | null
session_recording_retention_period: SessionRecordingRetentionPeriod | null
- /** Plan-derived events data retention window in months (synced from billing). */
+ /**
+ * Plan-derived events data retention window in months (synced from billing). Read-only: it follows the plan's
+ * data retention entitlement, so support cannot change it outside the enterprise plan.
+ * See https://github.com/PostHog/posthog/issues/17031
+ */
event_retention_months: number
- /** Whether events data retention is currently enforced for this team (cohort/flag gated). */
+ /** Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only. */
events_retention_enforced: boolean
session_replay_config: { record_canvas?: boolean } | undefined | null
survey_config?: TeamSurveyConfigType
diff --git a/posthog/api/project.py b/posthog/api/project.py
index a162b2da115d..b995da1ae188 100644
--- a/posthog/api/project.py
+++ b/posthog/api/project.py
@@ -543,7 +543,11 @@ class ProjectBackwardCompatSerializer(
available_setup_task_ids = serializers.SerializerMethodField() # Compat with TeamSerializer
managed_viewsets = serializers.SerializerMethodField() # Compat with TeamSerializer
events_retention_enforced = serializers.SerializerMethodField(
- help_text="Whether events data retention is currently enforced for this team (cohort/flag gated)."
+ help_text=(
+ "Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only: "
+ "neither you nor PostHog support can turn enforcement off, and the retention window itself only "
+ "changes with your plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031"
+ )
) # Compat with TeamSerializer
# These are @property attrs on Team, not Django model fields — declare explicitly so drf-spectacular can resolve them
default_modifiers = serializers.DictField(read_only=True) # Compat with TeamSerializer
@@ -832,7 +836,10 @@ class ProjectBackwardCompatSerializer(
"event_retention_months": {
"help_text": (
"The team's events data retention window in months (plan-derived, synced from billing). When "
- "retention enforcement is active for the team, queries do not return events older than this many months."
+ "retention enforcement is active for the team, queries do not return events older than this many "
+ "months. Read-only: this value follows your plan's data retention entitlement, so neither you nor "
+ "PostHog support can change it unless your organization is on the enterprise plan. Background and "
+ "discussion: https://github.com/PostHog/posthog/issues/17031"
)
},
"data_attributes": {
diff --git a/posthog/api/team.py b/posthog/api/team.py
index f7cfb118d001..183f97264c01 100644
--- a/posthog/api/team.py
+++ b/posthog/api/team.py
@@ -1025,11 +1025,18 @@ class TeamSerializer(serializers.ModelSerializer, UserPermissionsSerializerMixin
read_only=True,
help_text=(
"The team's events data retention window in months (plan-derived, synced from billing). When retention "
- "enforcement is active for the team, queries do not return events older than this many months."
+ "enforcement is active for the team, queries do not return events older than this many months. "
+ "Read-only: this value follows your plan's data retention entitlement, so neither you nor PostHog "
+ "support can change it unless your organization is on the enterprise plan. Background and discussion: "
+ "https://github.com/PostHog/posthog/issues/17031"
),
)
events_retention_enforced = serializers.SerializerMethodField(
- help_text="Whether events data retention is currently enforced for this team (cohort/flag gated)."
+ help_text=(
+ "Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only: "
+ "neither you nor PostHog support can turn enforcement off, and the retention window itself only "
+ "changes with your plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031"
+ )
)
class Meta:
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 08cacb747f6c..7034fc3d1f31 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -65289,9 +65289,9 @@ export namespace Schemas {
onboarding_tasks?: unknown;
/** @nullable */
web_analytics_pre_aggregated_tables_enabled?: boolean | null;
- /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. */
+ /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. Read-only: this value follows your plan's data retention entitlement, so neither you nor PostHog support can change it unless your organization is on the enterprise plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly event_retention_months?: number;
- /** Whether events data retention is currently enforced for this team (cohort/flag gated). */
+ /** Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only: neither you nor PostHog support can turn enforcement off, and the retention window itself only changes with your plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly events_retention_enforced?: boolean;
}
@@ -67380,9 +67380,9 @@ export namespace Schemas {
readonly product_intents?: readonly PatchedTeamProductIntentsItem[];
readonly managed_viewsets?: PatchedTeamManagedViewsets;
readonly available_setup_task_ids?: readonly AvailableSetupTaskIdsEnum[];
- /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. */
+ /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. Read-only: this value follows your plan's data retention entitlement, so neither you nor PostHog support can change it unless your organization is on the enterprise plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly event_retention_months?: number;
- /** Whether events data retention is currently enforced for this team (cohort/flag gated). */
+ /** Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only: neither you nor PostHog support can turn enforcement off, and the retention window itself only changes with your plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly events_retention_enforced?: boolean;
}
@@ -69670,9 +69670,9 @@ export namespace Schemas {
onboarding_tasks?: unknown;
/** @nullable */
web_analytics_pre_aggregated_tables_enabled?: boolean | null;
- /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. */
+ /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. Read-only: this value follows your plan's data retention entitlement, so neither you nor PostHog support can change it unless your organization is on the enterprise plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly event_retention_months: number;
- /** Whether events data retention is currently enforced for this team (cohort/flag gated). */
+ /** Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only: neither you nor PostHog support can turn enforcement off, and the retention window itself only changes with your plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly events_retention_enforced: boolean;
}
@@ -85256,9 +85256,9 @@ export namespace Schemas {
readonly product_intents: readonly TeamProductIntentsItem[];
readonly managed_viewsets: TeamManagedViewsets;
readonly available_setup_task_ids: readonly AvailableSetupTaskIdsEnum[];
- /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. */
+ /** The team's events data retention window in months (plan-derived, synced from billing). When retention enforcement is active for the team, queries do not return events older than this many months. Read-only: this value follows your plan's data retention entitlement, so neither you nor PostHog support can change it unless your organization is on the enterprise plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly event_retention_months: number;
- /** Whether events data retention is currently enforced for this team (cohort/flag gated). */
+ /** Whether events data retention is currently enforced for this team (cohort/flag gated). Read-only: neither you nor PostHog support can turn enforcement off, and the retention window itself only changes with your plan. Background and discussion: https://github.com/PostHog/posthog/issues/17031 */
readonly events_retention_enforced: boolean;
}