There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported. Continued use of HubSpot API Keys is a security risk to your account and data. Your API Keys could be deactivated at any time after Nov. 30th, and we recommend that you migrate to Private Apps as soon as possible so you do not lose business-critical functionality.

Create a new calendar task

Last updated January 31, 2023

POST /calendar/v1/events/task

Method Details

HTTP Methods:

POST

Content Type:

application/json

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing

Required Scope:

content

Create a new task for Calendar. Creating a task of type BLOG_POST, EMAIL, or LANDING_PAGE will create a draft of the respective content and associate it with the task, returning a contentId in the response.

By default, the createdBy user for the task will be automatically set as the User ID of the authenticated user. It is not possible to specify the createdBy user, only the ownerId of the calendar task. When specifying an owner, use the Owners API to get a list of owner Ids.

Please note:
  • Up to 10,000 tasks may be created over a 24 hour period per HubSpot account.
  • This endpoint is for tasks on the Marketing calendar. For tasks associated with the CRM and CRM objects, please see the Engagements API

Required parameters

Required Parameters How to use Description
OAuth Access Token or API Key Authorization: Bearer {token} header
or hapikey={key} query parameter.
Used to authenticate the request. Please see this page for more details about authentication.

Required JSON Fields in the body

Field name Type Description
name string The name of task.
eventDate long When the task is set to be due, in milliseconds since the epoch.
category string The type of task, such as BLOG_POST, EMAIL, LANDING_PAGE, CUSTOM.

Note: if this is set to BLOG_POST, then the contentGroupId field is also required.
state string The completion state of the task; value of TODO or DONE.

Allowed JSON Fields in the body

Field name Type Description
eventType string Type of calendar event; for tasks this is always PUBLISHING_TASK.
campaignGuid string The value of campaign GUID associated with task.
contentGroupId long The ID of the content group (aka blog) that the associated Blog Post will belong to, if any. Only read for BLOG_POST Tasks. See Blog API to get a list of blogs ids.

Note: this field is REQUIRED if the category is set to BLOG_POST.
topicIds list of longs The list of ids of topics associated with the associated Blog Post, if any. Otherwise null. Only read for BLOG_POST Tasks. See Topics API to get a list of topic ids.
templatePath string The template to use for emails and landing pages. only read for EMAIL and LANDING_PAGE categories. This field is OPTIONAL.
description string A description of the task.
ownerId long The HubSpot id of the user that the task is assigned to. See the Owners API to get a list of owner Ids.