# PATCH /quizzes/:quiz_id

**Resource:** [QUIZZES](./quizzes.md)  
**MCP tool:** `update_quiz`  
**Scopes:** `quizzes:write`  
**Write operation:** yes

Change a quiz's name, status, pass mark, questions drawn, attempts, wait between attempts, what they see when they finish and the score email. Setting it live checks it has questions and, for a scorecard with results, that they cover 0 to 100. A course module quiz's settings change here too.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `quiz_id` | path | string | yes | The quiz (list_quizzes). |
| `name` | body | string | no | What the quiz is called, e.g. "How AI-ready is your business?". |
| `status` | body | string | no | draft (being built), live (people can take it) or archived. Going live needs questions, and for a scorecard with results, results that cover 0 to 100. |
| `pass_mark` | body | number | no | Tests: the score (1 to 100) they need to pass. Default 80. |
| `draw_count` | body | number | no | Tests: how many questions each person gets, drawn at random (1 to 100). Send null for every question. |
| `max_attempts` | body | number | no | How many times one person can take it (1 to 100). Send null for no limit. A scorecard allows 1 when this is not set. |
| `cooldown_minutes` | body | number | no | Minutes they wait between attempts (0 to 525600). Send null for no wait. |
| `show_score` | body | boolean | no | Show their score (and result) when they finish. Default true. |
| `show_answers` | body | boolean | no | Tests: show the right answers when they finish. |
| `email_score` | body | boolean | no | Email them their score when they finish (a Lead Magnet quiz block can also turn this on). |
| `email_subject` | body | string | no | The score email's subject. May use {{contact.first_name}} and {{quiz.name}}. Send null for the default. |
| `email_intro` | body | string | no | The score email's opening words. Send null for the default. |
| `certificate_enabled` | body | boolean | no | Tests in a course: a certificate when they pass. |
| `calculations` | body | object | no | The quiz's calculated results: figures worked out instantly from their answers, with no AI, no credits and no waiting (a repayment, an LVR, what a score is worth in dollars). Replaces the whole definition, so send everything; send {} to remove it. Shape: { tables: { <name>: { kind: "brackets", rows: [{ from, to (null on the last row), base, rate }] } or { kind: "lookup", rows: [{ key, value }] } }, outputs: [{ key, label, formula, format: plain \| money \| percent }] }. A formula reads questions by their key (get_quiz lists them) and other results by their key, like price - deposit. It can use + - * / ^ and brackets, comparisons (= != < <= > >=), and, or, not, if(condition, a, b), min, max, round(x, decimal places), floor, ceil, abs, has(several-answers question, "option"), brackets(table, amount) for tiered amounts (base + rate x (amount - from) for the row the amount falls in; rate is a decimal, 0.0175 means 1.75 percent; each row starts at 0 or where the one before ends; the last row's to is null) and lookup(table, key, value if missing) for a value per key; a lookup value can name a brackets table. A choice question compares as text (state = "NSW"), a Yes/No choice is true or false, a Number question is a number (a percent question holds 6 for 6 percent, so write rate / 100). Division by zero or a question left blank shows "Not available". Up to 50 results, 30 tables, 200 rows a table, 2000 characters a formula. Number questions are never scored. Try them with calculate_quiz (nothing is saved). |
| `calculator_id` | body | string | no | Use a calculator from the library (list_calculators) for the calculated results, instead of writing calculations here. Its live version is used, and every publish updates this one too. null stops using it (the results stay as they are, now this one's own). |
| `calculator_map` | body | object | no | Where each of the calculator's inputs comes from, by input key: { "<input key>": { "question": "<question key>" } } to read one of the questions, or { "<input key>": { "value": <a set value> } }. An input with the same key as a question reads it without being listed; an input with a starting value uses it when not listed. |
| `calculator_show` | body | array | no | Which of the calculator's results the reader sees, by key. The others are not shown, and an open website calculator never sends them to the visitor's browser unless a shown result is worked out from them. null or left out shows them all. |
| `kind` | body | string | no | scorecard or test. Can change only before anyone took it, and only when every question suits the new kind. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X PATCH   "https://api.trustpager.com/functions/v1/api/v1/quizzes/:quiz_id"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","status":"...","pass_mark":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`