> For the complete documentation index, see [llms.txt](https://docs.platform.softwareone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform.softwareone.com/developer-resources/api-usage-and-reference/common-api-objects/audit.md).

# Audit

The Audit object records events related to the object. Each event contains two key components: 'at,' which specifies the last time the event occurred, and 'by,' which indicates who performed the event.

Events do not represent the complete history of the object. They are a cache that retains only the most recent occurrence of each type of event. For example, if an order is updated multiple times, only the latest update will be reflected in the Audit object.

Events cannot be set directly through API calls, which means they are ignored in input during both creation (`POST`) and update (`PUT`) operations.

Events can be either common or specific to the object. In such cases, they should follow the state diagram of the object. The same operation can be reflected in multiple events if it is logically reasonable. For example, if an order is approved and some data within the order has changed in one operation, both the updated and approved events must be recorded.

<table><thead><tr><th width="141">Field</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>&#x3C;event></code></td><td>object</td><td>(Read-only) (Optional) Indicates when the last event occurred and the event's initiator. If the event has not occurred yet, the entire object (along with its key) is omitted from the audit object.</td></tr><tr><td><code>&#x3C;event>.at</code></td><td>dateTime</td><td>The date and time of the event in the ISO-8601 format.</td></tr><tr><td><code>&#x3C;event>.by</code></td><td>object</td><td>(Optional) Represents the <a href="/developer-resources/rest-api/accounts-api/users.md"><code>user</code></a>  or the <a href="/developer-resources/rest-api/accounts-api/api-tokens.md"><code>token</code></a> that initiated the action. </td></tr><tr><td><code>&#x3C;event>.of</code></td><td><a href="/developer-resources/rest-api/accounts-api/account.md"><code>account</code></a></td><td>(Optional) Represents the account on behalf of which the action was executed.</td></tr></tbody></table>

### Example

{% code title="AUDIT OBJECT" overflow="wrap" lineNumbers="true" %}

```json
{
  "audit": {
    "created": { 
      "at": "2023-12-14T17:28:57Z", 
      "by": {
        "id": "USR-1234-1234-1234",
        "name": "John Smith",
        "icon": "/static/users/UR-1234-1234-1234.icon.svg"
      },
      "of": {
        "id": "ACC-1234-1234",
        "href": "/accounts/accounts/ACC-1234-1234",
        "name": "Microsoft",
        "icon": "/static/ACC-1234-1234/account.png"
      }
    },
    "updated": { 
      "at": "2023-12-14T17:28:57Z", 
      "by": {
        "id": "UR-1234-1234-1234",
        "name": "John Smith",
        "icon": "/static/users/UR-1234-1234-1234.icon.svg"
      },
      "of": {
        "id": "ACC-1234-1234",
        "href": "/accounts/accounts/ACC-1234-1234",
        "name": "Microsoft",
        "icon": "/static/ACC-1234-1234/account.png"
      }
    }
  }
}
```

{% endcode %}


---

# 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://docs.platform.softwareone.com/developer-resources/api-usage-and-reference/common-api-objects/audit.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.
