Skip to main content

Question bank API

Read and write assessment Questions. Every request needs a signed-in user (401 otherwise). Only aztec_staff can write (403 otherwise) and only aztec_staff receives answer keys. teacher and admin can read Published Versions and read Retired Versions by ID; a Draft Version is 404 for them. student gets 403 on every route.

Hierarchy: a Question has Versions, and a Version holds variants (one per locale and optional brand). The Question id stays the same across Versions. A Version is Draft, Published or Retired as a whole.

OperationRouteNotes
List typesGET /api/questions/typesThe registry: key, displayName, version, enabled, scoringMode.
ListGET /api/questions?tag&lessonId&typeNon-staff see only Questions with a Published Version.
CreatePOST /api/questionsBody: type, ownerType, ownerOrganizationId, difficulty, standardsTags (at least one), skills, lessonIds, variants. Creates Version 1 as Draft.
ReadGET /api/questions/{id}The Question with its Versions and variants.
UpdatePATCH /api/questions/{id}Body: rowVersion and any of difficulty, standardsTags, skills, lessonIds.
Read a VersionGET /api/questions/{id}/versions/{versionId}
Create a VersionPOST /api/questions/{id}/versionsA new Draft that copies the latest Version's variants.
Add a variantPOST /api/questions/{id}/versions/{versionId}/variantsDraft Versions only. Body: locale (en-US or es-US), brand, stem, payload, feedback, rationale.
Update a variantPUT /api/questions/{id}/versions/{versionId}/variants/{variantId}Draft Versions only. Needs rowVersion.
PublishPOST /api/questions/{id}/versions/{versionId}/publishNeeds an en-US variant without a brand. The response has missingTranslations.
RetirePOST /api/questions/{id}/versions/{versionId}/retirePublished Versions only.

The route shapes are not fixed by the specification and may change. There is no delete; retire a Version instead.

Payload​

payload is { "options": [{ "id", "text", "correct", "feedback" }] }. Option counts: multiple_choice 2–6 with exactly 1 correct, multi_select 2–8 with at least 1 correct, true_false exactly 2 with 1 correct. Non-staff responses keep only each option's id and text.

Errors​

401 not signed in, 403 not aztec_staff (writes) or a learner (reads), 404 not found or not visible (including another organization's Question), 409 stale rowVersion, or a change to a Published or Retired Version, 422 validation (unknown or disabled type, payload breaks the type's rules, no standards tag, unsupported locale, publish without an en-US variant).

Telemetry​

Meter Aztec.Platform.QuestionBank: write audit events, a variant-added counter and a version-published counter.