# POST /websites/:website_id/deploy/domain

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

Attach a custom domain to a website's deployment and return the exact DNS record(s) the owner must add at their registrar to point the domain at the site. Attaches both the bare domain and its "www" (or vice-versa) and sets one canonical host, 308-redirecting the other to it. Also stores the records on the website so the UI can show them.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `website_id` | path | string | yes |  |
| `domain` | body | string | yes | The custom domain to point at the site, e.g. "www.example-client.com". |
| `canonical` | body | string | no | Which host is canonical: "www" (default) redirects the bare domain to www; "apex" redirects www to the bare domain. |
| `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/deploy/domain"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"domain":"..."}'
```

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