# AuditLog

Type: AuditLog

Schema: [AuditLog](https://sourcey-peertube.pages.dev/api-rest-reference/models/auditlog.md)

- `id` (optional)
  Reference: [id](https://sourcey-peertube.pages.dev/api-rest-reference/models/id.md); Type: id
  
  minimum: 1
  
  Example:
  
  ```json
  42
  ```

- `action` (optional)
  Reference: [AuditLogAction](https://sourcey-peertube.pages.dev/api-rest-reference/models/auditlogaction.md); Type: AuditLogAction
  
  enum: ["create","update","delete"]

- `entityType` (optional)
  Reference: [AuditLogEntityType](https://sourcey-peertube.pages.dev/api-rest-reference/models/auditlogentitytype.md); Type: AuditLogEntityType
  
  enum: ["video","video-import","video-live","video-source","video-file","video-caption","video-chapters","video-password","video-embed-privacy","video-transcoding","video-transcription","video-studio-edition","video-player-settings","ownership-change","comment","channel","channel-sync","channel-videos-import","channel-collaborator","channel-player-settings","channel-playlists-order","playlist","playlist-element","playlist-elements-order","user","registration","password-reset","token-session","failed-login","scoped-token","user-export","user-import","abuse","abuse-message","video-block","account-block","server-block","blocklist-subscription","watched-words-list","watched-words-subscription","automatic-tag-policy","config","instance-image","instance-homepage","instance-host","plugin","follow","server-redundancy","video-redundancy","job-queue","job","runner","runner-registration-token","debug-command","storage-prune"]

- `entityId` (optional)
  Type: integer; nullable
  
  Id of the audited entity, `null` for the instance configuration

- `user` (optional)
  Type: object
  
  - `id` (optional)
    Type: integer; nullable
    
    `null` if the user has been deleted, for remote actors or for entries imported from the legacy audit log files
  
  - `username` (optional)
    Type: string
    
    Username at the time of the action, or the actor handle for remote actors

- `ip` (optional)
  Type: string; nullable
  
  IP address of the request, anonymized if `log.anonymize_ip` is enabled

- `entity` (optional)
  Type: object
  
  Snapshot of the entity after the action (before the action for deletions)
  
  Additional properties: true

- `changes` (optional)
  Type: object; nullable
  
  Only for updates. Keys are dot-separated paths of the changed entity attributes
  
  Additional properties: 
    Type: object
    
    - `old` (optional)
      Type: any
    
    - `new` (optional)
      Type: any

- `createdAt` (optional)
  Type: string, date-time

- `timestamp` (optional)
  Type: string, date-time
  
  Same as `createdAt`. Field of the format used before audit logs were stored in the database
  
  deprecated: true

- `level` (optional)
  Type: string
  
  Field of the format used before audit logs were stored in the database
  
  enum: ["audit"]
  
  deprecated: true

- `message` (optional)
  Type: string
  
  JSON string containing the `user`, `domain` (entity type), `action`, `entityId`, `ip` and `changes` of the entry, and the properties of the audited entity.
  Field of the format used before audit logs were stored in the database
  
  
  deprecated: true