# List every domain's catch-all

`GET https://api.mailmasker.org/api/v1/domains/catch-alls`

Every domain on the system, alphabetically, with where its catch-all sends mail.

- 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/catch-alls-list

`destination` is the catch-all's mailbox, or null when the domain has none. The domain takes mail while both `mail_enabled` and `active` are on. `send_enabled` is whether the catch-all's mailbox may also send from any address at the domain, and `has_dkim` whether the domain signs the mail it sends.

## Good to know

- Yes-or-no fields come back as 1 or 0, and the catch-all's own fields as null when there is none.

## Examples

cURL:

```bash
curl -s 'https://api.mailmasker.org/api/v1/domains/catch-alls' \
  -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/domains/catch-alls',
    { 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
[
  {
    "domain": "example.com",
    "mail_enabled": 1,
    "active": 1,
    "destination": null,
    "catchall_active": null,
    "send_enabled": null,
    "has_dkim": 1
  },
  {
    "domain": "example.org",
    "mail_enabled": 1,
    "active": 1,
    "destination": "you@example.com",
    "catchall_active": 1,
    "send_enabled": 0,
    "has_dkim": 0
  }
]
```
