There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API keys are no longer a supported authentication method for accessing HubSpot APIs. Instead, you should use a private app access token or OAuth to authenticate API calls. Learn more about this change and how to migrate an API key integration to use a private app instead.

Create a new Template

Last updated November 19, 2021

POST /content/api/v2/templates

Method Details

HTTP Methods:

POST

Content Type:

application/json

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing

Create a new coded template object in Design Manager.

Required Parameters How to use Description
OAuth access token or private app access token Authorization: Bearer {token} header Used to authenticate the request. Please see this page for more details about authentication.
Additional Parameters Description
category_id This parameter category type:

  • 0 - Unmapped
  • 1 - Landing Pages
  • 2 - Email
  • 3 - Blog Post
  • 4 - Site Page
folder The name of the folder to save the template in Design Manager.
template_type This parameter accepts a numeric value and sets the type of template that is created. The following numbers correspond to specific template types:

  • 2 - Email template
  • 4 - Page template
  • 11 - Error template
  • 12 - Subscription preferences template
  • 13 - Backup unsubscribe page template
  • 14 - Subscriptions update confirmation template
  • 19 - Password prompt page template
  • 27 - Search results template
  • 29 - Membership login template
  • 30 - Membership registration template
  • 31 - Membership reset password confirmation template
  • 32 - Membership reset password request template
path The Design Manager path to the directory that contains the file being created
source The source code of the file.
is_available_for_new_content
  • Used to determine if the template should be expected to pass page/content validation and be used with live content (if "True", the template source must contain the required variables for the template type).
  • This is equivalent to the "Make Available for New Content?" checkbox on Publish in the UI, and the "Template" vs. "Template Partial" radio select on template creation in the design manager beta.
  • Default value is "False".