The blog post endpoints are used to create and manage hubspot blog posts
campaign_name
is_draft
keywords
topicIds
property has been renamed to tagIds
.GET
request to /cms/v3/blogs/posts/<postId>
.GET
request to /cms/v3/blogs/posts
.createdAt
and updatedAt
dates. Learn more about the available filtering, sorting, and pagination options below.
property name
, followed by two underscore characters, then include the associated operator
as a suffix. For example, you can filter the results to only include blog posts where the name
property contains the word marketing
using the parameter: &name__contains=marketing
.
You can include any number of the following filters as query parameters in the request URL. All specified filters will be applied to narrow down results.
Filter | Operator |
---|---|
Equals | eq (or none) |
Not equal | ne |
Contains | contains |
Less than | lt |
Less than or equal | lte |
Greater than | gt |
Greater than or equal | gte |
Null | is_null |
Not null | not_null |
Like | like |
Not like | not_like |
Contains (case insensitive) | icontains |
Starts with | startswith |
In | in |
Not in | nin |
Property | Supported filters |
---|---|
id | eq , in |
slug | eq , in , nin , icontains |
campaign | eq , in |
state | eq , Not equal , in , nin , contains |
publishDate | eq , gt , gte , lt ,lte |
createdAt | eq , gt , gte , lt ,lte |
updatedAt | eq , gt , gte , lt ,lte |
name | eq , in , icontains |
archivedAt | eq , gt , gte , lt ,lte |
createdById | eq |
updatedById | eq |
blogAuthorId | eq , in |
translatedFromId | is_null , not_null |
contentGroupId | eq , in |
tagId | eq , in |
Publish State | Query parameters |
---|---|
Draft | state=DRAFT |
Scheduled | state=SCHEDULED |
Published | state=PUBLISHED |
currentState
field on the blog post object is a generated field which also reflects the blog’s publish state, but you cannot use it as a property to filter against in your requests.contentGroupId__eq=<germanBlogId>
as a query parameter.
Description | Query parameters |
---|---|
Primary blog post in a multi-language group | translatedFromId__is_null |
Variation blog post in a multi-language group | translatedFromId__not_null |
Blog post with specific language | contentGroupId__eq |
sort
query parameter to return the blog posts in the natural order of that property. You can reverse the sorting order by including a dash character before the property name (e.g., sort=-createdAt
).
By combining query parameters for filtering, sorting, and paging, you can retrieve blog posts that match more advanced search criteria. For example, the request below fetches blog posts that don’t have a language assigned, ordered by the most recently updated. Including the limit
and offset
parameters below returns the second page of results.
POST
request to the /cms/v3/blogs/posts
, specifying the blog post’s details in the request body. By default, the post will be created as an unpublished draft. If needed, a blog post can be published at the time of creation as long as the properties necessary for publishing are set.
Parameter | Type | Description |
---|---|---|
name | String | Description |
contentGroupId | String | The ID of the parent blog to publish the post to. You can retrieve the ID using the blog details API. |
slug | String | The URL slug of the blog post. HubSpot will automatically generate the full URL using this value, along with the parent blog domain and slug. If no value is provided, the name value will be used as a temporary slug (hyphenated). You will need to set a specific slug before the post can be published. |
blogAuthorId | String | The ID of the blog author. You can retrieve this value using the blog authors API. |
metaDescription | String | The post’s meta description. |
useFeaturedImage | Boolean | Whether to include a featured image for the blog post. By default, this field is set to true . To include a featured image, include a value for the featuredImage parameter. |
postBody | String | The HTML content of the blog post. |
PATCH
request to /cms/v3/blogs/posts/<postId>/draft
. You must include a JSON payload that represents the blog post model. Properties you provide in the request payloud will override existing draft properties without any complex merging logic. As a result, if you’re updating nested properties, you should provide the full definition of the object. Partial updates are not supported.
For example, the following request body would update the title and URL slug of a blog post:
PATCH
request to /cms/v3/blogs/posts/<postId>
, along with a request body containing the content you want to update.
PATCH
request to the /cms/v3/blogs/posts/<postId>
endpoint. In the request body, include a JSON payload that sets the state
to PUBLISHED
. The post must have the following properties set in order to be published:Property | Type | Description |
---|---|---|
name | String | The title of the blog post. |
contentGroupId | String | The ID of the parent blog to publish the post to. You can retrieve the ID using the blog details API. |
slug | String | The URL slug of the blog post. If no slug was specified at the time of creation, HubSpot will have assigned a temporary slug to the post. This temporary slug must be updated to a specific value in order for the post to be published. |
blogAuthorId | String | The ID of the blog author. You can retrieve this value using the blog authors API. |
metaDescription | String | The post’s meta description. |
featuredImage | String | An image to use as the post’s featured image. Alternatively, you can opt to not include a featured image by omitting this field and instead setting useFeaturedImage to false . |
state | String | The publish state of the post. Must be set to PUBLISHED . |
POST
request to /cms/v3/blogs/posts/<postId>/draft/push-live
. This endpoint does not require a request body.POST
request to /cms/v3/blogs/posts/schedule
. In the request body, include a JSON payload that contains the id
of the target blog post and a publishDate
(ISO8601 format).
POST
request to /cms/v3/blogs/posts/<postId>/draft/reset
. This endpoint does not require a request body.
POST
request to the /multi-language/create-language-variant
endpoint. The endpoint accepts a JSON payload containing the id
of the blog post to clone and the language
identifier of the new variant.
POST
request to the /multi-language/attach-to-lang-group
endpoint. The endpoint accepts a JSON payload containing the id
of the target blog post, the language
identifier of the blog post being added, and the primaryId
of the blog post designated as the primary blog post in the target multi-language group.
POST
request to the /multi-language/detach-from-lang-group
endpoint. The endpoint accepts a JSON payload containing the id
of the target blog post.