---
title: "Create survey"
method: POST
path: "/api/v1/surveys/"
tags: ["surveys"]
---

# Create survey

`POST /api/v1/surveys/`

You can create a survey with either `sections -> questions` or just `questions`. This allows you to decide
how much flexibility you want in your survey design. However, if you want to render the survey in the Prolific Application, you must use `sections`.

## Headers

- `Authorization` string, required

## Request body

- SurveyIn — The model used to create a `Survey`.
  - `researcher_id` string, required — The Prolific researcher ID.
  - `sections` SurveySection[] — An array of sections in the survey, or use `questions`.
    - `id` string, uuid — Auto generated by the system.
    - `questions` SurveyQuestion[], required — An array of questions a section within a Survey.
      - `answers` SurveyAnswerOption[], required — An array of answer options for a question.
        - `id` string, uuid
        - `value` string, required — The answer option value that can be selected.
      - `id` string, uuid
      - `title` string, required — The question title.
      - `type` 'single' | 'multiple', required — Responsible for articulating the question type. At the moment we have: - single answer - multiple answer Args: str (_type_): The type of question. Enum (_type_): The class to define an enum.
    - `title` string, required — The section title.
  - `questions` SurveyQuestion[] — An array of questions in the survey, or use `sections`.
    - `answers` SurveyAnswerOption[], required — An array of answer options for a question.
      - `id` string, uuid
      - `value` string, required — The answer option value that can be selected.
    - `id` string, uuid
    - `title` string, required — The question title.
    - `type` 'single' | 'multiple', required — Responsible for articulating the question type. At the moment we have: - single answer - multiple answer Args: str (_type_): The type of question. Enum (_type_): The class to define an enum.
  - `title` string, required — The survey title.

## Response `201`

Successful Response

- SurveyOut — The model used to create a serialised representation a `Survey`.
  - `_id` string — Auto generated by the system.
  - `date_created` string, date-time — The date/time the survey was created (UTC).
  - `date_modified` string, date-time — The date/time the survey was modified (UTC).
  - `researcher_id` string, required — The Prolific researcher ID.
  - `sections` SurveySection[] — Optional: An array of sections in the survey, otherwise `questions` will be defined.
    - `id` string, uuid — Auto generated by the system.
    - `questions` SurveyQuestion[], required — An array of questions a section within a Survey.
      - `answers` SurveyAnswerOption[], required — An array of answer options for a question.
        - `id` string, uuid
        - `value` string, required — The answer option value that can be selected.
      - `id` string, uuid
      - `title` string, required — The question title.
      - `type` 'single' | 'multiple', required — Responsible for articulating the question type. At the moment we have: - single answer - multiple answer Args: str (_type_): The type of question. Enum (_type_): The class to define an enum.
    - `title` string, required — The section title.
  - `questions` SurveyQuestion[] — Optional: An array of questions in the survey, otherwise `sections` will be defined.
    - `answers` SurveyAnswerOption[], required — An array of answer options for a question.
      - `id` string, uuid
      - `value` string, required — The answer option value that can be selected.
    - `id` string, uuid
    - `title` string, required — The question title.
    - `type` 'single' | 'multiple', required — Responsible for articulating the question type. At the moment we have: - single answer - multiple answer Args: str (_type_): The type of question. Enum (_type_): The class to define an enum.
  - `title` string, required — The survey title.

## Other responses

- `400` — Error

---

[API](https://skmtc.net/prolific/apis/api-reference.md) · [All operations](https://skmtc.net/prolific/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prolific/api-reference/versions/dc6f073a9827/schema)
