Skip to content
WorkRoad home
REST API

Create a practice test from your questions

POST
/tests/from-questions

Saves a practice test whose questions you wrote, in the shape WorkRoad's own generator writes them, and answers 201 with the test, ready to take: start it with POST /tests/{testId}/attempts. Nothing is generated, so it uses no AI. Multiple choice, true/false and fill-in questions are graded without AI too; short answers go to AI grading when an attempt is submitted, which counts as an AI use on each submit, so prefer the other kinds unless the user wants written answers. Read the material first (GET /notes/{noteId}, GET /sets/{setId}) and write questions it answers.

Use this to save content you wrote yourself. It uses none of the user's WorkRoad AI uses.

Required scopes: tests:create

Authorization

headerAuthorizationBearer <token>

Header Parameters

Idempotency-Key?string

A client-generated key (1 to 255 visible ASCII characters) that makes this POST safe to retry. A retry with the same key and body replays the original response; the same key with a different body returns 409 idempotency_conflict. Stored for 24 hours.

Match^[\x21-\x7E]{1,255}$
Length1 <= length <= 255

Request Body

application/json
  1. body
name*string

The test's name, 1-120 characters.

Length1 <= length <= 120
questions*array<>

1-50 questions in the order they are asked, written in the shape WorkRoad's own test generator writes them.

Items1 <= items <= 50
timerSecs?|

A time limit in seconds, 60-7200, counted from the start of each attempt. Null or omitted for no limit.

Defaultnull
sourceSetIds?array<>

The user's study sets the questions cover, up to 10. Optional; they label the test.

Itemsitems <= 10
Default[]
sourceNoteIds?array<>

The user's notes the questions cover, up to 10. Optional.

Itemsitems <= 10
Default[]

Response Body

Created

application/json
  1. response
data*
Example Request
curl -X POST 'https://workroad.app/api/v1/tests/from-questions' \  -H 'Authorization: Bearer $WORKROAD_API_KEY' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "questions": [    {      "kind": "multiple-choice",      "prompt": "string",      "answer": "string",      "explanation": "string",      "difficulty": "recall"    }  ]}'
Example Response
{  "data": {    "id": "6e5d4c3b-2a19-4f08-8e7d-6c5b4a392817",    "name": "Cell biology quiz",    "assisted": false,    "status": "ready",    "error": null,    "createdAt": "2026-01-15T09:30:00.000Z",    "generationJobId": "7d6c5b4a-3f2e-4d1c-8b0a-9f8e7d6c5b4a",    "questionsVersion": 1,    "questionCount": 2,    "kindCounts": [      {        "kind": "multiple-choice",        "count": 1      },      {        "kind": "short-answer",        "count": 1      }    ],    "generating": null,    "requestedLength": 2,    "kinds": [      "MCQ",      "SHORT"    ],    "timerSecs": 600,    "modelTier": "scholar",    "sourceSetIds": [],    "sourceNoteIds": [      "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"    ],    "attempts": [      {        "id": "1f2e3d4c-5b6a-4798-8a7b-6c5d4e3f2a1b",        "assisted": false,        "score": {          "num": 1,          "den": 2        },        "gradingStatus": "graded",        "questionsVersion": 1,        "startedAt": "2026-01-15T09:30:00.000Z",        "finishedAt": "2026-02-01T12:00:00.000Z",        "gradedAt": "2026-02-01T12:00:00.000Z"      }    ]  }}