# Revoke a share

`POST https://api.mailmasker.org/api/v1/drive/shares/:id/revoke`

Turn off a share's link, for everyone who has it.

- Who can use it: Any signed-in account
- Area: Drive
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/drive-revoke-share

The link stops working at once, and the share drops off your list and the other person's. It can't be turned back on; share again for a new link.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `id` | path | yes | The share's id, from List your shares. | `15` |

## Good to know

- A share that isn't yours, or is already revoked, answers 404.

## Examples

cURL:

```bash
curl -s -X POST 'https://api.mailmasker.org/api/v1/drive/shares/15/revoke' \
  -H "Authorization: Bearer $TOKEN"
```

Perl:

```perl
use Mojo::Base -strict;
use Mojo::UserAgent;

my $ua  = Mojo::UserAgent->new;
my $res = $ua->post('https://api.mailmasker.org/api/v1/drive/shares/15/revoke',
    { Authorization => "Bearer $ENV{TOKEN}" })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

There is no homelab-cli command for this yet.

## Response

200 OK:

```json
{ "ok": true, "id": 15 }
```
