# Workspace: audit

> The newest rows of the workspace's audit chain, oldest first within the window

## The newest rows of the workspace's audit chain, oldest first within the window

`GET /v1/workspace/audit` · operation `listWorkspaceAudit`

Requires the `batondeck:audit:read` permission (action `audit:read`).

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `limit` | query | integer | yes |  |

**Responses**

| Status | Meaning |
|---|---|
| 200 | The newest rows of the workspace's audit chain, oldest first within the window |
| 400 | The arguments did not validate. |
| 401 | No portal session, and no live API key. |
| 403 | The policy refused, or the request was cross-site. |
| 404 | No such resource, or none this session may see. |

<details>
<summary>200 response schema</summary>

```json
{
  "type": "object",
  "properties": {
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "seq": {
            "type": "number"
          },
          "ts": {
            "type": "number"
          },
          "actor": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "prev_hash": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          }
        },
        "required": [
          "seq",
          "ts",
          "actor",
          "kind",
          "details",
          "prev_hash",
          "hash"
        ],
        "additionalProperties": false
      }
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "seq": {
            "type": "number"
          },
          "ts": {
            "type": "number"
          },
          "actor": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "details": {
            "type": "string"
          }
        },
        "required": [
          "seq",
          "ts",
          "actor",
          "kind",
          "details"
        ],
        "additionalProperties": false
      }
    },
    "names": {
      "type": "object",
      "properties": {
        "owners": {
          "anyOf": [
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "identities": {
          "anyOf": [
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "keys": {
          "anyOf": [
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "revoked": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "revoked"
                ],
                "additionalProperties": false
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "grants": {
          "anyOf": [
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "revoked": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "revoked"
                ],
                "additionalProperties": false
              }
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "owners",
        "identities",
        "keys",
        "grants"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "rows",
    "events",
    "names"
  ],
  "additionalProperties": false
}
```

</details>

```sh
curl -X GET 'https://api.batondeck.com/v1/workspace/audit' \
  -H "Authorization: Bearer $BATONDECK_API_KEY"
```
