Action Logs

An ActionLog is an audit log of file actions performed by users or the system.

Logs available through this endpoint are retained for 6 months, after which they are automatically discarded. For longer retention, use Files.com SIEM integrations to stream logs in real time to your preferred SIEM, or configure SIEM streaming to a file.

List Action Logs

SDK Method

actionlog.List()

Return Object

[]*ActionLog

Authorization Requirement

Available to all authenticated keys or sessions.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    action_log "github.com/Files-com/files-sdk-go/v3/actionlog"
)

actionLogIterator, err := action_log.List(files_sdk.ActionLogListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for actionLogIterator.Next() {
    actionLog := actionLogIterator.actionLog()
}
err = actionLogIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The ActionLog Object

Some of the methods above return a ActionLog object. The attributes of this object are listed below.

AttributeDescription
Action
string
The type of action performed
CreatedAt
date-time
Time the action was performed
Destination
string
Destination path, for moves and copies
FailureType
string
Failure type, if applicable
Folder
string
Folder involved in the action
Interface
string
Interface used to perform the action
Ip
string
IP address from which the action was performed
MetadataDmId
int64
File or Folder ID associated with the action
ParentMetadataDmId
int64
Parent File or Folder ID associated with the action
Path
string
File path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
SiteId
int64
Site ID where the action took place
Src
string
Source path, for moves and copies
UserId
int64
User ID who performed the action
Username
string
Username who performed the action