You can create baselines through the public REST API.

The format for a Baseline Create call is as follows:

REST Call



Notes
HTTP MethodPOST
URL<confluence-server>/rest/baseline/1.0/baselineService/createBaseline
HeaderAuthorization: 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/

HeaderContent-Type: application/json
Body


Example
{
   "baseline-name":"My Baseline",
   "space-key":"ABC",
   "selectAllPages":"false",
   "creation-type":"version-based",
   "baseline-keyword":"",
   "baseline-date":"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.



ParameterDescriptionRequiredExample
confluence-serverThe full URL for your Confluence ServerYeshttp://192.668.0.71:6110/confluence611
space-keyThe key of the Confluence document space for which the baseline will be createdYesABC
baseline-nameThe name of the baseline that will be createdYesMy New Baseline
creation-type

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

  • date-based
  • version-based
Yes
  • date-based
  • version-based
baseline-keyword

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

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



baseline-dateThe date and exact time for the baselineonly when creation-type = date-based2018-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.

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