Skip to main content
POST
/
content
/
api
/
v2
/
blog-posts
Create a new blog post
curl --request POST \
  --url https://api.hubapi.com/content/api/v2/blog-posts \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "My first API blog post!",
  "content_group_id": 351076997
}'
{
  "id": 123,
  "portal_id": 123,
  "name": "<string>",
  "html_title": "<string>",
  "slug": "<string>",
  "content_group_id": 123,
  "blog_author_id": 123,
  "post_body": "<string>",
  "post_summary": "<string>",
  "meta_description": "<string>",
  "featured_image": "<string>",
  "head_html": "<string>",
  "footer_html": "<string>",
  "campaign": "<string>",
  "campaign_name": "<string>",
  "state": "DRAFT",
  "publish_date": 123,
  "publish_immediately": true,
  "created": 123,
  "updated": 123,
  "archived_at": 123,
  "is_draft": true,
  "url": "<string>",
  "published_url": "<string>",
  "topic_ids": [
    123
  ],
  "keywords": [
    {}
  ],
  "use_featured_image": true,
  "widgets": {}
}

Required Scopes

This API requires one of the following scopes:
  • content

Body

application/json
name
string
required

The post title and the internal name of the blog post

content_group_id
integer
required

The id of the blog that this post belongs to

blog_author_id
integer

The integer id of the blog author

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

meta_description
string

A description that goes in meta tag on the page

The URL of the image that the post will use as the featured image

head_html
string

Custom HTML for embed codes, javascript, etc. that goes in the head tag

Custom HTML for embed codes, javascript that should be placed before the body tag

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

publish_date
integer

The date the blog post is to be published at in milliseconds since the unix epoch

publish_immediately
boolean

Set this to true if you want to ignore the publish_date setting and set this blog post's publish date when the schedule publish endpoint is called

slug
string

The path of the URL on which the post will live

topic_ids
integer[]

A json list of topic ids from the topics API

keywords
object[]

A JSON list of keywords and their GUIDs

Controls whether or not the blog post should use the featured image

widgets
object

A data structure containing the data for all the modules for this post

Response

201 - application/json

Blog post created

id
integer
portal_id
integer
name
string

The internal name of the blog post

html_title
string
slug
string

The path of the URL on which the post will live

content_group_id
integer

The id of the blog that this post belongs to

blog_author_id
integer

The integer id of the blog author

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

meta_description
string

A description that goes in meta tag on the page

The URL of the featured image

head_html
string

Custom HTML for embed codes, javascript, etc. that goes in the head tag

Custom HTML for embed codes, javascript that should be placed before the body tag

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

state
enum<string>

The current state of the blog post

Available options:
DRAFT,
PUBLISHED,
SCHEDULED
publish_date
integer

The date the blog post is to be published at in milliseconds since the unix epoch

publish_immediately
boolean

Set this to true if you want to be published immediately when the schedule publish endpoint is called

created
integer

When the post was first created, in milliseconds since the epoch

updated
integer

When the post was last updated, in milliseconds since the epoch

archived_at
integer

When the post was deleted, in milliseconds since the epoch

is_draft
boolean

True if the post is still a draft, invisible to the public

url
string

The full URL with domain and scheme to the blog post

published_url
string

The published URL of the blog post

topic_ids
integer[]

A json list of topic ids from the topics API

keywords
object[]

A JSON list of keywords and their GUIDs

Controls whether or not the blog post should use the featured image

widgets
object

A data structure containing the data for all the modules for this post