Skip to main content
Skip table of contents

REST API

This page contains a listing of the most used REST API’s that will allow you to integrate with the App with your own scripts and plugins.

Preface

Classification Levels are set by their Index in the REST API, by default:

  • Highly Restricted = 0

  • Restricted = 1

  • Internal = 2

  • Public = 3

Classify a Page

Set the classification of a Confluence Page.

Method

POST

URL

/rest/server-classification/1.0/classify?pid={pageId}&lid={levelIndex}

Query Parameters

pid required

Page ID

lid required

Level ID

Responses

200

Successful

400

Bad Request

403

Authentication or Permission Error

404

Page or Level Not Found

Get Classification Levels

Get a list of all available Classification Levels in the Confluence site.

Method

GET

URL

/rest/server-classification/1.0/level

Response

CODE
{
  levels: {
    name: string,
    description: string,
    colour: "dark-red" | "red" | "orange" | "yellow" |
       "dark-green" | "green" | "light-green" |
       "teal" | "blue" | "purple" | "black" | "white"
  }[],
  force: boolean,
  printOnly: boolean,
  spaceLevel: boolean,
  spaceData: boolean,
  dataByline: boolean,
  macroSize: string,
  macroPrefix: string
}

Get Classification Level for a Page

Get the classification of a Confluence Page.

Method

GET

URL

/rest/api/content/{pageId}/property/classification

Response

200

JSON
{
    id: string ,
    key: "classification",
    value: {
        name: {
            value: string,
            search: string,
            index: number
        },
        icon: {
            url: string
        },
        tooltip: {
            value: string
        },
        updated: Date
    },
    version: {
        when: Date,
        message: string,
        number: number,
        minorEdit: boolean,
        hidden: boolean
    },
}

404

Page is not classified

Search for Pages with a Level

Find Confluence Pages classified under a particular level using CQL.

Method

GET

URL

/rest/api/content/search?cql=content.property[classification].name.index={levelId}

Query Parameters

levelId required

Level ID

Response

JSON
{
 preface: string,
 size: string,
 printOnly: boolean,
 force: boolean,
 inherit: boolean,
 forceGloballyControlled: boolean,
 spaceLevel: boolean,
 spaceData: boolean,
 dataByline: boolean,
 restrict: boolean,
 restrictions: {
   name: string,
   users: string[],
   groups: string[],
   roles: string[]
 }[],
 classificationGloballyControlled: boolean,
 classificationEnabled: boolean,
 onlyCheckEditPerms: boolean,
}

Get Global Settings

Get the main Compliance for Confluence settings.

Method

GET

URL

/rest/server-classification/1.0/global

Response

JSON
{
 preface: string,
 size: string,
 printOnly: boolean,
 force: boolean,
 inherit: boolean,
 forceGloballyControlled: boolean,
 spaceLevel: boolean,
 spaceData: boolean,
 dataByline: boolean,
 restrict: boolean,
 restrictions: {
  name: string,
  users: string[],
  groups: string[],
  roles: string[]
 }[],
 classificationGloballyControlled: boolean,
 classificationEnabled: boolean,
 onlyCheckEditPerms: boolean,
}

Get Space Settings

Get the settings for a particular Confluence Space.

Method

GET

URL

/rest/api/space/{spaceKey}/property/dataclassification

Response

JSON
{
  key: string,
  value: {
    constantGroups: string[],
    enabled: true,
    force: false,
    levelRestrictions: {
      name: string,
      users: string[],
      groups: string[],
      roles: string[]
    }[],
    restricted: false
  }
}

Get Statistics for a Space

Get the classification statistics for a Space.

Method

GET

URL

/rest/server-classification/1.0/statistics?spaceKey={spaceKey}

Query Parameters

spaceKey required

Space Key

Response

JSON
{
  spaceKey: string,
  spaceTitle: string,
  spaceStatistics: {
    classifcationLevel: string,
    count: number
  }[]
}

Get Automation Rules

Get a list of all available Automation rules for sensitive data on the Confluence site.

Method

GET

URL

/rest/server-classification/1.0/automation

Response

200

JSON
{
  id: number,
  name: string,
  enabled: boolean,
  executions: number,
  createdOn: date,
  extractions: {
    id: number,
    name: string,
    description: string,
    icon: "address" |
      "card" | "email" | "flag",
    regEx: string,
    isEnabled: boolean,
    isSystem: boolean,
    invalidRegexes: string[]
  }[]
  // scope is a list of spaces
  scope: {
    id: number,
    key: string,
    name: string,
    avatar: string
  }[],
  actions: {
    id: number,
    type: "classify" |
      "email" | "label" | "redact",
    // defined if the type = label
    label?: string
    // defined if the type = classify
    level?: number
    // defined if the type = email
    users?: "pageCreator" |
      "pageCollaborator" | "spaceAdmin"
  }[]
}[]

403

User is not an admin

Search for Pages with Extractions

Get a list of all available Automation rules for sensitive data on the Confluence site.

Method

POST

URL

/rest/server-classification/1.0/search/admin

Request

JSON
{
  spaces: string[], // spaceKeys
  extractions: number[], // List of extractions ids
  query: string, // search term for captured text
  startAt: number,
  limit: number
}

Response

200

JSON
{
  results: {
    id: number,
    page: {
      id: number,
      title: string,
      version: number
    },
    extractionJson: {
      id: number,
      name: string,
      description: string,
      icon: string,
      regEx: string,
      isEnabled: boolean,
      isSystem: boolean
    },
    space: {
      id: number,
      key: string,
      name: string,
      icon: string,
    },
    text: string,
    detectedOn: date,
    active: boolean
  }[]
  startAt: number,
  limit: number,
  total: number,
}

401

User is not an admin

Browsing the Full REST API

You can browse the full REST API by using the Atlassian REST API Browser on a development instance of Confluence (using the Atlas-SDK).

If you have specific queries that you’d like help with, please raise a ticket with the support team.

JavaScript errors detected

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

If this problem persists, please contact our support.