Create a survey draft payload with AI
Changed onCreates 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. Both type: link and type: app are supported; for app, the payload includes a default distribution (display once, no triggers, no targeting) that you finish configuring in the editor or via the create request.
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.
Request
- Base URLhttps://app.formbricks.com
- URLhttps://app.formbricks.com/api/v3/surveys/generate
- Auth
- API key in cookie next-auth.session-token
- or API key in header x-api-key
- or HTTP bearer
Request body
Example request
{
"language": "en-US",
"surveyLanguage": "en-US"
}Response
Survey create payload generated successfully. The survey has not been created yet.
Changes
- warning
added the new
rowenum value to the///////////////response property for the response status - warning
added the new
rowenum value to the///////////////response property for the response status
- warning
- breaking
added
subschema #5: SurveyInteractionFilterto the/////////////////response propertyoneOflist for the response status
- breaking