Class: HubSpotSDK::Resources::Cms::Pages::LandingPages

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/cms/pages/landing_pages.rb,
lib/hubspot_sdk/resources/cms/pages/landing_pages/batch.rb,
lib/hubspot_sdk/resources/cms/pages/landing_pages/draft.rb,
lib/hubspot_sdk/resources/cms/pages/landing_pages/ab_test.rb,
lib/hubspot_sdk/resources/cms/pages/landing_pages/folders.rb,
lib/hubspot_sdk/resources/cms/pages/landing_pages/revisions.rb,
lib/hubspot_sdk/resources/cms/pages/landing_pages/multi_language.rb

Defined Under Namespace

Classes: AbTest, Batch, Draft, Folders, MultiLanguage, Revisions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ LandingPages

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

Parameters:



473
474
475
476
477
478
479
480
481
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 473

def initialize(client:)
  @client = client
  @ab_test = HubSpotSDK::Resources::Cms::Pages::LandingPages::AbTest.new(client: client)
  @batch = HubSpotSDK::Resources::Cms::Pages::LandingPages::Batch.new(client: client)
  @draft = HubSpotSDK::Resources::Cms::Pages::LandingPages::Draft.new(client: client)
  @folders = HubSpotSDK::Resources::Cms::Pages::LandingPages::Folders.new(client: client)
  @multi_language = HubSpotSDK::Resources::Cms::Pages::LandingPages::MultiLanguage.new(client: client)
  @revisions = HubSpotSDK::Resources::Cms::Pages::LandingPages::Revisions.new(client: client)
end

Instance Attribute Details

#ab_testHubSpotSDK::Resources::Cms::Pages::LandingPages::AbTest (readonly)



9
10
11
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 9

def ab_test
  @ab_test
end

#batchHubSpotSDK::Resources::Cms::Pages::LandingPages::Batch (readonly)



12
13
14
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 12

def batch
  @batch
end

#draftHubSpotSDK::Resources::Cms::Pages::LandingPages::Draft (readonly)



15
16
17
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 15

def draft
  @draft
end

#foldersHubSpotSDK::Resources::Cms::Pages::LandingPages::Folders (readonly)



18
19
20
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 18

def folders
  @folders
end

#multi_languageHubSpotSDK::Resources::Cms::Pages::LandingPages::MultiLanguage (readonly)



21
22
23
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 21

def multi_language
  @multi_language
end

#revisionsHubSpotSDK::Resources::Cms::Pages::LandingPages::Revisions (readonly)



24
25
26
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 24

def revisions
  @revisions
end

Instance Method Details

#clone_(id:, clone_name: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PagesPage

Create a copy of an existing landing page.

Parameters:

  • id (String)

    ID of the object to be cloned.

  • clone_name (String)

    Name of the cloned object.

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

Returns:

See Also:



406
407
408
409
410
411
412
413
414
415
416
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 406

def clone_(params)
  parsed, options = HubSpotSDK::Cms::Pages::LandingPageCloneParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/clone",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: HubSpotSDK::Cms::PagesPage,
    options: options
  )
end

#create(id:, ab_status:, ab_test_id:, archived_at:, archived_in_dashboard:, attached_stylesheets:, author_name:, campaign:, category_id:, content_group_id:, content_type_category:, created:, created_by_id:, currently_published:, current_state:, domain:, dynamic_page_data_source_id:, dynamic_page_data_source_type:, dynamic_page_hub_db_table_id:, enable_domain_stylesheets:, enable_layout_stylesheets:, featured_image:, featured_image_alt_text:, folder_id:, footer_html:, head_html:, html_title:, include_default_custom_css:, language:, layout_sections:, link_rel_canonical_url:, mab_experiment_id:, meta_description:, name:, page_expiry_date:, page_expiry_enabled:, page_expiry_redirect_id:, page_expiry_redirect_url:, page_redirected:, password:, public_access_rules:, public_access_rules_enabled:, publish_date:, publish_immediately:, slug:, state:, subcategory:, template_path:, theme_settings_values:, translated_from_id:, translations:, updated:, updated_by_id:, url:, use_featured_image:, widget_containers:, widgets:, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PagesPage

Some parameter documentations has been truncated, see Models::Cms::Pages::LandingPageCreateParams for more details.

