Scope requirements
Scope requirements
Changes in V3
Thedescription property has been deprecated and will not be included in the response of any of the V3 endpoints.
Retrieve blog tags
You can retrieve blog tags either individually by ID or by retrieving all blog tags:- To retrieve all blog tags, make a
GETrequest to/cms/v3/blogs/tags. - To retrieve an individual blog tag, make a
GETrequest to/cms/v3/blogs/tags/{tagId}.
Retrieve all blog tags
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:
The response includes a
total count and an array of blog tag objects:
Retrieve a single blog tag
To retrieve details for a specific blog tag, make aGET request to /cms/v3/blogs/tags/{tagId}.
For example, the request below would retrieve the details for the blog tag with ID 184993428780:
property query parameter to return only specific properties.
Filtering
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 thename 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.
Below are the definitions for each operator.
Filtering for multi-language tags
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 includelanguage__in=de as a query parameter.
Sorting and paginating
You can provide sorting and pagination options as query parameters. Specify the property name as the value to thesort 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:
Create a blog tag
To create a new blog tag, make aPOST request to /cms/v3/blogs/tags.
For example, the request below would create a new blog 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.
Update a blog tag
To update an existing blog tag, make aPATCH request to /cms/v3/blogs/tags/{tagId}.
For example, the request below would update the name of a blog tag:
Delete a blog tag
To delete an existing blog tag, make aDELETE request to /cms/v3/blogs/tags/{tagId}.
For example, the request below would delete the blog tag with ID 184993428780:
204 No Content response with no body.
Multi-language management
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.Create a new language variant
You can create a new language variant for an existing blog tag by making aPOST 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 aPOST request to the /cms/v3/blogs/tags/multi-language/attach-to-lang-group endpoint.
Detach a blog tag from a multi-language group
To detach a blog tag from a multi-language group, make aPOST request to /cms/v3/blogs/tags/multi-language/detach-from-lang-group.
Set a new primary language
To change the primary language of a multi-language group, make aPUT request to /cms/v3/blogs/tags/multi-language/set-new-lang-primary:
Update languages in a multi-language group
To explicitly set new languages for each tag in a multi-language group, make aPOST request to /cms/v3/blogs/tags/multi-language/update-languages: