Create a survey draft idempotently; identical retries return the original draft.

post/v1/surveys

Request

  • Base URL: http://127.0.0.1:8080
  • URL: http://127.0.0.1:8080/v1/surveys
  • Auth: HTTP bearer

Headers

X-Likerts-Workspacestring

Required for human OAuth access; service credentials are already workspace-bound.

Request body

idempotencyKeystring required

Required by survey creation; omitted from draft update payloads.

titlestring required

Example request

{
  "title": "Checkout experience",
  "questions": [
    {
      "id": "recommend",
      "type": "scale",
      "preset": "nps",
      "label": "How likely are you to recommend us?",
      "required": true,
      "min": 0,
      "max": 10,
      "labels": {
        "0": "Not at all likely",
        "10": "Extremely likely"
      }
    },
    {
      "id": "easy",
      "type": "scale",
      "label": "Checkout was easy",
      "required": true,
      "min": 1,
      "max": 5,
      "labels": {
        "1": "Strongly disagree",
        "2": "Disagree",
        "3": "Neutral",
        "4": "Agree",
        "5": "Strongly agree"
      }
    },
    {
      "id": "return",
      "type": "single_choice",
      "preset": "yes_no",
      "label": "Would you shop again?",
      "required": true,
      "options": [
        {
          "id": "yes",
          "label": "Yes"
        },
        {
          "id": "no",
          "label": "No"
        }
      ]
    },
    {
      "id": "improvements",
      "type": "multiple_choice",
      "label": "Choose one or two improvements",
      "required": true,
      "minSelections": 1,
      "maxSelections": 2,
      "options": [
        {
          "id": "speed",
          "label": "Speed"
        },
        {
          "id": "payment",
          "label": "Payment options"
        },
        {
          "id": "navigation",
          "label": "Navigation"
        }
      ]
    }
  ]
}

Response

Success

idstring uuid required
revisioninteger required
titlestring required

Changes

No recorded changes to this operation across all 1 revision of this API.