---
title: "Save Draft Public"
method: PATCH
path: "/api/coding-assessment/{magic_token}/draft"
tags: ["coding-assessment"]
---

# Save Draft Public

`PATCH /api/coding-assessment/{magic_token}/draft`

## Request

- Base URL: `https://api.ruzora.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ruzora.com/api/coding-assessment/{magic_token}/draft`
- Auth: none declared

Save work in progress and advance the working-time clock.

Drafts lived only in the candidate's localStorage until now, so someone
who started on a phone and moved to a laptop lost everything silently.
The magic token is the auth, exactly as it is for run and submit.

Returns ``saved: false`` rather than an error when the payload is stale
or the assessment is already submitted — from the candidate's side
their work is safe either way, and a heartbeat has nothing useful to do
with a 4xx.

## Path parameters

- `magic_token` string, required

## Request body

- SaveDraftRequest: A heartbeat from the assessment page. Fires every ~15s and on blur.
  - `code` string, nullable
  - `answers` object, nullable
  - `elapsed_seconds` integer
  - `client_saved_at` string, date-time, required
  - `telemetry` object, nullable
  - `pasted` boolean
  - `pasted_snippets` string[], nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ruzora/apis/ruzora-candidate-crm-api.md) · [All operations](https://skmtc.dev/ruzora/apis/ruzora-candidate-crm-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ruzora/apis/ruzora-candidate-crm-api/revisions/f9b8223f3ac4?raw)
