# Audit log

What happened in an org, and who did it.

An SDK signs every request with your key: [Authentication](https://mailset.app/docs/authentication.md). To sign one yourself, see [Calling the API without an SDK](https://mailset.app/docs/authentication/http.md).

## audit.list

Show what happened in an org.

`POST /v1/audit.list`

An admin or owner of the org.

### Parameters

- `limit` (integer, optional): How many rows to return, 1 to 200. Default `50`. From 1 to 200.
- `actor` (string, optional): Who did it: a whole address, or part of one. At most 254 characters.
- `kind` (string, optional): Only events of this kind, such as `member_invited`. At most 64 characters.
- `since` (integer or string, optional): From this moment on: milliseconds, an ISO time, or a day (YYYY-MM-DD, from its start in UTC).
- `until` (integer or string, optional): Up to this moment: milliseconds, an ISO time, or a day (YYYY-MM-DD, to its end in UTC).
- `before` (string, optional): The id of the last row you have, for the rows before it.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is a list of objects, each with:

- `id` (string)
- `kind` (string)
- `target` (string)
- `actor` (nullable string)
- `at` (number)
- `ip` (nullable string): Where it was done from, for the events that record that.
- `location` (nullable string)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.audit.list({
	actor: "ben@example.com",
	since: "2026-11-01",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.audit.list(
    {"actor": "ben@example.com", "since": "2026-11-01"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AuditListParams{
		Actor: mailset.String("ben@example.com"),
		Since: "2026-11-01",
	}
	answer, err := client.Audit.List(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.audit.list(
  actor: 'ben@example.com',
  since: '2026-11-01'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->audit->list([
    'actor' => 'ben@example.com',
    'since' => '2026-11-01',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Audit;
import app.mailset.model.AuditListParams;
import java.util.List;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AuditListParams.builder()
        .actor("ben@example.com")
        .since("2026-11-01")
        .build();
List<Audit> answer = mailset.audit().list(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AuditListParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .audit()
    .list(AuditListParams {
        actor: Some("ben@example.com".into()),
        since: Some("2026-11-01".into()),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/audit.list \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"actor":"ben@example.com","since":"2026-11-01"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset audit list --actor ben@example.com --since 2026-11-01
```

### Response

```json
{
  "ok": true,
  "data": [
    {
      "id": "out_3f9a1c0e7b2d",
      "kind": "text",
      "target": "text",
      "actor": "text",
      "at": 1796048940000,
      "ip": "text",
      "location": "text"
    }
  ]
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/audit#audit-list)

---

© 2026 Intenseloop, Inc. Mailset’s site, docs and guides are copyrighted. You may read them and use their code to build with Mailset. Don’t republish them or use them to build a copy of Mailset. Terms: https://mailset.app/terms#content