Create a new landing page.

Parameters:

  • id (String)

    The unique ID of the page.

  • ab_status (Symbol, HubSpotSDK::Models::Cms::PagesPage::AbStatus)

    The status of the AB test associated with this page, if applicable

  • ab_test_id (String)

    The ID of the AB test associated with this page, if applicable

  • archived_at (Time)

    The timestamp (ISO8601 format) when this page was deleted.

  • archived_in_dashboard (Boolean)

    If True, the page will not show up in your dashboard, although the page could st

  • attached_stylesheets (Array<Hash{Symbol=>Object}>)

    List of stylesheets to attach to this page. These stylesheets are attached to ju

  • author_name (String)

    The name of the user that updated this page.

  • campaign (String)

    The GUID of the marketing campaign this page is a part of.

  • category_id (Integer)

    ID of the type of object this is. Should always .

  • content_group_id (String)

    The unique identifier for the content group associated with the page.

  • content_type_category (Symbol, HubSpotSDK::Models::Cms::PagesPage::ContentTypeCategory)

    An ENUM descibing the type of this object. Should be either LANDING_PAGE or SITE

  • created (Time)

    The timestamp indicating when the page was created.

  • created_by_id (String)

    The ID of the user that created this page.

  • currently_published (Boolean)

    Indicates whether the page is currently published.

  • current_state (Symbol, HubSpotSDK::Models::Cms::PagesPage::CurrentState)

    A generated ENUM descibing the current state of this page.

  • domain (String)

    The domain this page will resolve to. If null, the page will default to the prim

  • dynamic_page_data_source_id (String)

    The identifier for the data source used by the dynamic page.

  • dynamic_page_data_source_type (Integer)

    The type of data source used by the dynamic page.

  • dynamic_page_hub_db_table_id (String)

    The ID of the HubDB table this page references, if applicable

  • enable_domain_stylesheets (Boolean)

    Boolean to determine whether or not the styles from the template should be appli

  • enable_layout_stylesheets (Boolean)

    Boolean to determine whether or not the styles from the template should be appli

  • featured_image (String)

    The featuredImage of this page.

  • featured_image_alt_text (String)

    Alt Text of the featuredImage.

  • folder_id (String)

    The ID of the associated folder this landing page is organized under in the app

  • footer_html (String)

    Custom HTML for embed codes, javascript that should be placed before the </body>

  • head_html (String)

    Custom HTML for embed codes, javascript, etc. that goes in the <head> tag of the

  • html_title (String)

    The html title of this page.

  • include_default_custom_css (Boolean)

    Boolean to determine whether or not the Primary CSS Files should be applied.

  • language (Symbol, HubSpotSDK::Models::Cms::PagesPage::Language)

    The explicitly defined ISO 639 language code of the page. If null, the page will

  • layout_sections (Hash{Symbol=>HubSpotSDK::Models::Cms::LayoutSection})

    A structure detailing the layout sections of the page.

  • link_rel_canonical_url (String)

    Optional override to set the URL to be used in the rel=canonical link tag on the

  • mab_experiment_id (String)

    The ID of the MAB test (or dynamic test) associated with this page, if applicabl

  • meta_description (String)

    A description that goes in <meta> tag on the page.

  • name (String)

    The internal name of the page.

  • page_expiry_date (Integer)

    The date at which this page should expire and begin redirecting to another url o

  • page_expiry_enabled (Boolean)

    Boolean describing if the page expiration feature is enabled for this page

  • page_expiry_redirect_id (Integer)

    The ID of another page this page’s url should redirect to once this page expires

  • page_expiry_redirect_url (String)

    The URL this page’s url should redirect to once this page expires. Should only s

  • page_redirected (Boolean)

    A generated Boolean describing whether or not this page is currently expired and

  • password (String)

    Set this to create a password protected page. Entering the password will be requ

  • public_access_rules (Array<Object>)

    Rules for require member registration to access private content.

  • public_access_rules_enabled (Boolean)

    Boolean to determine whether or not to respect publicAccessRules.

  • publish_date (Time)

    The date (ISO8601 format) the page is to be published at.

  • publish_immediately (Boolean)

    Set this to true if you want to be published immediately when the schedule publi

  • slug (String)

    The path of the this page. This field is appended to the domain to construct the

  • state (String)

    An ENUM descibing the current state of this page.

  • subcategory (String)

    Details the type of page this is. Should always be landing_page or site_page

  • template_path (String)

    String detailing the path of the template used for this page.

  • theme_settings_values (Hash{Symbol=>Object})

    A collection of settings specific to the theme applied to the page.

  • translated_from_id (String)

    ID of the primary page this object was translated from.

  • translations (Hash{Symbol=>HubSpotSDK::Models::Cms::ContentLanguageVariation})

    A map of translations for the page, each associated with a specific language var

  • updated (Time)

    The timestamp indicating when the page was last updated.

  • updated_by_id (String)

    The ID of the user that updated this page.

  • url (String)

    A generated field representing the URL of this page.

  • use_featured_image (Boolean)

    Boolean to determine if this page should use a featuredImage.

  • widget_containers (Hash{Symbol=>Object})

    A data structure containing the data for all the modules inside the containers f

  • widgets (Hash{Symbol=>Object})

    A data structure containing the data for all the modules for this page.

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

