> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/navixy-api/user-api/resources/commons/user/audit/audit_log.md).

# User audit log

What the account's users did, so an owner can review activity across sub-users.

The audit log records what the account's users did, which is how an account owner reviews the activity of everyone added through the Access rights section.

It covers the current user and their [sub-users](/docs/navixy-api/user-api/resources/commons/subuser.md), so a sub-user calling it sees only their own records.

## Audit object

## The AuditLogRecord object

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"components":{"schemas":{"AuditLogRecord":{"type":"object","description":"One audit log entry. Fields that do not apply to the recorded action are absent.","properties":{"id":{"type":"integer","description":"Record identifier."},"user_id":{"type":"integer","description":"Master user the record belongs to."},"subuser_id":{"type":"integer","description":"Sub-user who performed the action."},"entry_category":{"type":"string","description":"Category of the entity acted on, for example `user` or `custom_field`."},"entry_id":{"type":["integer","null"],"description":"Identifier of the entity acted on, when the action targets one."},"action":{"type":"string","description":"Action performed, for example `create` or `checkin`."},"payload":{"type":["object","null"],"description":"Additional information about the action. Typically the fields that changed. Absent or null for actions that carry none.","additionalProperties":true},"host":{"type":"string","description":"Source IP address of the request, IPv4 or IPv6."},"user_agent":{"type":"string","description":"User agent of the client that made the request."},"action_date":{"type":"string","description":"When the action occurred."}}}}}}
```

## API actions

API base path: `/user/audit/log`.

Results can be sorted by:

* `action`
* `action_date`, by date only, ignoring the time
* `action_datetime`, by date including the time
* `user`, by the sub-user's last, first, and middle name rather than by ID
* `host`

Without a sort parameter, the result is sorted as though `["action_date=asc"]` had been given.

{% hint style="info" %}
A request with an empty body reports `interval` as the missing required parameter. There is no such parameter. It is the internal name of the field holding both dates, and the parameters to send are `from` and `to`.
{% endhint %}

Operations that list no errors of their own return only the [general error codes](/docs/navixy-api/general/errors.md#error-codes).

***

*Required sub-user rights:* `admin` (available only to master users).

## List audit log records

> Return audit records for the current user and their sub-users. Requires the \`admin\` right.\
> \
> Note that a request with an empty body reports \`interval\` as the missing required parameter. That is the internal field name; the public parameters are \`from\` and \`to\`, and both forms work.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"Operations for authenticating a user, managing their sessions, reading and updating their settings and personal information, reading audit records, and registering custom applications. All resources under the /user/ path."}],"servers":[{"url":"https://api.eu.navixy.com/v2","description":"Navixy production server on European platform"},{"url":"https://api.us.navixy.com/v2","description":"Navixy production server on American platform"},{"url":"https://api.me.navixy.com/v2","description":"Navixy production server on Middle East platform"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","description":"Either a user session hash or an API key, with the \"NVX \" prefix, for example \"NVX 22eac1c27af4be7b9d04da2ce1af111b\". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.","name":"Authorization","in":"header"}},"schemas":{"AuditLogRecord":{"type":"object","description":"One audit log entry. Fields that do not apply to the recorded action are absent.","properties":{"id":{"type":"integer","description":"Record identifier."},"user_id":{"type":"integer","description":"Master user the record belongs to."},"subuser_id":{"type":"integer","description":"Sub-user who performed the action."},"entry_category":{"type":"string","description":"Category of the entity acted on, for example `user` or `custom_field`."},"entry_id":{"type":["integer","null"],"description":"Identifier of the entity acted on, when the action targets one."},"action":{"type":"string","description":"Action performed, for example `create` or `checkin`."},"payload":{"type":["object","null"],"description":"Additional information about the action. Typically the fields that changed. Absent or null for actions that carry none.","additionalProperties":true},"host":{"type":"string","description":"Source IP address of the request, IPv4 or IPv6."},"user_agent":{"type":"string","description":"User agent of the client that made the request."},"action_date":{"type":"string","description":"When the action occurred."}}}},"responses":{"ResponseError":{"description":"Error response object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false."},"status":{"type":"object","description":"Error status. Present only when an error occurred.","properties":{"code":{"type":"integer","description":"An error code in this API, not an HTTP code."},"description":{"type":"string","description":"An error description."}}},"errors":{"type":"array","description":"Per-parameter detail, returned with validation failures such as error code 7. A parameter name here may be an internal field name rather than the documented parameter name.","items":{"type":"object","properties":{"parameter":{"type":"string","description":"Name of the parameter that failed validation."},"error":{"type":"string","description":"What was wrong with it."}}}}}}}}}}},"paths":{"/user/audit/log/list":{"post":{"tags":["Users"],"summary":"List audit log records","description":"Return audit records for the current user and their sub-users. Requires the `admin` right.\n\nNote that a request with an empty body reports `interval` as the missing required parameter. That is the internal field name; the public parameters are `from` and `to`, and both forms work.","operationId":"userAuditLogList","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","description":"Include records recorded at or after this date and time."},"to":{"type":"string","description":"Include records recorded at or before this date and time."},"limit":{"type":"integer","description":"Maximum number of records to return."},"offset":{"type":"integer","description":"Number of records to skip."},"subuser_ids":{"type":"array","description":"Optional. Restrict to these sub-users.","items":{"type":"integer"}},"actions":{"type":"array","description":"Optional. Restrict to these action names.","items":{"type":"string"}},"sort":{"type":"array","description":"Optional. Sort options, each a property and direction such as `action_date=asc`. Sortable properties are `action`, `action_date`, `action_datetime`, `user`, and `host`. Defaults to `[\"action_date=asc\"]`.","items":{"type":"string"}},"grouping":{"type":"string","description":"Optional. How to group the log.","enum":["user","action_date","action","default"]}},"required":["from","to","limit","offset"]}}}},"responses":{"200":{"description":"Matching audit records","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"list":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogRecord"}}}}}}},"400":{"description":"Bad request. The response body carries the API-level error code in `status.code`. Validation failures also include an `errors` array naming each offending parameter.","$ref":"#/components/responses/ResponseError"},"403":{"description":"Operation not permitted, error code 13: the caller lacks the `admin` right.","$ref":"#/components/responses/ResponseError"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://navixy.com/docs/navixy-api/user-api/resources/commons/user/audit/audit_log.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
