POST /exams/{id}/close ends an open test right away: it sets the test's endDateTime to now, so students can no longer start it, and attempts still in progress end — students who are mid-test see it time out, with their answers so far saved. It needs exams:write and at least Editor access to the test.
{ "closed": true, "endDateTime": "2026-11-25T09:30:00.000Z" }Calling it on a test that isn't open is safe: you get closed: false and the current end date, and nothing changes. Handy right before you publish results or push grades from your own system, so no late attempt slips in afterwards.