---
title: "Restore a deleted entity"
type: reference
method: POST
path: /rest-api/deleted-entities/{type}/{id}/restore.do
tag: "Recently Deleted"
---

# Restore a deleted entity

`POST https://YOUR-NETWORK-DOMAIN/rest-api/deleted-entities/{type}/{id}/restore.do`

Undoes the newest delete of an advertiser, campaign, banner, site, zone or placement made in the last 90 days: it is no longer deleted, an advertiser, campaign or banner is switched on or off as it was before, its rule groups come back, and so do its banner-placement links - to placements and banners that still exist, are not deleted, still fit and the caller may still see and link (the others are listed in skippedLinks with reason deleted, missing, unsuitable or forbidden). Everything the delete cascaded to (the campaigns and banners of an advertiser, the zones and placements of a site) is restored the same way; a banner whose creative files are no longer in storage stays deleted and is listed in notRestored. Entities deleted on their own before or after the delete are not touched. Takes the same permission as deleting the entity. The ad server serves it again after its next scheduled reload. Answers {success, type, id, name, restored:[{type, id, name}], notRestored, linksRestored, skippedLinks, ruleGroupsRestored, ruleGroupsSkipped, partial}. A refusal changes nothing.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `type` | string | yes | `BANNER` | ADVERTISER, CAMPAIGN, BANNER, SITE, ZONE or PLACEMENT (any case) |
| `id` | integer | yes | `3001` | The deleted entity's id |

## Responses

- `200` — Restored
- `400` — Unknown type
- `401` — Authentication error
- `403` — The caller may view the entity but not delete it
- `404` — No such entity, or one the caller may not view
- `409` — Not restorable: {success:false, message, reason, blockedBy?}. reason is NOT_DELETED, NOT_RECORDED (deleted before deletions were recorded, more than 90 days ago, or already restored), PARENT_DELETED (blockedBy {type, id, name} names the deleted advertiser, campaign, site or zone to restore first) or FILES_MISSING (a banner whose creative files are gone)

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/deleted-entities/BANNER/3001/restore.do' \
  --header 'X-Api-Key: YOUR_API_KEY'
```

Source: https://epom.com/ad-server/docs/api/recently-deleted/post-deleted-entities-restore