Skip to main content
PATCH

Authorizations

next-auth.session-token
string
cookie
required

NextAuth session JWT cookie. Development: often next-auth.session-token. Production (HTTPS): often __Secure-next-auth.session-token. Send the cookie your browser receives after sign-in.

Path Parameters

surveyId
string<cuid2>
required

Survey identifier.

Body

application/json

Patch payload shape. Top-level fields are partial; any provided nested object or array fully replaces that subtree. Omitted top-level fields are preserved. Immutable/system fields such as id, workspaceId, type, defaultLanguage, timestamps, questions, analytics, styling, and scripts are rejected. App surveys (stored type: app) additionally accept distribution and targeting; both are rejected for link surveys, and changing targeting filters requires the Contacts entitlement.

metadata, languages, welcomeCard, blocks, endings, hiddenFields, and variables replace their full top-level value when provided. Missing ids in replaced arrays are deletions. Non-default locale keys in translatable maps must be declared in languages; undeclared locale keys are rejected with unsupported_locale. To remove a language, remove it from both languages and every translatable map that contains that locale key. Use /api/v3/surveys/validate with operation: patch before committing automated or agentic changes.

name
string
Minimum string length: 1
status
enum<string>
Available options:
draft,
inProgress,
paused,
completed
metadata
object

Arbitrary JSON survey context for customer- or operation-specific metadata. v3 preserves arbitrary metadata values as-is. If present, title and description are treated as translatable text maps and returned with real locale-code keys.

languages
object[]

Replaces the survey language configuration. The default language cannot be changed through PATCH; any default: true entry must match the existing default language. Languages referenced by metadata, welcomeCard, blocks, or endings translatable maps must be explicitly declared here, so remove the locale key from those maps as well when intentionally removing a language.

welcomeCard
object

Optional card shown before the first survey block.

blocks
object[]
Minimum array length: 1
endings
object[]

Ending reached after the last block or a jump action. type selects the allowed shape; unsupported fields are rejected instead of ignored.

hiddenFields
object

Hidden fields, sometimes called embedded data in other survey products. Field ids are stable public identifiers and may be referenced by logic, recall, quotas, integrations, and response data.

Naming rule for new field ids — the same rule the survey editor applies (ENG-2539): a new id must start with a lowercase letter and then contain only lowercase letters, numbers and underscores (^[a-z][a-z0-9_]*$), and must not take a reserved name. Reserved are the link-survey system params and internal ids — userId, source, suid, end, start, welcomeCard, hidden, verifiedEmail, multiLanguage, embed, verify, suToken, lang, preview, startAt, skipPrefilled, offlineSupport (matched case-insensitively) — and the names of auto-captured system fields, which every survey can already read without declaring them: source, url, country, action, browser, os, deviceType, ipAddress, finished, language, locale, responseId, surveyId, durationSeconds, startedAt, finishedAt, pagePath, pageReferrer, utmSource, utmMedium, utmCampaign, utmTerm, utmContent, screenWidth, screenHeight, viewportWidth, viewportHeight, timezone.

Ids a survey already declares are grandfathered: they always load, and re-sending the survey unchanged never fails validation — only adding such a name as a new field is refused. Deleting a grandfathered field spends the reprieve: once it is gone from the saved survey, the name can no longer be re-added. Note this means re-creating a survey from an exported document can fail with a 400 when the export declares a name the rule refuses; rename the field in the payload before importing. The pattern below describes what stored surveys may hold (the pre-existing lenient charset), not what a new id may look like.

variables
object[]

Survey variable. Variable ids are stable references used by logic and calculation actions. Variable names are human-readable labels and must be unique within the survey.

distribution
object

App-survey runtime/display settings. Only valid for stored type: app. Replaces the full distribution; omitted scalars reset to their defaults.

Example:
targeting
object

App-survey contact targeting. Only valid for stored app surveys.

Response

Survey updated successfully

data
object
required