---
title: "Revoke every link to a file"
description: "Makes the file private: every public link to it stops working, including in mail already sent."
url: "https://openemail.uk/docs/api/files/revoke-links"
area: "API"
category: "Mailbox"
---

# Revoke every link to a file

Makes the file private: every public link to it stops working, including in mail already sent.

`DELETE /files/{id}/links`

## DELETE /files/{id}/links

Makes the file private: every public link to it stops working, including in mail already sent.

## Example

Needs `files:write`. This is Make private on the Files page. `revoked` says how many links were still working and now are not.

**curl**

```
curl -X DELETE "$OE/files/file_6bb640f5b99e47deb758f1f5/links" -H "$AUTH"
```

**Response**

```
{
  "object": "file_link_revocation",
  "fileId": "file_6bb640f5b99e47deb758f1f5",
  "revoked": 2
}
```

> A file with no working links answers `revoked: 0`, so the call is safe to repeat. The file itself stays, and `POST /files/{id}/links` can publish it again at a new link.

> A key limited to particular addresses reaches only the files that arrived at them, and any other file is a 404.

## Reference

- [`DELETE /files/{id}/links`](https://openemail.uk/docs/api/reference/files#delete-files-id-links): full reference
