Class: HubSpotSDK::Resources::Account::Activity

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/account/activity.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Activity

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 Activity.

Parameters:



131
132
133
# File 'lib/hubspot_sdk/resources/account/activity.rb', line 131

def initialize(client:)
  @client = client
end

Instance Method Details

#list_audit_logs(acting_user_id: nil, after: nil, fill_final_timestamp: nil, limit: nil, occurred_after: nil, occurred_before: nil, sort: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Account::PublicAPIUserActionEvent>

Some parameter documentations has been truncated, see Models::Account::ActivityListAuditLogsParams for more details.

Retrieve activity history for user actions related to approvals, content updates, CRM object updates, security activity, and more (Enterprise only). Learn more about [activities included in audit log exports](knowledge.hubspot.com/account-management/view-and-export-account-activity-history-in-a-centralized-audit-log?hubs_content=knowledge.hubspot.com/account-management/view-and-export-account-activity-history&hubs_content-cta=centralized%20audit%20log#data-included-in-the-centralized-audit-log).

Parameters:

  • acting_user_id (Array<Integer>)
  • after (String)

    The paging cursor token of the last successfully read resource will be returned

  • fill_final_timestamp (Boolean)
  • limit (Integer)

    The maximum number of results to display per page.

  • occurred_after (Time)
  • occurred_before (Time)
  • sort (Array<String>)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/hubspot_sdk/resources/account/activity.rb', line 36

def list_audit_logs(params = {})
  parsed, options = HubSpotSDK::Account::ActivityListAuditLogsParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "account-info/2026-03/activity/audit-logs",
    query: query.transform_keys(
      acting_user_id: "actingUserId",
      fill_final_timestamp: "fillFinalTimestamp",
      occurred_after: "occurredAfter",
      occurred_before: "occurredBefore"
    ),
    page: HubSpotSDK::Internal::Page,
    model: HubSpotSDK::Account::PublicAPIUserActionEvent,
    options: options
  )
end

#list_login_activities(after: nil, limit: nil, user_id: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Account::PublicLoginAudit>

Some parameter documentations has been truncated, see Models::Account::ActivityListLoginActivitiesParams for more details.

Retrieve logs of user actions related to [login activity](knowledge.hubspot.com/account-management/view-and-export-account-activity-history#account-login-history).

Parameters:

  • after (String)

    The paging cursor token of the last successfully read resource will be returned

  • limit (Integer)

    The maximum number of results to display per page.

  • user_id (Integer)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/hubspot_sdk/resources/account/activity.rb', line 74

def (params = {})
  parsed, options = HubSpotSDK::Account::ActivityListLoginActivitiesParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "account-info/2026-03/activity/login",
    query: query.transform_keys(user_id: "userId"),
    page: HubSpotSDK::Internal::Page,
    model: HubSpotSDK::Account::PublicLoginAudit,
    options: options
  )
end

#list_security_activities(after: nil, from_timestamp: nil, limit: nil, to_timestamp: nil, user_id: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Account::HydratedCriticalAction>

Some parameter documentations has been truncated, see Models::Account::ActivityListSecurityActivitiesParams for more details.

Retrieve logs of user actions related to [security activity](knowledge.hubspot.com/account-management/view-and-export-account-activity-history#security-activity-history).

Parameters:

  • after (String)

    The paging cursor token of the last successfully read resource will be returned

  • from_timestamp (Integer)
  • limit (Integer)

    The maximum number of results to display per page.

  • to_timestamp (Integer)
  • user_id (Integer)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/hubspot_sdk/resources/account/activity.rb', line 111

def list_security_activities(params = {})
  parsed, options = HubSpotSDK::Account::ActivityListSecurityActivitiesParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "account-info/2026-03/activity/security",
    query: query.transform_keys(
      from_timestamp: "fromTimestamp",
      to_timestamp: "toTimestamp",
      user_id: "userId"
    ),
    page: HubSpotSDK::Internal::Page,
    model: HubSpotSDK::Account::HydratedCriticalAction,
    options: options
  )
end