Create a survey
Creates the survey as a draft. Pass active: true to publish immediately so publicUrl accepts responses; that needs an API key with the publish scope, otherwise the survey stays a draft and the response note says why. A question can be shown only when earlier answers match: give the earlier question an id and reference it from conditions.rules. Conditions that could never match are rejected.
Authorization
BearerAuth Use an API key from the Produktly dashboard → Settings → API keys.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/surveys" \ -H "Content-Type: application/json" \ -d '{ "name": "Customer research Q3", "settings": { "publicTitle": "Help us improve Acme", "questions": [ { "id": "nps", "type": "nps", "question": "How likely are you to recommend us to a colleague?", "required": true }, { "type": "long-text", "question": "What would make it a 10?", "conditions": { "match": "all", "rules": [ { "questionId": "nps", "operator": "is_at_most", "value": 8 } ] } }, { "type": "multi-choice", "question": "What\'s your role?", "options": [ "Product", "Engineering", "Support", "Other" ] } ], "identity": { "collectEmail": "optional" } }, "closesAt": "2026-12-31T00:00:00.000Z", "active": true }'{ "id": 0, "name": "string", "active": true, "status": "draft", "publicUrl": "string", "responseCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "folderId": 0, "publicId": "string", "opensAt": "2019-08-24T14:15:22Z", "closesAt": "2019-08-24T14:15:22Z", "responseCap": 0, "themeId": 0, "surveyDomainId": 0, "settings": { "property1": null, "property2": null }, "dashboardUrl": "string", "note": "string"}