# List a server's audit log

`GET https://console.advinservers.com/api/v1/client/servers/{server}/audit-log`

### Overview

Lists server activity, newest first. `per_page` defaults to 25 and accepts 1 to 100. Sort by `created_at` or `updated_at`, with `-` for descending order. Filter by `filter[action]`, `filter[user_id]` or `filter[user.email]`. By default, `user` contains only an email address. Add `?include=user` for full account details. The included `user` is null when you cannot view that account.

### Permissions

Requires the `server.read` (View servers) permission for the selected team. Resources outside that team return 404.

## Authorization

Send `Authorization: Bearer <token>` with the request. Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.

## Path parameters

- `server` (string, required): The server uuid short

## Query parameters

- `per_page` (integer | null): The maximum number of records to return on one page. 1 to 100
- `include` (string): Related records to include, with multiple values separated by commas.
- `filter[user.email]` (string): Filter records by user.email.
- `filter[action]` (string): Filter records by action.
- `sort` (string[]): The field to sort by, prefixed with `-` for descending order. Defaults to `["-created_at"]`.

## Response 200

One page of results, with the rows under `data` and the paging figures beside them.

- `current_page` (integer, required): Which page this is, counting from 1.
- `data` (object[], required): The rows on this page.
  - `id` (integer, required): The id ID.
  - `server_id` (integer | null, required): The server id ID.
  - `user_id` (integer | null, required): The user id ID.
  - `action` (string, required): The value of `action`.
  - `description` (string | null, required): An optional description shown to customers.
  - `metadata` (object | array | null, required): The value of `metadata`.
  - `ip_address` (string, required): The value of `ip_address`.
  - `created_at` (string | null, required): The date and time for created at, in UTC.
  - `updated_at` (string | null, required): The date and time for updated at, in UTC.
  - `user` (object | null, required): The account the entry is filed under.
- `first_page_url` (string, required): A link to the first page.
- `from` (integer | null, required): The position of the first row on this page in the whole result, or null when the page is empty.
- `last_page` (integer, required): How many pages there are.
- `last_page_url` (string, required): A link to the last page.
- `links` (object[], required): Pagination links in display order.
  - `url` (string | null, required)
  - `label` (string, required)
  - `active` (boolean, required)
  - `page` (integer | null)
- `next_page_url` (string | null, required): A link to the next page, or null on the last one.
- `path` (string, required): The base URL used for pagination.
- `per_page` (integer, required): How many rows a page holds.
- `prev_page_url` (string | null, required): A link to the previous page, or null on the first one.
- `to` (integer | null, required): The position of the last row on this page, or null when the page is empty.
- `total` (integer, required): How many rows there are altogether.

```json
{
  "current_page": 1,
  "data": [
    {
      "id": 58214,
      "server_id": 4821,
      "user_id": 1873,
      "action": "power_action",
      "description": "Server power action: restart",
      "metadata": {
        "action": "restart",
        "resource": {
          "type": "server",
          "id": "ecc6f4f1-c89b-4dce-a20b-a330641c5b0b",
          "name": "lambda-core"
        }
      },
      "ip_address": "192.0.2.44",
      "created_at": "2026-09-14T15:58:21.000000Z",
      "updated_at": "2026-09-14T15:58:21.000000Z",
      "user": {
        "email": "gordon.freeman@blackmesa.example.com"
      }
    }
  ],
  "first_page_url": "https://vps.advinservers.com/api/v1/client/servers/ecc6f4f1/audit-log?page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "https://vps.advinservers.com/api/v1/client/servers/ecc6f4f1/audit-log?page=1",
  "links": [
    {
      "url": null,
      "label": "&laquo; Previous",
      "page": null,
      "active": false
    },
    {
      "url": "https://vps.advinservers.com/api/v1/client/servers/ecc6f4f1/audit-log?page=1",
      "label": "1",
      "page": 1,
      "active": true
    },
    {
      "url": null,
      "label": "Next &raquo;",
      "page": null,
      "active": false
    }
  ],
  "next_page_url": null,
  "path": "https://vps.advinservers.com/api/v1/client/servers/ecc6f4f1/audit-log",
  "per_page": 50,
  "prev_page_url": null,
  "to": 1,
  "total": 1
}
```

## Errors

- `401`: The key was missing, malformed, revoked, or belongs to an account that no longer exists.
- `403`: Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
- `404`: The resource was not found in the selected team. Resources in another account or team also return 404.
- `429`: Too many requests. The `Retry-After` header says how many seconds to wait. Limits are per account, so several keys on one account share them.

## Example request

```bash
curl --request GET \
  --url 'https://console.advinservers.com/api/v1/client/servers/{server}/audit-log' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json'
```