Returns:

See Also:



152
153
154
155
156
157
158
159
160
161
162
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 152

def create(params)
  parsed, options = HubSpotSDK::Cms::Pages::LandingPageCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: HubSpotSDK::Cms::PagesPage,
    options: options
  )
end

#delete(object_id_, archived: nil, request_options: {}) ⇒ nil

Delete a landing page, specified by its ID.

Parameters:

  • object_id_ (String)

    The unique identifier of the landing page to delete.

  • archived (Boolean)

    Whether to return only results that have been archived.

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

Returns:

  • (nil)

See Also:



381
382
383
384
385
386
387
388
389
390
391
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 381

def delete(object_id_, params = {})
  parsed, options = HubSpotSDK::Cms::Pages::LandingPageDeleteParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :delete,
    path: ["cms/pages/2026-03/landing-pages/%1$s", object_id_],
    query: query,
    model: NilClass,
    options: options
  )
end

#get(object_id_, archived: nil, property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PagesPage

Retrieve a landing page, specified by its ID.

Parameters:

  • object_id_ (String)

    The unique identifier of the landing page to retrieve.

  • archived (Boolean)

    Whether to return only results that have been archived.

  • property (String)

    A specific property of the landing page to include in the response.

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

Returns:

See Also:



433
434
435
436
437
438
439
440
441
442
443
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 433

def get(object_id_, params = {})
  parsed, options = HubSpotSDK::Cms::Pages::LandingPageGetParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["cms/pages/2026-03/landing-pages/%1$s", object_id_],
    query: query,
    model: HubSpotSDK::Cms::PagesPage,
    options: options
  )
end

#list(after: nil, archived: nil, created_after: nil, created_at: nil, created_before: nil, limit: nil, property: nil, sort: nil, updated_after: nil, updated_at: nil, updated_before: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Cms::PagesPage>

Some parameter documentations has been truncated, see Models::Cms::Pages::LandingPageListParams for more details.

Retrieve a list of landing pages in your HubSpot account. This endpoint allows you to filter landing pages based on creation and update timestamps, sort them, and paginate through results. You can also choose to include archived pages or specify certain properties to be included in the response.

Parameters:

  • after (String)

    A cursor token for pagination. Use the value from the previous response’s paging

  • archived (Boolean)

    Whether to return only results that have been archived.

  • created_after (Time)

    Filter landing pages created after a specific date and time.

  • created_at (Time)

    Filter landing pages by their creation timestamp.

  • created_before (Time)

    Filter landing pages created before a specific date and time.

  • limit (Integer)

    The maximum number of results to display per page.

  • property (String)

    Specify which properties of the landing pages to include in the response.

  • sort (Array<String>)

    Specify the order in which results are returned. Accepts an array of strings.

  • updated_after (Time)

    Filter landing pages updated after a specific date and time.

  • updated_at (Time)

    Filter landing pages by their last updated timestamp.

  • updated_before (Time)

    Filter landing pages updated before a specific date and time.

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

Returns:

See Also:



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 348

