Skip to content

Create Card

Creates a card of the given type (quiz, content, boolean, …). Institution is taken from the admin JWT.

Terminal window
curl --request POST \
--url 'https://lxp.prod.api.toolzz.media/cards/quiz' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Sample quiz",
"ask": "What is 2+2?",
"time": 60,
"difficulties_id": 1,
"answers": "[{\"answer\":\"4\",\"correct\":true},{\"answer\":\"3\",\"correct\":false}]"
}'

Legacy alias: POST /cards/:type/:ctype (same write body).

{
"success": true,
"card": {
"id": 8709,
"name": "Sample quiz",
"type": "quiz"
}
}

ParameterTypeDescriptionRequired
typestringCard source type (quiz, content, images, boolean, words, gibbet, crosswords, phrase).Yes
ParameterTypeDescriptionRequired
namestringCard name.No
askstringQuestion / prompt HTML.No
timenumberTime limit (seconds).No
feedbackstringFeedback on success.No
wrong_feedbackstringFeedback on failure.No
title / text / sourcestringContent fields (type-dependent).No
correctbooleanUsed by boolean cards.No
difficulties_idnumberDifficulty ID.No
images_idnumberCover / asset image ID.No
answersstringJSON string of answer options (quiz, etc.).No
tagsstringTags.No
toolzz_school_idstringOptional school scope.No

toolzz_institution_id is enforced from the JWT (optional body value must match).


HTTPCodeWhen
400invalid_argumentInvalid payload / type
401unauthenticatedMissing/invalid JWT
403permission_deniedNot an admin

  • Admin only. New rows are stamped with the JWT institution.