# PATCH /websites/:website_id/posthog-link

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

Set which domains count as this website when reading its traffic from PostHog. By default a website uses its own domain (with and without www) and its deployed address; set this when the site is served on other domains, or when one PostHog project covers several sites. Send no hosts (or an empty list) to go back to the default. Needs PostHog connected. Returns the domains now in use and whether they are "custom" or "default".

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `website_id` | path | string | yes | UUID of the website. Get ids from list_websites. |
| `hosts` | body | array | no | Up to 10 bare domains that count as this website, e.g. ["acme.com.au", "www.acme.com.au"]. Leave out, or send an empty list or null, to go back to the website's own 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 PATCH   "https://api.trustpager.com/functions/v1/api/v1/websites/:website_id/posthog-link"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"hosts":"...","require_approval":"..."}'
```

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