---
title: "Re-apply auto-linking to a site"
type: reference
method: POST
path: /rest-api/sites/{siteId}/auto-linking/apply.do
tag: "Placements"
---

# Re-apply auto-linking to a site

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

Links the site's placements to the creatives whose auto-linking rules they now match and unlinks auto-linking creatives they no longer match. Placements with auto-linking disabled and creatives without auto-linking rules are left alone. linkCount: creative-placement links to add, unlinkCount: links to remove, placementCount: placements affected. All zero means the links already follow the auto-linking rules. Requires UPDATE share on the site and APPLY_AUTO_LINKING.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `siteId` | integer | yes | `1001` | ID of the site |

## Responses

- `200` — Applied; the counts say what changed
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — Missing share or permission; the message names the permission
- `404` — Site not found

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/sites/1001/auto-linking/apply.do' \
  --header 'X-Api-Key: YOUR_API_KEY'
```

Source: https://epom.com/ad-server/docs/api/placements/post-sites-auto-linking-apply