# Turn inbox links on or off

`PUT https://api.mailmasker.org/api/v1/block-link/account`

Choose whether your incoming mail carries a "block this address" link.

- Who can use it: Any signed-in account
- Area: Your addresses and blocking
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/block-link-set

Your own choice overrides your domain's default. Send `null` to drop your choice and follow the domain default again.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `enabled` | body | yes | true for links, false for none, null to follow the domain default. | `true` |

## Examples

cURL:

```bash
curl -s -X PUT 'https://api.mailmasker.org/api/v1/block-link/account' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"enabled":true}'
```

Perl:

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

my $ua  = Mojo::UserAgent->new;
my $res = $ua->put('https://api.mailmasker.org/api/v1/block-link/account',
    { Authorization => "Bearer $ENV{TOKEN}" },
    json => { enabled => \1 })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

```bash
homelab-cli mail block-link enable
```

## Response

200 OK:

```json
{ "enabled": true, "mode": "both", "domain_default": false }
```
