Skip to main content

Blog topics

Use the blog topics API to create and manage blog topics in a HubSpot account.

Retrieve all blog tags as a part of a content audit, then update and merge specific tags to support an upcoming company rebrand.

GET/blogs/v3/topics

List all blog topics. Supports paging and filtering.

Some parameters support "range" filters via double-underscored param suffixes, like __gt. If a parameter supports a filter type of 'gt', that means you can append a double-underscore and 'gt' to the parameter name to find all items greater than a specified value.

For example, the following query will find all items with the 'updated' time greater than 1364424600000: https://api.hubapi.com/blogs/v3/topics?created__gt=1364424600000

Requirements
Scopes
  1. content
Auth Methods

Private apps

OAuth

Parameters
id

Query param

Search for topics by id. Supports exact value matching and the 'in' range filter (e.g. id__in=348109009,348109019)

name

Query param

Search for topics by name. Supports exact value matching, 'contains' searching, and 'icontains' case-insensitive searching (e.g. name__contains=topic1)

slug

Query param

Search for topics by slug. Supports exact value matching

created

Query param

Filter results by creation date, in milliseconds since the epoch. Supports exact value matching and the following range filters: range, gt, gte, lt, lte

limit

Query param

The maximum number of items to return. Defaults to 20.

offset

Query param

The offset from the beginning of the result set from which to start returning results. Used for paging. Defaults to 0.

casing

Query param

Use the casing=snake parameter to change the API's casing for all query parameters (including those above) and JSON fields (below) to snake_case, rather than camelCase, which is the default. This option is provided for backwards-compatibility and ease of migration from Content v2 APIs, which used snake_case.

Response

Show more
JSON Fields returned in the response
Field nameTypeDescription
idlongThe unique id of the topic
portalIdintThe hub id
createdlongWhen the topic was first created, in milliseconds since the epoch
updatedlongWhen the topic was last updated, in milliseconds since the epoch
deletedAtlongWhen the topic was deleted, in milliseconds since the epoch. Zero if the topic was never deleted. Use a DELETE request to properly soft delete a topic - do not set this value directly.
namestringThe topic name
slugstringThe URL-friendly version of the topic, used in blog urls
descriptionstringThe topic description
Show more
GET/blogs/v3/topics/search

Search for blog topics by various criteria. See the options below for details about filtering. Supports paging for the case where a large number of topics match the criteria.

Some parameters support "range" filters via double-underscored param suffixes, like __gt. If a parameter supports a filter type of 'gt', that means you can append a double-underscore and 'gt' to the parameter name to find all items greater than a specified value.

For example, the following query will find all items with the 'updated' time greater than 1364424600000: https://api.hubapi.com/blogs/v3/topics/search?created__gt=1364424600000

Requirements
Scopes
  1. content
Auth Methods

Private apps

OAuth

Parameters
id

Query param

Search for topics by id. Supports exact value matching and the 'in' range filter (e.g. id__in=348109009,348109019)

name

Query param

Search for topics by name. Supports exact value matching, 'contains' searching, and 'icontains' case-insensitive searching (e.g. name__contains=topic1)

slug

Query param

Search for topics by slug. Supports exact value matching

created

Query param

Filter results by creation date, in milliseconds since the epoch. Supports exact value matching and the following range filters: range, gt, gte, lt, lte

limit

Query param

The maximum number of items to return. Defaults to 100.

offset

Query param

The offset from the beginning of the result set from which to start returning results. Used for paging. Defaults to 0.

casing

Query param

Use the casing=snake parameter to change the API's casing for all query parameters (including those above) and JSON fields (below) to snake_case, rather than camelCase, which is the default. This option is provided for backwards-compatibility and ease of migration from Content v2 APIs, which used snake_case.

q

Query param

Search for topics whose names or url slugs contain the given string.

active

Query param

Filter topics by whether or not they are associated with any published blog posts (true or false).

blog

Query param

Filter topics by a blog they are used on (value is a blog ID).

Response

Show more
JSON Fields returned in the response
Field nameTypeDescription
idlongThe unique id of the topic
portalIdintThe hub id
createdlongWhen the topic was first created, in milliseconds since the epoch
updatedlongWhen the topic was last updated, in milliseconds since the epoch
deletedAtlongWhen the topic was deleted, in milliseconds since the epoch. Zero if the topic was never deleted. Use a DELETE request to properly soft delete a topic - do not set this value directly.
namestringThe topic name
slugstringThe URL-friendly version of the topic, used in blog urls
descriptionstringThe topic description
totalPostsintThe total count of posts (including drafts) associated with this topic.
livePostsintThe total count of published posts associated with this topic.
lastUsedlongThe most recent publish date of a blog post associated with this topic, in milliseconds since the epoch.
associatedBlogIdsarrayA list of the blog IDs where this topic has been used.
Show more
GET/blogs/v3/topics/:topic-id

Get the details for a specific topic by its ID.

Requirements
Auth Methods

Private apps

OAuth

Parameters
topic-id*

Path param

Unique identifier for a particular topic

casing

Query param

Use the casing=snake parameter to change the API's casing for returned JSON fields (below) to snake_case, rather than camelCase, which is the default. This option is provided for backwards-compatibility and ease of migration from Content v2 APIs, which used snake_case.

Response

Show more
JSON Fields returned in the response
Field nameTypeDescription
idstringThe unique id of the topic
portalIdstringThe hub id
createdlongWhen the topic was first created, in milliseconds since the epoch
updatedlongWhen the topic was last updated, in milliseconds since the epoch
deletedAtlongWhen the topic was deleted, in milliseconds since the epoch. Zero if the topic was never deleted. Use a DELETE request to properly soft delete a topic - do not set this value directly.
namestringThe topic name
slugstringThe URL-friendly version of the topic, used in blog urls
descriptionstringThe topic description
Show more
POST/blogs/v3/topics

Create a new blog topic.

Requirements
Scopes
  1. content
Auth Methods

Private apps

OAuth

Parameters
casing

Query param

Use the casing=snake parameter to change the API's casing for allowed JSON fields (below) to snake_case, rather than camelCase, which is the default. This option is provided for backwards-compatibility and ease of migration from Content v2 APIs, which used snake_case.

name

String

Body param

The topic name

description

String

Body param

The topic description

Response

Show more
POST/blogs/v3/topics/group-topics

Merge multiple topics by ID into a single topic group.

Requirements
Auth Methods

Private apps

OAuth

Parameters
casing

Query param

Use the casing=snake parameter to change the API's casing for allowed JSON fields (below) to snake_case, rather than camelCase, which is the default. This option is provided for backwards-compatibility and ease of migration from Content v2 APIs, which used snake_case.

groupedTopicName

String

Body param

The new name of the combined topics

topicIds

List(long)

Body param

The List of topic ids to merge

Response

Show more
PUT/blogs/v3/topics/:topic-id

Update an existing blog topic.

Requirements
Auth Methods

Private apps

OAuth

Parameters
topic-id*

Path param

Unique identifier for a particular topic

casing

Query param

Use the casing=snake parameter to change the API's casing for returned JSON fields (below) to snake_case, rather than camelCase, which is the default. This option is provided for backwards-compatibility and ease of migration from Content v2 APIs, which used snake_case.

name

String

Body param

The topic name

description

String

Body param

The topic description

Response

Show more
DELETE/blogs/v3/topics/:topic-iid

Marks a blog topic as deleted.

Requirements
Scopes
  1. content
Auth Methods

Private apps

OAuth

Parameters
topic-id*

Path param

Unique identifier for the particular topic to delete

Response

Show more