# Revoke a share link.

> The link stops opening the preview at once; a pending approval for it expires.
> https://koi.dog/docs/api/previews/revoke-preview-share-link/

`DELETE /api/v1/previews/{id}/share-links/{linkId}` · Scope: `crews`

Revoking a link that no longer works answers it unchanged. A browser that already opened it keeps Boat's access until the preview stops. The timeline records the key ID, action and outcome.

## Path parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The preview's id. |
| `linkId` | `string` | yes | The share link's id. |

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Response.

200 OK · JSON object

## Request.

```sh
curl -X DELETE "https://api.koi.dog/api/v1/previews/$ID/share-links/$LINK_ID" \
    -H "Authorization: Bearer $KOIDOG_API_KEY"
```

```js
const res = await fetch(`https://api.koi.dog/api/v1/previews/${process.env.ID}/share-links/${process.env.LINK_ID}`, {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
  },
});
console.log(await res.json());
```

```python
import os

import requests

r = requests.delete(
    f"https://api.koi.dog/api/v1/previews/{os.environ['ID']}/share-links/{os.environ['LINK_ID']}",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "id": "string",
  "previewId": "string",
  "crewId": "string",
  "label": "string",
  "prefix": "string",
  "state": "pending_approval",
  "approvalId": "string",
  "expiresAt": "string",
  "createdAt": "string",
  "revokedAt": "string",
  "createdBy": {
  },
  "opens": 0,
  "lastOpenedAt": "string"
}
```
