# Check that a mailbox exists

`GET https://api.mailmasker.org/api/v1/mail/recipient-exists`

Whether an address is an active account's mailbox.

- Who can use it: Site admins, and accounts granted the domains.catchall permission
- Area: Catch-all routing
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/mailbox-exists

Matches the whole address exactly, ignoring case, and never lists or suggests others. Use it before setting a catch-all, which doesn't check its destination.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `email` | query | yes | The full address to check. | `you@example.com` |

## Good to know

- A suspended account, or text without an @, answers false.

## Examples

cURL:

```bash
curl -s 'https://api.mailmasker.org/api/v1/mail/recipient-exists?email=you%40example.com' \
  -H "Authorization: Bearer $TOKEN"
```

Perl:

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

my $ua  = Mojo::UserAgent->new;
my $res = $ua->get('https://api.mailmasker.org/api/v1/mail/recipient-exists',
    { Authorization => "Bearer $ENV{TOKEN}" },
    form => { email => 'you@example.com' })->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
{ "exists": true }
```
