# Audit log

Read every change in your organization for the last 90 days, with its actor, action, target, time and address.

Source: https://slashinfra.com/docs/platform/audit-log
Last modified: 2026-11-30T16:36:19.000Z

The audit log records the mutations of your organization: who changed what, when, from where and with which details. It keeps rows for 90 days, newest first. An owner or an admin holds `audit:read`; a member does not.

## Read the audit log

Filters combine with AND, and each one narrows the list. `limit` sets the page size and `next_cursor` reads the next page.

### Dashboard

- Open the [Audit log](https://app.slashinfra.com/audit) page. 
- Enter an action in Action, such as `project.create`, or leave it empty for every action. 
- Enter an actor in Actor, such as `user:8Xk2mQ4pLd`, or leave it empty for every actor. 
- Choose a Period: Any time (the default), Last hour, Last 24 hours, Last 7 days, Last 30 days, Last 90 days or Custom. Custom adds From and To as `YYYY-MM-DD` days in your time zone. 
- Select Apply. 
- Select Load more to read the next page.

The table shows Time, Actor, Action, Target, IP and Details. IP and Details appear on wider screens.

### CLI

```bash
si org audit --action member.add --from 7d
```

Output

```text
at                    actor            action      target             ip
2026-11-25 00:30:49Z  user:8Xk2mQ4pLd  member.add  member:6f1c0f0e8a  -
```

The CLI table shows the time, actor, action, target and address; it does not show `details`.

### curl

```bash
curl -sS "https://api.slashinfra.com/audit?limit=1&action=apikey.create" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
{"entries":[{"id":"6f1c0f0e8a","actor":"user:8Xk2mQ4pLd","action":"apikey.create","target":"apikey:8a2b3c4d5e","ip":"203.0.113.9","at_ms":1795684877590,"details":{"name":"companion","projects":"*","actions":["svm:read","svm:write","svm:delete","svm:exec","snapshot:read","snapshot:write","snapshot:delete","project:read","apikey:write","member:read","audit:read"],"expires_ms":1803460877539}}],"next_cursor":"MTc2NzIyNTYwMDAwMCw2ZjFjMGYwZThh"}
```

### Python

```python
import os, requests

res = requests.get(
"https://api.slashinfra.com/audit",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
params={"limit": 1, "action": "apikey.create"},
)
res.raise_for_status()
page = res.json()
entry = page["entries"][0]
print(entry["action"], entry["target"], page["next_cursor"] is not None)
```

Output

```text
apikey.create apikey:8a2b3c4d5e True
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/audit?limit=1&action=apikey.create', {
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
const page = (await res.json()) as { entries: { action: string; target: string }[]; next_cursor: string | null }
console.log(page.entries[0].action, page.entries[0].target, page.next_cursor !== null)
```

Output

```text
apikey.create apikey:8a2b3c4d5e true
```

| Field | Type | What it is |
| --- | --- | --- |   
| `entries` | array | The rows of the page, newest first. | 
| `entries[].id` | string | The id of the row. | 
| `entries[].actor` | string | Who made the change: `user:<id>`, `key:<id>`, `node:<name>`, `operator` or `system`. | 
| `entries[].action` | string | What changed, as `<resource>.<verb>`. | 
| `entries[].target` | string | The row that changed, as `<resource>:<id>`. | 
| `entries[].ip` | string or null | The client address of the request, or `null` when the request had none. | 
| `entries[].at_ms` | integer | The time of the change, in Unix epoch milliseconds. | 
| `entries[].details` | object | The fields that the action needs, such as the name or the new role; it never holds a token, key or password. | 
| `next_cursor` | string or null | The opaque cursor of the next page, or `null` on the last page. Send it back as `cursor`. |

## Page through the log

A cursor names the time and id of the last row of a page, so a row written after the page is read cannot move a row to another page. Send the `next_cursor` of a page as `cursor`, and stop when it is `null`.

```python
import os, requests

url = "https://api.slashinfra.com/audit"
headers = {"Authorization": f"Bearer {os.environ['SI_API_KEY']}"}
params = {"limit": 1, "action": "apikey.create"}
while True:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
page = res.json()
for entry in page["entries"]:
print(entry["action"], entry["target"])
if page["next_cursor"] is None:
break
params["cursor"] = page["next_cursor"]
```

Output

```text
apikey.create apikey:8a2b3c4d5e
apikey.create apikey:9c3d4e5f6a
```

## Audit actions

The API records these actions. The `details` column of a row holds the fields that the action needs; a token, key or password never appears.

| Action | What it records |
| --- | --- |   
| `apikey.create` | An organization key was created. | 
| `apikey.revoke` | A key was revoked. | 
| `database.delete` | A database and its branches and backups were deleted. | 
| `join_token.delete` | A node join token was deleted. | 
| `join_token.mint` | A node join token was minted. | 
| `member.add` | A member was added to the organization. | 
| `member.remove` | A member was removed from the organization. | 
| `member.role_update` | A member’s role changed. | 
| `node.drain` | A node was set to draining. | 
| `node.enroll` | A node enrolled with a join token. | 
| `node.leave` | A node left its pool. | 
| `node.quarantine` | A node was quarantined. | 
| `node.revoke` | A node was revoked. | 
| `pool.ca_rotate` | A pool’s CA was rotated. | 
| `pool.create` | A pool was created. | 
| `pool.default_change` | The default pool changed. | 
| `pool.delete` | A pool was deleted. | 
| `pool.update` | A pool’s settings changed. | 
| `project.create` | A project was created. | 
| `project.delete` | An empty project was deleted. | 
| `project.rename` | A project was renamed. | 
| `secret.update` | A secret’s description changed. | 
| `storage.create` | A storage connection was added. | 
| `storage.delete` | A storage connection was deleted. | 
| `storage.rotate` | A storage connection’s key was rotated. | 
| `svm.checkpoint_untrusted` | A VM’s last checkpoint was signed only by a compromised node. |

## Options

| Field | Type | Default | Allowed values | What it changes |
| --- | --- | --- | --- | --- |   
| `limit` | string | 50 | 1 to 200 | The most rows on one page. Another value answers `400 invalid_limit`. | 
| `cursor` | string | None | The `next_cursor` of the previous page | The page to read. An unreadable value answers `400 invalid_cursor`. | 
| `action` (`--action`) | string | None | Any action in Audit actions | Only the rows of this action. | 
| `actor` (`--actor`) | string | None | `user:<id>`, `key:<id>`, `node:<name>`, `operator` or `system`, exactly | Only the rows of this actor. An empty value answers `400 invalid_actor`. | 
| `from` (`--from`) | string | None | A non-negative whole number; the CLI takes a duration back such as `1h` or `7d` | Only the rows at or after this time. A value that is not a whole number answers `400 invalid_range`. | 
| `to` (`--to`) | string | None | A non-negative whole number; the CLI takes a duration back such as `1h` or `7d` | Only the rows before this time. `from` must not be after `to`. |

## Errors

| Code | When | Fix |
| --- | --- | --- |   
| [`invalid_limit`](https://slashinfra.com/docs/reference/errors#invalid_limit) | `limit` is not an integer from 1 to 200. | Send an integer from 1 to 200, or omit `limit` for 50. | 
| [`invalid_cursor`](https://slashinfra.com/docs/reference/errors#invalid_cursor) | `cursor` does not come from this list. | Read the first page again and use its `next_cursor`. | 
| [`invalid_actor`](https://slashinfra.com/docs/reference/errors#invalid_actor) | `actor` is empty. | Send `user:<id>`, `key:<id>`, `node:<name>`, `operator` or `system`, or omit `actor`. | 
| [`invalid_range`](https://slashinfra.com/docs/reference/errors#invalid_range) | `from` or `to` is not a non-negative whole number, or `from` is after `to`. | Send both as Unix epoch milliseconds with `from` first. |

Errors that any request can return are in the [error catalog](https://slashinfra.com/docs/reference/errors).

## Permissions

| Operation | Who can | Key action |
| --- | --- | --- |   
| Read the audit log | Owner or admin | `audit:read` |

## Limits

- A page holds 1 to 200 rows; the default is 50. 
- Rows stay 90 days; a daily sweep deletes older rows. 
- The log writes five actor forms, and `actor` matches the exact string. 
- `from` and `to` are Unix epoch milliseconds, and `from` must not be after `to`. 
- A cursor names the time and id of the last row, so new rows do not move a page.

The full list is in [Limits](https://slashinfra.com/docs/reference/limits).

## Next

- [Who can reach your VM](https://slashinfra.com/docs/how/access): roles and what an owner or an admin holds. 
- [API keys](https://slashinfra.com/docs/platform/api-keys): the actors a key writes in the log. 
- [Control API audit](https://slashinfra.com/docs/api-reference/control/audit#getAudit): the operation and its status codes.
