Drafts

Retrieve the draft version of a specific article in the knowledge base. This endpoint allows you to access the draft content of an article, which can be useful for reviewing or editing purposes before publishing.

get/cms/knowledge-base/2027-03-beta/articles/{articleId}/draft

Request

  • Base URL: https://api.hubapi.com
  • URL: https://api.hubapi.com/cms/knowledge-base/2027-03-beta/articles/{articleId}/draft
  • Auth: one of:
    • OAuth 2 (authorization code, authorization URL https://app.hubspot.com/oauth/authorize, token URL https://api.hubapi.com/oauth/v1/token, scopes: cms.knowledge_base.settings.read)
    • OAuth 2 (authorization code, authorization URL https://app.hubspot.com/oauth/authorize, token URL https://api.hubapi.com/oauth/v1/token, scopes: cms.knowledge_base.articles.publish)
    • OAuth 2 (authorization code, authorization URL https://app.hubspot.com/oauth/authorize, token URL https://api.hubapi.com/oauth/v1/token, scopes: cms.knowledge_base.articles.write)
    • OAuth 2 (authorization code, authorization URL https://app.hubspot.com/oauth/authorize, token URL https://api.hubapi.com/oauth/v1/token, scopes: cms.knowledge_base.articles.read)
    • OAuth 2 (authorization code, authorization URL https://app.hubspot.com/oauth/authorize, token URL https://api.hubapi.com/oauth/v1/token, scopes: cms.knowledge_base.settings.write)

Path parameters

articleIdstring required

The unique identifier of the article whose draft version is being retrieved.

Query parameters

includeBodyboolean

A boolean indicating whether to include the article’s HTML content (the body field) in the response. Defaults to true.

includeTranslationsboolean

A boolean indicating whether to include a summary of the article’s translations (id, title, and state per language) in the response. Defaults to true.

Response

successful operation

accessGroupIdsstring[] required

The IDs of the access groups that have access to the article. Used when accessType is ACCESS_GROUP_MEMBERSHIP.

accessType'ACCESS_GROUP_MEMBERSHIP' | 'PUBLIC' | 'SSO_LOGIN' required

The access level for the article: PUBLIC, SSO_LOGIN, or ACCESS_GROUP_MEMBERSHIP.

archivedInDashboardboolean required

A boolean indicating whether the article is archived in the dashboard.

bodystring

The article’s HTML content. Only included when the request’s includeBody query parameter is true (which is the default value for the query).

categoryIdstring

The ID of the category this article belongs to.

createdAtstring date-time required

The date and time when the article was created, in ISO 8601 format.

createdByUserIdstring

The unique identifier of the user who created the article.

idstring required

The unique identifier for the knowledge article.

initialPublishedAtstring date-time

The date and time the article was first published, in ISO 8601 format. Absent if the article has never been published.

knowledgeBaseIdstring required

The unique identifier of the knowledge base to which this article belongs.

languagestring required

The article’s language, as an ISO 639 code (e.g. en).

metaDescriptionstring

A brief description of the article, used for SEO.

pathstring required

The URL path segment for the article. Combined with the knowledge base’s domain, this forms the URL field.

positioninteger

The position of the article within its category.

publishedAtstring date-time

The date and time the article was last published, in ISO 8601 format. Absent if the article has never been published.

state'DRAFT' | 'PUBLISHED' required

The article’s state: either DRAFT or PUBLISHED.

subcategoryIdstring

The subcategory this article belongs to.

subtitlestring

The subtitle of the knowledge article.

tagIdsstring[] required

The IDs of the tags associated with the article.

titlestring required

The title of the knowledge article.

translationOfIdstring

The ID of the article this is a translation of.

translationsobject

A summary of the article’s translations, keyed by language code. Only included when the request’s includeTranslations query parameter is true (which is the default value for the query).

updatedAtstring date-time required

The date and time when the article was last updated, in ISO 8601 format.

updatedByUserIdstring

The unique identifier of the user who last updated the article.

urlstring required

The full URL of the article.

Changes

  • 2027-03-beta2eff3dd6fefaRevision changes
    • ○

      the security scope cms.knowledge_base.settings.read was added to the endpoint's security scheme oauth2

    • ○

      the security scope cms.knowledge_base.settings.write was removed from the endpoint's security scheme oauth2

  • 2027-03-betaf542018e1a93Revision changes
    • ○

      the security scope cms.knowledge_base.settings.read was added to the endpoint's security scheme oauth2

    • ○

      the security scope cms.knowledge_base.settings.write was removed from the endpoint's security scheme oauth2