---
title: "Remove site share"
type: reference
method: DELETE
path: /rest-api/siteShares/{userId}/{siteId}.do
tag: "Shares"
---

# Remove site share

`DELETE https://YOUR-NETWORK-DOMAIN/rest-api/siteShares/{userId}/{siteId}.do`

Revokes a user's share on a site, as the Shares grid of the console does. The response echoes the userId and siteId. Works for a deleted site too, so a share left on one can be cleaned up. Needs the SHARE permission on inventory at ALL level; at SHARED level the caller's own share on the site must be higher than the one being removed, or the user must be one the caller owns.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `userId` | integer | yes | `5001` | ID of the user whose share is removed |
| `siteId` | integer | yes | `4001` | ID of the site the share is on |

## Responses

- `200` — Share removed: {success, userId, siteId}
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — Not allowed to remove this share
- `404` — No such user or site, or the user has no share on it

## Example request

```bash
curl --request DELETE \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/siteShares/5001/4001.do' \
  --header 'X-Api-Key: YOUR_API_KEY'
```

Source: https://epom.com/ad-server/docs/api/shares/delete-siteshares