Skip to main content
PUT
/
quiz
/
startQuiz
/
{quizId}
Start Quiz
curl --request PUT \
  --url https://api.example.com/quiz/startQuiz/{quizId} \
  --header 'api-key: <api-key>'
{
  "_id": "65f3...",
  "orgId": "65f1c0f5a2b3c4d5e6f7a8b9",
  "userId": "user-123",
  "hasStarted": true,
  "hasCompleted": false,
  "quizName": "Algebra Basics Quiz",
  "questionsWithOptionsAndAnswers": [...]
}

Description

This endpoint marks a quiz as started using its unique quizId. It updates the quiz status to indicate that the user has begun attempting the quiz. Use this endpoint to track quiz progress and enable quiz-taking features in your application.

Example Request

curl -X PUT \
  'https://b2b-api-backend-95487.ondigitalocean.app/quiz/startQuiz/{quizId}' \
  -H 'accept: application/json' \
  -H 'api-key: <your-api-key>'

Authentication

api-key
string
required
Your organisation’s API key

Path Parameters

quizId
string
required
The ID of the quiz to start

Response

Returns the updated quiz object with hasStarted set to true.
_id
string
MongoDB ObjectId of the quiz
orgId
string
Organisation ID
userId
string
User identifier
hasStarted
boolean
Set to true after this operation
hasCompleted
boolean
Whether the quiz has been completed
quizName
string
Name of the quiz
questionsWithOptionsAndAnswers
array
Array of quiz questions
{
  "_id": "65f3...",
  "orgId": "65f1c0f5a2b3c4d5e6f7a8b9",
  "userId": "user-123",
  "hasStarted": true,
  "hasCompleted": false,
  "quizName": "Algebra Basics Quiz",
  "questionsWithOptionsAndAnswers": [...]
}