# Vend202601\AuditApi

Audit and security operations

All URIs are relative to https://example.retail.lightspeed.app/api/2026-01, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**getAuditLogEvents()**](AuditApi.md#getAuditLogEvents) | **GET** /auditlog_events | List audit events |
| [**getSecurityEvents()**](AuditApi.md#getSecurityEvents) | **GET** /security_events | List security events for current user |


## `getAuditLogEvents()`

```php
getAuditLogEvents($page_size, $offset, $from, $to, $order, $user_id, $type)
```

List audit events

This API returns a list of all the audit log events that match the given filters.  **Note**: Not every single change in the system is audited. Currently the audited entities include:  | Object     | Action                    | Notes | |------------|---------------------------|-------| | customer   | form create/update/delete |       | | customer   | api create/update/delete  |       | | customer   | csv import                |       | | register   | form create/update/delete |       | | outlet     | form create/update/delete |       | | csv import | init                      | Tracks CSV import requests and includes data about the import type (customer, product) and the CSV file line count. | | product*   | create/update/delete      | All actions on products. | | security   | terms_accepted, signin, signout, change_email, change_password, reset_password_confirm, user_switching_succes, user_switching_denied, new_personal_token, update_personal_token, delete_personal_tokenss, issue_oauth_token || | vend_consignment | insert/update | Receiving, creating and editing purchase orders as well as inventory counts. | | vend_consignment_product | insert/update | Changes to the products in a purchase order. Such as creating purchase orders. | | timeclock | clockin/clockout | Clock event where a user either clocked in or clocked out. |  ### Filters - The from and to filters require a full isoformat date, for example `?from=2020-02-03T00:00:00&to=2020-02-05T23:59:59`.  🔒 Requires: `audit:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\AuditApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$page_size = 'page_size_example'; // string | The size for a single page of results. By default 100 events will be returned.
$offset = 'offset_example'; // string | The number of objects to skip.
$from = 'from_example'; // string | The lower limit for the `occurred_at` attribute. to be included in the response. The date and time from needs to be in isoformat.
$to = 'to_example'; // string | The upper limit for the `occurred_at` attribute. to be included in the response. The date and time from needs to be in isoformat.
$order = 'order_example'; // string | The sorting order for the results. Sorting is done by the `occurred_at` parameter. The default order is descending.
$user_id = 'user_id_example'; // string | The `id` of the user to filter the events by.
$type = 'type_example'; // string | The `type` of the events to be filtered for the response.

try {
    $apiInstance->getAuditLogEvents($page_size, $offset, $from, $to, $order, $user_id, $type);
} catch (Exception $e) {
    echo 'Exception when calling AuditApi->getAuditLogEvents: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **page_size** | **string**| The size for a single page of results. By default 100 events will be returned. | [optional] |
| **offset** | **string**| The number of objects to skip. | [optional] |
| **from** | **string**| The lower limit for the &#x60;occurred_at&#x60; attribute. to be included in the response. The date and time from needs to be in isoformat. | [optional] |
| **to** | **string**| The upper limit for the &#x60;occurred_at&#x60; attribute. to be included in the response. The date and time from needs to be in isoformat. | [optional] |
| **order** | **string**| The sorting order for the results. Sorting is done by the &#x60;occurred_at&#x60; parameter. The default order is descending. | [optional] |
| **user_id** | **string**| The &#x60;id&#x60; of the user to filter the events by. | [optional] |
| **type** | **string**| The &#x60;type&#x60; of the events to be filtered for the response. | [optional] |

### Return type

void (empty response body)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `Insert of product example`, `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `getSecurityEvents()`

```php
getSecurityEvents()
```

List security events for current user

This API returns a list of all the security log events **for the current user**. If you want a list of all the security events for all users please use the auditlog_events with filter type == \"security\". See the auditlog_events API in the beta documentation for more information.  🔒 Requires: `audit:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\AuditApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $apiInstance->getSecurityEvents();
} catch (Exception $e) {
    echo 'Exception when calling AuditApi->getSecurityEvents: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

This endpoint does not need any parameter.

### Return type

void (empty response body)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `Security signin example`, `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
