---
title: "Audit log API"
description: "Audit log in the OneSend API: 2 endpoints. Who changed members, roles, API keys, sending providers, domains and settings, and when."
url: https://onesend.email/docs/api-reference/audit-log/
---
[Docs](https://onesend.email/docs/) / [API reference](https://onesend.email/docs/api-reference/)

# Audit log

Who changed members, roles, API keys, sending providers, domains and settings, and when.

Base URL `https://your-server.example` (your OneSend server). [Authentication](https://onesend.email/docs/api-reference/#authentication) and errors are described in the [overview](https://onesend.email/docs/api-reference/).

## List audit log entries

GET `/v1/audit-log`

Admins and the owner (or an admin-scoped key). Newest first. Records member, role and invitation changes, and changes to sending providers, routing, domains, DNS hosts, mailboxes, webhooks, API keys, workspace settings and AI provider connections. Request bodies are not stored, only field names and non-secret values.

**Authentication:** `Authorization: Bearer` with an API key or a session token.

### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `action` | query | `string` | Exact action (member.role\_changed) or a prefix ending in a dot (member.) |
| `actor` | query | `string` | User id or API key id |
| `target` | query | `string` |  |
| `since` | query | `string (date-time)` |  |
| `until` | query | `string (date-time)` |  |
| `limit` | query | `integer` | 1 to 200. |
| `cursor` | query | `string` |  |

### Responses

`200` Success

```
{
  "data": [{
    "id": string,
    "action": string,
    "target": string or null,
    "actor": {
      "id": string,
      "type": "user" | "api_key" | "system",
      "label": string
    },
    "data": object or null,
    "createdAt": string
  }],
  "nextCursor": string or null
}
```

**Errors: 400, 401, 403, 404, 429, 500**

- `400` Invalid request: validation failed, a parameter is not allowed, the body is not valid JSON (`invalid_json`) or the pagination cursor is not valid (`invalid_cursor`). Type `invalid_request`.
- `401` Missing credentials (`unauthorized`), an unknown or revoked API key (`invalid_api_key`) or an expired session (`invalid_session`). Type `unauthorized`.
- `403` The API key's permission does not allow this operation (`insufficient_scope`; configuration needs an `admin` key), a test key was used outside its sandbox (`test_key_not_allowed`), a Conversion tracking key was used (`publishable_key`), or a cookie request is missing `X-OneSend-Client: dashboard` (`csrf_header_required`). Type `forbidden`.
- `404` The resource does not exist in this workspace (`not_found`)
- `429` Too many requests; retry after the time in the `Retry-After` header (`rate_limited`)
- `500` Unexpected server error (`internal`)

## Export the audit log as CSV

GET `/v1/audit-log/export`

Same filters as the list. Up to 50,000 rows, newest first.

**Authentication:** `Authorization: Bearer` with an API key or a session token.

### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `action` | query | `string` | Exact action (member.role\_changed) or a prefix ending in a dot (member.) |
| `actor` | query | `string` | User id or API key id |
| `target` | query | `string` |  |
| `since` | query | `string (date-time)` |  |
| `until` | query | `string (date-time)` |  |

### Responses

`200` Success (text/csv)

**Errors: 400, 401, 403, 404, 429, 500**

- `400` Invalid request: validation failed, a parameter is not allowed, the body is not valid JSON (`invalid_json`) or the pagination cursor is not valid (`invalid_cursor`). Type `invalid_request`.
- `401` Missing credentials (`unauthorized`), an unknown or revoked API key (`invalid_api_key`) or an expired session (`invalid_session`). Type `unauthorized`.
- `403` The API key's permission does not allow this operation (`insufficient_scope`; configuration needs an `admin` key), a test key was used outside its sandbox (`test_key_not_allowed`), a Conversion tracking key was used (`publishable_key`), or a cookie request is missing `X-OneSend-Client: dashboard` (`csrf_header_required`). Type `forbidden`.
- `404` The resource does not exist in this workspace (`not_found`)
- `429` Too many requests; retry after the time in the `Retry-After` header (`rate_limited`)
- `500` Unexpected server error (`internal`)
