# POST /websites/:website_id/builder/undo-publish

**Resource:** [Websites](./websites.md)  
**MCP tool:** `undo_website_builder_publish`  
**Scopes:** `websites:write`  
**Write operation:** yes

Put the live website back to how it was before the latest publish from the AI website builder, as a new update (the files that publish changed go back to their old content). Call again to go back one more publish. Refused while there are unpublished changes in the draft: publish or undo those first (restore_website_builder with 0). get_website_builder shows last_publish.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `website_id` | path | string | yes | The website UUID (from list_websites). |
| `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/websites/:website_id/builder/undo-publish"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"require_approval":"..."}'
```

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