---
title: "Surveys and quizzes: replace the questions (only until the first response)"
method: PUT
path: "/api/admin/{slug}/questions"
---

# Surveys and quizzes: replace the questions (only until the first response)

`PUT /api/admin/{slug}/questions`

## Request

- Base URL: `https://qrvote.org`
- URL: `https://qrvote.org/api/admin/{slug}/questions`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://qrvote.org/authorize`, token URL `https://qrvote.org/oauth/token`, scopes: `read`, `manage`)

Body: { questions: [...] }, 1–50, in order; the whole list is replaced. Each: { type, prompt (≤300 chars), required?, options?, max?, answer?, id? }. type is single (pick one) or multi (pick any) with options (2–20 distinct texts), yesno, likert (disagree…agree), rating (max 5 or 10 stars), short or long (written). Quizzes: answer is the correct option index (single; yesno uses 1 = yes, 0 = no), a list of option indexes (multi), or a list of accepted texts (short); at least one question needs one. Send a question's id back to keep its picture. Refused with 409 once anyone has answered; the answer key can still be fixed with setAnswerKey.

## Path parameters

- `slug` string, required

## Request body

- object
  - `questions` object[], required
    - `type` 'single' | 'multi' | 'yesno' | 'likert' | 'rating' | 'short' | 'long', required
    - `prompt` string, required
    - `required` boolean
    - `options` string[]
    - `max` 5 | 10
    - `answer` unknown
    - `id` integer

## Response `200`

The saved questions

- object

## Other responses

- `409`: Locked: people have answered

---

[API](https://skmtc.dev/qrvote/apis/qrvote-api.md) · [All operations](https://skmtc.dev/qrvote/apis/qrvote-api/llms.txt) · [OpenAPI document](https://skmtc.dev/qrvote/apis/qrvote-api/revisions/4b67158991e0?raw)
