---
title: "Change invocation code domain"
type: reference
method: POST
path: /rest-api/sites/{siteId}/changeInvocationCodeDomain.do
tag: "Sites"
---

# Change invocation code domain

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

Changes the invocation code domain (the host used in placement invocation code snippets) 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 INVOCATION_CODE_DOMAIN 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 | `cdn.example.com` | Invocation code host name to set, or null to reset to system default |

## Responses

- `200` — Invocation code 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/changeInvocationCodeDomain.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'host=cdn.example.com'
```

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