# Audits

The audit logs in fulfillmenttools ensure transparency and security. The logs track which user performed an operation and when it occurred, providing a clear history of modifications to entities. This function is implemented for numerous entities, including `pick job`, `handover job`, `facility`, `parcel`, and `stow job`.

{% hint style="warning" %}
Audits are anonymized by default to conform with GDPR regulations. This behavior can be changed via the [GDPR API](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/configurations/gdpr) by setting the `actorAnonymization` parameter to `false`. **Changes to this value may take up to an hour to take effect.**
{% endhint %}

## Retrieving audits

Retrieve audit logs by making a request to the following endpoint.

```http
GET https://{projectId}.api.fulfillmenttools.com/api/audits
```

The response can be narrowed down using filter parameters. For a complete list of available parameters, refer to the [Audit endpoint documentation in the REST API reference](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/audits). The API returns a list of audit entries, structured as shown in the example below:

```json
{
    "id": "67a1bf95bdcc1ede1ea1447d",
    "entityRef": "e4de35b3-6662-46b9-a9ad-e17ccc0f0168",
    "entityType": "PACK_JOB",
    "entityVersion": 1,
    "entityCreated": "2025-02-04T07:19:35.329Z",
    "eventId": "32566960-aa0f-4942-90af-b1ffe0d02f37",
    "anonymizationDate": "2025-03-06T07:19:35.329Z",
    "deletionDate": "2025-09-02T07:19:35.329Z",
    "isAnonymized": false,
    "version": 1,
    "trace": "1fb1eee25abf25660fd24a49aa27cebf",
    "actor": {
        "id": "NtwfRbu82fMPQspHkOdvv5UeLK83",
        "details": {
            "username": "user@ocff-tenant.com"
        }
    },
    "globalActor": {
        "id": "NtwfRbu82rrrQspHkOdYR5UeLK83",
        "details": {
            "username": "user@ocff-tenant.com"
        }
    },
    "operation": {
        "name": "POST /api/packjobs/",
        "start": "2025-02-04T07:19:35.153Z"
    },
    "client": {
        "api": "http",
        "rawInfo": "PostmanRuntime/7.43.0"
    },
    "lastModified": "2025-02-04T07:19:49.794Z",
    "created": "2025-02-04T07:19:49.794Z"
}
```

## Actor

Two types of actors are available: the `globalActor` and the `actor`. A single user interaction, such as creating an order, can result in multiple audit entries for different processes, like the creation of a `routing plan` and a `pick job`.

The `globalActor` always represents the original initiator of the interaction, for example, the API user who created the order.

The `actor` represents the direct initiator of the specific audited operation. For a subsequent process triggered by the system, this might be a fulfillmenttools technical user, such as `order-created_event-v1`.
