Logs

Get instance audit logs

GET
https://peertube2.cpy.re/api/v1/server/audit-logs

User, administration and moderation actions recorded by all the PeerTube processes of the instance.

By default (format=array), returns an array of at most the 10,000 most recent entries of the requested date range, oldest first. startDate is then required and pagination parameters are ignored.

With format=list, returns a paginated list.

Parameters

formatstringarraylistarrayquery
startinteger>= 0query

Offset used to paginate results

countinteger[1, 100]15query

Number of items to return

sortstring-createdAtcreatedAtquery
searchstringquery

Search in usernames, IP addresses and audited entities

entityTypeAuditLogEntityTypevideovideo-importvideo-livevideo-sourcevideo-filevideo-captionvideo-chaptersvideo-passwordvideo-embed-privacyvideo-transcodingvideo-transcriptionvideo-studio-editionvideo-player-settingsownership-changecommentchannelchannel-syncchannel-videos-importchannel-collaboratorchannel-player-settingschannel-playlists-orderplaylistplaylist-elementplaylist-elements-orderuserregistrationpassword-resettoken-sessionfailed-loginscoped-tokenuser-exportuser-importabuseabuse-messagevideo-blockaccount-blockserver-blockblocklist-subscriptionwatched-words-listwatched-words-subscriptionautomatic-tag-policyconfiginstance-imageinstance-homepageinstance-hostpluginfollowserver-redundancyvideo-redundancyjob-queuejobrunnerrunner-registration-tokendebug-commandstorage-prunequery
entityIdintegerquery
actionAuditLogActioncreateupdatedeletequery
startDatestring<date-time>query

Required with the default array format

endDatestring<date-time>query

Response

200OKArray<AuditLog> | object

successful operation

Response fields application/json
One of

Default array format

Show child attributes
idid>= 1
Example
42
actionAuditLogActioncreateupdatedelete
entityTypeAuditLogEntityTypevideovideo-importvideo-livevideo-sourcevideo-filevideo-captionvideo-chaptersvideo-passwordvideo-embed-privacyvideo-transcodingvideo-transcriptionvideo-studio-editionvideo-player-settingsownership-changecommentchannelchannel-syncchannel-videos-importchannel-collaboratorchannel-player-settingschannel-playlists-orderplaylistplaylist-elementplaylist-elements-orderuserregistrationpassword-resettoken-sessionfailed-loginscoped-tokenuser-exportuser-importabuseabuse-messagevideo-blockaccount-blockserver-blockblocklist-subscriptionwatched-words-listwatched-words-subscriptionautomatic-tag-policyconfiginstance-imageinstance-homepageinstance-hostpluginfollowserver-redundancyvideo-redundancyjob-queuejobrunnerrunner-registration-tokendebug-commandstorage-prune
entityIdinteger | null

Id of the audited entity, null for the instance configuration

userobject
Show child attributes
idinteger | null

null if the user has been deleted, for remote actors or for entries imported from the legacy audit log files

usernamestring

Username at the time of the action, or the actor handle for remote actors

ipstring | null

IP address of the request, anonymized if log.anonymize_ip is enabled

entityobject

Snapshot of the entity after the action (before the action for deletions)

changesobject | null

Only for updates. Keys are dot-separated paths of the changed entity attributes

Show child attributes
[key: string]object
Show child attributes
oldany
newany
createdAtstring<date-time>
timestampstring<date-time>deprecated

Same as createdAt. Field of the format used before audit logs were stored in the database

levelstringauditdeprecated

Field of the format used before audit logs were stored in the database

messagestringdeprecated

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

list format

totalinteger
Example
1
Show child attributes
idid>= 1
Example
42
actionAuditLogActioncreateupdatedelete
entityTypeAuditLogEntityTypevideovideo-importvideo-livevideo-sourcevideo-filevideo-captionvideo-chaptersvideo-passwordvideo-embed-privacyvideo-transcodingvideo-transcriptionvideo-studio-editionvideo-player-settingsownership-changecommentchannelchannel-syncchannel-videos-importchannel-collaboratorchannel-player-settingschannel-playlists-orderplaylistplaylist-elementplaylist-elements-orderuserregistrationpassword-resettoken-sessionfailed-loginscoped-tokenuser-exportuser-importabuseabuse-messagevideo-blockaccount-blockserver-blockblocklist-subscriptionwatched-words-listwatched-words-subscriptionautomatic-tag-policyconfiginstance-imageinstance-homepageinstance-hostpluginfollowserver-redundancyvideo-redundancyjob-queuejobrunnerrunner-registration-tokendebug-commandstorage-prune
entityIdinteger | null

Id of the audited entity, null for the instance configuration

userobject
Show child attributes
idinteger | null

null if the user has been deleted, for remote actors or for entries imported from the legacy audit log files

usernamestring

Username at the time of the action, or the actor handle for remote actors

ipstring | null

IP address of the request, anonymized if log.anonymize_ip is enabled

entityobject

Snapshot of the entity after the action (before the action for deletions)

changesobject | null

Only for updates. Keys are dot-separated paths of the changed entity attributes

Show child attributes
[key: string]object
Show child attributes
oldany
newany
createdAtstring<date-time>
timestampstring<date-time>deprecated

Same as createdAt. Field of the format used before audit logs were stored in the database

levelstringauditdeprecated

Field of the format used before audit logs were stored in the database

messagestringdeprecated

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

403Forbidden

audit log is disabled

Authorization

OAuth2oauth2

Authenticating via OAuth requires the following steps:

  • Have an activated account
  • Generate an access token for that account at /api/v1/users/token.
  • Make requests with the Authorization: Bearer <token> header
  • Profit, depending on the role assigned to the account

Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.

Scopes: admin