# See your activity log

`GET https://api.mailmasker.org/api/v1/audit/log`

What your account has done and when, the newest first.

- Who can use it: Any signed-in account
- Area: Your account
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/activity-log

Sign-ins and changes made through the fleet's services: ending a session, blocking an address, deleting a file, sending mail through this API and so on. Looking at things isn't recorded. Each entry says what was done (`action`), to what (`resource_type`, `resource_id`), by which service, and from which network address and program. At most 500 entries come back.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `user` | query | no | Only entries this account did. Anyone but yourself needs the audit.view permission. |  |
| `affecting` | query | no | Only entries that touched this account, including what a site admin did to it. Anyone but yourself needs the audit.view permission. |  |
| `since` | query | no | Only entries at or after this time, such as 2026-11-01 or 2026-11-01 16:00:00-06. | `2026-11-01` |
| `until` | query | no | Only entries at or before this time, written the same way. |  |
| `action` | query | no | Only entries with this action, such as auth.login or file.delete. |  |

## Good to know

- Asking for someone else's entries without the audit.view permission answers 403.
- With audit.view and neither user nor affecting, you see everyone's entries.

## Examples

cURL:

```bash
curl -s 'https://api.mailmasker.org/api/v1/audit/log?since=2026-11-01' \
  -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/audit/log',
    { Authorization => "Bearer $ENV{TOKEN}" },
    form => { since => '2026-11-01' })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

```bash
homelab-cli audit list --since 2026-11-01
```

## Response

200 OK:

```json
[
  {
    "id": 18342,
    "occurred_at": "2026-11-03 21:42:10.123456-06",
    "actor_email": "you@example.com",
    "affected_user": "you@example.com",
    "jti": "7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f",
    "action": "recipient_access.block",
    "resource_type": "recipient_access",
    "resource_id": "shop@example.com",
    "source_service": "homelab-domain-admin",
    "ip_address": "203.0.113.7",
    "user_agent": "homelab-cli/0.1.0 (Linux 6.8.0-49-generic)",
    "detail": { "tier": "self_service", "action": "REJECT", "reason": "Sells my address" }
  },
  {
    "id": 18297,
    "occurred_at": "2026-11-03 21:40:02.654321-06",
    "actor_email": "you@example.com",
    "affected_user": "you@example.com",
    "jti": "7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f",
    "action": "auth.login",
    "resource_type": "user",
    "resource_id": "42",
    "source_service": "homelab-api",
    "ip_address": "203.0.113.7",
    "user_agent": "homelab-cli/0.1.0 (Linux 6.8.0-49-generic)",
    "detail": null
  }
]
```
