The Quiz API manages quiz definitions used by quiz steps in Wix Online Programs. A definition contains quiz settings and its active questions, including the input type, answer key, feedback messages, and optional per-answer score. Creating or cloning a quiz definition requires at least one active question.
With the Quiz API, you can:
A quiz definition is separate from an Online Programs step. Creating or cloning a quiz doesn't add it to a program. To make the quiz available in a program:
step.quizOptions.id to the quiz ID.The Quiz API intentionally doesn't provide a List or Query method. Discover an existing quiz ID by querying or retrieving its quiz-type step and reading step.quizOptions.id.
Each item in quiz.fields defines one active question and its answer input. Creating or cloning a quiz requires at least one active question. A retrieved quiz can have an empty fields list after all its questions have been deleted. Check for active questions before displaying or reusing it.
When creating a definition, callers provide:
fields.id.fields.target. Quiz submissions use this key to match an answer to its question; it isn't the question's correct answer.numeric, shortText, longText, singleChoice, multiChoice, or fileUpload.New submissions are evaluated against the definition that exists when the submission is created. If a definition changes through another supported workflow, previously stored submissions retain their recorded grades and answer evaluations, while future submissions use the changed definition.
For single-choice questions, a supplied rightAnswer must exactly match an entry in options. For multi-choice questions, every supplied rightAnswer value must exactly match an entry in options. An answer key containing an unavailable option causes creation to fail with INVALID_QUIZ.
Existing image-choice questions from Wix Forms are returned as multiChoice, including questions whose original settings allow only one selection. The Quiz API doesn't expose image-choice-specific settings; the returned multiChoice shape doesn't establish that the original question allowed multiple selections.
See Quiz Grading for matching, scoring, and attempt-limit behavior.
Callers with permission to create and clone quizzes can view their answer keys. Permission to retrieve a quiz alone doesn't grant access to its answer keys.
These rules apply to quiz definitions returned by the Quiz API. When the caller can't access answer keys, numeric, short-text, and single-choice rightAnswer fields are omitted, and multi-choice rightAnswer is an empty list. Questions, options, targets, IDs, and other metadata remain available.
Filtering affects responses only. It doesn't remove answers supplied in write requests, erase stored answer keys, or change server-side grading. An absent answer in a filtered response doesn't establish that the stored question has no correct answer. Don't use a filtered definition to reconstruct or overwrite answer keys.
Participants submit their own answers through the Quiz Submissions API. They don't need access to answer keys for server-side grading.
An invalid quiz definition causes bulk creation to fail before any quizzes are created. Otherwise, a successful bulk request can still contain individual failures. Check each result's itemMetadata.success and itemMetadata.error, even when the request succeeds. Use itemMetadata.originalIndex to correlate results with inputs, and attach only successfully created quizzes to steps.
See Bulk Create Quizzes and Bulk Delete Quizzes for request limits and response options.
Methods document errors such as INVALID_QUIZ, QUIZ_NOT_FOUND, and QUIZ_CONFLICT. Validation, authorization, temporary failures, and individual bulk results can return other error codes. Inspect the status and error details rather than handling only those three codes.
Cloning copies the quiz definition and returns a new quiz ID. It doesn't clone Online Programs step associations or quiz submissions. Attach the new ID to a step separately when needed.
Cloning requires a quiz with active questions. Avoid modifying the source quiz while cloning it. See Clone Quiz for error details.
DeleteQuiz and BulkDeleteQuizzes permanently delete quiz definitions. They don't check whether Online Programs steps reference those definitions. Coordinate deletion with the Steps API and remove known step references first. Otherwise, a step can retain a dangling quiz reference.
It's important to note the following points before starting to code:
id values and stable, unique target values within each quiz.quizOptions.id.The cURL examples show REST requests and sample responses. The TypeScript examples use quizzes from @wix/online-programs and show sample SDK responses in Promise resolves to comments. Generate unique question GUIDs and replace sample quiz IDs with IDs returned by your own requests. SDK timestamps are JavaScript Dates, shown as ISO strings in the response comments.
Each method's reference page includes its request and response examples:
REST quiz and question IDs use id; the TypeScript SDK uses _id. Bulk result metadata follows the same convention: itemMetadata.id in REST and itemMetadata._id in the SDK. REST timestamps use createdDate and updatedDate; the SDK uses _createdDate and _updatedDate.
REST Create Quiz and Get Quiz responses wrap the definition in quiz. The SDK's createQuiz() and getQuiz() return the definition directly. SDK cloneQuiz() and deleteQuiz() responses retain the quiz wrapper.
Last updated: 22 September 2026