Skip to main content
Skip table of contents

REST API

You can create baselines through the public REST API.

The format for a Baseline Create call is as follows:

REST Call



Notes

HTTP Method

POST


URL

<confluence-server>/rest/baseline/1.0/baselineService/createBaseline


Header

⚠️ Basic authentication is disabled for Confluence version 10 and higher. Use Personal Access Token instead.

Authorization: Bearer <personal_access_token>

Use the personal access token of the Confluence user used for this integration.

https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

Authorization: Basic <base64_encoded_username_password>

Use the username and password of the Confluence user used for this integration.

https://mixedanalytics.com/tools/basic-authentication-generator/

Header

Content-Type: application/json


Body


Example
CODE
{
   "baselineName":"My Baseline",
   "spaceKey":"ABC",
   "selectAllPages":"false",
   "creationType":"version-based",
   "baselineKeyword":"",
   "baselineDate":"2022-12-31 12:34:56",
   "fullySelectedPages":[
      {
         "id":"3473425"
      }
   ],
   "partiallySelectedPages":[
      {
         "id":"3473421",
         "version":"2"
      },
      {
         "id":"3473423",
         "version":"latest"
      }
   ]
}

The JSON body here is shown as an example for all the report parameter values.

Not all of these parameters can be used together. Please see the parameter reference table further on this page.



Parameter

Description

Required

Example

confluence-server

The full URL for your Confluence Server

Yes

http://192.668.0.71:6110/confluence611

spaceKey

The key of the Confluence document space for which the baseline will be created

Yes

ABC

baselineName

The name of the baseline that will be created

Yes

My New Baseline

creationType

How to pick page versions from each page's history. Two options:

  • date-based

  • version-based

Yes

  • date-based

  • version-based

baselineKeyword

(Optional) The keyword for the baseline. Any string works.

!!! Leave it empty if you are not sure how to use this.



baselineDate

The date and exact time for the baseline

only when creationType = date-based

2018-09-12 11:08:12

selectAllPages

Whether all pages in the space will be included in the baseline

Possible values:

  • true

  • false


  • true

  • false

partiallySelectedPages

Used if "selectAllPages" is false

A list of page ID's that will be included in the baseline.

The pages in this list will be included in the baseline WITHOUT their subpages. 

  • For each page you can define a version explicitly or use the keyword "latest" to get the latest version of the page.

  • If version info is not present for a page, latest page version is assumed.


[
   {
      "id":"12345",
      "version":"latest"
   },
   {
      "id":"13564",
      "version":"3"
   },
   {
      "id":"13564"
   }
]

fullySelectedPages

Used if "selectAllPages" is false

A list of page ID's that will be included in the baseline.

The pages in this list will be included in the baseline WITH all their subpages. (Subpages will be included with their latest versions unless another version is explicitly defined)

  • For each page you can define a version explicitly or use the keyword "latest" to get the latest version of the page.

  • If version info is not present for a page, latest page version is assumed.



[
   {
      "id":"12345",
      "version":"latest"
   },
   {
      "id":"13564",
      "version":"3"
   },
   {
      "id":"13564"
   }
]






Result

The REST call will return a JSON text either confirming the creation of the baselines or error messages about parameters.

CODE
{
    "message": "Baseline My New Baseline 1 created with 14 page(s) and 21 attachment(s)",
    "warnings": []
}




JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.