# List a team's audit log

`GET https://console.advinservers.com/api/v1/client/teams/{team}/audit-logs`

### Overview

Lists activity by the team's owner and members, newest first. Filter by `filter[action]`, `filter[ip_address]`, `filter[actor]` or `filter[*]` for text search. Use text search for a server's short ID; `filter[server_id]` requires an internal numeric ID. Sort with `sort=created_at` or `sort=-created_at`. `per_page` defaults to 25 and is limited to 1 to 100. `actors` lists up to 50 people for filtering, including former members. Members need permission to view both the team and its servers. Personal account events are hidden from members.

### Permissions

Requires the account permission `teams.read` (View teams).

## 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

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

## Query parameters

- `filter[action]` (string): Filter records by action.
- `filter[ip_address]` (string): Filter records by ip address.
- `filter[server_id]` (string): Filter records by server id.
- `filter[actor]` (string): Filter records by actor.
- `filter[*]` (string): Search the records for this text.
- `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.

- `actors` (object[], required): The value of `actors`.
  - `id` (string, required): The id ID.
  - `name` (string | null, required): The name shown to customers.
  - `email` (string | null, required): The email address.
- `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.
  - `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`.
  - `user_agent` (string | null, required): The value of `user_agent`.
  - `method` (string | null, required): The value of `method`.
  - `path` (string | null, required): The value of `path`.
  - `is_staff` (boolean, required): Whether the resource is staff.
  - `created_at` (string | null, required): Written out with `toISOString()` rather than left to the date serialiser, because that is the rendering the transformer this replaces published.
  - `server` (object | null, required): Absent as null rather than as a missing key, and null for the events that belong to no server at all - signing in, a firewall group being created, a session being cut off.
    - `uuid` (string, required): The uuid UUID.
    - `uuid_short` (string, required): The value of `uuid_short`.
    - `name` (string, required): The name shown to customers.
    - `hostname` (string, required): The fully qualified hostname.
    - `windows` (boolean, required): The value of `windows`.
    - `template_name` (string | null, required): The value of `template_name`.
    - `template_icon_url` (string | null, required): The value of `template_icon_url`.
  - `actor` (object | null, required): Null for automated events or events without an identified person, such as failed sign-ins and scheduled checks.
    - `name` (string | null, required): The name shown to customers.
    - `email` (string | null, required): The email address.
    - `gravatar_url` (string | null, required): The value of `gravatar_url`.
  - `resource` (object | null, required): The type of resource this entry describes.
    - `type` (string, required): The type of operation or resource.
    - `id` (string | null, required): The id ID.
    - `name` (string, required): The name shown to customers.
- `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,
      "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",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36",
      "method": "PATCH",
      "path": "/api/v1/client/servers/ecc6f4f1/state",
      "is_staff": false,
      "created_at": "2026-09-14T15:58:21.000000Z",
      "server": {
        "uuid": "ecc6f4f1-c89b-4dce-a20b-a330641c5b0b",
        "uuid_short": "ecc6f4f1",
        "name": "lambda-core",
        "hostname": "lambda-core.blackmesa.example.com",
        "windows": false,
        "template_name": "Ubuntu 24.04",
        "template_icon_url": "/assets/icons/ubuntu.png"
      },
      "actor": {
        "name": "Barney Calhoun",
        "email": "barney.calhoun@blackmesa.example.com",
        "gravatar_url": "https://www.gravatar.com/avatar/52fe79725661c25ad4a3f683abc54c3a?s=64&d=404"
      },
      "resource": {
        "type": "server",
        "id": "ecc6f4f1-c89b-4dce-a20b-a330641c5b0b",
        "name": "lambda-core"
      }
    }
  ],
  "first_page_url": "https://vps.advinservers.com/api/v1/client/teams/fbb31f5f/audit-logs?page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "https://vps.advinservers.com/api/v1/client/teams/fbb31f5f/audit-logs?page=1",
  "links": [
    {
      "url": null,
      "label": "&laquo; Previous",
      "page": null,
      "active": false
    },
    {
      "url": "https://vps.advinservers.com/api/v1/client/teams/fbb31f5f/audit-logs?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/teams/fbb31f5f/audit-logs",
  "per_page": 50,
  "prev_page_url": null,
  "to": 1,
  "total": 1,
  "actors": [
    {
      "id": "4c4f3e5f-7531-4811-99ff-52f04f4679fd",
      "name": "Barney Calhoun",
      "email": "barney.calhoun@blackmesa.example.com"
    },
    {
      "id": "67d74fbd-2dc5-4f95-a946-c504a98f59fb",
      "name": "Gordon Freeman",
      "email": "gordon.freeman@blackmesa.example.com"
    }
  ]
}
```

## 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/teams/{team}/audit-logs' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json'
```
