Use the blog tags API to manage tags for your blog posts. Tags help organize your blog content and make it easier for visitors to find related posts. Learn more about how to create and maintain your blog on the HubSpot Knowledge Base.
When retrieving all blog tags, you can filter and sort the returned results using query parameters.For example, the following request would retrieve the first 10 blog tags created after January 1, 2024:
Report incorrect code
Copy
Ask AI
curl https://api.hubapi.com/cms/v3/blogs/tags?createdAfter=2024-01-01T00:00:00Z&limit=10 \ --request GET \ --header "Authorization: Bearer YOUR_ACCESS_TOKEN"
The following query parameters are available:
Parameter
Type
Description
after
String
The paging cursor token of the last successfully read resource. Available from paging.next.after in paginated responses.
archived
Boolean
Whether to return only results that have been archived. Defaults to false.
createdAfter
String
Only return blog tags created after this date (ISO 8601 format).
createdAt
String
Only return blog tags created at exactly this date (ISO 8601 format).
createdBefore
String
Only return blog tags created before this date (ISO 8601 format).
limit
Integer
Maximum number of results per page. Default is 100.
property
String
Specify specific properties to return from the tags.
sort
String
Specify the order in which the blog tags are returned. Valid fields are name, createdAt (default), updatedAt, createdBy, updatedBy. Prefix with - to reverse the order (e.g., -createdAt).
updatedAfter
String
Only return blog tags last updated after this date (ISO 8601 format).
updatedAt
String
Only return blog tags last updated at exactly this date (ISO 8601 format).
updatedBefore
String
Only return blog tags last updated before this date (ISO 8601 format).
The response includes a total count and an array of blog tag objects:
To retrieve details for a specific blog tag, make a GET request to /cms/v3/blogs/tags/{tagId}.For example, the request below would retrieve the details for the blog tag with ID 184993428780:
Report incorrect code
Copy
Ask AI
curl https://api.hubapi.com/cms/v3/blogs/tags/184993428780 \ --request GET \ --header "Authorization: Bearer YOUR_ACCESS_TOKEN"
You can optionally include the property query parameter to return only specific properties.
You can filter blog tags using query parameters. Provide the 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 tags where the name property contains the word marketing using the parameter: &name__icontains=marketing.You can include any number of filters as query parameters in the request URL. Filters will be combined as AND criteria (you cannot specify filters as OR).The table below lists the properties that can be filtered on, along with their supported filter types.
To filter blog tags based on a multi-language group, you can include one of the query parameters from the table below. For example, to get blog tags from the German variation of your blog, you’d include language__in=de as a query parameter.
Description
Query parameters
Primary blog tag in a multi-language group
translatedFromId__is_null
Variation blog tag in a multi-language group
translatedFromId__not_null
Blog tag with specific language
language__in=de
Languages with locales (e.g., en-us) are not supported with the language filter.
You can provide sorting and pagination options as query parameters. Specify the property name as the value to the sort query parameter to return the blog tags 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 pagination, you can retrieve blog tags that match more advanced search criteria. For example, the request below fetches blog tags that have a language assigned, ordered by the most recently updated, and returns the second page of results:
Report incorrect code
Copy
Ask AI
curl 'https://api.hubapi.com/cms/v3/blogs/tags?sort=-updatedAt&language__not_null&limit=10&after=MTA%3D' \ --request GET \ --header "Authorization: Bearer YOUR_ACCESS_TOKEN"
The following request body parameters are available:
Parameter
Type
Description
nameRequired
String
The name of the blog tag.
language
String
The ISO 639 language code for the tag (e.g., en, de, fr). If not set, the tag is considered global and can be used on all blog posts.
A tag with a language set may only be used on blog posts of the same language. Tags that do not have a language set are considered global and may be used on all blog posts.
To delete an existing blog tag, make a DELETE request to /cms/v3/blogs/tags/{tagId}.For example, the request below would delete the blog tag with ID 184993428780:
To help you maintain blog tags across multiple languages, HubSpot’s CMS allows you to group together language variants of the same tag. A tag with a language set may only be used on blog posts of the same language. Tags that do not have a language set are considered global and may be used on all blog posts.To learn more about working with multi-language blog tags, check out this Knowledge Base article.
You can create a new language variant for an existing blog tag by making a POST request to the /cms/v3/blogs/tags/multi-language/create-language-variation endpoint.
Attach a blog tag to an existing multi-language group
You can add a blog tag to an existing multi-language group by making a POST request to the /cms/v3/blogs/tags/multi-language/attach-to-lang-group endpoint.