---
title: "Audit log of file access events."
method: GET
path: "/file-events"
tags: ["Get list of file access events"]
---

# Audit log of file access events.

`GET /file-events`

## Request

- Base URL: `http://localhost:26900`
- URL: `http://localhost:26900/file-events`
- Auth: API key in header `Authorization`

## Query parameters

- `limit` integer
- `offset` integer
- `after` string, date-time
- `before` string, date-time
- `path` string

## Response `200`

The list of file access events.

- EventsList: The list of access events which form the audit log for users downloading a file.
  - `count` integer: The number of items returned.
  - `limit` integer: The number of items requested.
  - `offset` integer: The offset of the first item to retrieve, starting at 0. Use this parameter as a pagination mechanism along with the limit parameter.
  - `total_count` integer: The total number of items available.
  - `items` Event[]
    - `created_at` string, date-time: The date and time the event occurred.
    - `requested_by` object, required: The user who made the request.
      - `id` string, required: The ID of the user.
      - `email` string, email: The email of the user. This is only populated if the user is a human user.
    - `action` 'CREATE' | 'READ' | 'UPDATE' | 'DELETE', required: The action taken by the user.
    - `resource` string, required: The path of the API resource that was called.
    - `file` MetaData, required: File metadata
      - `path` string: Path to file
      - `is_publishable` boolean: Is the file publishable
      - `collection_id` string: The collection ID to which the file is attached
      - `bundle_id` string: The bundle ID to which the file is attached
      - `title` string: The title given to the file
      - `size_in_bytes` integer: Size of the file in bytes
      - `type` string: The file type
      - `licence` string: The type of licence the file has
      - `licence_url` string: Licence URL
      - `etag` string: File etag
      - `state` string: File state
      - `content_item` object: Dataset information that the file relates to
        - `dataset_id` string: The dataset ID
        - `edition` string: The edition
        - `version` string: The version

## Other responses

- `400`: Unable to process request due to a malformed or invalid request body or query parameter.
- `401`: Authentication information is missing or invalid.
- `403`: Access denied.
- `404`: The requested resource does not exist.
- `500`: Failed to process the request due to an internal error

---

[API](https://skmtc.dev/office-of-national-statistics/apis/files-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/files-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/files-api/revisions/b34c9662a495?raw)
