# POST /quizzes/:quiz_id/questions/generate

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

Write questions for a quiz with AI from a brief (what they should find out), with points (scorecards) or right answers (tests), and add them. Every question passes the same checks as one you write. Costs 16 credits a go, refunded when nothing usable comes back. replace=true swaps out the current questions.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `quiz_id` | path | string | yes | The quiz (list_quizzes). |
| `brief` | body | string | no | What the questions should find out, in your words. Defaults to the quiz or gift's own brief and name. |
| `count` | body | number | no | How many questions to write, 1 to 20 (default 8). |
| `replace` | body | boolean | no | true: remove the current questions first. Default false: add to them. |
| `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 POST   "https://api.trustpager.com/functions/v1/api/v1/quizzes/:quiz_id/questions/generate"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"brief":"...","count":"...","replace":"..."}'
```

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