Update Test

Update a generated test and its items using a Platform API key.

Authenticated Update Endpoints

These endpoints use the Platform API key and the test request id returned by Create Test. Use them to update tests programmatically without using an editToken.

All paths are prefixed with /v1/platform/tests/:id.

MethodPathPurpose
PATCH/Update test metadata
PATCH/fullBulk-update metadata and items
PATCH/items/by-id/:itemIdUpdate a single item by UUID

Updates are available after the generation request has completed.


PATCH /

Updates test-level metadata.

curl -X PATCH https://api.tutorflow.io/v1/platform/tests/{id} \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Algebra Checkpoint",
    "description": "A short checkpoint on linear equations."
  }'

Body

FieldTypeDescription
titlestring | nullUpdated test title
descriptionstring | nullUpdated test description

Returns the updated TestResDto.


PATCH /full

Bulk-updates test metadata and the complete item list. This is the preferred endpoint for agents or editors that save several item changes at once.

curl -X PATCH https://api.tutorflow.io/v1/platform/tests/{id}/full \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Algebra Checkpoint",
    "description": "Ten questions on equations.",
    "level": "medium",
    "timeLimit": 30,
    "items": [
      {
        "id": "c31e3b03-e54d-4f71-9335-d22f95cd5afe",
        "sequence": 1,
        "title": "Solve for x",
        "type": "select",
        "question": "Solve: 2x + 4 = 10",
        "options": ["2", "3", "4", "5"],
        "correctAnswers": ["3"],
        "explanation": "Subtract 4, then divide by 2.",
        "score": 10
      }
    ]
  }'

Body

FieldTypeDescription
titlestring | nullTest title
descriptionstring | nullTest description
levelstring | nullDifficulty label
timeLimitnumber | nullTime limit in minutes
itemsarrayFull item upsert list

Item Fields

FieldTypeDescription
idstringExisting item id. Omit to insert a new item.
sequencenumberItem order
titlestring | nullItem title
typestringItem type, such as select, true_false, or short_answer
questionstringQuestion text
optionsstring[] | nullAnswer options
correctAnswersstring[] | nullCorrect answer values
explanationstring | nullExplanation shown after grading
scorenumberPoints for the item

When items is supplied, the list is treated as authoritative: existing items missing from the incoming list are removed, matching ids are patched, and items without an id are inserted.

Returns the updated TestResDto.


PATCH /items/by-id/:itemId

Updates one item by UUID.

curl -X PATCH https://api.tutorflow.io/v1/platform/tests/{id}/items/by-id/{itemId} \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{
    "sequence": 2,
    "question": "Solve: 3x = 12",
    "options": ["2", "3", "4", "6"],
    "correctAnswers": ["4"],
    "explanation": "Divide both sides by 3.",
    "score": 10
  }'

Returns { "success": true }.