---
updatedAt: 2026-09-22T19:15:06.000Z
agentTools:
  projectIndex: https://docs.zesty.io/llms.txt
---

# Get Audits

Get all Audit trails of a given instance. You can use one or more query params to filter the result. All query params are optional.

### Params

| name                  | description           |
| ---------             | --------------------- |
| action                | [int] Value accepted are `1` to `5` which corresponds to what operation. _See table below._ |
| limit                 | [int] Number of items to return. Default is 100. |
| order                 | [string] On what property should the ordering be based on. Could be `CREATED`, `MODIFIED` or `LABEL` |
| dir                   | [string] Sorting direction. Could be `asc` or `desc` meaning ascending or descending respectively. |
| start_date            | [date] Acceptable date formats are here: https://github.com/araddon/dateparse |
| end_date              | [date] Acceptable date formats are here: https://github.com/araddon/dateparse |
| page                  | [int] Sets the results pagination. Default value is 0. |
| affectedZUID          | [string] Filter logs by ZUID of the affected resource. |
| userZUID              | [string] Filter logs by user who created them. |

**actions:**

| value                  | description           |
| ---------              | --------------------- |
| 1                 | create |
| 2                 | update |
| 3                 | delete |
| 4                 | publish |
| 5                 | unpublish |

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "A collection of available REST endpoints scoped to your unique instance.\n\n# ZUID\nAll named resources in this API have a unique identifier called a ZUID. For example an instance ZUID would look like `8-f48cf3a682-7fthvk`. The initial prefix, e.g. `8-`, represents the type of resource it is. Every discreet resource has it's own prefix. To find a full list of supported ZUIDs and to learn more read the spec; https://github.com/zesty-io/zuid-specification\n\n# URLs\nAs you peruse the available endpoints you will see the URLs which can be requested. The following is an explanation of the URL structure and the significance of specific portions.\n\nFor example the URL https://8-f48cf3a682-7fthvk.api.zesty.io/v1/content/models/6-556370-8sh47g/items/7-b939a4-457q19/publishings/18-660e14-jpx715 would breakdown as follows:\n\n| URL portion                       | description                                                           |\n| ---                               | ---                                                                   |\n| https://                          | protocol                                                              |\n| 8-f48cf3a682-7fthvk               | Your instances unique identifier                                      |\n| .api.zesty.io/                    | domain for the API                                                    |\n| v1                                | version of the API                                                    |\n| /content/models/6-556370-8sh47g   | path to a unique content model                                        |\n| /items/7-b939a4-457q19            | path to a unique item which belongs to the prior model                |\n| /publishings/18-660e14-jpx715     | path to a unique publishings record which belongs to the prior item   |\n\n# Getting an Auth Token\nThere are two types of authorization; session and access tokens. Read more about them here https://zesty.org/apis/auth-api#user-authentication",
    "title": "Instances API",
    "contact": {},
    "version": "1.0"
  },
  "paths": {
    "/env/audits": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "description": "Get all Audit trails of a given instance. You can use one or more query params to filter the result. All query params are optional.\n\n### Params\n\n| name                  | description           |\n| ---------             | --------------------- |\n| action                | [int] Value accepted are `1` to `5` which corresponds to what operation. _See table below._ |\n| limit                 | [int] Number of items to return. Default is 100. |\n| order                 | [string] On what property should the ordering be based on. Could be `CREATED`, `MODIFIED` or `LABEL` |\n| dir                   | [string] Sorting direction. Could be `asc` or `desc` meaning ascending or descending respectively. |\n| start_date            | [date] Acceptable date formats are here: https://github.com/araddon/dateparse |\n| end_date              | [date] Acceptable date formats are here: https://github.com/araddon/dateparse |\n| page                  | [int] Sets the results pagination. Default value is 0. |\n| affectedZUID          | [string] Filter logs by ZUID of the affected resource. |\n| userZUID              | [string] Filter logs by user who created them. |\n\n**actions:**\n\n| value                  | description           |\n| ---------              | --------------------- |\n| 1                 | create |\n| 2                 | update |\n| 3                 | delete |\n| 4                 | publish |\n| 5                 | unpublish |",
        "tags": [
          "/env/audits"
        ],
        "summary": "Get Audits",
        "operationId": "get-audits",
        "parameters": [
          {
            "example": 0,
            "description": "alue accepted are `1` to `5` which corresponds to what operation.",
            "name": "action",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "example": 100,
            "description": "Number of items to return",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "example": "created",
            "description": "Basis of where the result will be sorted. Accepted values are created and modified. This is required if you will be using the dir parameter.",
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "DESC",
            "description": "Direction of the sort. Accepted values are ASC and DESC",
            "name": "dir",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "2021-06-29",
            "description": "acceptable date formats are here: https://github.com/araddon/dateparse",
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "2021-06-30",
            "description": "acceptable date formats are here: https://github.com/araddon/dateparse",
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "example": 1,
            "description": "The value on which to start. Page begins at 1, the results are calculated by the limit parameter which is used as the denominator.",
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "example": "7-0000-0000",
            "description": "Filter logs by ZUID of the affected resource.",
            "name": "affectedZUID",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "5-0000-0000",
            "description": "Filter logs by user who created them.",
            "name": "userZUID",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/body_samples.JSONResult"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/body_samples.EnvAuditsResponseSuccess"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/body_samples.JSONResultUnauthorized"
                }
              }
            }
          }
        },
        "x-readme": {
          "explorer-enabled": false
        }
      }
    }
  },
  "tags": [
    {
      "description": "The Audit Trail acts as an immutable log of various actions taken on an instance by users. It is system controlled and as such does not allow for user creation or updating of logs.",
      "name": "/env/audits"
    }
  ],
  "servers": [
    {
      "url": "https://{instance_zuid}.api.zesty.io/v1",
      "variables": {
        "instance_zuid": {
          "default": "unknown"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "Bearer": {
        "description": "Type \"Bearer\" followed by a space and JWT token.",
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "body_samples.EmptyData": {
        "type": "object"
      },
      "body_samples.EnvAuditsResponseSuccess": {
        "type": "object",
        "properties": {
          "ZUID": {
            "type": "string",
            "example": "15-1234-abcd"
          },
          "action": {
            "type": "integer",
            "example": 1
          },
          "actionByUserZUID": {
            "type": "string",
            "example": "5-1234-abcd"
          },
          "affectedZUID": {
            "type": "string",
            "example": "7-1234-abcd"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2021-06-29T20:00:00Z"
          },
          "entityZUID": {
            "type": "string",
            "example": "8-1234-abcd"
          },
          "firstName": {
            "type": "string",
            "example": "John"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2021-06-29T20:00:00Z"
          },
          "lastName": {
            "type": "string",
            "example": "Doe"
          },
          "meta": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "message": "example message",
              "uri": "/path/to/resource",
              "url": "https://example.com"
            }
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2021-06-29T20:00:00Z"
          }
        }
      },
      "body_samples.JSONResult": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/body_samples.Meta"
          },
          "data": {}
        }
      },
      "body_samples.JSONResultUnauthorized": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/body_samples.Meta"
          },
          "data": {
            "$ref": "#/components/schemas/body_samples.EmptyData"
          },
          "error": {
            "type": "string",
            "example": "invalid session"
          }
        }
      },
      "body_samples.Meta": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "example": 1
          },
          "offset": {
            "type": "integer",
            "example": 0
          },
          "start": {
            "type": "integer",
            "example": 0
          },
          "timestamp": {
            "type": "string",
            "example": "2024-04-11T14:49:51.039478001Z"
          },
          "totalResults": {
            "type": "integer",
            "example": 1
          }
        }
      }
    }
  }
}
```