# Remove an extra address

`DELETE https://api.mailmasker.org/api/v1/domains/mail-aliases/:source_pattern`

Stop routing an address or domain to an account, and stop the account sending from it.

- Who can use it: Site admins
- Area: Domains and DNS
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/alias-remove

Removes the entry completely: its mail no longer reaches the account, and a send from it is refused. To stop only sending, turn sending off instead. The domain itself stays.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `source_pattern` | path | yes | The exact address, or `@` and a domain, as the list shows it. The `@` may be sent as it is or as `%40`. | `sales@example.com` |

## Good to know

- An address that isn't on the list answers 404.

## Examples

cURL:

```bash
curl -s -X DELETE 'https://api.mailmasker.org/api/v1/domains/mail-aliases/sales%40example.com' \
  -H "Authorization: Bearer $TOKEN"
```

Perl:

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

my $ua  = Mojo::UserAgent->new;
my $res = $ua->delete('https://api.mailmasker.org/api/v1/domains/mail-aliases/sales%40example.com',
    { Authorization => "Bearer $ENV{TOKEN}" })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

```bash
homelab-cli dns mail-aliases remove sales@example.com
```

## Response

200 OK:

```json
{ "ok": true }
```
