# Undo a soft photo delete

> Un-deletes a soft-deleted photo's faces so they are searchable again. (POST /v1/collections/{id}/photos/{photoId}/restore)

Source: https://sightradar.com/docs/api/collections/undo-a-soft-photo-delete

Un-deletes a soft-deleted photo's faces so they are searchable again.
Only works while the vectors still exist — i.e. for a soft delete inside
its grace window. An immediate delete physically removed the vectors and
cannot be undone; re-index the photo instead. Free and idempotent.

### Example request

```bash
curl -X POST "https://api.sightradar.com/v1/collections/$ID/photos/$PHOTOID/restore" \
  -H "Authorization: Bearer $SR_API_KEY"
```

Put each id in the path percent-encoded, as a single path segment. An id with `/`, `?`, `#`, `%` or a space otherwise addresses a different URL. In code, use your HTTP library's path encoding (for example `encodeURIComponent` in JavaScript or `urllib.parse.quote(id, safe="")` in Python).

### Parameters

| Name                   | In   | Type     | Description                         |
| ---------------------- | ---- | -------- | ----------------------------------- |
| `id` **required**      | path | `string` | Collection id.                      |
| `photoId` **required** | path | `string` | The photoId supplied at index time. |

### Response body

| Field           | Type      | Description                                         |
| --------------- | --------- | --------------------------------------------------- |
| `restored`      | `boolean` |                                                     |
| `collection_id` | `string`  |                                                     |
| `photo_id`      | `string`  |                                                     |
| `engine`        | `object`  | The engine's own acknowledgement, echoed for audit. |

### Status codes

| Status | Meaning                                                            |
| ------ | ------------------------------------------------------------------ |
| `200`  | Faceprints restored.                                               |
| `401`  | Missing or invalid API key.                                        |
| `403`  | Account is read-only, or the collection does not accept a restore. |
| `404`  | Resource not found.                                                |
| `502`  | Restore service unavailable, or the engine failed.                 |
