# POST /websites/:website_id/site-code

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

Build the one site code into a website TrustPager hosts: adds it just before </head> on every page of the site's own code (once; nothing else changes), connects the contact form of a site made from a TrustPager design so its enquiries come into the CRM, and saves the change, which rebuilds the live site. Sites made from a design, and every site TrustPager deploys from now on, get this automatically. Only for sites whose code TrustPager holds: a site on WordPress, Wix and the like, or built from an agency's own repository, gets a 409 and pastes site_code from list_website_tools instead. dry_run: true lists the files that would change first.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `website_id` | path | string | yes | UUID of the website. Get ids from list_websites. |
| `dry_run` | body | boolean | no | true lists the files that would change, without changing anything. |
| `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/site-code"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"dry_run":"...","require_approval":"..."}'
```

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