Class: HubSpotSDK::Resources::WebhooksJournal::Subscriptions

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/webhooks_journal/subscriptions.rb,
lib/hubspot_sdk/resources/webhooks_journal/subscriptions/filters.rb

Defined Under Namespace

Classes: Filters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Subscriptions

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

Parameters:



135
136
137
138
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions.rb', line 135

def initialize(client:)
  @client = client
  @filters = HubSpotSDK::Resources::WebhooksJournal::Subscriptions::Filters.new(client: client)
end

Instance Attribute Details

#filtersHubSpotSDK::Resources::WebhooksJournal::Subscriptions::Filters (readonly)



8
9
10
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions.rb', line 8

def filters
  @filters
end

Instance Method Details

#create(subscription_upsert_request:, request_options: {}) ⇒ HubSpotSDK::Models::WebhooksJournal::JournalSubscriptionResponse

Create a new subscription in the Webhooks Journal for the specified version. This endpoint allows you to define the subscription details by providing the necessary information in the request body. It supports various types of subscriptions, including object, association, event, app lifecycle event, list membership, and GDPR privacy deletion. Ensure that all required fields are included in the request to successfully create a subscription.



25
26
27
28
29
30
31
32
33
34
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions.rb', line 25

def create(params)
  parsed, options = HubSpotSDK::WebhooksJournal::SubscriptionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "webhooks-journal/subscriptions/2026-03",
    body: parsed[:subscription_upsert_request],
    model: HubSpotSDK::WebhooksJournal::JournalSubscriptionResponse,
    options: options
  )
end

#delete(subscription_id, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::WebhooksJournal::SubscriptionDeleteParams for more details.

Delete a specific webhook journal subscription using its unique identifier. This operation is useful for managing and cleaning up subscriptions that are no longer needed in your HubSpot account.

Parameters:

  • subscription_id (Integer)

    The unique identifier of the subscription to delete. It must be provided as an i

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

Returns:

  • (nil)

See Also:



74
75
76
77
78
79
80
81
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions.rb', line 74

def delete(subscription_id, params = {})
  @client.request(
    method: :delete,
    path: ["webhooks-journal/subscriptions/2026-03/%1$s", subscription_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#delete_for_portal(portal_id, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::WebhooksJournal::SubscriptionDeleteForPortalParams for more details.

Delete a webhook journal subscription for a specific portal. This operation removes the subscription associated with the given portalId, ensuring that no further webhook events are sent for this portal. Use this endpoint to manage and clean up subscriptions that are no longer needed.

Parameters:

  • portal_id (Integer)

    The unique identifier of the portal for which the webhook journal subscription i

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

Returns:

  • (nil)

See Also:



101
102
103
104
105
106
107
108
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions.rb', line 101

def delete_for_portal(portal_id, params = {})
  @client.request(
    method: :delete,
    path: ["webhooks-journal/subscriptions/2026-03/portals/%1$s", portal_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#get(subscription_id, request_options: {}) ⇒ HubSpotSDK::Models::WebhooksJournal::JournalSubscriptionResponse

Retrieve details of a specific webhook subscription using its unique identifier. This endpoint is useful for obtaining information about a particular subscription, such as its actions, object type, and associated properties.

Parameters:

  • subscription_id (Integer)

    The unique identifier of the subscription to retrieve.

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

Returns:

See Also:



123
124
125
126
127
128
129
130
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions.rb', line 123

def get(subscription_id, params = {})
  @client.request(
    method: :get,
    path: ["webhooks-journal/subscriptions/2026-03/%1$s", subscription_id],
    model: HubSpotSDK::WebhooksJournal::JournalSubscriptionResponse,
    options: params[:request_options]
  )
end

#list(request_options: {}) ⇒ HubSpotSDK::Models::WebhooksJournal::JournalCollectionResponseSubscriptionResponseNoPaging

Retrieve a list of webhook journal subscriptions for the specified version. This endpoint allows you to view all active subscriptions without pagination. It is useful for monitoring and managing webhook subscriptions in your HubSpot account.



48
49
50
51
52
53
54
55
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions.rb', line 48

def list(params = {})
  @client.request(
    method: :get,
    path: "webhooks-journal/subscriptions/2026-03",
    model: HubSpotSDK::WebhooksJournal::JournalCollectionResponseSubscriptionResponseNoPaging,
    options: params[:request_options]
  )
end