v16

latestOpenAPI 3.1.1raw.githubusercontent.com2026-08-0124102197.4 KB
V3 Surveys

Create a survey

Creates a block-based survey template from one strict survey document. The endpoint accepts multilingual authoring maps keyed by real locale codes and converts them to Formbricks' internal default-language representation. Non-default locale keys in translated content must be declared in languages; undeclared locale keys return unsupported_locale in invalid_params instead of silently mutating workspace languages.

blocks[].id and variables[].id are stable public identifiers. They may be omitted on create, in which case the server generates cuid2 ids. If the same create request needs to reference a block or variable from logic, provide explicit valid ids and use those references consistently.

For normal sequential surveys, omit logic and logicFallback. logicFallback is only valid when the same block has at least one logic rule; otherwise the API returns invalid_reference.

type may be omitted or set to link or app. App surveys additionally accept the distribution (display options + triggers) and targeting (contact segment filters) objects; both are rejected for link surveys. Trigger ids must reference existing workspace action classes (discover them via GET /api/v3/action-classes), and targeting.filters references (contact-attribute keys and segments) must exist in the workspace. Unsupported fields are rejected instead of ignored.

post/api/v3/surveys

Request body

workspaceIdstring cuid2 required

Workspace where the survey will be created. Requires read/write access.

namestring required
type'link' | 'app'

Survey type. link surveys are distributed by URL; app surveys are shown in-app and configure their runtime behavior via the distribution and targeting objects. type is immutable after creation (it cannot be changed via PATCH).

status'draft' | 'inProgress' | 'paused' | 'completed'
defaultLanguagestring

Canonical locale code accepted by v3 survey APIs, for example en-US, de-DE, or zh-Hans-CN.

Response

Survey created successfully