openapi: 3.0.1 info: title: HubSpot Automation Email Templates description: Basepom for all HubSpot Projects version: 2026-09 x-hubspot-product-tier-requirements: marketing: FREE sales: FREE service: FREE cms: FREE commerce: FREE crmHub: FREE dataHub: FREE servers: - url: https://api.hubapi.com tags: - name: Basic paths: /automation/email-templates/2026-09: get: tags: - Basic summary: List templates description: 'Retrieve a list of email templates available in the HubSpot account. This endpoint supports pagination to navigate through large sets of templates. Use this endpoint to access and manage your email templates efficiently. Please note: the scopes for these endpoints require user-level access and will not work for existing apps with portal-level access. ' operationId: get-/automation/email-templates/2026-09_/automation/email-templates/2026-09-beta parameters: - name: after in: query description: The paging cursor token of the last successfully read resource, returned as the `paging.next.after` JSON property of a paged response containing more results. required: false style: form explode: true schema: type: string - name: limit in: query description: The maximum number of results to display per page. Defaults to 20. required: false style: form explode: true schema: type: integer format: int32 default: 20 responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/CollectionResponsePublicTemplateForwardPaging' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - sales-templates-public-read x-hubspot-user-level-auth: internalOnly: false post: tags: - Basic summary: Create description: 'Create a new email template in your HubSpot account. This endpoint allows you to define the template''s name, subject, body, and optionally assign it to a folder. The request must include the template''s body and name. Please note: the scopes for these endpoints require user-level access and will not work for existing apps with portal-level access. ' operationId: post-/automation/email-templates/2026-09_/automation/email-templates/2026-09-beta parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/PublicTemplateInput' required: true responses: '201': description: successful operation headers: Location: description: URL of the newly created resource style: simple explode: false schema: type: string content: application/json: schema: $ref: '#/components/schemas/PublicTemplate' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - sales-templates-public-write x-hubspot-user-level-auth: internalOnly: false /automation/email-templates/2026-09/folders: get: tags: - Basic summary: List folders description: 'Retrieve a list of email template folders available in your HubSpot account. This endpoint supports pagination to navigate through large sets of folders. Use this endpoint to organize and manage your email templates efficiently. Please note: the scopes for these endpoints require user-level access and will not work for existing apps with portal-level access. ' operationId: get-/automation/email-templates/2026-09/folders_/automation/email-templates/2026-09-beta/folders parameters: - name: after in: query description: The paging cursor token of the last successfully read resource. Use this token to retrieve the next set of results. required: false style: form explode: true schema: type: string - name: limit in: query description: The maximum number of results to display per page. Defaults to 20. required: false style: form explode: true schema: type: integer format: int32 default: 20 responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/CollectionResponsePublicFolderForwardPaging' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - sales-templates-public-read x-hubspot-user-level-auth: internalOnly: false /automation/email-templates/2026-09/{templateId}: get: tags: - Basic summary: Retrieve template description: 'Retrieve a specific email template by its unique identifier. This endpoint allows you to access the details of an email template, which can be useful for reviewing or managing your email automation strategies. Please note: the scopes for these endpoints require user-level access and will not work for existing apps with portal-level access. ' operationId: get-/automation/email-templates/2026-09/{templateId}_/automation/email-templates/2026-09-beta/{templateId} parameters: - name: templateId in: path description: The unique identifier of the email template to retrieve. required: true style: simple explode: false schema: type: integer format: int64 responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/PublicTemplate' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - sales-templates-public-read x-hubspot-user-level-auth: internalOnly: false patch: tags: - Basic summary: Update template description: 'Update an existing email template in your HubSpot account. This endpoint allows you to modify the template''s properties such as name, subject, body, and folderId. Ensure that the templateId provided corresponds to an existing template. Please note: the scopes for these endpoints require user-level access and will not work for existing apps with portal-level access. ' operationId: patch-/automation/email-templates/2026-09/{templateId}_/automation/email-templates/2026-09-beta/{templateId} parameters: - name: templateId in: path description: The unique identifier of the email template to update. required: true style: simple explode: false schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: '#/components/schemas/PublicTemplateUpdate' required: true responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/PublicTemplate' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - sales-templates-public-write x-hubspot-user-level-auth: internalOnly: false components: schemas: CollectionResponsePublicFolderForwardPaging: required: - results type: object properties: paging: $ref: '#/components/schemas/ForwardPaging' results: type: array description: An array of PublicFolder objects, each representing a folder containing email templates. items: $ref: '#/components/schemas/PublicFolder' CollectionResponsePublicTemplateForwardPaging: required: - results type: object properties: paging: $ref: '#/components/schemas/ForwardPaging' results: type: array description: An array of public templates. Each item in the array is an object representing a template with properties such as id, name, subject, body, folderId, ownerId, createdAt, and updatedAt. items: $ref: '#/components/schemas/PublicTemplate' Error: required: - category - correlationId - message type: object properties: category: type: string description: The error category, represented as a string. context: type: object additionalProperties: type: array items: type: string description: An object providing context about the error condition, with additional properties as arrays of strings. example: '{invalidPropertyName=[propertyValue], missingScopes=[scope1, scope2]}' correlationId: type: string description: A unique identifier for the request, formatted as a UUID. Include this value with any error reports or support tickets. format: uuid example: aeb5f871-7f07-4993-9211-075dc63e7cbf errors: type: array description: An array providing further information about the error, with each item being an ErrorDetail object. items: $ref: '#/components/schemas/ErrorDetail' links: type: object additionalProperties: type: string description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps, represented as an object with string properties. message: type: string description: A human readable message describing the error along with remediation steps where appropriate. It is a string. example: An error occurred subCategory: type: string description: A specific category that contains more specific detail about the error, represented as a string. description: Represents an error response returned by the API when an operation fails. This component is used in various endpoints to provide detailed information about the error encountered. example: message: Invalid input (details will vary based on the error) correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf category: VALIDATION_ERROR links: knowledge-base: https://www.hubspot.com/products/service/knowledge-base ErrorDetail: required: - message type: object properties: code: type: string description: The status code associated with the error detail. context: type: object additionalProperties: type: array items: type: string description: Context about the error condition, represented as an object where each key is a context name and the value is an array of strings providing additional details. example: '{missingScopes=[scope1, scope2]}' in: type: string description: The name of the field or parameter in which the error was found. message: type: string description: A human readable message describing the error along with remediation steps where appropriate. This is a required field. subCategory: type: string description: A specific category that contains more specific detail about the error. description: Represents detailed information about an error that occurred in the API. This component is used to provide additional context and specifics about errors, typically as part of an error response. ForwardPaging: type: object properties: next: $ref: '#/components/schemas/NextPage' description: Paging information for forward-only pagination. Contains the next page reference when more results are available; omitted or empty on the last page. NextPage: required: - after type: object properties: after: type: string description: A string that serves as the paging cursor token, indicating the position after the last successfully read resource. link: type: string description: A string representing the URL link to the next page of results. description: Specifies the paging information needed to retrieve the next set of results in a paginated API response PublicFolder: required: - id type: object properties: createdAt: type: integer description: The timestamp indicating when the folder was created, represented as an integer in int64 format. format: int64 id: type: string description: The unique identifier for the folder, represented as a string. name: type: string description: The name of the folder, represented as a string. updatedAt: type: integer description: The timestamp indicating when the folder was last updated, represented as an integer in int64 format. format: int64 PublicTemplate: required: - id type: object properties: body: type: string description: The content of the email template, represented as a string. createdAt: type: integer description: The timestamp indicating when the email template was created, represented as an integer in int64 format. format: int64 folderId: type: string description: The identifier of the folder where the email template is stored, represented as a string. id: type: string description: The unique identifier for the email template, represented as a string. name: type: string description: The name of the email template, represented as a string. ownerId: type: string description: The identifier of the owner of the email template, represented as a string. subject: type: string description: The subject line of the email template, represented as a string. updatedAt: type: integer description: The timestamp indicating when the email template was last updated, represented as an integer in int64 format. format: int64 PublicTemplateInput: required: - body - name type: object properties: body: type: string description: The main content of the email template. This is a required field and must be a string. folderId: type: string description: The identifier of the folder in which the template is stored. This is an optional field and must be a string if provided. name: type: string description: The name of the email template. This is a required field and must be a string. subject: type: string description: The subject line of the email template. This is an optional field and must be a string if provided. PublicTemplateUpdate: required: - body - folderId - name - subject type: object properties: body: type: object properties: {} description: An object representing the body content of the email template. folderId: type: object properties: {} description: An object representing the identifier of the folder where the email template is stored. name: type: object properties: {} description: An object representing the name of the email template. subject: type: object properties: {} description: An object representing the subject line of the email template. responses: Error: description: An error occurred. content: '*/*': schema: $ref: '#/components/schemas/Error' securitySchemes: developer_hapikey: type: apiKey name: hapikey in: query oauth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://app.hubspot.com/oauth/authorize tokenUrl: https://api.hubapi.com/oauth/v1/token scopes: sales-templates-public-read: '' sales-templates-public-write: '' private_apps: type: apiKey name: private-app in: header private_apps_legacy: type: apiKey name: private-app-legacy in: header x-hubspot-product-tier-requirements: marketing: FREE sales: FREE service: FREE cms: FREE commerce: FREE crmHub: FREE dataHub: FREE