---
title: "Change ad serving domain"
type: reference
method: POST
path: /rest-api/sites/{siteId}/changeAdServingDomain.do
tag: "Sites"
---

# Change ad serving domain

`POST https://YOUR-NETWORK-DOMAIN/rest-api/sites/{siteId}/changeAdServingDomain.do`

Changes the ad serving domain (the host used for ad delivery URLs) for the specified site. Pass null for the host parameter to reset to the system default domain. Requires ALL or SHARED level UPDATE permission on INVENTORY and the AD_SERVING_DOMAIN_INVENTORY permission must be enabled. SSP sites cannot have their domain changed.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `siteId` | integer | yes | `5001` | Unique numeric ID of the site |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `host` | string | no | `ads.example.com` | Ad serving host name to set, or null to reset to system default |

## Responses

- `200` — Ad serving domain updated successfully
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — No permission for this operation
- `404` — Site or domain not found

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/sites/5001/changeAdServingDomain.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'host=ads.example.com'
```

Source: https://epom.com/ad-server/docs/api/sites/post-sites-changeadservingdomain