Articles & Revisions Management

Management APIs can create new articles and revisions, or modify existing contents.

Create a new Article and a Revision

PropertyDescription
MethodPOST
Path/open/v1/spaces/$me/articles
Acceptapplication/json
Content-Typeapplication/json
DescriptionCreates a new article and revision with given content. The created revision is in draft state.
The body can be specified either in blocks-formatted object (body field) or in HTML (bodyHtml field), which will be then parsed into the blocks format. If given both, body will take precedence.
  • Request
    • Query
      (empty)
    • Body
      type Request = {
        language: LanguageCode
        name: string
        authorId?: string
        title?: string
        subtitle?: string
        body?: Blocks
        bodyHtml?: string
      }
      
  • Response
    type ArticleRevisionView = {
      article: Article
      revision: Revision
      author: Author
    }
    

Create a new Revision

PropertyDescription
MethodPOST
Path/open/v1/spaces/$me/articles/{articleId}/revisions
Acceptapplication/json
Content-Typeapplication/json
DescriptionCreates a new draft revision to an article.
The body can be specified either in blocks-formatted object (body field) or in HTML (bodyHtml field), which will be then parsed into the blocks format. If given both, body will take precedence.
  • Request
    • Query
      (empty)
    • Body
      type Request = {
        language: LanguageCode
        name: string
        authorId?: string
        title?: string
        subtitle?: string
        body?: Blocks
        bodyHtml?: string
      }
      
  • Response
    type ArticleRevisionView = {
      article: Article
      revision: Revision
      author: Author
    }
    

Save a Revision

PropertyDescription
MethodPATCH
Path/open/v1/spaces/$me/articles/{articleId}/revisions/{revisionId}
Acceptapplication/json
Content-Typeapplication/json
DescriptionUpdates title or other contents of a revision. Only revisions in draft state can be updated (once published, it will become immutable).
The body can be specified either in blocks-formatted object (body field) or in HTML (bodyHtml field), which will be then parsed into the blocks format. If given both, body will take precedence.
  • Request
    • Query
      (empty)
    • Body
      type Request = {
        name?: string
        authorId?: string
        title?: string | null
        subtitle?: string | null
        body?: Blocks | null
        bodyHtml?: string | null
      }
      
  • Response
    type ArticleRevisionView = {
      article: Article
      revision: Revision
      author: Author
    }
    

Publish a Revision

PropertyDescription
MethodPUT
Path/open/v1/spaces/$me/articles/{articleId}/revisions/{revisionId}/publish
Acceptapplication/json
Content-Typeapplication/json
DescriptionPublishes a revision. The published revision becomes the new current version of this article in the language, which will be exposed to the published website. The previously published revision (if any) will become unpublished. Once the revision is published, it is no longer editable.
  • Request
    • Query
      (empty)
    • Body
      // (empty)
      
  • Response
    type ArticleRevisionView = {
      article: Article
      revision: Revision
      author: Author
    }
    

Unpublish a Revision

PropertyDescription
MethodPUT
Path/open/v1/spaces/$me/articles/{articleId}/revisions/{revisionId}/unpublish
Acceptapplication/json
Content-Typeapplication/json
DescriptionUnpublishes a revision. The revision and article will no longer be exposed int eh published website.
  • Request
    • Query
      (empty)
    • Body
      // (empty)
      
  • Response
    type ArticleRevisionView = {
      article: Article
      revision: Revision
      author: Author
    }
    

Delete a Revision

PropertyDescription
MethodDELETE
Path/open/v1/spaces/$me/articles/{articleId}/revisions/{revisionId}
Acceptapplication/json
Content-Typeapplication/json
DescriptionDeletes a revision. (You cannot delete a published revision: you should unpublish it first.)
  • Request
    • Query
      (empty)
    • Body
      // (empty)
      
  • Response
    // (empty)
    

Delete an Article

PropertyDescription
MethodDELETE
Path/open/v1/spaces/$me/articles/{articleId}
Acceptapplication/json
Content-Typeapplication/json
DescriptionDeletes an article and all revisions within the article. You cannot delete an article which has a published revision in any language.
  • Request
    • Query
      (empty)
    • Body
      // (empty)
      
  • Response
    // (empty)