V3 Surveys

Create a survey draft payload with AI

Creates a strict v3 POST /api/v3/surveys create payload from a creator prompt and returns validation metadata. This endpoint is single-purpose: it does not persist the survey. Clients should validate the returned payload with /api/v3/surveys/validate or use the embedded validation metadata, then create the draft through POST /api/v3/surveys.

The generated payload always sets status: draft. The initial contract supports only type: link; app and website survey creation must stay disabled until the v3 create endpoint accepts those types.

Prompt privacy: prompt text is sent to the configured AI provider to create the payload, but this endpoint does not store prompts and server logs should use request ids and failure categories instead of raw prompt content.

post/api/v3/surveys/generate

Request body

workspaceIdstring cuid2 required

Workspace where the AI-created survey draft would be created. Requires read/write access.

promptstring required

Natural-language survey goal and audience. Prompts with fewer than 24 characters or fewer than four whitespace-separated words return prompt feedback before any AI provider call.

type'link'

Link Survey is the only AI-created type until the v3 create endpoint supports additional types.

language'de-DE' | 'en-US' | 'es-ES' | 'fr-FR' | 'hu-HU' | 'ja-JP' | 'nl-NL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sv-SE' | 'tr-TR' | 'zh-Hans-CN' | 'zh-Hant-TW'

Supported app locale code that AI survey creation can return.

Example request

{
  "language": "en-US"
}

Response

Survey create payload generated successfully. The survey has not been created yet.

Changes