def list(params = {})
  parsed, options = HubSpotSDK::Cms::Pages::LandingPageListParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "cms/pages/2026-03/landing-pages",
    query: query.transform_keys(
      created_after: "createdAfter",
      created_at: "createdAt",
      created_before: "createdBefore",
      updated_after: "updatedAfter",
      updated_at: "updatedAt",
      updated_before: "updatedBefore"
    ),
    page: HubSpotSDK::Internal::Page,
    model: HubSpotSDK::Cms::PagesPage,
    options: options
  )
end

#schedule(id:, publish_date:, request_options: {}) ⇒ nil

Schedule a landing page to be published.

Parameters:

  • id (String)

    The ID of the object to be scheduled.

  • publish_date (Time)

    The date the object should transition from scheduled to published.

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

Returns:

  • (nil)

See Also:



458
459
460
461
462
463
464
465
466
467
468
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 458

def schedule(params)
  parsed, options = HubSpotSDK::Cms::Pages::LandingPageScheduleParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/schedule",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: NilClass,
    options: options
  )
end

#update(object_id_, id:, ab_status:, ab_test_id:, archived_at:, archived_in_dashboard:, attached_stylesheets:, author_name:, campaign:, category_id:, content_group_id:, content_type_category:, created:, created_by_id:, currently_published:, current_state:, domain:, dynamic_page_data_source_id:, dynamic_page_data_source_type:, dynamic_page_hub_db_table_id:, enable_domain_stylesheets:, enable_layout_stylesheets:, featured_image:, featured_image_alt_text:, folder_id:, footer_html:, head_html:, html_title:, include_default_custom_css:, language:, layout_sections:, link_rel_canonical_url:, mab_experiment_id:, meta_description:, name:, page_expiry_date:, page_expiry_enabled:, page_expiry_redirect_id:, page_expiry_redirect_url:, page_redirected:, password:, public_access_rules:, public_access_rules_enabled:, publish_date:, publish_immediately:, slug:, state:, subcategory:, template_path:, theme_settings_values:, translated_from_id:, translations:, updated:, updated_by_id:, url:, use_featured_image:, widget_containers:, widgets:, archived: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PagesPage

Some parameter documentations has been truncated, see Models::Cms::Pages::LandingPageUpdateParams for more details.

Sparse updates a single Landing Page object identified by the id in the path. You only need to specify the column values that you are modifying.

LANDING_

