Class: MetronomeSDK::Resources::V1::AuditLogs
- Inherits:
-
Object
- Object
- MetronomeSDK::Resources::V1::AuditLogs
- Defined in:
- lib/metronome_sdk/resources/v1/audit_logs.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ AuditLogs
constructor
private
A new instance of AuditLogs.
-
#list(ending_before: nil, limit: nil, next_page: nil, resource_id: nil, resource_type: nil, sort: nil, starting_on: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::AuditLogListResponse>
Some parameter documentations has been truncated, see Models::V1::AuditLogListParams for more details.
Constructor Details
#initialize(client:) ⇒ AuditLogs
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AuditLogs.
86 87 88 |
# File 'lib/metronome_sdk/resources/v1/audit_logs.rb', line 86 def initialize(client:) @client = client end |
Instance Method Details
#list(ending_before: nil, limit: nil, next_page: nil, resource_id: nil, resource_type: nil, sort: nil, starting_on: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::AuditLogListResponse>
Some parameter documentations has been truncated, see Models::V1::AuditLogListParams for more details.
Get a comprehensive audit trail of all operations performed in your Metronome account, whether initiated through the API, web interface, or automated processes. This endpoint provides detailed logs of who did what and when, enabling compliance reporting, security monitoring, and operational troubleshooting across all interaction channels.
### Use this endpoint to:
-
Monitor all account activity for security and compliance purposes
-
Track configuration changes regardless of source (API, UI, or system)
-
Investigate issues by reviewing historical operations
### Key response fields:
An array of AuditLog objects containing:
-
id: Unique identifier for the audit log entry
-
timestamp: When the action occurred (RFC 3339 format)
-
actor: Information about who performed the action
-
request: Details including request ID, IP address, and user agent
-
‘resource_type`: The type of resource affected (e.g., customer, contract, invoice)
-
‘resource_id`: The specific resource identifier
-
‘action`: The operation performed
-
‘next_page`: Cursor for continuous log retrieval
### Usage guidelines:
-
Continuous retrieval: The next_page token enables uninterrupted log streaming—save it between requests to ensure no logs are missed
-
Empty responses: An empty data array means no new logs yet; continue polling with the same next_page token
-
Date filtering:
-
‘starting_on`: Earliest logs to return (inclusive)
-
‘ending_before`: Latest logs to return (exclusive)
-
Cannot be used with ‘next_page`
-
-
Resource filtering: Must specify both ‘resource_type` and `resource_id` together
-
Sort order: Default is ‘date_asc`; use `date_desc` for newest first
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/metronome_sdk/resources/v1/audit_logs.rb', line 71 def list(params = {}) parsed, = MetronomeSDK::V1::AuditLogListParams.dump_request(params) @client.request( method: :get, path: "v1/auditLogs", query: parsed, page: MetronomeSDK::Internal::CursorPage, model: MetronomeSDK::Models::V1::AuditLogListResponse, options: ) end |