V3 Surveys

Update a survey

Changed on

Updates a survey through a strict top-level partial document. Omitted top-level fields are preserved. Provided top-level objects and arrays replace that whole subtree; this endpoint does not deep-merge nested objects and does not implement JSON Patch.

This write endpoint accepts the canonical multilingual authoring document only. Translatable fields must be locale-code maps, not strings. PATCH ?lang=... and ?version=... are not supported in Scope 1.

For MCP and AI-agent workflows, fetch the current survey first, modify only the intended top-level fields, call /api/v3/surveys/validate with operation: patch for preflight, then submit the same patch here. Missing ids in replaced arrays are treated as deletions. Variable name renames are allowed but may be destructive for downstream exports or integrations. Element id changes are rejected once the survey and element are no longer drafts.

Server-owned fields that GET returns (id, workspaceId, type, createdAt, archivedAt, defaultLanguage, languages[].alias) are accepted and verified, so the output of a GET can be sent straight back. Echoing the value you were given is a no-op; changing one is a 422 read_only_field.

A round-tripped updatedAt acts as an optimistic-concurrency precondition: the write is applied only if the survey has not changed since your read, and is otherwise rejected with 409. Omit it and overlapping writes remain last-write-wins. Header-based preconditions (ETag / If-Match) are still future work.

patch/api/v3/surveys/{surveyId}

Request

  • Base URL
    https://app.formbricks.com
  • URL
    https://app.formbricks.com/api/v3/surveys/{surveyId}
  • Auth
    • API key in cookie next-auth.session-token
    • or API key in header x-api-key
    • or HTTP bearer

Path parameters

surveyIdstring cuid2 required

Survey identifier.

Request body

idstring

Read-only echo. Must match the survey being patched.

workspaceIdstring

Read-only echo. A survey cannot be moved between workspaces.

type'link' | 'app'

Read-only echo. Immutable after creation.

createdAtstring date-time

Read-only echo of the creation timestamp.

updatedAtstring date-time

Read-only echo, and an optimistic-concurrency precondition: the write is applied only if the survey has not changed since the read this value came from, and is otherwise a 409.

archivedAtstring date-time nullable

Read-only echo. Use /archive and /restore to change it.

visibility'restricted' | 'workspace'

restricted: readable by the owner and the organisation's owners and managers only. The owner's access is conditional on their workspace access, level for level: they read the survey only while they can read the workspace, and edit it only while they can write to it — being the owner grants nothing the workspace does not. workspace: readable by everyone with access to the workspace — today's behaviour.

defaultLanguagestring

Read-only echo of the survey default language, in whatever shape GET returned — legacy surveys carry language-only codes, so this is not constrained to LocaleCode.

namestring
status'draft' | 'inProgress' | 'paused' | 'completed'
showLanguageSwitchboolean nullable

Show respondents a language switch on multi-language surveys. null and false both mean off. Omit to keep the stored value.

autoSelectLanguageboolean nullable

Open link and app surveys in the respondent's browser language when it matches an enabled survey language; otherwise the default language is used. null and false both mean off. Omit to keep the stored value.

Response

Survey updated successfully

Changes

    • warning

      added the new row enum value to the /////////// response property for the response status

    • warning

      added the new row enum value to the /////////// response property for the response status

    • info

      added the new row enum value to the request property /////////

    • info

      added the new row enum value to the request property /////////

    • breaking

      added subschema #5: SurveyInteractionFilter to the ///////////// response property oneOf list for the response status

    • info

      added subschema #5: SurveyInteractionFilter to the /////////// request property oneOf list