Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

List

Get audit logs
v1.audit_logs.list(**kwargs) -> CursorPage<idStringrequestobjecttimestampTimeactionStringactorobjectdescriptionStringresource_idStringresource_typeStringstatusunionAuditLogListResponse>
get/v1/auditLogs

Retrieves a range of audit logs. If no further audit logs are currently available, the data array will be empty. As new audit logs are created, subsequent requests using the same next_page value will be in the returned data array, ensuring a continuous and uninterrupted reading of audit logs.

Parameters
ending_beforeTime
optional

RFC 3339 timestamp (exclusive). Cannot be used with 'next_page'.

formatdate-time
limitInteger
optional

Max number of results that should be returned

minimum1
maximum100
next_pageString
optional

Cursor that indicates where the next page of results should start.

resource_idString
optional

Optional parameter that can be used to filter which audit logs are returned. If you specify resource_id, you must also specify resource_type.

resource_typeString
optional

Optional parameter that can be used to filter which audit logs are returned. If you specify resource_type, you must also specify resource_id.

sortunion
optional
:date_asc | :date_desc

Sort order by timestamp, e.g. date_asc or date_desc. Defaults to date_asc.

Hide ParametersShow Parameters
:date_asc
:date_desc
starting_onTime
optional

RFC 3339 timestamp of the earliest audit log to return. Cannot be used with 'next_page'.

formatdate-time
Returns
AuditLogListResponseclass
Hide ParametersShow Parameters
idString
requestobject
{ id, ip, user_agent}
Hide ParametersShow Parameters
idString
ipString
optional
user_agentString
optional
timestampTime
formatdate-time
actionString
optional
actorobject
optional
{ id, name, email}
Hide ParametersShow Parameters
idString
nameString
emailString
optional
descriptionString
optional
resource_idString
optional
resource_typeString
optional
statusunion
optional
:success | :failure | :pending
Hide ParametersShow Parameters
:success
:failure
:pending
require "metronome_sdk"

metronome = MetronomeSDK::Client.new(bearer_token: "My Bearer Token")

page = metronome.v1.audit_logs.list

puts(page)
200 Example
{
  "data": [
    {
      "id": "id",
      "request": {
        "id": "id",
        "ip": "ip",
        "user_agent": "user_agent"
      },
      "timestamp": "2019-12-27T18:11:19.117Z",
      "action": "action",
      "actor": {
        "id": "id",
        "name": "name",
        "email": "email"
      },
      "description": "description",
      "resource_id": "resource_id",
      "resource_type": "resource_type",
      "status": "success"
    }
  ],
  "next_page": "next_page"
}