curl -s "https://$CANVAS_URL/api/v1/courses/$COURSE_ID/quizzes" \
-X POST \
-F "quiz[title]=Test4" \
-F "quiz[only_visible_to_overrides]=true" \
-F "quiz[published]=true" \
-H "Authorization: Bearer $CANVAS_TOKEN" | jq -r '.'
Get assignment_id from this output, and use it in the next call:
curl -s "https://$CANVAS_URL/api/v1/courses/$COURSE_ID/assignments/$ASSIGNMENT_ID/overrides" \
-X POST \
-F "assignment_override[student_ids][]=$STUDENT_ID" \
-H "Authorization: Bearer $CANVAS_TOKEN" | jq -r '.'