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.

List blog posts

Last updated May 15, 2023

GET /content/api/v2/blog-posts

Method Details

HTTP Methods:

GET

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing

Required Scope:

content

Get the posts from your HubSpot blogs. Supports paging and filtering. This method would be useful for an integration that examined blog posts and used an external service to suggest edits.

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.

Optional query string filters & options

If a parameter supports a filter type of 'gt', that means you can append a double underscore to the parameter name to find all items greater than the specified value. For example, the following query will find all blog posts updated after 5/1/2015: https://api.hubapi.com/content/api/v2/blog-posts?updated__gt=1430452800000&content_group_id=351076

Parameter name Description
limit The number of items to return. Defaults to 20. Cannot exceed 300.
offset The offset set to start returning rows from. Defaults to 0.
archived_at Returns the posts that match a particular deleted time value. Supports exact, gt, gte, lt, lte lookups.
archivedInDashboard Returns the posts that match the boolean lookup
(e.g. archived=false returns all posts currently not archived).
blog_author_id Returns the posts that match a particular blog author ID value.
campaign Returns the posts that match the campaign guid. The campaign guid can be found in the campaign dashboard URL
content_group_id Returns the posts that match the blog guid. The blog guid can be found using the Blog API
created Returns the posts that match a particular created time value. Supports exact, range, gt, gte, lt, lte lookups.
name Returns the posts that match the name value. Supports exact, icontains, ne lookups.
slug Returns the posts that match a particular slug value.
updated Returns the posts that match a particular updated time. Supports exact, range, gt, gte, lt, lte lookups.
state DRAFT, PUBLISHED, or SCHEDULED.
order_by Return the posts ordered by a particular field value. Blog posts can currently only be sorted by publish_date. Use a negative value to sort in descending order (e.g. order_by=-publish_date).

JSON Fields returned in the response

Parameter name Type Description
archived_at long When the post was deleted, in milliseconds since the epoch. Zero if the blog post was never deleted. Use a DELETE request to delete the post, do not set this directly.
archivedInDashboard bool If True, the post will not show up in your dashboard, although the post will still be live
blog_author_id long The integer id of the blog author, look up via the blog authors end point /content/api/v2/blog-authors
campaign string The guid of the marketing campaign this post is associated with
campaign_name string The name of the marketing campaign this post is associated with
content_group_id long The id of the blog that this post belongs to. Get the id by looking at the blog API endpoint /content/api/v2/blogs
created long When the post was first created, in milliseconds since the epoch
footer_html string Custom HTML for embed codes, javascript that should be placed before the </body> tag of the page
head_html string Custom HTML for embed codes, javascript, etc. that goes in the <head> tag of the page
is_draft string True if the post is still a draft, invisible to the public. Gets changed when the /publish-action API endpoint is called
keywords list A JSON list of keywords and their GUIDs. This list contains key value pairs of "keyword" and "keyword_guid". For example:
  • "keyword" : "sandwiches",
  • "keyword_guid" : "ee7c2292-7a2f-4f0f-81fb-ad0bd9ca4fcb"
The GUID is available from the Keywords API. This list adds keywords to the Optimization tab in HubSpot.
meta_description string A description that goes in <meta> tag on the page
name string The internal name of the blog post
post_body string The HTML of the main post body
post_summary string The summary of the blog post that will appear on the main listing page
publish_date long The date the blog post is to be published at in milliseconds since the unix epoch.
publish_immediately string Set this to true if you want to be published immediately when the schedule publish endpoint is called, and to ignore the publish_date setting
slug string The path of the URL on which the post will live. Changing this will change the URL.
topic_ids list A json list of topic ids from the topics API ( /content/api/v2/topics )
updated long When the post was last updated, in milliseconds since the epoch
url string The full URL with domain and scheme to the blog post. Will return a 404 if the post is not yet published.
widgets string A data structure containing the data for all the modules for this post. This will only be populated if the blog template has editable widgets defined.