# List permissions

`GET https://api.mailmasker.org/api/v1/admin/permissions`

Every permission a role can be given, alphabetically.

- Who can use it: Site admins
- Area: Users and roles
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/admin-list-permissions

Permissions come with the software, since each one only means something where the code checks for it, so there is no way to add one here. Give them to roles; a site admin holds them all already.

## Examples

cURL:

```bash
curl -s 'https://api.mailmasker.org/api/v1/admin/permissions' \
  -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/admin/permissions',
    { 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 admin permissions list
```

## Response

200 OK:

```json
[
  {
    "id": 1,
    "name": "audit.view",
    "description": "View the system audit log (own entries always allowed; this grants viewing other users' entries too)"
  },
  {
    "id": 3,
    "name": "domains.catchall",
    "description": "Manage domain catch-all routing + domain send-as (the myaccount \"Domain catch-all routing\" area)"
  },
  {
    "id": 2,
    "name": "metrics.view",
    "description": "View the fleet metrics dashboard (Prometheus-backed) in myaccount"
  }
]
```
