# computer.localnetwork.audit.entry

> One audited action. Each action is written twice with the same record key: once by the acting account into its own repo in the audit space, and once by the root account (with hash-chain fields) into the root's repo in the same space.

- Kind: record
- Record key: tid
- Authority: audit.localnetwork.computer
- Lexicon: 1
- Published by [localnetwork.computer](https://lexicon.garden/identity/did:plc:d42l64gsczg6qh2vo243xv5l), not the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:d42l64gsczg6qh2vo243xv5l/computer.localnetwork.audit.entry)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:d42l64gsczg6qh2vo243xv5l/computer.localnetwork.audit.entry/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:d42l64gsczg6qh2vo243xv5l/computer.localnetwork.audit.entry/analytics)

## Record (`computer.localnetwork.audit.entry`)

Type: record · key tid

### Properties

- `action` (string, required)
  - Constraints: maxLength: 64, knownValues: auth.login | auth.logout | project.create | project.update | project.status | project.managers | request.submit | request.update | request.withdraw | request.approve | request.reject | request.changesRequested | role.grant | role.revoke | verification.grant | verification.revoke | booking.create | booking.message | booking.status | planner.save | planner.unsave | planner.show | epk.save | epk.delete | epk.request | epk.grant | epk.decline | epk.revoke | epk.view | epk.forget | show.save | show.delete | follow.create | follow.delete | profile.save | space.create | people.add | people.update | people.remove | people.leave | people.hide | people.invite | people.join | people.request | people.approve | people.reject | people.link | listing.list | listing.unlist | page.update | page.editAsStaff | venue.block | venue.unblock | record.delete | flag.update | flag.preview | flagGroup.create | flagGroup.update | flagGroup.delete | system.bootstrap | system.space
- `actor` (string · did, required)
- `actorRole` (string)
  - Constraints: maxLength: 32, knownValues: admin | moderator | member | system
- `chain` (ref)
  - Reference: `#chain`
- `changes` (array)
  - Constraints: maxLength: 100
  - `items` (ref)
    - Reference: `#change`
- `createdAt` (string · datetime, required)
- `details` (unknown)
- `outcome` (string, required)
  - Constraints: maxLength: 16, knownValues: success | failure | denied
- `reason` (string)
  - Constraints: maxLength: 10000, maxGraphemes: 1000
- `subject` (string)
  - Constraints: maxLength: 2048
- `subjectKind` (string)
  - Constraints: maxLength: 32, knownValues: account | project | profile | request | role | booking | planner | space | epk | show | flag | flagGroup
- `summary` (string, required)
  - Constraints: maxLength: 3000, maxGraphemes: 300
- `via` (string, required)
  - Constraints: maxLength: 16, knownValues: web | system | sync

## #chain (`computer.localnetwork.audit.entry#chain`)

Type: object

Tamper-evident hash chain over the root account's audit log.

### Properties

- `hash` (string, required)
  - Constraints: minLength: 64, maxLength: 64
- `prev` (string, required): Hex SHA-256 of the previous entry, empty for the first.
  - Constraints: maxLength: 64
- `seq` (integer, required)
  - Constraints: minimum: 1

## #change (`computer.localnetwork.audit.entry#change`)

Type: object

### Properties

- `after` (string)
  - Constraints: maxLength: 4000
- `before` (string)
  - Constraints: maxLength: 4000
- `field` (string, required)
  - Constraints: maxLength: 128

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "chain": {
      "description": "Tamper-evident hash chain over the root account's audit log.",
      "properties": {
        "hash": {
          "maxLength": 64,
          "minLength": 64,
          "type": "string"
        },
        "prev": {
          "description": "Hex SHA-256 of the previous entry, empty for the first.",
          "maxLength": 64,
          "type": "string"
        },
        "seq": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "seq",
        "prev",
        "hash"
      ],
      "type": "object"
    },
    "change": {
      "properties": {
        "after": {
          "maxLength": 4000,
          "type": "string"
        },
        "before": {
          "maxLength": 4000,
          "type": "string"
        },
        "field": {
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "field"
      ],
      "type": "object"
    },
    "main": {
      "description": "One audited action. Each action is written twice with the same record key: once by the acting account into its own repo in the audit space, and once by the root account (with hash-chain fields) into the root's repo in the same space.",
      "key": "tid",
      "record": {
        "properties": {
          "action": {
            "knownValues": [
              "auth.login",
              "auth.logout",
              "project.create",
              "project.update",
              "project.status",
              "project.managers",
              "request.submit",
              "request.update",
              "request.withdraw",
              "request.approve",
              "request.reject",
              "request.changesRequested",
              "role.grant",
              "role.revoke",
              "verification.grant",
              "verification.revoke",
              "booking.create",
              "booking.message",
              "booking.status",
              "planner.save",
              "planner.unsave",
              "planner.show",
              "epk.save",
              "epk.delete",
              "epk.request",
              "epk.grant",
              "epk.decline",
              "epk.revoke",
              "epk.view",
              "epk.forget",
              "show.save",
              "show.delete",
              "follow.create",
              "follow.delete",
              "profile.save",
              "space.create",
              "people.add",
              "people.update",
              "people.remove",
              "people.leave",
              "people.hide",
              "people.invite",
              "people.join",
              "people.request",
              "people.approve",
              "people.reject",
              "people.link",
              "listing.list",
              "listing.unlist",
              "page.update",
              "page.editAsStaff",
              "venue.block",
              "venue.unblock",
              "record.delete",
              "flag.update",
              "flag.preview",
              "flagGroup.create",
              "flagGroup.update",
              "flagGroup.delete",
              "system.bootstrap",
              "system.space"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "actor": {
            "format": "did",
            "type": "string"
          },
          "actorRole": {
            "knownValues": [
              "admin",
              "moderator",
              "member",
              "system"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "chain": {
            "ref": "#chain",
            "type": "ref"
          },
          "changes": {
            "items": {
              "ref": "#change",
              "type": "ref"
            },
            "maxLength": 100,
            "type": "array"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "details": {
            "type": "unknown"
          },
          "outcome": {
            "knownValues": [
              "success",
              "failure",
              "denied"
            ],
            "maxLength": 16,
            "type": "string"
          },
          "reason": {
            "maxGraphemes": 1000,
            "maxLength": 10000,
            "type": "string"
          },
          "subject": {
            "maxLength": 2048,
            "type": "string"
          },
          "subjectKind": {
            "knownValues": [
              "account",
              "project",
              "profile",
              "request",
              "role",
              "booking",
              "planner",
              "space",
              "epk",
              "show",
              "flag",
              "flagGroup"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "summary": {
            "maxGraphemes": 300,
            "maxLength": 3000,
            "type": "string"
          },
          "via": {
            "knownValues": [
              "web",
              "system",
              "sync"
            ],
            "maxLength": 16,
            "type": "string"
          }
        },
        "required": [
          "actor",
          "action",
          "summary",
          "outcome",
          "via",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "computer.localnetwork.audit.entry",
  "lexicon": 1
}
```
