: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
feat(surveys): stop shipping external surveys to SDKs and flag public content (#78633)
Lucas Faria9e1350d75219
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex b75ee5a02f8f..d516a7a26d1b 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -7283,29 +7283,29 @@ snapshots:scenes-app-support-threadreportentry--several-reports-across-states--light:hash: v1.k794b7964.ec55e023b31b2a327072c0e9fe3b164f74d81a226aa3efae9d6fe79d98db5da6.R5v-7fBBPhhayu8hBAHgU6eyTieyIbMYD3ewFUeP_Voscenes-app-surveys--new-multi-question-survey-section--dark:- hash: v1.k794b7964.e4c838e9c192c01eab518de2435a2fef6d3ed65b727fe4c05af61eee010bf03d.yIm_bRCN_65TxDwWd9qVeapTEfZ5QAYSmpJbKKle8Hw+ hash: v1.k794b7964.2ca7cfe8058d9bb074e60e795308ce170bba030323193c9aa1d9bf15230dcdd2.nabqRm_sKv773DVOxobE7ALkDaOTsvsM0VV7h_vbg80scenes-app-surveys--new-multi-question-survey-section--light:- hash: v1.k794b7964.c8850f5e98ba6086904e1262412c93fdd0811ef77bdfbdf3cd293a63337130b4.0S3ERzBKh95D7ON-rPWwHqmGwMa8DAJ0pbPZ_XoB2c0+ hash: v1.k794b7964.ad5861ea909368188bb3fec2edfddf542bfb31230e9bdcdbd7f993ea42885d23.Ych93ianW7eWaE-_7KUOaJTKhoW4jS34LwLcqIP0ncAscenes-app-surveys--new-survey--dark:- hash: v1.k794b7964.9f1eb18e627cbd0bebe1f939b9da03272947b15ef5d0ef1f8aeac98fd9057e84.ayNUFlkK943LdUCfAQDuuAmEU33gG3njVuug4cRSp7Y+ hash: v1.k794b7964.2a148d3140b9d56f9a2a1c790306f14227c5a3d744c8f884ea5091ddec40eff0.tL6oOWHzANfwva7tgjQ_MSZ5eyh7bocfKZ5wWu7dgdAscenes-app-surveys--new-survey--light:- hash: v1.k794b7964.b0b1c500a4603b3f5412d78864b6534aa8ada11700f15e3ec113a14c5c1c364d.YuTXpieE3nTdg903NJfEi4lrgPUHiAKFfce54TG_od8+ hash: v1.k794b7964.5139a48ccd5c3055b230e3090a598b559b4527978db4a252de14fac7f5840b01.BWRtjm-hAperWfkUHoGDhRv2bFoZdkJlU06XzkPupwwscenes-app-surveys--new-survey-customisation-section--dark:- hash: v1.k794b7964.6390106eddcd613878013d63c3268b14e22caadec462d8fdb807d239593ca1d0.Zq2lPNhFOkW9s9Rd59_qc3O3RAkF5IIY2xn0xNCHGfM+ hash: v1.k794b7964.d4210b609a372ab27d92150c27a4b1384ec949650beb560dde9d01a947daaa19.dB_p0daXC7_Q2cnpwGqdoStHKPIauujl3wE1WBpAc5Qscenes-app-surveys--new-survey-customisation-section--light:- hash: v1.k794b7964.bc016f559e76a957263be186aa2ef2c4f8866349984c8c42848ee37a8e454185.5BzY7jlNP0TRSi4knqU3u-_VZX-GvO5vnVk2XT5okFY+ hash: v1.k794b7964.339c3c78d35a293f9ad6f9523dab8728e4a3b627a164231c340ff08909964e05.l01MqFCkH2yV8pcwPmARadljXlVsY-B5n_64ICHhshMscenes-app-surveys--new-survey-targeting-section--dark:- hash: v1.k794b7964.613ab3e01bf3425c96ce0b13ff28e300776d92e155da5f899165d93c70571c36.My2MvTdYRum7fY0L1VNbic1nMMQn7k2aIjcQIesqCUw+ hash: v1.k794b7964.6ce27fad0f643dd5b0049907cddc5b448e2d9cdb957c07c7cca584e2d436cd3d.UN9Qr_CqblK1Q2JYHtXs__8YntETBxJFHqjy77ULOsAscenes-app-surveys--new-survey-targeting-section--light:- hash: v1.k794b7964.ca8af865f7a041b0ff718a36edd0d86c2fb03c5ec43b8f36316de571367f5bf6.6Qo_9HWNOUfRlhPYMcbunu8THHG9lDRdEef2eujDhRk+ hash: v1.k794b7964.a978289c41618e1588e3119e5d92232568fcb58635c386a622c333a141604a61._XThypgeHY8ecXuZid3b7Bz7fmF1NkLnts4nKR1ebBwscenes-app-surveys--new-survey-with-html-question-description--dark:- hash: v1.k794b7964.54111bee2334eccdc99f6c9212d4a8c71bcd53e608ddec9a92fb31898f3082b8.DRc8wJwLM863SeYFi_zH6JuZDSseEB9fvftMC_XeB1E+ hash: v1.k794b7964.a574ed86e292ebc92b497686542327da0720d3ed1574c4a729d935bbe7877dd0.eqQXnqs8DOn2gZvkqXuppmNbOMx-y_73R2AJggWhbRcscenes-app-surveys--new-survey-with-html-question-description--light:- hash: v1.k794b7964.8faa5d573a504a532848bed8e130b21f148f098b48a56925ca59d464db1d64c8.yZQ5LfKAa3u5gDKdqyOnzSsuxYbOjoxOvd8ZHINWPfY+ hash: v1.k794b7964.b74e0f2ebaac866fe89e4f263882124381d73c752f60d6c47deb66313238de90.By3dMrp1mkPzQeybSWmGytMVvrKcXikGhGqrOsIAxKwscenes-app-surveys--new-survey-with-text-question-description-that-does-not-render-html--dark:- hash: v1.k794b7964.269b36ff910a321235b6c6b89ee704b32defa4723e2539932df0bcae1d1fa599.fi19NiT2t2mk0vhl4n0tGfXEexIjIQ5vFxpw0gxg8nI+ hash: v1.k794b7964.b5c0785a4a4e24977f02827d2daadd37cae7b0b31ed3826db998940fd497cf1b.UdXETJ6sSCA061BgPz5FZThOOLVu1bko64wYSM7ojSEscenes-app-surveys--new-survey-with-text-question-description-that-does-not-render-html--light:- hash: v1.k794b7964.74fa4b3e23fdeac8f701b748f3fcdc4403d77a1e580b70a782ddfe1d311d982b.jSyhLpcFiZ0g4Z8OCnVzXf_vfju_YI7VGCLI7eFurgE+ hash: v1.k794b7964.330d7ebc3fa161e5a5407fe56558bae6751d79ba6a71fbde761c0a5e7f4d8ece.CFfpPARTbAs-YcF1dSkqHGTSDh4PjtO82En8zVk2Q80scenes-app-surveys--survey-results--dark:hash: v1.k794b7964.593d9cfd1f47b2ff7296eb4d5e2e31be1636bd2a39a9b350b4c1b5e157684cbb.al8-igeJ8c_xg1N5V4_LD874kwxo1rnKFtrfQGu3daYscenes-app-surveys--survey-results--light:diff --git a/frontend/src/scenes/surveys/HostedSurveyEdit.tsx b/frontend/src/scenes/surveys/HostedSurveyEdit.tsxindex 8a303068a5f4..a10e509600a3 100644--- a/frontend/src/scenes/surveys/HostedSurveyEdit.tsx+++ b/frontend/src/scenes/surveys/HostedSurveyEdit.tsx@@ -35,6 +35,7 @@ import { SceneContent } from '~/layout/scenes/components/SceneContent'import { Survey, SurveyQuestion, SurveyQuestionType, SurveyType } from '~/types'import { SurveyBranchingFlowModal } from './branching-flow/SurveyBranchingFlowModal'+import { SurveyPublicContentNotice } from './components/SurveyPublicContentNotice'import { defaultSurveyFieldValues, NewSurvey, SurveyQuestionLabel } from './constants'import { CopySurveyLink } from './CopySurveyLink'import { HostedSurveyCanvas } from './hosted-canvas/HostedSurveyCanvas'@@ -552,6 +553,7 @@ export function HostedSurveyEdit({ id }: { id: string }): JSX.Element {onCancel={handleCancelClick}onConvertToInApp={convertToInAppSurvey}/>+ <SurveyPublicContentNotice /><div className="grid min-h-[640px] grid-cols-1 gap-4 xl:grid-cols-[300px_minmax(0,1fr)]"><HostedSurveyQuestionRailid={id}diff --git a/frontend/src/scenes/surveys/SurveyEdit.tsx b/frontend/src/scenes/surveys/SurveyEdit.tsxindex 18090d271546..932dd63e7caa 100644--- a/frontend/src/scenes/surveys/SurveyEdit.tsx+++ b/frontend/src/scenes/surveys/SurveyEdit.tsx@@ -65,6 +65,7 @@ import {} from '~/types'import { SurveyBranchingFlowModal } from './branching-flow/SurveyBranchingFlowModal'+import { SurveyPublicContentNotice } from './components/SurveyPublicContentNotice'import { SurveyUrlAudienceEstimate } from './components/SurveyUrlAudienceEstimate'import { SURVEY_TYPE_LABEL_MAP, SurveyMatchTypeLabels, defaultSurveyFieldValues } from './constants'import { COMMON_LANGUAGES, getBaseLanguage, getSurveyLanguageName } from './language'@@ -503,6 +504,7 @@ export default function SurveyEdit({ id }: { id: string }): JSX.Element {</>}/>+ <SurveyPublicContentNotice /><div className="sticky top-[34px] z-[100] bg-bg-3000">{(() => {const shouldShowValidationErrors = hasVisibleTranslationValidationErrorsdiff --git a/frontend/src/scenes/surveys/components/SurveyPublicContentNotice.tsx b/frontend/src/scenes/surveys/components/SurveyPublicContentNotice.tsxnew file mode 100644index 000000000000..c9aa6be6784a--- /dev/null+++ b/frontend/src/scenes/surveys/components/SurveyPublicContentNotice.tsx@@ -0,0 +1,22 @@+import { useValues } from 'kea'++import { LemonBanner } from '@posthog/lemon-ui'++import { surveyLogic } from 'scenes/surveys/surveyLogic'++import { SurveyType } from '~/types'++export function SurveyPublicContentNotice(): JSX.Element {+ const { survey } = useValues(surveyLogic)++ // Both survey kinds expose their content, but by different routes: in-app definitions ship to+ // every visitor through the SDK, while a hosted survey is a public page.+ const exposure =+ survey.type === SurveyType.ExternalSurvey+ ? 'This survey is a public page, so anyone with the link can read its name and questions. Keep private details out of them.'+ : "Everything you write here is sent to every visitor's browser so your app can show the survey. Anyone can read it, so keep private details out of names and question text."++ return (+ <LemonBanner type="info">{exposure} The survey description is the exception and stays in PostHog.</LemonBanner>+ )+}diff --git a/frontend/src/scenes/surveys/wizard/SurveyWizard.tsx b/frontend/src/scenes/surveys/wizard/SurveyWizard.tsxindex d68b366a52c0..c584b4398a8d 100644--- a/frontend/src/scenes/surveys/wizard/SurveyWizard.tsx+++ b/frontend/src/scenes/surveys/wizard/SurveyWizard.tsx@@ -21,6 +21,7 @@ import { SurveyMatchType, SurveyQuestionBranchingType, SurveyType } from '~/typeimport { HostedSurveyRespondentHint } from '../components/HostedSurveyRespondentHint'import { SdkVersionWarnings } from '../components/SdkVersionWarnings'+import { SurveyPublicContentNotice } from '../components/SurveyPublicContentNotice'import { NewSurvey } from '../constants'import { SurveyAppearancePreview } from '../SurveyAppearancePreview'import { getEventPropertyFilterCount } from '../SurveyEventTrigger'@@ -386,6 +387,7 @@ function SurveyWizard({ id }: SurveyWizardLogicProps): JSX.Element {/></div></div>+ <SurveyPublicContentNotice /><div className="flex justify-center"><WizardStepper currentStep={currentStep} onStepClick={setStep} stepErrors={stepValidationErrors} /></div>diff --git a/products/surveys/backend/api/survey.py b/products/surveys/backend/api/survey.pyindex 765b85eabdf2..74697c20134f 100644--- a/products/surveys/backend/api/survey.py+++ b/products/surveys/backend/api/survey.py@@ -2035,8 +2035,20 @@ class SurveySerializerCreateUpdateOnlySchema(SurveySerializerCreateUpdateOnly):class Meta(SurveySerializerCreateUpdateOnly.Meta):extra_kwargs = {- "name": {"help_text": "Survey name.", "min_length": 1},- "description": {"help_text": "Survey description."},+ "name": {+ "help_text": (+ "Survey name. Anyone can read it. In-app surveys send it to every visitor's browser "+ "alongside the questions and appearance text, and a hosted survey shows it on its public "+ "page. Keep customer names and other private details out of it."+ ),+ "min_length": 1,+ },+ "description": {+ "help_text": (+ "Survey description. Internal only: unlike the name and questions, it is never delivered "+ "to visitors."+ )+ },"type": {"help_text": "Survey type."},"start_date": {"help_text": "Setting this will launch the survey immediately. Don't add a start_date unless explicitly requested to do so."@@ -3479,6 +3491,10 @@ def get_surveys_response(team: Team) -> dict[str, Any]:.filter(team__project_id=team.project_id).exclude(archived=True).filter(start_date__isnull=False, end_date__isnull=True)+ # External surveys are their own hosted page, rendered server-side from the database by id.+ # No SDK can display one: the web SDK renders only in-app types, and the mobile SDKs have no+ # external_survey case in their type enums at all.+ .exclude(type=Survey.SurveyType.EXTERNAL_SURVEY).select_related("linked_flag", "targeting_flag", "internal_targeting_flag").prefetch_related("actions"),many=True,diff --git a/products/surveys/backend/api/test/test_survey.py b/products/surveys/backend/api/test/test_survey.pyindex d2304de47950..282e7e4c8f75 100644--- a/products/surveys/backend/api/test/test_survey.py+++ b/products/surveys/backend/api/test/test_survey.py@@ -467,17 +467,21 @@ class TestSurvey(APIBaseTest):False,),("archived", {"start_date": datetime(2026, 1, 1, tzinfo=UTC), "archived": True}, False),+ (+ "external",+ {"start_date": datetime(2026, 1, 1, tzinfo=UTC), "type": Survey.SurveyType.EXTERNAL_SURVEY},+ False,+ ),])- def test_sdk_payload_only_includes_running_surveys(- self, _name: str, lifecycle_fields: dict[str, Any], expected_in_payload: bool+ def test_sdk_payload_only_includes_running_in_app_surveys(+ self, _name: str, survey_fields: dict[str, Any], expected_in_payload: bool) -> None:survey = Survey.objects.create(team=self.team,name="Lifecycle survey",- type="popover",questions=[{"type": "open", "id": "q1", "question": "How are you?"}],- **lifecycle_fields,+ **{"type": "popover", **survey_fields},)payload_ids = {str(item["id"]) for item in get_surveys_response(self.team)["surveys"]}diff --git a/products/surveys/frontend/generated/api.schemas.ts b/products/surveys/frontend/generated/api.schemas.tsindex 915fbf373408..78d64fb2cbf4 100644--- a/products/surveys/frontend/generated/api.schemas.ts+++ b/products/surveys/frontend/generated/api.schemas.ts@@ -1251,12 +1251,12 @@ export interface SurveyAppearanceSchemaApi {export interface SurveySerializerCreateUpdateOnlySchemaApi {readonly id: string/**- * Survey name.+ * Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it.* @minLength 1* @maxLength 400*/name: string- /** Survey description. */+ /** Survey description. Internal only: unlike the name and questions, it is never delivered to visitors. */description?: string/** Survey type.*@@ -1688,12 +1688,12 @@ export interface SurveySerializerCreateUpdateOnlyApi {export interface PatchedSurveySerializerCreateUpdateOnlySchemaApi {readonly id?: string/**- * Survey name.+ * Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it.* @minLength 1* @maxLength 400*/name?: string- /** Survey description. */+ /** Survey description. Internal only: unlike the name and questions, it is never delivered to visitors. */description?: string/** Survey type.*diff --git a/products/surveys/frontend/generated/api.zod.ts b/products/surveys/frontend/generated/api.zod.tsindex 4c7ef318600d..213d22e5e786 100644--- a/products/surveys/frontend/generated/api.zod.ts+++ b/products/surveys/frontend/generated/api.zod.ts@@ -44,8 +44,19 @@ export const surveysCreateBodyResponseSamplingLimitMax = 2147483647export const surveysCreateBodyBaseLanguageMax = 20export const SurveysCreateBody = /* @__PURE__ */ zod.object({- name: zod.string().min(1).max(surveysCreateBodyNameMax).describe('Survey name.'),- description: zod.string().optional().describe('Survey description.'),+ name: zod+ .string()+ .min(1)+ .max(surveysCreateBodyNameMax)+ .describe(+ "Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it."+ ),+ description: zod+ .string()+ .optional()+ .describe(+ 'Survey description. Internal only: unlike the name and questions, it is never delivered to visitors.'+ ),type: zod.enum(['popover', 'widget', 'external_survey', 'api']).describe(@@ -977,8 +988,20 @@ export const surveysPartialUpdateBodyResponseSamplingLimitMax = 2147483647export const surveysPartialUpdateBodyBaseLanguageMax = 20export const SurveysPartialUpdateBody = /* @__PURE__ */ zod.object({- name: zod.string().min(1).max(surveysPartialUpdateBodyNameMax).optional().describe('Survey name.'),- description: zod.string().optional().describe('Survey description.'),+ name: zod+ .string()+ .min(1)+ .max(surveysPartialUpdateBodyNameMax)+ .optional()+ .describe(+ "Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it."+ ),+ description: zod+ .string()+ .optional()+ .describe(+ 'Survey description. Internal only: unlike the name and questions, it is never delivered to visitors.'+ ),type: zod.enum(['popover', 'widget', 'external_survey', 'api']).describe(diff --git a/products/surveys/mcp/tools.yaml b/products/surveys/mcp/tools.yamlindex bb3f8c94932c..5d7e16a3061a 100644--- a/products/surveys/mcp/tools.yaml+++ b/products/surveys/mcp/tools.yaml@@ -39,7 +39,10 @@ tools:Creates a new survey in the project. Use this for both in-app surveys and hosted forms. Prefer draftcreation by default and do not set start_date unless the user explicitly asks to launch immediately. Forin-app surveys, popover is the default unless the user asks for widget or api. For hosted forms, use- external_survey. Keep surveys short unless the user asks for a longer flow.+ external_survey. Keep surveys short unless the user asks for a longer flow. Survey content is public: anyone+ can read the name, questions, and appearance text. In-app surveys send them to every visitor's browser, and+ a hosted survey shows them on its public page. Tell the user before putting a customer name or other private+ detail in a survey.include_params:- name- description@@ -195,7 +198,10 @@ tools:Update an existing survey by ID. Omitted top-level fields are preserved, but nested objects and arrays youprovide may replace existing values. Before changing questions, conditions, appearance, targeting,translations, or hosted-form content, retrieve the survey first and preserve fields that should remain. Do- not send null to clear a field unless the user explicitly asked to remove it.+ not send null to clear a field unless the user explicitly asked to remove it. Survey content is public:+ anyone can read the name, questions, and appearance text. In-app surveys send them to every visitor's+ browser, and a hosted survey shows them on its public page. Tell the user before putting a customer name or+ other private detail in a survey.include_params:- id- namediff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 39371826503e..7310d4f6b380 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -9521,7 +9521,7 @@}},"survey-create": {- "description": "Creates a new survey in the project. Use this for both in-app surveys and hosted forms. Prefer draft creation by default and do not set start_date unless the user explicitly asks to launch immediately. For in-app surveys, popover is the default unless the user asks for widget or api. For hosted forms, use external_survey. Keep surveys short unless the user asks for a longer flow.",+ "description": "Creates a new survey in the project. Use this for both in-app surveys and hosted forms. Prefer draft creation by default and do not set start_date unless the user explicitly asks to launch immediately. For in-app surveys, popover is the default unless the user asks for widget or api. For hosted forms, use external_survey. Keep surveys short unless the user asks for a longer flow. Survey content is public: anyone can read the name, questions, and appearance text. In-app surveys send them to every visitor's browser, and a hosted survey shows them on its public page. Tell the user before putting a customer name or other private detail in a survey.","category": "Surveys","feature": "surveys","summary": "Creates a new survey in the project.",@@ -9605,7 +9605,7 @@}},"survey-update": {- "description": "Update an existing survey by ID. Omitted top-level fields are preserved, but nested objects and arrays you provide may replace existing values. Before changing questions, conditions, appearance, targeting, translations, or hosted-form content, retrieve the survey first and preserve fields that should remain. Do not send null to clear a field unless the user explicitly asked to remove it.",+ "description": "Update an existing survey by ID. Omitted top-level fields are preserved, but nested objects and arrays you provide may replace existing values. Before changing questions, conditions, appearance, targeting, translations, or hosted-form content, retrieve the survey first and preserve fields that should remain. Do not send null to clear a field unless the user explicitly asked to remove it. Survey content is public: anyone can read the name, questions, and appearance text. In-app surveys send them to every visitor's browser, and a hosted survey shows them on its public page. Tell the user before putting a customer name or other private detail in a survey.","category": "Surveys","feature": "surveys","summary": "Update an existing survey by ID.",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 399853ec8fe7..bde51b5495d2 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -10133,7 +10133,7 @@}},"survey-create": {- "description": "Creates a new survey in the project. Use this for both in-app surveys and hosted forms. Prefer draft creation by default and do not set start_date unless the user explicitly asks to launch immediately. For in-app surveys, popover is the default unless the user asks for widget or api. For hosted forms, use external_survey. Keep surveys short unless the user asks for a longer flow.",+ "description": "Creates a new survey in the project. Use this for both in-app surveys and hosted forms. Prefer draft creation by default and do not set start_date unless the user explicitly asks to launch immediately. For in-app surveys, popover is the default unless the user asks for widget or api. For hosted forms, use external_survey. Keep surveys short unless the user asks for a longer flow. Survey content is public: anyone can read the name, questions, and appearance text. In-app surveys send them to every visitor's browser, and a hosted survey shows them on its public page. Tell the user before putting a customer name or other private detail in a survey.","category": "Surveys","feature": "surveys","summary": "Creates a new survey in the project.",@@ -10217,7 +10217,7 @@}},"survey-update": {- "description": "Update an existing survey by ID. Omitted top-level fields are preserved, but nested objects and arrays you provide may replace existing values. Before changing questions, conditions, appearance, targeting, translations, or hosted-form content, retrieve the survey first and preserve fields that should remain. Do not send null to clear a field unless the user explicitly asked to remove it.",+ "description": "Update an existing survey by ID. Omitted top-level fields are preserved, but nested objects and arrays you provide may replace existing values. Before changing questions, conditions, appearance, targeting, translations, or hosted-form content, retrieve the survey first and preserve fields that should remain. Do not send null to clear a field unless the user explicitly asked to remove it. Survey content is public: anyone can read the name, questions, and appearance text. In-app surveys send them to every visitor's browser, and a hosted survey shows them on its public page. Tell the user before putting a customer name or other private detail in a survey.","category": "Surveys","feature": "surveys","summary": "Update an existing survey by ID.",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 267b2d6379a2..8934b7b160f9 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -58198,12 +58198,12 @@ export namespace Schemas {export interface PatchedSurveySerializerCreateUpdateOnlySchema {readonly id?: string;/**- * Survey name.+ * Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it.* @minLength 1* @maxLength 400*/name?: string;- /** Survey description. */+ /** Survey description. Internal only: unlike the name and questions, it is never delivered to visitors. */description?: string;/** Survey type.*@@ -73381,12 +73381,12 @@ export namespace Schemas {export interface SurveySerializerCreateUpdateOnlySchema {readonly id: string;/**- * Survey name.+ * Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it.* @minLength 1* @maxLength 400*/name: string;- /** Survey description. */+ /** Survey description. Internal only: unlike the name and questions, it is never delivered to visitors. */description?: string;/** Survey type.*diff --git a/services/mcp/src/generated/surveys/api.ts b/services/mcp/src/generated/surveys/api.tsindex 3a2e3a438a35..cd58126b06ee 100644--- a/services/mcp/src/generated/surveys/api.ts+++ b/services/mcp/src/generated/surveys/api.ts@@ -78,8 +78,19 @@ export const surveysCreateBodyResponseSamplingLimitMax = 2147483647export const surveysCreateBodyBaseLanguageMax = 20export const SurveysCreateBody = /* @__PURE__ */ zod.object({- name: zod.string().min(1).max(surveysCreateBodyNameMax).describe('Survey name.'),- description: zod.string().optional().describe('Survey description.'),+ name: zod+ .string()+ .min(1)+ .max(surveysCreateBodyNameMax)+ .describe(+ "Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it."+ ),+ description: zod+ .string()+ .optional()+ .describe(+ 'Survey description. Internal only: unlike the name and questions, it is never delivered to visitors.'+ ),type: zod.enum(['popover', 'widget', 'external_survey', 'api']).describe(@@ -930,8 +941,20 @@ export const surveysPartialUpdateBodyResponseSamplingLimitMax = 2147483647export const surveysPartialUpdateBodyBaseLanguageMax = 20export const SurveysPartialUpdateBody = /* @__PURE__ */ zod.object({- name: zod.string().min(1).max(surveysPartialUpdateBodyNameMax).optional().describe('Survey name.'),- description: zod.string().optional().describe('Survey description.'),+ name: zod+ .string()+ .min(1)+ .max(surveysPartialUpdateBodyNameMax)+ .optional()+ .describe(+ "Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it."+ ),+ description: zod+ .string()+ .optional()+ .describe(+ 'Survey description. Internal only: unlike the name and questions, it is never delivered to visitors.'+ ),type: zod.enum(['popover', 'widget', 'external_survey', 'api']).describe(diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/survey-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/survey-create.jsonindex eb6c8a6f0260..e93919e2868b 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/survey-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/survey-create.json@@ -184,7 +184,7 @@"description": "Display and targeting conditions for in-app surveys, such as URL matching, event triggers, device filters, or linked flag variants. Do not use URL, selector, event, device, or linkedFlagVariant conditions for external_survey forms."},"description": {- "description": "Survey description.",+ "description": "Survey description. Internal only: unlike the name and questions, it is never delivered to visitors.","type": "string"},"enable_iframe_embedding": {@@ -250,7 +250,7 @@"description": "Feature flag ID linked to this survey. Use only when the user explicitly wants the survey linked to a feature flag. Resolve the flag ID first, preferably with SQL in v2."},"name": {- "description": "Survey name.",+ "description": "Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it.","maxLength": 400,"minLength": 1,"type": "string"diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/survey-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/survey-update.jsonindex b650d103d213..494f3d1657fd 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/survey-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/survey-update.json@@ -188,7 +188,7 @@"description": "Complete replacement display and targeting conditions object. Do not provide this field unless changing display targeting. Preserve existing URL, selector, event, device, wait-period, and linked flag variant conditions unless explicitly changing them."},"description": {- "description": "Survey description.",+ "description": "Survey description. Internal only: unlike the name and questions, it is never delivered to visitors.","type": "string"},"enable_iframe_embedding": {@@ -270,7 +270,7 @@"description": "The feature flag linked to this survey."},"name": {- "description": "Survey name.",+ "description": "Survey name. Anyone can read it. In-app surveys send it to every visitor's browser alongside the questions and appearance text, and a hosted survey shows it on its public page. Keep customer names and other private details out of it.","maxLength": 400,"minLength": 1,"type": "string"