Users and roles
List roles
GET /api/v1/admin/roles
Who can use this: Site admins As Markdown
In the order they were made. protected is 1 for the three built-in roles that can't be deleted, and 0 for the rest: user, site_admin, and system_agent, the role the fleet's own services sign in with. site_admin carries no permissions because it needs none: a site admin may always do everything.
cURL
Perl
homelab-cli
Copy
curl -s 'https://api.mailmasker.org/api/v1/admin/roles' \
-H "Authorization: Bearer $TOKEN"
use Mojo::Base -strict;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
my $res = $ua->get('https://api.mailmasker.org/api/v1/admin/roles',
{ Authorization => "Bearer $ENV{TOKEN}" })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
homelab-cli admin roles list
Response 200 OK
Copy
[
{
"id": 1,
"name": "user",
"description": "Default role -- standard API access",
"protected": 1,
"created_at": "2026-10-12 13:58:20.118347-05",
"permissions": []
},
{
"id": 2,
"name": "site_admin",
"description": "Administrative capabilities (informational only; admin routes are hardcoded, not gated by a table, so a bad edit can't lock every admin out)",
"protected": 1,
"created_at": "2026-10-12 13:58:20.118347-05",
"permissions": []
},
{
"id": 4,
"name": "auditor",
"description": "Reads the audit log",
"protected": 0,
"created_at": "2026-11-03 21:42:10.123456-06",
"permissions": ["audit.view"]
}
]