Parameters:

  • object_id_ (String)

    Path param: The unique identifier of the landing page to update.

  • id (String)

    Body param: The unique ID of the page.

  • ab_status (Symbol, HubSpotSDK::Models::Cms::PagesPage::AbStatus)

    Body param: The status of the AB test associated with this page, if applicable

  • ab_test_id (String)

    Body param: The ID of the AB test associated with this page, if applicable

  • archived_at (Time)

    Body param: The timestamp (ISO8601 format) when this page was deleted.

  • archived_in_dashboard (Boolean)

    Body param: If True, the page will not show up in your dashboard, although the p

  • attached_stylesheets (Array<Hash{Symbol=>Object}>)

    Body param: List of stylesheets to attach to this page. These stylesheets are at

  • author_name (String)

    Body param: The name of the user that updated this page.

  • campaign (String)

    Body param: The GUID of the marketing campaign this page is a part of.

  • category_id (Integer)

    Body param: ID of the type of object this is. Should always .

  • content_group_id (String)

    Body param: The unique identifier for the content group associated with the page

  • content_type_category (Symbol, HubSpotSDK::Models::Cms::PagesPage::ContentTypeCategory)

    Body param: An ENUM descibing the type of this object. Should be either

  • created (Time)

    Body param: The timestamp indicating when the page was created.

  • created_by_id (String)

    Body param: The ID of the user that created this page.

  • currently_published (Boolean)

    Body param: Indicates whether the page is currently published.

  • current_state (Symbol, HubSpotSDK::Models::Cms::PagesPage::CurrentState)

    Body param: A generated ENUM descibing the current state of this page.

  • domain (String)

    Body param: The domain this page will resolve to. If null, the page will default

  • dynamic_page_data_source_id (String)

    Body param: The identifier for the data source used by the dynamic page.

  • dynamic_page_data_source_type (Integer)

    Body param: The type of data source used by the dynamic page.

  • dynamic_page_hub_db_table_id (String)

    Body param: The ID of the HubDB table this page references, if applicable

  • enable_domain_stylesheets (Boolean)

    Body param: Boolean to determine whether or not the styles from the template sho

  • enable_layout_stylesheets (Boolean)

    Body param: Boolean to determine whether or not the styles from the template sho

  • featured_image (String)

    Body param: The featuredImage of this page.

  • featured_image_alt_text (String)

    Body param: Alt Text of the featuredImage.

  • folder_id (String)

    Body param: The ID of the associated folder this landing page is organized under

  • footer_html (String)

    Body param: Custom HTML for embed codes, javascript that should be placed before

  • head_html (String)

    Body param: Custom HTML for embed codes, javascript, etc. that goes in the <head

  • html_title (String)

    Body param: The html title of this page.

  • include_default_custom_css (Boolean)

    Body param: Boolean to determine whether or not the Primary CSS Files should be

  • language (Symbol, HubSpotSDK::Models::Cms::PagesPage::Language)

    Body param: The explicitly defined ISO 639 language code of the page. If null, t

  • layout_sections (Hash{Symbol=>HubSpotSDK::Models::Cms::LayoutSection})

    Body param: A structure detailing the layout sections of the page.

  • link_rel_canonical_url (String)

    Body param: Optional override to set the URL to be used in the rel=canonical lin

  • mab_experiment_id (String)

    Body param: The ID of the MAB test (or dynamic test) associated with this page,

  • meta_description (String)

    Body param: A description that goes in <meta> tag on the page.

  • name (String)

    Body param: The internal name of the page.

  • page_expiry_date (Integer)

    Body param: The date at which this page should expire and begin redirecting to a

  • page_expiry_enabled (Boolean)

    Body param: Boolean describing if the page expiration feature is enabled for thi

  • page_expiry_redirect_id (Integer)

    Body param: The ID of another page this page’s url should redirect to once this

  • page_expiry_redirect_url (String)

    Body param: The URL this page’s url should redirect to once this page expires. S

  • page_redirected (Boolean)

    Body param: A generated Boolean describing whether or not this page is currently

  • password (String)

    Body param: Set this to create a password protected page. Entering the password

  • public_access_rules (Array<Object>)

    Body param: Rules for require member registration to access private content.

  • public_access_rules_enabled (Boolean)

    Body param: Boolean to determine whether or not to respect publicAccessRules.

  • publish_date (Time)

    Body param: The date (ISO8601 format) the page is to be published at.

  • publish_immediately (Boolean)

    Body param: Set this to true if you want to be published immediately when the sc

  • slug (String)

    Body param: The path of the this page. This field is appended to the domain to c

  • state (String)

    Body param: An ENUM descibing the current state of this page.

  • subcategory (String)

    Body param: Details the type of page this is. Should always be landing_page or s

  • template_path (String)

    Body param: String detailing the path of the template used for this page.

  • theme_settings_values (Hash{Symbol=>Object})

    Body param: A collection of settings specific to the theme applied to the page.

  • translated_from_id (String)

    Body param: ID of the primary page this object was translated from.

  • translations (Hash{Symbol=>HubSpotSDK::Models::Cms::ContentLanguageVariation})

    Body param: A map of translations for the page, each associated with a specific

  • updated (Time)

    Body param: The timestamp indicating when the page was last updated.

  • updated_by_id (String)

    Body param: The ID of the user that updated this page.

  • url (String)

    Body param: A generated field representing the URL of this page.

  • use_featured_image (Boolean)

    Body param: Boolean to determine if this page should use a featuredImage.

  • widget_containers (Hash{Symbol=>Object})

    Body param: A data structure containing the data for all the modules inside the

  • widgets (Hash{Symbol=>Object})

    Body param: A data structure containing the data for all the modules for this pa

  • archived (Boolean)

    Query param: Whether to return only results that have been archived.

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

Returns:

See Also:



296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages.rb', line 296

def update(object_id_, params)
  query_params = [:archived]
  parsed, options = HubSpotSDK::Cms::Pages::LandingPageUpdateParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :patch,
    path: ["cms/pages/2026-03/landing-pages/%1$s", object_id_],
    query: query,
    headers: {"content-type" => "*/*"},
    body: parsed.except(*query_params),
    model: HubSpotSDK::Cms::PagesPage,
    options: options
  )
end