> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prequel.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Audit logs

> Track and review audit logs for your Prequel Import activity

All activity on the Prequel Import platform is recorded in an immutable audit log. You can fetch audit log entries via the `/logs` API or via Reporting Export.

## Audit log data model

| Field Name        | Data Type   | Description                                                                                                        |
| ----------------- | ----------- | ------------------------------------------------------------------------------------------------------------------ |
| `id`              | `string`    | Unique audit log ID.                                                                                               |
| `created_at`      | `timestamp` | Timestamp when the event occurred, reported in UTC (RFC 3339).                                                     |
| `event_type`      | `string`    | The type of event. See [Event types](#event-types) below.                                                          |
| `resource_id`     | `string`    | The ID of the resource involved in the event.                                                                      |
| `actor`           | `object`    | The agent that triggered the event. Contains `actor_id` and `type` (`unknown`, `user`, `api_key`, or `provider`).  |
| `object`          | `json`      | Nullable JSON object representing the current state of the resource. `DELETE` events will not populate this field. |
| `previous_object` | `json`      | Nullable JSON object representing the prior state of the resource. `CREATE` events will not populate this field.   |

## Fetching logs

Use `GET /logs` to list audit log entries, or `GET /logs/{log_id}` to retrieve a single entry by ID.

### Filtering and pagination

`GET /logs` accepts the following query parameters:

| Parameter    | Description                                                           |
| ------------ | --------------------------------------------------------------------- |
| `event_type` | Restrict results to a single event type.                              |
| `min_time`   | Unix timestamp; return only events at or after this time.             |
| `count`      | Number of logs to return.                                             |
| `offset`     | Offset of the result window.                                          |
| `page_size`  | Items per page.                                                       |
| `order`      | `asc` or `desc`.                                                      |
| `cursor`     | Cursor returned by a prior page; pass through to fetch the next page. |

Successful responses include `has_next` and `next_url` alongside the `data` envelope to drive cursor-based pagination.

## Event types

The `event_type` field is one of:

* Datalakes: `IMPORT_DATALAKE_ADD`, `IMPORT_DATALAKE_UPDATE`, `IMPORT_DATALAKE_DELETE`
* Providers: `IMPORT_PROVIDER_ADD`, `IMPORT_PROVIDER_UPDATE`, `IMPORT_PROVIDER_DELETE`
* Sources: `IMPORT_SOURCE_ADD`, `IMPORT_SOURCE_UPDATE`, `IMPORT_SOURCE_DELETE`
* Datasets: `IMPORT_DATASET_ADD`, `IMPORT_DATASET_UPDATE`, `IMPORT_DATASET_DELETE`
* Destinations: `IMPORT_DESTINATION_ADD`, `IMPORT_DESTINATION_UPDATE`, `IMPORT_DESTINATION_DELETE`
* Products: `IMPORT_PRODUCT_ADD`, `IMPORT_PRODUCT_UPDATE`, `IMPORT_PRODUCT_DELETE`
* Streams: `IMPORT_STREAM_ADD`, `IMPORT_STREAM_UPDATE`, `IMPORT_STREAM_DELETE`
