> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/oms/oms-audit-events-service.md).

# OMS Audit Events Service

The OMS Audit Events Service contains records of model changes and various events that occur within the OMS. This service is responsible for retrieving these event logs from the OMS.

### `GET` List OMS Audit Events

This service is used to retrieve list of audit events from OMS.

**Path:** `/api/v1/oms/settings/audit_events/`

**Payload**

No payload is required.

**Filters**

| Parameter     | Data Type  | In          | Description                           |
| ------------- | ---------- | ----------- | ------------------------------------- |
| url           | `string`   | query param | Filters the event url                 |
| content\_type | `int`      | query param | Filters the event object content type |
| object\_id    | `int`      | query param | Filters the event object              |
| start\_date   | `datetime` | query param | Filters the event start date          |
| end\_date     | `datetime` | body        | Filters the event end date            |

**Example Request**

To run this service, a `GET` request should be sent to `/api/v1/oms/settings/audit_events/` endpoint.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{oms_base_url}/api/v1/oms/settings/audit_events/?url=https://example-url.com&content_type=1"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("get", url, headers=headers)

print(response.text)
```

**Example Response (201 CREATED)**

In a successful response with a status code of 200 OK, the response body contains list of audit event objects.

| Parameter     | Data Type | Description                                                                       |
| ------------- | --------- | --------------------------------------------------------------------------------- |
| uuid          | uuid      | Unique ID of the audit event                                                      |
| timestamp     | datetime  | Timestamp of the event                                                            |
| remote\_addr  | string    | If event has remote address, this parameter shows the remote address of the event |
| url           | string    | URL of the event                                                                  |
| query\_params | object    | If event has query params, this parameter shows the query params of the event     |
| post\_data    | object    | If event has post data, this parameter shows the post data of the event           |
| headers       | object    | Headers of the event                                                              |
| object\_id    | int       | Related object ID of the event                                                    |
| content       | object    | Content of the event                                                              |
| user          | int       | If event is triggered by user, this parameter shows the user of the event.        |
| content\_type | int       | Related object content type of the event                                          |

```json
    {
    "count": 100,
    "next": "https://demo.omnitron.akinon.net/api/v1/oms/settings/audit_events/?page=2",
    "previous": null,
    "results": [
        {
            "uuid": "410237f7-2a6f-48de-9c41-b988326d7607",
            "timestamp": "2023-10-16T09:00:00.929094Z",
            "remote_addr": null,
            "url": "https://example.com",
            "query_params": {},
            "post_data": {},
            "headers": {},
            "object_id": 859,
            "content": {
                "new_data": {
                    "quantity": 2.0
                },
                "old_data": {
                    "quantity": 1.0
                },
            },
            "user": null,
            "content_type": 41
        }
    ]
}
```


---

# 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://apidocs.akinon.com/oms/oms-audit-events-service.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.
